Skip to content

Commit

Permalink
Add TNEW performance keyword integration
Browse files Browse the repository at this point in the history
  • Loading branch information
portableant committed Apr 21, 2022
1 parent ff5d7b2 commit 9de666d
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change log

## 21.04.2022

1. Added True to Nature banner to homepage (this will need removal at end of the exhibition)
2. Change things to do -> Podcasts
3. Change exhibition model for home page to allow for featured instances
4. Changed layout for fundraising and added new component
5. Added Tessitura search for related exhibition events

## 19.04.2022

1. Added Cockerell exhibition site to solr importer
Expand Down
8 changes: 7 additions & 1 deletion app/Http/Controllers/exhibitionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use App\Models\Labels;
use App\Models\TtnBios;
use App\Models\TtnLabels;
use App\Models\TessituraPerformances;
use Illuminate\Http\Response;
use Psr\SimpleCache\InvalidArgumentException;

Expand Down Expand Up @@ -78,6 +79,7 @@ public function details(string $slug): View|Response
$podcasts = NULL;
$cases = NULL;
$products = NULL;
$events = NULL;
if (!empty($exhibitions['data'][0]['podcasts'])) {
$podcasts = PodcastArchive::find($exhibitions['data'][0]['podcasts'][0]['podcast_series_id']['id']);
}
Expand All @@ -87,10 +89,14 @@ public function details(string $slug): View|Response
if (!empty($exhibitions['data'][0]['fme_product_ids'])) {
$products = Shopify::getShopifyCollection($exhibitions['data'][0]['fme_product_ids']);
}
if (!empty($exhibitions['data'][0]['tessitura_keyword_id'])) {
$events = TessituraPerformances::getExhibitionPerformances($exhibitions['data'][0]['tessitura_keyword_id']);
}
if (empty($exhibitions['data'])) {
return response()->view('errors.404', [], 404);
}
return view('exhibitions.details', compact('exhibitions', 'records', 'adlib', 'podcasts', 'cases', 'products'));

return view('exhibitions.details', compact('exhibitions', 'records', 'adlib', 'podcasts', 'cases', 'products', 'events'));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/tessituraController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public function type(string $slug): View
return view('tessitura.type', compact('productions', 'slug', 'events'));
}



/**
* @param string $slug
* @return int
Expand All @@ -86,7 +88,6 @@ public function translateEvent(string $slug):int
*/
public function search(): View
{
// dd(request('datefrom'));
$this->validateForm();
$prods = $this->getTessituraApi();
$prods->setPerformanceStartDate(request('datefrom'));
Expand Down
17 changes: 17 additions & 0 deletions app/Models/TessituraPerformances.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
<?php

namespace App\Models;
use App\TessituraApi;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Contracts\View\View;
use Illuminate\Validation\ValidationException;
use JetBrains\PhpStorm\Pure;

class TessituraPerformances extends Model
{


/**
* @param string $id
* @return mixed
* @throws GuzzleException
*/
public static function getExhibitionPerformances(string $id): mixed
{
$api = new TessituraApi();
return $api->getPerformances($id);
}

}
33 changes: 24 additions & 9 deletions resources/views/exhibitions/details.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
@endif
@if(isset($coll['exhibition_start_date']))
<li>
{{$type}} run: {{ Carbon\Carbon::parse($coll['exhibition_start_date'])->format('l dS F Y') }} to
{{$type}} run: {{ Carbon\Carbon::parse($coll['exhibition_start_date'])->format('l dS F Y') }}
to
{{ Carbon\Carbon::parse($coll['exhibition_end_date'])->format('l dS F Y') }}
</li>
@endif
Expand Down Expand Up @@ -197,14 +198,14 @@ class="stretched-link">{{ ucfirst($record['_source']['summary_title']) }}</a>
:params="[$curator['staff_profiles_id']['slug']]"
/>
@endforeach
@foreach($coll['external_curators'] as $curator)
<x-image-card
:altTag="$curator['associated_people_id']['display_name']"
:title="$curator['associated_people_id']['display_name']"
:image="$curator['associated_people_id']['profile_image']"
:route="'exhibition-externals'"
:params="[$curator['associated_people_id']['slug']]"></x-image-card>
@endforeach
@foreach($coll['external_curators'] as $curator)
<x-image-card
:altTag="$curator['associated_people_id']['display_name']"
:title="$curator['associated_people_id']['display_name']"
:image="$curator['associated_people_id']['profile_image']"
:route="'exhibition-externals'"
:params="[$curator['associated_people_id']['slug']]"></x-image-card>
@endforeach
</div>
</div>
</div>
Expand Down Expand Up @@ -404,3 +405,17 @@ class="stretched-link">{{ ucfirst($record['_source']['summary_title']) }}</a>
</div>
@endsection
@endif


@if(!empty($events))
@section('tnew-data')
<div class="container">
<h3>Special events for this exhibition</h3>
<div class="row">
@foreach($events as $production)
<x-tessitura-production-details-card :production="$production"/>
@endforeach
</div>
</div>
@endsection
@endif
1 change: 1 addition & 0 deletions resources/views/layouts/exhibitions.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<div class="container mt-3">
@yield('content')
</div>
@yield('tnew-data')
@yield('exhibitions-files')
@yield('shopify')
@yield('exhibitionCaseCards')
Expand Down

0 comments on commit 9de666d

Please sign in to comment.