From 205e4a04bf0303324aa209855fec62e636e6d564 Mon Sep 17 00:00:00 2001 From: Daniel Pett Date: Mon, 22 Aug 2022 15:48:47 +0100 Subject: [PATCH 1/5] Add configurable banner for homepage This is based off expiring dates for exhibitions. This may need to be revisited. Closes #479 --- app/Http/Controllers/homeController.php | 7 +- app/Models/HomePageBanners.php | 30 ++++++ app/View/Components/homePageBanner.php | 28 +++++ .../components/home-page-banner.blade.php | 101 ++++++++++++++++++ resources/views/home/index.blade.php | 4 + resources/views/layouts/home.blade.php | 6 +- 6 files changed, 168 insertions(+), 8 deletions(-) create mode 100644 app/Models/HomePageBanners.php create mode 100644 app/View/Components/homePageBanner.php create mode 100644 resources/views/components/home-page-banner.blade.php diff --git a/app/Http/Controllers/homeController.php b/app/Http/Controllers/homeController.php index d0d74cd0..c05a519a 100644 --- a/app/Http/Controllers/homeController.php +++ b/app/Http/Controllers/homeController.php @@ -12,6 +12,7 @@ use App\Models\ResearchProjects; use App\Models\Shopify; use App\Models\ThingsToDo; +use App\Models\HomePageBanners; use Illuminate\Contracts\View\View; use Psr\SimpleCache\InvalidArgumentException; @@ -34,12 +35,12 @@ public function index(): View $objects = Highlights::homeList(); $things = ThingsToDo::list(); $shopify = Shopify::list(); - + $banners = HomePageBanners::getBanner(); return view('home.index', compact( 'carousel', 'news', 'research', 'objects', 'things', 'fundraising', - 'shopify', 'galleries', - 'exhibitions', 'settings' + 'shopify', 'galleries', 'exhibitions', + 'settings', 'banners' )); } } diff --git a/app/Models/HomePageBanners.php b/app/Models/HomePageBanners.php new file mode 100644 index 00000000..bd3360a4 --- /dev/null +++ b/app/Models/HomePageBanners.php @@ -0,0 +1,30 @@ + 'now', + 'limit' => 1, + 'fields' => '*.*.*.*', + ]; + $api = new DirectUs( + 'banner_images', + $args + ); + $banner = $api->getData(); + if(!empty($banner['data'])) { + return Collect($banner['data'])->first(); + } else { + return []; + } + } +} diff --git a/app/View/Components/homePageBanner.php b/app/View/Components/homePageBanner.php new file mode 100644 index 00000000..56c2850d --- /dev/null +++ b/app/View/Components/homePageBanner.php @@ -0,0 +1,28 @@ + +
+
+
+ + {{ $banners['left_image_alt_text'] }} + +
+ + + +
+
+ + + + +@else + @include('includes.structure.head') +@endif diff --git a/resources/views/home/index.blade.php b/resources/views/home/index.blade.php index f3ccc4c3..b97a45c7 100644 --- a/resources/views/home/index.blade.php +++ b/resources/views/home/index.blade.php @@ -7,6 +7,10 @@ @section('keywords', 'fitzwilliam, museum, cambridge, university, art, design, archaeology') @section('title', $settings['title']) +@section('banner') + +@endSection + @section('news') @foreach($news['data'] as $news) diffInHours('2022-02-14 09:30:00', false) <= 0) - @include('includes.structure.hockney-header') -@else - @include('includes.structure.head') -@endif +@yield('banner') @include('includes.structure.open') @include('includes.structure.exhibitions') From 2c21c9713156793a953c9cc576294afe8b3af2e6 Mon Sep 17 00:00:00 2001 From: Daniel Pett Date: Tue, 23 Aug 2022 10:13:02 +0100 Subject: [PATCH 2/5] Remove loops 1.Update MVC to remove foreach in single record views 2.Clean up logic in controllers and throw 404s when no data found (use of Collection and first(). 3. Add youtube playlist in learning community 4. Remove things to do pages and routes (not used) 5. Remove themes pages (no longer a directorial project) 6. Fix a couple of table names in models 7. Add IIIF svg as it was missing 8. Break up exhibitions page into elements 9. Break up galleries page into elements 10. Add more like this to FAQs 11. Remove unused timeline This references #491 and #479, but does not close them yet. --- app/Http/Controllers/aboutusController.php | 25 +- .../Controllers/collectionsController.php | 37 +- .../Controllers/departmentsController.php | 6 +- .../Controllers/exhibitionsController.php | 115 +++-- app/Http/Controllers/galleriesController.php | 3 +- app/Http/Controllers/highlightsController.php | 106 +++-- app/Http/Controllers/homeController.php | 32 +- app/Http/Controllers/instagramController.php | 63 ++- app/Http/Controllers/learningController.php | 86 ++-- app/Http/Controllers/newsController.php | 12 +- app/Http/Controllers/pagesController.php | 24 +- app/Http/Controllers/podcastsController.php | 33 +- app/Http/Controllers/researchController.php | 45 +- app/Http/Controllers/searchController.php | 4 +- app/Http/Controllers/themesController.php | 35 -- app/Http/Controllers/thingstodoController.php | 18 - app/Http/Controllers/twitterController.php | 1 - app/Http/Controllers/visitController.php | 34 +- app/Models/AudioGuide.php | 2 +- app/Models/Collections.php | 3 + app/Models/HighlightThemes.php | 4 +- app/Models/SpoliationClaims.php | 2 +- public/images/logos/iiif.svg | 15 + resources/views/aboutus/director.blade.php | 6 +- .../views/aboutus/spoliation-claim.blade.php | 29 +- resources/views/aboutus/spoliation.blade.php | 2 +- resources/views/aboutus/vacancy.blade.php | 8 +- resources/views/collections/details.blade.php | 192 ++++---- .../views/components/ttn-artist.blade.php | 22 +- .../views/components/ttn-label.blade.php | 37 +- resources/views/departments/details.blade.php | 74 ++- resources/views/exhibitions/details.blade.php | 422 +----------------- resources/views/exhibitions/label.blade.php | 22 +- .../views/exhibitions/ttn-artist.blade.php | 6 +- .../views/exhibitions/ttn-label.blade.php | 20 +- resources/views/galleries/gallery.blade.php | 138 +----- .../views/highlights/associate.blade.php | 84 ++-- resources/views/highlights/byperiod.blade.php | 18 +- resources/views/highlights/bytheme.blade.php | 14 +- resources/views/highlights/details.blade.php | 213 +++++---- .../views/highlights/fitz-object.blade.php | 14 - .../views/highlights/fitz-objects.blade.php | 20 - resources/views/highlights/landing.blade.php | 1 - resources/views/highlights/stop.blade.php | 97 ++-- .../elements/exhibitions/360.blade.php | 17 + .../elements/exhibitions/artworks.blade.php | 48 ++ .../elements/exhibitions/carousel.blade.php | 67 +++ .../elements/exhibitions/cases.blade.php | 23 + .../elements/exhibitions/curators.blade.php | 23 + .../exhibitions/departments.blade.php | 17 + .../elements/exhibitions/events.blade.php | 13 + .../elements/exhibitions/files.blade.php | 5 + .../elements/exhibitions/films.blade.php | 42 ++ .../elements/exhibitions/galleries.blade.php | 22 + .../exhibitions/main-content.blade.php | 54 +++ .../elements/exhibitions/partners.blade.php | 18 + .../elements/exhibitions/podcasts.blade.php | 19 + .../elements/exhibitions/products.blade.php | 14 + .../exhibitions/similar-exhibits.blade.php | 12 + .../elements/exhibitions/sketchfab.blade.php | 16 + .../elements/exhibitions/thanks.blade.php | 3 + .../includes/elements/galleries/360.blade.php | 14 + .../elements/galleries/adlib.blade.php | 16 + .../elements/galleries/audio-guide.blade.php | 20 + .../elements/galleries/description.blade.php | 5 + .../elements/galleries/info.blade.php | 10 + .../elements/galleries/sketchfab.blade.php | 17 + .../elements/galleries/sketchup.blade.php | 17 + .../elements/galleries/star-objects.blade.php | 15 + .../elements/galleries/status.blade.php | 7 + .../views/includes/jsonld/news.blade.php | 14 +- .../community-youtube-playlist.blade.php | 7 + .../social/youtube-playlist.blade.php | 1 + .../includes/structure/breadcrumb.blade.php | 2 +- .../includes/structure/oldnews.blade.php | 2 +- .../includes/structure/tessitura.blade.php | 8 +- resources/views/learning/adult.blade.php | 28 +- resources/views/learning/community.blade.php | 101 ++--- .../learning/lookthinkdoactivity.blade.php | 117 +++-- .../views/learning/lookthinkdomain.blade.php | 10 +- resources/views/learning/resource.blade.php | 80 ++-- resources/views/learning/session.blade.php | 58 ++- resources/views/learning/young.blade.php | 24 +- resources/views/news/article.blade.php | 125 +++--- resources/views/pages/index.blade.php | 87 ++-- resources/views/pages/landing.blade.php | 14 +- resources/views/podcasts/episode.blade.php | 6 +- resources/views/podcasts/mindseye.blade.php | 102 +++-- resources/views/podcasts/presenter.blade.php | 78 ++-- resources/views/podcasts/series.blade.php | 47 +- resources/views/research/affiliate.blade.php | 409 +++++++++-------- .../views/research/opportunity.blade.php | 28 +- resources/views/research/profile.blade.php | 388 ++++++++-------- resources/views/research/project.blade.php | 176 ++++---- resources/views/research/resource.blade.php | 36 +- resources/views/social/story.blade.php | 8 +- resources/views/thingstodo/index.blade.php | 18 - routes/web.php | 12 +- 98 files changed, 2365 insertions(+), 2299 deletions(-) delete mode 100644 app/Http/Controllers/themesController.php delete mode 100644 app/Http/Controllers/thingstodoController.php create mode 100644 public/images/logos/iiif.svg delete mode 100644 resources/views/highlights/fitz-object.blade.php delete mode 100644 resources/views/highlights/fitz-objects.blade.php create mode 100644 resources/views/includes/elements/exhibitions/360.blade.php create mode 100644 resources/views/includes/elements/exhibitions/artworks.blade.php create mode 100644 resources/views/includes/elements/exhibitions/carousel.blade.php create mode 100644 resources/views/includes/elements/exhibitions/cases.blade.php create mode 100644 resources/views/includes/elements/exhibitions/curators.blade.php create mode 100644 resources/views/includes/elements/exhibitions/departments.blade.php create mode 100644 resources/views/includes/elements/exhibitions/events.blade.php create mode 100644 resources/views/includes/elements/exhibitions/files.blade.php create mode 100644 resources/views/includes/elements/exhibitions/films.blade.php create mode 100644 resources/views/includes/elements/exhibitions/galleries.blade.php create mode 100644 resources/views/includes/elements/exhibitions/main-content.blade.php create mode 100644 resources/views/includes/elements/exhibitions/partners.blade.php create mode 100644 resources/views/includes/elements/exhibitions/podcasts.blade.php create mode 100644 resources/views/includes/elements/exhibitions/products.blade.php create mode 100644 resources/views/includes/elements/exhibitions/similar-exhibits.blade.php create mode 100644 resources/views/includes/elements/exhibitions/sketchfab.blade.php create mode 100644 resources/views/includes/elements/exhibitions/thanks.blade.php create mode 100644 resources/views/includes/elements/galleries/360.blade.php create mode 100644 resources/views/includes/elements/galleries/adlib.blade.php create mode 100644 resources/views/includes/elements/galleries/audio-guide.blade.php create mode 100644 resources/views/includes/elements/galleries/description.blade.php create mode 100644 resources/views/includes/elements/galleries/info.blade.php create mode 100644 resources/views/includes/elements/galleries/sketchfab.blade.php create mode 100644 resources/views/includes/elements/galleries/sketchup.blade.php create mode 100644 resources/views/includes/elements/galleries/star-objects.blade.php create mode 100644 resources/views/includes/elements/galleries/status.blade.php create mode 100644 resources/views/includes/social/community-youtube-playlist.blade.php delete mode 100644 resources/views/thingstodo/index.blade.php diff --git a/app/Http/Controllers/aboutusController.php b/app/Http/Controllers/aboutusController.php index df8e3c00..2042ad7d 100644 --- a/app/Http/Controllers/aboutusController.php +++ b/app/Http/Controllers/aboutusController.php @@ -12,7 +12,6 @@ use Illuminate\Contracts\View\View; use Illuminate\Http\Request; use Illuminate\Http\Response; -use Illuminate\Pagination\LengthAwarePaginator; class aboutusController extends Controller { @@ -43,11 +42,12 @@ public function directors(): View */ public function director(string $slug): View|Response { - $directors = Directors::getDirector($slug); - if (empty($directors['data'])) { + $data = Directors::getDirector($slug); + if (empty($data['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('aboutus.director', ['director' => Collect($data['data'])->first()]); } - return view('aboutus.director', compact('directors')); } @@ -79,11 +79,12 @@ public function archiveVacancies(Request $request): View */ public function vacancy(string $slug): View|Response { - $vacancies = Vacancies::getVacancy($slug); - if (empty($vacancies['data'])) { + $vacancy = Vacancies::getVacancy($slug); + if (empty($vacancy['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('aboutus.vacancy', ['vacancy' => Collect($vacancy['data'])->first()]); } - return view('aboutus.vacancy', compact('vacancies')); } /** @@ -152,11 +153,15 @@ public function spoliation(Request $request): View /** * @param string $priref - * @return View + * @return View|Response */ - public function spoliationClaim(string $priref): View + public function spoliationClaim(string $priref): View|Response { $claims = SpoliationClaims::find($priref); - return view('aboutus.spoliation-claim', compact('claims')); + if(empty($claims ['data'])){ + return response()->view('errors.404', [], 404); + } else { + return view('aboutus.spoliation-claim', ['claims' => Collect($claims['data'])->first()]); + } } } diff --git a/app/Http/Controllers/collectionsController.php b/app/Http/Controllers/collectionsController.php index 46b64f8e..ee6875b5 100644 --- a/app/Http/Controllers/collectionsController.php +++ b/app/Http/Controllers/collectionsController.php @@ -14,33 +14,36 @@ class collectionsController extends Controller /** * @return View */ - public function index(): View - { - $pages = Stubs::getLandingBySlug('about-us', 'collections'); - $collections = Collections::list(); - return view('collections.index', compact('collections', 'pages')); - } + public function index(): View + { + $pages = Stubs::getLandingBySlug('about-us', 'collections'); + $collections = Collections::list(); + return view('collections.index', compact('collections', 'pages')); + } /** * @param string $slug * @return View|Response */ - public function details(string $slug): View|Response - { - $collection = Collections::find($slug); - if(empty($collection['data'])){ - return response()->view('errors.404',[],404); + public function details(string $slug): View|Response + { + $collection = Collections::find($slug); + if(empty($collection['data'])) { + return response()->view('errors.404', [], 404); + } else { + return view('collections.details', [ + 'collection' => Collect($collection['data'])->first() + ]); + } } - return view('collections.details', compact('collection')); - } /** * @param string $prirefs * @return array */ - public static function getObjects(string $prirefs): array - { - return CIIM::findByPriRefs($prirefs); - } + public static function getObjects(string $prirefs): array + { + return CIIM::findByPriRefs($prirefs); + } } diff --git a/app/Http/Controllers/departmentsController.php b/app/Http/Controllers/departmentsController.php index 4be6c634..d531d031 100644 --- a/app/Http/Controllers/departmentsController.php +++ b/app/Http/Controllers/departmentsController.php @@ -40,9 +40,11 @@ public function details(string $slug): View|Response if (empty($departments['data'])) { return response()->view('errors.404', [], 404); } else { - $staff = StaffProfiles::findByDepartment($departments['data'][0]['id']); + $department = Collect($departments['data'])->first(); + $staff = StaffProfiles::findByDepartment($department['id']); + return view('departments.details', compact('department', 'staff')); } - return view('departments.details', compact('departments', 'staff')); + } /** diff --git a/app/Http/Controllers/exhibitionsController.php b/app/Http/Controllers/exhibitionsController.php index e76e3e31..7e54954e 100644 --- a/app/Http/Controllers/exhibitionsController.php +++ b/app/Http/Controllers/exhibitionsController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Models\Shopify; +use GuzzleHttp\Exception\GuzzleException; use Illuminate\Contracts\View\View; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; @@ -21,6 +22,8 @@ use Illuminate\Http\Response; use Illuminate\Support\Str; +use PHPShopify\Exception\ApiException; +use PHPShopify\Exception\CurlException; use Psr\SimpleCache\InvalidArgumentException; class exhibitionsController extends Controller @@ -71,36 +74,37 @@ public function archive(): View * @param string $slug * @return View|Response * @throws InvalidArgumentException + * @throws GuzzleException + * @throws ApiException + * @throws CurlException */ public function details(string $slug): View|Response { $exhibitions = Exhibitions::find($slug); - $adlib = NULL; - if (!empty($exhibitions['data'])) { - $adlib = CIIM::findByExhibition($exhibitions['data'][0]['adlib_id_exhibition']); - } - $records = FindMoreLikeThis::find($slug, 'exhibitions'); - $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']); - } - if (!empty($exhibitions['data'][0]['id'])) { - $cases = Cases::list($exhibitions['data'][0]['id']); - } - 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); + if(empty($exhibitions['data'])){ + abort(404); + } else { + $exhibition = Collect($exhibitions['data'])->first(); + $adlib = CIIM::findByExhibition($exhibition['adlib_id_exhibition']); + $records = FindMoreLikeThis::find($slug, 'exhibitions'); + $podcasts = NULL; + $cases = NULL; + $products = NULL; + $events = NULL; + if (!empty($exhibition['podcasts'])) { + $podcasts = PodcastArchive::find($exhibition['podcasts'][0]['podcast_series_id']['id']); + } + if (!empty($exhibition['id'])) { + $cases = Cases::list($exhibition['id']); + } + if (!empty($exhibition['fme_product_ids'])) { + $products = Shopify::getShopifyCollection($exhibition['fme_product_ids']); + } + if (!empty($exhibition['tessitura_keyword_id'])) { + $events = TessituraPerformances::getExhibitionPerformances($exhibition['tessitura_keyword_id']); + } + return view('exhibitions.details', compact('exhibition', 'records', 'adlib', 'podcasts', 'cases', 'products', 'events')); } - - return view('exhibitions.details', compact('exhibitions', 'records', 'adlib', 'podcasts', 'cases', 'products', 'events')); } /** @@ -123,8 +127,14 @@ public function labels(Request $request): View public function label(string $slug): View { $labels = Labels::find($slug); - $records = FindMoreLikeThis::find($slug, 'highlights'); - return view('exhibitions.label', compact('labels', 'records')); + if(empty($labels['data'])){ + abort(404); + } else { + $label = Collect($labels['data'])->first(); + $records = FindMoreLikeThis::find($slug, 'highlights'); + return view('exhibitions.label', compact('label', 'records')); + } + } /** @@ -144,12 +154,12 @@ public function cases(string $slug): View public function externals(string $slug): View|Response { $external = AssociatedPeople::find($slug); - if (empty($external['data'])) { return response()->view('errors.404', [], 404); + } else { + $exhibitions = Exhibitions::findByExternals($external['data'][0]['id'])['data']; + return view('exhibitions.externals', compact('external', 'exhibitions')); } - $exhibitions = Exhibitions::findByExternals($external['data'][0]['id'])['data']; - return view('exhibitions.externals', compact('external', 'exhibitions')); } /** @@ -162,14 +172,21 @@ public function ttnArtists(): View } /** + * @param string $slug * @return View + * @throws InvalidArgumentException */ public function ttnArtist(string $slug): View { - $artists = TtnBios::find($slug)['data']; - $works = TtnLabels::byArtist($artists[0]['id'])['data']; - $records = FindMoreLikeThis::find($slug, 'ttnArtists'); - return view('exhibitions.ttn-artist', compact('artists', 'works', 'records')); + $artists = TtnBios::find($slug); + if(empty($artists['data'])){ + abort(404); + } else { + $artist = Collect($artists['data'])->first(); + $works = TtnLabels::byArtist($artist['id'])['data']; + $records = FindMoreLikeThis::find($slug, 'ttnArtists'); + return view('exhibitions.ttn-artist', compact('artist', 'works', 'records')); + } } /** @@ -202,9 +219,14 @@ public function ttnLabels(): View */ public function ttnLabel(string $slug): View { - $label = TtnLabels::find($slug)['data']; - $records = FindMoreLikeThis::find($slug, 'ttnLabels'); - return view('exhibitions.ttn-label', compact('label', 'records')); + $label = TtnLabels::find($slug); + if(empty($label['data'])){ + abort(404); + } else { + $labels = Collect($label['data'])->first(); + $records = FindMoreLikeThis::find($slug, 'ttnLabels'); + return view('exhibitions.ttn-label', compact('labels', 'records')); + } } /** @@ -220,7 +242,7 @@ public function ttniif(string $slug): View /** * @return JsonResponse */ - public function ttnGeoJson() + public function ttnGeoJson(): JsonResponse { $labels = TtnLabels::list()['data']; $geoJson = array( @@ -252,7 +274,10 @@ public function ttnGeoJson() return response()->json($geoJson); } - public function linkedPasts() + /** + * @return JsonResponse + */ + public function linkedPasts(): JsonResponse { $labels = TtnLabels::listFiltered('lat')['data']; $geoJson = array( @@ -323,7 +348,11 @@ public function linkedPasts() } - public function linkedPastsBirths() + /** + * @return JsonResponse + * @throws InvalidArgumentException + */ + public function linkedPastsBirths(): JsonResponse { $labels = TtnBios::listFiltered('birth_lat')['data']; $geoJson = array( @@ -382,7 +411,11 @@ public function linkedPastsBirths() return response()->json($geoJson); } - public function linkedPastsDeaths() + /** + * @return JsonResponse + * @throws InvalidArgumentException + */ + public function linkedPastsDeaths(): JsonResponse { $labels = TtnBios::listFiltered('death_lon')['data']; $geoJson = array( diff --git a/app/Http/Controllers/galleriesController.php b/app/Http/Controllers/galleriesController.php index b802ad20..e64ef45f 100644 --- a/app/Http/Controllers/galleriesController.php +++ b/app/Http/Controllers/galleriesController.php @@ -29,8 +29,9 @@ public function gallery(string $slug): View|Response $galleries = Galleries::find($slug); if (empty($galleries['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('galleries.gallery', ['gallery' => Collect($galleries['data'])->first()]); } - return view('galleries.gallery', compact('galleries')); } /** diff --git a/app/Http/Controllers/highlightsController.php b/app/Http/Controllers/highlightsController.php index ce6e905f..d8fef929 100644 --- a/app/Http/Controllers/highlightsController.php +++ b/app/Http/Controllers/highlightsController.php @@ -9,7 +9,6 @@ use App\Models\HighlightPeriods; use App\Models\Highlights; use App\Models\HighlightThemes; -use App\Models\StaffObjects; use App\Models\Stubs; use Illuminate\Support\Facades\Config; use Illuminate\Http\Request; @@ -48,11 +47,17 @@ public function details(string $slug): Response|View $pharos = Highlights::find($slug); if (empty($pharos['data'])) { return response()->view('errors.404', [], 404); + } else { + $records = FindMoreLikeThis::find($slug, 'highlights'); + $adlib = CIIM::findByAccession(Str::upper($pharos['data'][0]['adlib_id'])); + $shopify = FindMoreLikeThis::find($slug, 'shopify'); + return view('highlights.details', [ + 'pharos' => Collect($pharos['data'])->first(), + 'records' => $records, + 'adlib' => $adlib, + 'shopify' => $shopify + ]); } - $records = FindMoreLikeThis::find($slug, 'highlights'); - $adlib = CIIM::findByAccession(Str::upper($pharos['data'][0]['adlib_id'])); - $shopify = FindMoreLikeThis::find($slug, 'shopify'); - return view('highlights.details', compact('pharos', 'records', 'adlib', 'shopify')); } /** @@ -66,7 +71,11 @@ public function associate(string $section, string $slug): View $pharos = HighlightPages::list($slug, $section); $records = FindMoreLikeThis::find($slug, '"pharos-pages"'); $highlights = FindMoreLikeThis::find($slug, 'highlights'); - return view('highlights.associate', compact('pharos', 'records', 'highlights')); + return view('highlights.associate', [ + 'pharos' => Collect($pharos['data'])->first(), + 'records' => $records, + 'highlights' => $highlights, + ]); } /** @@ -74,13 +83,16 @@ public function associate(string $section, string $slug): View */ public function landing(): View { - $page = Stubs::getHighlightPage(9); - $pharos = HighlightThemes::list(); $periods = Highlights::getPeriods(); - $periods = $this->group_by("period_assigned", $periods['data']); + $periodsGrouped = $this->group_by("period_assigned", $periods['data']); $contexts = HighlightPages::getContexts(); - $contexts = $this->group_by("section", $contexts['data']); - return view('highlights.landing', compact('pharos', 'periods', 'contexts', 'page')); + $contextsGrouped = $this->group_by("section", $contexts['data']); + return view('highlights.landing', [ + 'pharos' => HighlightThemes::list(), + 'periods'=> $periodsGrouped, + 'contexts' => $contextsGrouped, + 'page' => Stubs::getHighlightPage(9) + ]); } /** @@ -150,14 +162,23 @@ public function audioguide(): View /** * @param string $slug - * @return View + * @return View|Response * @throws InvalidArgumentException */ - public function stop(string $slug): View + public function stop(string $slug): View|Response { $stop = AudioGuide::find($slug); - $records = FindMoreLikeThis::find($slug, 'audioguide'); - return view('highlights.stop', compact('stop', 'records')); + if(empty($stop['data'])){ + return response()->view('errors.404', [], 404); + } else { + $records = FindMoreLikeThis::find($slug, 'audioguide'); + return view('highlights.stop', + [ + 'stop' => Collect($stop['data'])->first(), + 'records' => $records + ] + ); + } } /** @@ -171,34 +192,49 @@ public function pharosSections(string $section): View } /** - * @return View + * @return View|Response */ - public function contextual(): View + public function contextual(): View|Response { $pharos = HighlightPages::getByContext(); - $context = $this->group_by("section", $pharos['data']); - return view('highlights.context', compact('context')); + if(empty($pharos['data'])){ + return response()->view('errors.404', [], 404); + } else { + $context = $this->group_by("section", $pharos['data']); + return view('highlights.context', compact('context')); + } } /** - * @return View + * @return View|Response */ - public function period(): View + public function period(): View|Response { $pharos = Highlights::getPeriods(); - $periods = $this->group_by("period_assigned", $pharos['data']); - return view('highlights.period', compact('periods')); + if(empty($pharos['data'])){ + return response()->view('errors.404', [], 404); + } else { + $periods = $this->group_by("period_assigned", $pharos['data']); + return view('highlights.period', compact('periods')); + } } /** * @param string $period - * @return View + * @return View|Response */ - public function byperiod(string $period): View + public function byPeriod(string $period): View|Response { $pharos = Highlights::findByPeriod($period); - $period = HighlightPeriods::find($period); - return view('highlights.byperiod', compact('pharos', 'period')); + if(empty($pharos['data'])){ + return response()->view('errors.404', [], 404); + } else { + $period = HighlightPeriods::find($period); + return view('highlights.byperiod', [ + 'pharos'=> $pharos, + 'period' => Collect($period['data'])->first() + ]); + } } /** @@ -212,12 +248,20 @@ public function theme(): View /** * @param string $theme - * @return View + * @return View|Response */ - public function bytheme(string $theme): View + public function byTheme(string $theme): View|Response { + $pharos = HighlightThemes::find($theme); - $theme = HighlightThemes::getDetails($theme); - return view('highlights.bytheme', compact('pharos', 'theme')); + if(empty($pharos['data'])){ + return response()->view('errors.404', [], 404); + } else { + $theme = HighlightThemes::getDetails($theme); + return view('highlights.bytheme', [ + 'pharos'=> $pharos, + 'theme' => Collect($theme['data'])->first() + ]); + } } } diff --git a/app/Http/Controllers/homeController.php b/app/Http/Controllers/homeController.php index c05a519a..6ee19ac4 100644 --- a/app/Http/Controllers/homeController.php +++ b/app/Http/Controllers/homeController.php @@ -16,7 +16,6 @@ use Illuminate\Contracts\View\View; use Psr\SimpleCache\InvalidArgumentException; - class homeController extends Controller { /** @@ -25,22 +24,19 @@ class homeController extends Controller */ public function index(): View { - $settings = HomePage::find(); - $carousel = Carousels::findBySection('home'); - $galleries = Galleries::list(3, '?'); - $exhibitions = Exhibitions::listHome('current', 'tessitura_string', 3); - $news = NewsArticles::feature(); - $research = ResearchProjects::listSimple('?', 3); - $fundraising = FundRaising::list(4); - $objects = Highlights::homeList(); - $things = ThingsToDo::list(); - $shopify = Shopify::list(); - $banners = HomePageBanners::getBanner(); - return view('home.index', compact( - 'carousel', 'news', 'research', - 'objects', 'things', 'fundraising', - 'shopify', 'galleries', 'exhibitions', - 'settings', 'banners' - )); + return view('home.index', [ + 'carousel' => Carousels::findBySection('home'), + 'news' => NewsArticles::feature(), + 'research' => ResearchProjects::listSimple('?', 3), + 'objects' => Highlights::homeList(), + 'things' => ThingsToDo::list(), + 'fundraising' => FundRaising::list(4), + 'shopify' => Shopify::list(), + 'galleries' => Galleries::list(3, '?'), + 'exhibitions' => Exhibitions::listHome('current', 'tessitura_string', 3), + 'settings' => HomePage::find(), + 'banners' => HomePageBanners::getBanner() + ] + ); } } diff --git a/app/Http/Controllers/instagramController.php b/app/Http/Controllers/instagramController.php index bbea7fac..2bcaf215 100644 --- a/app/Http/Controllers/instagramController.php +++ b/app/Http/Controllers/instagramController.php @@ -21,39 +21,38 @@ class instagramController extends Controller * @throws InstagramException * @throws InstagramNotFoundException */ - public function instagram() - { - $expires = now()->addMinutes(600); - if (Cache::has('cache_insta_search')) { - $insta = Cache::get('cache_insta_search'); - } else { - $instagram = new Instagram(new GuzzleHttp\Client()); - $insta = $instagram->getMedias('fitzmuseum_uk'); - Cache::put('cache_insta_search', $insta, $expires); - } - $configSolr = Config::get('solarium'); - $client = new Client(new Curl(), new EventDispatcher(), $configSolr); - $update = $client->createUpdate(); - $documents = array(); - foreach($insta as $gram) + public function instagram() { - $doc = $update->createDocument(); - $doc->id = md5($gram->getId()); - $text = iconv(mb_detect_encoding($gram->getCaption(), mb_detect_order(), true), "UTF-8", $gram->getCaption()); - $text = transliterator_transliterate('Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove', $text); - $text = trim( preg_replace('/[\x00-\x1F\x80-\xFF]/', '', mb_convert_encoding( $gram->getCaption(), "UTF-8" ) ) ); - $doc->title = substr($text, 0, 100); - $doc->description = $text; - $doc->url = $gram->getLink(); - $doc->contentType = 'instagram-'. $gram->getType(); - $doc->thumbnail = $gram->getImageThumbnailUrl(); - $doc->image = $gram->getImageHighResolutionUrl(); - $doc->searchImage = 'https://fitz-cms-images.s3.eu-west-2.amazonaws.com/insta.png'; - $documents[] = $doc; + $expires = now()->addMinutes(600); + if (Cache::has('cache_insta_search')) { + $insta = Cache::get('cache_insta_search'); + } else { + $instagram = new Instagram(new GuzzleHttp\Client()); + $insta = $instagram->getMedias('fitzmuseum_uk'); + Cache::put('cache_insta_search', $insta, $expires); + } + $configSolr = Config::get('solarium'); + $client = new Client(new Curl(), new EventDispatcher(), $configSolr); + $update = $client->createUpdate(); + $documents = array(); + foreach ($insta as $gram) { + $doc = $update->createDocument(); + $doc->id = md5($gram->getId()); + $text = iconv(mb_detect_encoding($gram->getCaption(), mb_detect_order(), true), "UTF-8", $gram->getCaption()); + $text = transliterator_transliterate('Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove', $text); + $text = trim(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', mb_convert_encoding($gram->getCaption(), "UTF-8"))); + $doc->title = substr($text, 0, 100); + $doc->description = $text; + $doc->url = $gram->getLink(); + $doc->contentType = 'instagram-' . $gram->getType(); + $doc->thumbnail = $gram->getImageThumbnailUrl(); + $doc->image = $gram->getImageHighResolutionUrl(); + $doc->searchImage = 'https://fitz-cms-images.s3.eu-west-2.amazonaws.com/insta.png'; + $documents[] = $doc; + } + $update->addDocuments($documents); + $update->addCommit(); + $client->update($update); } - $update->addDocuments($documents); - $update->addCommit(); - $client->update($update); - } } diff --git a/app/Http/Controllers/learningController.php b/app/Http/Controllers/learningController.php index a97febf2..31af8321 100644 --- a/app/Http/Controllers/learningController.php +++ b/app/Http/Controllers/learningController.php @@ -25,23 +25,34 @@ class learningController extends Controller public function lookThinkDoMain(): View|Response { $ltd = LookThinkDo::list(); - $pages = Stubs::getPage('learning', 'look-think-do'); + $page = Stubs::getPage('learning', 'look-think-do'); if (empty($ltd['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('learning.lookthinkdomain', + [ + 'page' => Collect($page['data'])->first(), + 'ltd' => Collect($ltd['data']), + ]); } - return view('learning.lookthinkdomain', compact('pages', 'ltd')); } /** * Display a Look think do activity * @param string $slug The required slug - * @return View + * @return View|Response */ - public function lookThinkDoActivity(string $slug): View + public function lookThinkDoActivity(string $slug): View|Response { $ltd = LookThinkDo::find($slug); - $adlib = CIIM::findByAccession($ltd['data'][0]['adlib_id_number']); - return view('learning.lookthinkdoactivity', compact('ltd', 'adlib')); + if (empty($ltd['data'])) { + return response()->view('errors.404', [], 404); + } else { + $activity = Collect($ltd['data'])->first(); + $adlib = CIIM::findByAccession($activity['adlib_id_number']); + return view('learning.lookthinkdoactivity', ['ltd' => $activity, 'adlib' => $adlib]); + } + } /** @@ -58,13 +69,17 @@ public function resources(): View /** * @param string $slug - * @return View + * @return View|Response */ - public function resource(string $slug): View + public function resource(string $slug): View|Response { - $res = LearningPages::filterBySlug($slug); + $resource = LearningPages::filterBySlug($slug); + if (empty($resource['data'])) { + return response()->view('errors.404', [], 404); + } else { + return view('learning.resource', ['resource' => Collect($resource['data'])->first()]); - return view('learning.resource', compact('res')); + } } /** @@ -125,47 +140,68 @@ public static function research(): array /** * @param $slug - * @return View + * @return View|Response */ - public function adult($slug): View + public function adult($slug): View|Response { $session = Stubs::findBySlug($slug); - return view('learning.adult', compact('session')); + if(empty($session['data'])) { + return response()->view('errors.404', [], 404); + } else { + return view('learning.adult', ['session' => Collect($session['data'])->first()]); + } } /** * @param $slug - * @return View + * @return View|Response * @throws InvalidArgumentException */ - public function session($slug): View + public function session($slug): View|Response { $session = SchoolSessions::find($slug); - $records = FindMoreLikeThis::find($slug, 'pages'); - return view('learning.session', compact('session', 'records')); + if (empty($session['data'])) { + return response()->view('errors.404', [], 404); + } else { + $records = FindMoreLikeThis::find($slug, 'pages'); + return view('learning.session', ['session' => Collect($session['data'])->first(), 'records' => $records]); + } + } /** * @param $slug - * @return View + * @return View|Response * @throws InvalidArgumentException */ - public function community($slug): View + public function community($slug): View|Response { $pages = Stubs::findBySlug($slug); - $records = FindMoreLikeThis::find($slug, 'school_sessions'); - return view('learning.community', compact('pages', 'records')); + if(empty($pages['data'])){ + return response()->view('errors.404', [], 404); + } else { + $records = FindMoreLikeThis::find($slug, 'pages'); + return view('learning.community', [ + 'page' => Collect($pages['data'])->first(), + 'records' => $records] + ); + } } + /** * @param string $slug - * @return View + * @return View|Response * @throws InvalidArgumentException */ - public function young(string $slug): View + public function young(string $slug): View|Response { $session = Stubs::findBySlug($slug); - $records = FindMoreLikeThis::find($slug, 'schoolsessions'); - return view('learning.young', compact('session', 'records')); + if(empty($session['data'])){ + return response()->view('errors.404', [], 404); + } else { + $records = FindMoreLikeThis::find($slug, 'pages'); + return view('learning.young', ['session' => Collect($session['data'])->first(), 'records' => $records]); + } } /** diff --git a/app/Http/Controllers/newsController.php b/app/Http/Controllers/newsController.php index 65b59140..07f39702 100644 --- a/app/Http/Controllers/newsController.php +++ b/app/Http/Controllers/newsController.php @@ -30,10 +30,16 @@ public function index(Request $request): View public function article(string $slug): View|Response { $news = NewsArticles::find($slug); - $records = FindMoreLikeThis::find($slug, 'news'); - if (empty($news['data'])) { + if(empty($news['data'])) { return response()->view('errors.404', [], 404); + } else { + $records = FindMoreLikeThis::find($slug, 'news'); + return view('news.article', + [ + 'news' => Collect($news['data'])->first(), + 'records' => $records + ] + ); } - return view('news.article', compact('news', 'records')); } } diff --git a/app/Http/Controllers/pagesController.php b/app/Http/Controllers/pagesController.php index 927f8f98..2be4cac1 100644 --- a/app/Http/Controllers/pagesController.php +++ b/app/Http/Controllers/pagesController.php @@ -1,6 +1,7 @@ view('errors.404', [], 404); + } else { + return view('pages.index', [ + 'page' => Collect($page['data'])->first(), + 'records' => FindMoreLikeThis::find($slug, 'pages'), + ] + ); } - return view('pages.index', compact('pages', 'records')); } /** @@ -41,11 +46,14 @@ public function index(string $section, string $slug): View|Response */ public function landing(string $section): View|Response { - $pages = Stubs::getLanding($section); - $associated = Stubs::getAssociated($section); - if (empty($pages['data'])) { + $page = Stubs::getLanding($section); + if (empty($page['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('pages.landing', [ + 'page' => Collect($page['data'])->first(), + 'associated' => Stubs::getAssociated($section) + ]); } - return view('pages.landing', compact('pages', 'associated')); } } diff --git a/app/Http/Controllers/podcastsController.php b/app/Http/Controllers/podcastsController.php index d1ce6760..ac979968 100644 --- a/app/Http/Controllers/podcastsController.php +++ b/app/Http/Controllers/podcastsController.php @@ -34,10 +34,17 @@ public function series(string $slug): View|Response $ids = PodcastSeries::getSeriesID($slug); if (empty($ids['data'])) { return response()->view('errors.404', [], 404); + } else { + $podcasts = PodcastArchive::find(Collect($ids['data'])->first()['id']); + $suggest = FindMoreLikeThis::find($slug, 'podcast_series'); + return view('podcasts.series', + [ + 'podcasts' => $podcasts['data'], + 'ids' => Collect($ids['data'])->first(), + 'suggest' => $suggest + ] + ); } - $podcasts = PodcastArchive::find($ids['data'][0]['id']); - $suggest = FindMoreLikeThis::find($slug, 'podcast_series'); - return view('podcasts.series', compact('podcasts', 'ids', 'suggest')); } /** @@ -74,12 +81,16 @@ public function mindseyes(Request $request): View public function mindseye(string $slug): View|Response { $mindseye = MindsEye::find($slug); - $adlib = CIIM::findByAccession($mindseye['data'][0]['adlib_id']); - $suggest = FindMoreLikeThis::find($slug, 'podcasts'); if (empty($mindseye['data'])) { return response()->view('errors.404', [], 404); + } else { + $mind = Collect($mindseye['data'])->first(); + return view('podcasts.mindseye', [ + 'mindseye' => $mind, + 'adlib' => CIIM::findByAccession($mind['adlib_id']), + 'suggest' => FindMoreLikeThis::find($slug, 'podcasts') + ]); } - return view('podcasts.mindseye', compact('mindseye', 'adlib', 'suggest')); } /** @@ -88,11 +99,12 @@ public function mindseye(string $slug): View|Response */ public function presenter(string $slug): View|Response { - $profiles = AssociatedPeople::find($slug); - if (empty($profiles['data'])) { + $profile = AssociatedPeople::find($slug); + if (empty($profile['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('podcasts.presenter', ['profile' => Collect($profile['data'])->first()]); } - return view('podcasts.presenter', compact('profiles')); } /** @@ -103,7 +115,8 @@ public function presenters(): View|Response $profiles = AssociatedPeople::list(); if (empty($profiles['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('podcasts.presenters', compact('profiles')); } - return view('podcasts.presenters', compact('profiles')); } } diff --git a/app/Http/Controllers/researchController.php b/app/Http/Controllers/researchController.php index 34600052..d2fc0723 100644 --- a/app/Http/Controllers/researchController.php +++ b/app/Http/Controllers/researchController.php @@ -44,12 +44,15 @@ public function projects(Request $request): View */ public function project(string $slug): View|Response { - $projects = ResearchProjects::find($slug); - $records = FindMoreLikeThis::find($slug, 'projects'); - if (empty($projects['data'])) { + $project = ResearchProjects::find($slug); + if (empty($project['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('research.project', [ + 'project' => Collect($project['data'])->first(), + 'records' => FindMoreLikeThis::find($slug, 'projects') + ]); } - return view('research.project', compact('projects', 'records')); } /** @@ -67,14 +70,17 @@ public function profiles(Request $request): View * @return View|Response * @throws InvalidArgumentException */ - public function affiliate(string $slug): View|Response + public function affiliatedResearcher(string $slug): View|Response { - $profiles = AffiliateResearchers::find($slug); - if (empty($profiles['data'])) { + $profile = AffiliateResearchers::find($slug); + if (empty($profile['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('research.affiliate', [ + 'profile' => Collect($profile['data'])->first(), + 'similar' => FindMoreLikeThis::find($slug, 'affiliate') + ]); } - $similar = FindMoreLikeThis::find($slug, 'affiliate'); - return view('research.affiliate', compact('profiles', 'similar')); } /** @@ -93,12 +99,15 @@ public function affiliates(): View */ public function profile(string $slug): View|Response { - $profiles = StaffProfiles::find($slug); - if (empty($profiles['data'])) { + $profile = StaffProfiles::find($slug); + if (empty($profile['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('research.profile', [ + 'profile' => Collect($profile['data'])->first(), + 'similar' => FindMoreLikeThis::find($slug, 'staffProfile') + ]); } - $similar = FindMoreLikeThis::find($slug, 'staffProfile'); - return view('research.profile', compact('profiles', 'similar')); } /** @@ -110,8 +119,9 @@ public function resource(string $slug): View|Response $resources = OnlineResources::find($slug); if (empty($resources['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('research.resource', ['resources' => Collect($resources['data'])->first()]); } - return view('research.resource', compact('resources')); } /** @@ -130,11 +140,12 @@ public function resources(Request $request): View */ public function opportunity(string $slug): View|Response { - $opportunities = ResearchOpportunities::find($slug); - if (empty($opportunities['data'])) { + $opportunity = ResearchOpportunities::find($slug); + if (empty($opportunity['data'])) { return response()->view('errors.404', [], 404); + } else { + return view('research.opportunity', ['opportunity' => Collect($opportunity['data'])->first()]); } - return view('research.opportunity', compact('opportunities')); } /** diff --git a/app/Http/Controllers/searchController.php b/app/Http/Controllers/searchController.php index 014bb522..bb0b46ae 100644 --- a/app/Http/Controllers/searchController.php +++ b/app/Http/Controllers/searchController.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers; -use Config; +use Illuminate\Support\Facades\Config; use Exception; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; @@ -14,7 +14,7 @@ use Solarium\Client; use Solarium\Core\Client\Adapter\Curl; use Symfony\Component\EventDispatcher\EventDispatcher; -use Purifier; +use Mews\Purifier\Facades\Purifier; class searchController extends Controller { diff --git a/app/Http/Controllers/themesController.php b/app/Http/Controllers/themesController.php deleted file mode 100644 index 5fa77711..00000000 --- a/app/Http/Controllers/themesController.php +++ /dev/null @@ -1,35 +0,0 @@ -view('errors.404', [], 404); - } - return view('themes.theme', compact('themes')); - } -} diff --git a/app/Http/Controllers/thingstodoController.php b/app/Http/Controllers/thingstodoController.php deleted file mode 100644 index 8850920c..00000000 --- a/app/Http/Controllers/thingstodoController.php +++ /dev/null @@ -1,18 +0,0 @@ -addDocuments($documents); $update->addCommit(); return $client->update($update); diff --git a/app/Http/Controllers/visitController.php b/app/Http/Controllers/visitController.php index 1d038c80..92438b7b 100644 --- a/app/Http/Controllers/visitController.php +++ b/app/Http/Controllers/visitController.php @@ -4,11 +4,13 @@ use App\Models\CoronaVirusNotes; use App\Models\Directions; +use App\Models\FindMoreLikeThis; use App\Models\FloorPlans; use App\Models\Transport; use App\Models\Faqs; use App\Models\Stubs; use App\Models\VisitUsComponents; + use Illuminate\Contracts\View\View; class visitController extends Controller @@ -18,18 +20,16 @@ class visitController extends Controller */ public function index(): View { - $associated = Stubs::visitUsAssociated(); - $pages = Stubs::visitUsLanding(); - $directions = Directions::list(); - $floors = FloorPlans::list(); - $corona = CoronaVirusNotes::list(); - $transport = Transport::list(); - $measures = VisitUsComponents::find(2); - return view('visit.index', compact( - 'pages', 'associated', 'directions', - 'floors', 'corona', 'transport', - 'measures' - )); + return view('visit.index', [ + 'pages' => Stubs::visitUsLanding(), + 'associated' => Stubs::visitUsAssociated(), + 'directions' => Directions::list(), + 'floors' => FloorPlans::list(), + 'corona' => CoronaVirusNotes::list(), + 'transport' => Transport::list(), + 'measures' => VisitUsComponents::find(2) + ] + ); } /** @@ -37,9 +37,11 @@ public function index(): View */ public function faqs(): View { - $booking = Faqs::list('booking'); - $hse = Faqs::list('hse'); - $visiting = Faqs::list('visit'); - return view('visit.faqs', compact('visiting', 'hse', 'booking')); + return view('visit.faqs', [ + 'visiting' => Faqs::list('visit'), + 'hse' => Faqs::list('hse'), + 'booking' => Faqs::list('booking'), + 'records' => FindMoreLikeThis::find('frequently-asked-questions', 'pages') + ]); } } diff --git a/app/Models/AudioGuide.php b/app/Models/AudioGuide.php index 79f25b19..06bebf1f 100644 --- a/app/Models/AudioGuide.php +++ b/app/Models/AudioGuide.php @@ -6,7 +6,7 @@ class AudioGuide extends Model { - protected static string $table = 'audio_guides'; + protected static string $table = 'audio_guide'; /** * @return array diff --git a/app/Models/Collections.php b/app/Models/Collections.php index 6cee33e6..f01de4ce 100644 --- a/app/Models/Collections.php +++ b/app/Models/Collections.php @@ -6,6 +6,9 @@ class Collections extends Model { + /** + * @var string $table + */ protected static string $table = 'collections'; /** diff --git a/app/Models/HighlightThemes.php b/app/Models/HighlightThemes.php index 418e80eb..c7539d73 100644 --- a/app/Models/HighlightThemes.php +++ b/app/Models/HighlightThemes.php @@ -29,10 +29,10 @@ public static function list(): array public static function find(string $theme):array { $api = new DirectUs( - self::$table, + 'pharos', array( 'fields' => '*.*.*', - 'meta' => 'result_count,total_count,type', + 'meta' => '*', 'filter[themes][contains]' => $theme, ) ); diff --git a/app/Models/SpoliationClaims.php b/app/Models/SpoliationClaims.php index 72170e6f..cb664602 100644 --- a/app/Models/SpoliationClaims.php +++ b/app/Models/SpoliationClaims.php @@ -26,7 +26,7 @@ public static function find(string $priref): array 'filter[priref][eq]' => $priref ) ); - return $api->getData()['data']; + return $api->getData(); } /** diff --git a/public/images/logos/iiif.svg b/public/images/logos/iiif.svg new file mode 100644 index 00000000..2c6b1fec --- /dev/null +++ b/public/images/logos/iiif.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/resources/views/aboutus/director.blade.php b/resources/views/aboutus/director.blade.php index 66db85e6..cb8c15df 100644 --- a/resources/views/aboutus/director.blade.php +++ b/resources/views/aboutus/director.blade.php @@ -3,9 +3,8 @@ @section('hero_image',env('CONTENT_STORE') . 'img_20190105_153947.jpg') @section('hero_image_title', "The inside of our Founder's entrance") -@foreach($directors['data'] as $director) - @include('includes.elements.page-meta', $data = $director) - @section('title', $director['display_name']) +@include('includes.elements.page-meta', $data = $director) +@section('title', $director['display_name']) @section('content')
@if(!is_null($director['hero_image'])) @@ -26,4 +25,3 @@ @markdown($director['biography'] ?? 'No content available')
@endsection -@endforeach diff --git a/resources/views/aboutus/spoliation-claim.blade.php b/resources/views/aboutus/spoliation-claim.blade.php index 2d1a6c38..31371fe5 100644 --- a/resources/views/aboutus/spoliation-claim.blade.php +++ b/resources/views/aboutus/spoliation-claim.blade.php @@ -3,22 +3,17 @@ @section('hero_image_title', "The inside of our Founder's entrance") @section('description', 'Spoliation claims made to the Museum') @section('keywords', 'spoliation,stories,museum,cambridge') - -@foreach($claims as $claim) - @section('title','Spoliation claim: ' . $claim['alt_text']) -@endforeach +@section('title','Spoliation claim: ' . $claims['alt_text']) @section('content') - @foreach($claims as $claim) -
- @markdown($claim['text']) - - Learn more about this claim - -
- {{ $claim['alt_text'] }} - @endforeach +
+ @markdown($claims['text']) + + Learn more about this claim + +
+ {{ $claims['alt_text'] }} @endsection diff --git a/resources/views/aboutus/spoliation.blade.php b/resources/views/aboutus/spoliation.blade.php index aec006f6..e85e7521 100644 --- a/resources/views/aboutus/spoliation.blade.php +++ b/resources/views/aboutus/spoliation.blade.php @@ -5,7 +5,7 @@ @section('description', 'Spoliation claims made to the Museum') @section('keywords', 'spoliation,stories,museum,cambridge') @section('content') -
+
@foreach($claims['data'] as $claim) @endforeach diff --git a/resources/views/aboutus/vacancy.blade.php b/resources/views/aboutus/vacancy.blade.php index 700d7c4f..71fd80bc 100644 --- a/resources/views/aboutus/vacancy.blade.php +++ b/resources/views/aboutus/vacancy.blade.php @@ -1,16 +1,15 @@ @extends('layouts.layout') -@foreach($vacancies['data'] as $vacancy) - @section('title', $vacancy['job_title']) +@section('title', $vacancy['job_title']) @section('description',$vacancy['meta_description']) @section('keywords',$vacancy['meta_keywords']) @if(!empty($vacancy['hero_image'])) @section('hero_image', $vacancy['hero_image']['data']['url']) -@section('hero_image_title', $vacancy['hero_image_alt_text']) + @section('hero_image_title', $vacancy['hero_image_alt_text']) @else @section('hero_image','https://fitz-cms-images.s3.eu-west-2.amazonaws.com/img_20190105_153947.jpg') -@section('hero_image_title', "The inside of our Founder's entrance") + @section('hero_image_title', "The inside of our Founder's entrance") @endif @section('content') @@ -37,4 +36,3 @@
@endsection -@endforeach diff --git a/resources/views/collections/details.blade.php b/resources/views/collections/details.blade.php index 60bc5499..15ffc8da 100644 --- a/resources/views/collections/details.blade.php +++ b/resources/views/collections/details.blade.php @@ -1,111 +1,109 @@ @extends('layouts.layout') -@foreach($collection['data'] as $coll) - @section('keywords', $coll['meta_keywords']) - @section('description', $coll['meta_description']) - @section('title', $coll['collection_name']) - @section('hero_image', $coll['hero_image']['data']['url']) - @section('hero_image_title', $coll['hero_image_alt_text']) +@section('keywords', $collection['meta_keywords']) +@section('description', $collection['meta_description']) +@section('title', $collection['collection_name']) +@section('hero_image', $collection['hero_image']['data']['url']) +@section('hero_image_title', $collection['hero_image_alt_text']) - @section('content') -
- {!! $coll['collection_description'] !!} -
- @endsection +@section('content') +
+ {!! $collection['collection_description'] !!} +
+@endsection - @section('collections') - @isset($coll['object_id_numbers']) - @inject('collectionsController', 'App\Http\Controllers\collectionsController') - @php - $records = $collectionsController::getObjects($coll['object_id_numbers']); - @endphp - @if(!empty($records)) -
-

- Selected Related Objects -

-
- @foreach($records as $record) - @php - $pris = Arr::pluck($record['_source']['identifier'],'priref'); - $pris = array_filter($pris); - $pris= Arr::flatten($pris); - @endphp +@section('collections') + @isset($collection['object_id_numbers']) + @inject('collectionsController', 'App\Http\Controllers\collectionsController') + @php + $records = $collectionsController::getObjects($collection['object_id_numbers']); + @endphp + @if(!empty($records)) +
+

+ Selected Related Objects +

+
+ @foreach($records as $record) + @php + $pris = Arr::pluck($record['_source']['identifier'],'priref'); + $pris = array_filter($pris); + $pris= Arr::flatten($pris); + @endphp -
-
-
- @if(array_key_exists('multimedia', $record['_source'])) - An image of {{ ucfirst($record['_source']['summary_title']) }} - @else - A stand in image for {{ ucfirst($record['_source']['summary_title']) }}} - @endif -
-
-
-

- @if(array_key_exists('title',$record['_source'] )) - {{ ucfirst($record['_source']['title'][0]['value']) }} - @else - {{ ucfirst($record['_source']['summary_title']) }} - @endif -

-

{{ $record['_source']['identifier'][0]['accession_number'] }}

-
+
+
+
+ @if(array_key_exists('multimedia', $record['_source'])) + An image of {{ ucfirst($record['_source']['summary_title']) }} + @else + A stand in image for {{ ucfirst($record['_source']['summary_title']) }}} + @endif +
+
+
+

+ @if(array_key_exists('title',$record['_source'] )) + {{ ucfirst($record['_source']['title'][0]['value']) }} + @else + {{ ucfirst($record['_source']['summary_title']) }} + @endif +

+

{{ $record['_source']['identifier'][0]['accession_number'] }}

- @endforeach -
+
+ @endforeach
- @endif - @endisset - @endsection +
+ @endif + @endisset +@endsection - @if(!empty($coll['associated_galleries'])) - @section('galleries') -
-

- Associated Galleries -

-
- @foreach($coll['associated_galleries'] as $gallery) - - @endforeach -
+@if(!empty($collection['associated_galleries'])) + @section('galleries') +
+

+ Associated Galleries +

+
+ @foreach($collection['associated_galleries'] as $gallery) + + @endforeach
- @endsection - @endif +
+ @endsection +@endif - @if(!empty($coll['curators'])) - @section('curators') -
-

Associated staff

-
- @foreach($coll['curators'] as $curator) - - @endforeach -
+@if(!empty($collection['curators'])) + @section('curators') +
+

Associated staff

+
+ @foreach($collection['curators'] as $curator) + + @endforeach
- @endsection - @endif -@endforeach +
+ @endsection +@endif diff --git a/resources/views/components/ttn-artist.blade.php b/resources/views/components/ttn-artist.blade.php index 47ca68c1..d3e4cdc9 100644 --- a/resources/views/components/ttn-artist.blade.php +++ b/resources/views/components/ttn-artist.blade.php @@ -1,20 +1,20 @@
- @if(empty($artists['image'])) - + @if(empty($artist['image'])) + A stand in image for {{ $artists['display_name'] }} @else - + {{ $artists['display_name'] }} @@ -22,11 +22,11 @@

- - {{ $artists['display_name'] }} + + {{ $artist['display_name'] }}

-

{{ $artists['year_of_birth'] }} -{{ $artists['year_of_death'] }}

+

{{ $artist['year_of_birth'] }} -{{ $artist['year_of_death'] }}

diff --git a/resources/views/components/ttn-label.blade.php b/resources/views/components/ttn-label.blade.php index 9d9378aa..0757e7ac 100644 --- a/resources/views/components/ttn-label.blade.php +++ b/resources/views/components/ttn-label.blade.php @@ -1,6 +1,6 @@ @section('title', $label['title']) @section('description', $label['alt_text'] . ' - True to Nature') -
+
@if(!empty($label['image'])) {{ $label['alt_text'] }} @if(!empty($label['manifest_url'])) IIIF icon - view image View + src="{{ asset('/images/logos/iiif.svg') }}" alt="IIIF icon - view image" width="20px"> View deep zooming image @endif

- {{ $label['artist']['display_name'] }}
+ + {{ $label['artist']['display_name'] }} + +
{{ $label['artist']['place_of_birth']}} {{$label['artist']['year_of_birth']}} - {{$label['artist']['year_of_death']}} {{ $label['artist']['place_of_death']}}

@@ -69,20 +72,20 @@
@map( [ - 'lat' => $label['lat'], - 'lng' => $label['lng'], - 'zoom' => 12, - 'minZoom' => 6, - 'maxZoom' => 18, - 'markers' => [ - [ - 'title' => 'Place depicted', - 'lat' => $label['lat'], - 'lng' => $label['lng'], - 'popup' => 'Place depicted', - ], - ], - ] + 'lat' => $label['lat'], + 'lng' => $label['lng'], + 'zoom' => 12, + 'minZoom' => 6, + 'maxZoom' => 18, + 'markers' => [ + [ + 'title' => 'Place depicted', + 'lat' => $label['lat'], + 'lng' => $label['lng'], + 'popup' => 'Place depicted', + ], + ], + ] )
@endsection diff --git a/resources/views/departments/details.blade.php b/resources/views/departments/details.blade.php index d044446d..418fcf0e 100644 --- a/resources/views/departments/details.blade.php +++ b/resources/views/departments/details.blade.php @@ -1,42 +1,41 @@ @extends('layouts.layout') -@foreach($departments['data'] as $dept) - @section('title', $dept['title']) -@section('keywords', $dept['meta_keywords']) -@section('description', $dept['meta_description']) -@section('hero_image', $dept['hero_image']['data']['url']) -@section('hero_image_title', $dept['hero_image_alt_text']) +@section('title', $department['title']) +@section('keywords', $department['meta_keywords']) +@section('description', $department['meta_description']) +@section('hero_image', $department['hero_image']['data']['url']) +@section('hero_image_title', $department['hero_image_alt_text']) @section('content')
- @markdown($dept['department_description'] ?? '') - @isset( $dept['email_address'] ) + @markdown($department['department_description'] ?? '') + @isset( $department['email_address'] )

- Email: {{ $dept['email_address'] }} + Email: {{ $department['email_address'] }}

@endisset
@endsection -@if(!empty($dept['associated_galleries'])) -@section('galleries') -
-

Associated Galleries

-
- @foreach($dept['associated_galleries'] as $gallery) - - @endforeach +@if(!empty($department['associated_galleries'])) + @section('galleries') +
+

Associated Galleries

+
+ @foreach($department['associated_galleries'] as $gallery) + + @endforeach +
-
-@endsection + @endsection @endif @section('cons-areas') - @if($dept['slug'] == 'conservation-and-collections-care') + @if($department['slug'] == 'conservation-and-collections-care') @inject('departmentsController', 'App\Http\Controllers\departmentsController') @php $areas = $departmentsController::areas(); @@ -48,20 +47,19 @@ @endsection @if(!empty($staff['data'])) -@section('curators') -
-

Associated staff

-
- @foreach($staff['data'] as $curator) - - @endforeach + @section('curators') +
+

Associated staff

+
+ @foreach($staff['data'] as $curator) + + @endforeach +
-
-@endsection + @endsection @endif -@endforeach diff --git a/resources/views/exhibitions/details.blade.php b/resources/views/exhibitions/details.blade.php index 48d5750a..ecbbe211 100644 --- a/resources/views/exhibitions/details.blade.php +++ b/resources/views/exhibitions/details.blade.php @@ -1,421 +1,47 @@ @extends('layouts.exhibitions') -@foreach($exhibitions['data'] as $coll) - @section('keywords', $coll['meta_keywords']) -@section('description', $coll['meta_description']) -@section('title', $coll['exhibition_title']) -@section('hero_image', $coll['hero_image']['data']['url']) -@section('hero_image_title', $coll['hero_image_alt_text']) -@php - $type = match($coll['type']){ 'display'=>'Temporary Display', default => 'Exhibition'} -@endphp -@if($coll['slug'] === 'true-to-nature-open-air-painting-in-europe-1780-1870') +@section('keywords', $exhibition['meta_keywords']) +@section('description', $exhibition['meta_description']) +@section('title', $exhibition['exhibition_title']) +@section('hero_image', $exhibition['hero_image']['data']['url']) +@section('hero_image_title', $exhibition['hero_image_alt_text']) + +@if($exhibition['slug'] === 'true-to-nature-open-air-painting-in-europe-1780-1870') @if (\Carbon\Carbon::now()->diffInHours('2022-04-28 00:00:01', false) <= 0) @include('includes.structure.true') @endif @endif -@section('content') - @isset($coll['tessitura_string']) - @if(!Carbon\Carbon::parse($coll['exhibition_end_date'])->isPast() && !Carbon\Carbon::parse($coll['exhibition_end_date'])->isPast()) - @include('includes.structure.tessitura') - @endif - @endisset - @isset($coll['exhibition_end_date']) - @if(Carbon\Carbon::parse($coll['exhibition_end_date'])->isPast()) - @include('includes.structure.expired') - @endif - @endisset - @if($coll['tessitura_string'] === NULL) - @if(!Carbon\Carbon::parse($coll['exhibition_end_date'])->isPast() && !Carbon\Carbon::parse($coll['exhibition_end_date'])->isPast() && $coll['exhibition_status'] === 'current') - @include('includes.structure.general') - @endif - @endisset - @if(isset($coll['exhibition_narrative']) || isset($coll['exhibition_abstract'])) -
- @if(isset($coll['exhibition_narrative'])) - @markdown($coll['exhibition_narrative']) - @endif - @if(isset($coll['exhibition_abstract'])) - @markdown($coll['exhibition_abstract']) - @endif -
- @endif +@include('includes.elements.exhibitions.main-content') - @if( isset($coll['exhibition_url']) || isset($coll['exhibition_start_date'])) -

{{$type}} details

-
-
    - @if(isset($coll['exhibition_url'])) -
  • - {{$type}} website -
  • - @endif - @if(isset($coll['exhibition_start_date'])) -
  • - {{$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') }} -
  • - @endif -
-
- @endif +@include('includes.elements.exhibitions.cases') - @if(!empty($cases['data'])) - @section('exhibitionCaseCards') -
-
-

- - Exhibition Case Introductions - -

-
- @foreach($cases['data'] as $case) - - @endforeach -
-
-
- @endsection - @endif +@include('includes.elements.exhibitions.podcasts') -@if(!empty($podcasts)) -@section('exhibitionAudio') -
-
-

Audio

-
- @foreach($podcasts['data'] as $podcast) - - @endforeach -
-
-
-@endsection -@endif +@include('includes.elements.exhibitions.films') -@if(isset($coll['youtube_id']) && $coll['youtube_id']!= '' ) -

- {{ $type }} films -

-
-
- -
-
-@endif +@include('includes.elements.exhibitions.artworks') -@if(isset($coll['youtube_secondary_id']) && $coll['youtube_secondary_id']!= '' ) -
-
- -
-
-@endif +@include('includes.elements.exhibitions.curators') -@if(isset($coll['youtube_playlist_id'])) -

- {{ $type }} films - a playlist -

-
-
- -
-
-@endif +@include('includes.elements.exhibitions.partners') +@include('includes.elements.exhibitions.departments') -@isset($adlib) -

Selected objects from the {{$type}}

-
- @foreach($adlib as $record) - @php - $pris = Arr::pluck($record['_source']['identifier'],'priref'); - $pris = array_filter($pris); - $pris= Arr::flatten($pris) - @endphp -
-
-
- @if(array_key_exists('multimedia', $record['_source'])) - An image of {{ ucfirst($record['_source']['summary_title']) }} - @else - A stand in image for {{ ucfirst($record['_source']['summary_title']) }}} - @endif -
-
+@include('includes.elements.exhibitions.carousel') -
-

- {{ ucfirst($record['_source']['summary_title']) }} -

-

- @if(array_key_exists('department', $record['_source'])) - {{ $record['_source']['identifier'][0]['accession_number'] }}
- @endif -

-
-
-
-
- @endforeach -
-@endisset +@include('includes.elements.exhibitions.galleries') -@endsection +@include('includes.elements.exhibitions.360') -@if(!empty($coll['associated_curators']) || !empty($coll['external_curators'])) -@section('curators') -
-
-

Curators and experts behind this exhibition

-
- @foreach($coll['associated_curators'] as $curator) - - @endforeach - @foreach($coll['external_curators'] as $curator) - - @endforeach -
-
-
-@endsection -@endif - -@if(!empty($coll['exhibition_partners'] )) -@section('research-funders') -
-
-

Funders and partners

-
- @foreach($coll['exhibition_partners'] as $partner) - - @endforeach -
-
-
-@endsection -@endif +@include('includes.elements.exhibitions.sketchfab') +@include('includes.elements.exhibitions.files') -@if(!empty($coll['associated_departments'])) -@section('departments') -
-

Associated departments

-
- @foreach($coll['associated_departments'] as $department) - - @endforeach -
-
-@endsection -@endif +@include('includes.elements.exhibitions.thanks') +@include('includes.elements.exhibitions.products') -@if(!empty($coll['exhibition_carousel'])) -@section('excarousel') -
-
-
- -
-
-
-@endsection -@endif - -@if(!empty($coll['associated_galleries'])) -@section('galleries') -
-
-

Associated Galleries

-
- @foreach($coll['associated_galleries'] as $gallery) - - @endforeach -
-
-
-@endsection -@endif +@include('includes.elements.exhibitions.events') -@section('360') - @if(!empty($coll['image_360_pano'])) -
-

360 gallery image

-
-
-
-
-@section('360_image', $coll['image_360_pano']['data']['full_url'])) -@endif -@endsection -@endforeach - -@if(!empty($records)) -@section('mlt') -
-

Similar exhibitions from our archives

-
- @foreach($records as $record) - - @endforeach -
-
-@endsection - - -@section('sketchfab') - @if(!empty($coll['sketchfab_id'])) -
-

3d model of this display or exhibition

-
-
- -
-
-
- @endif -@endsection -@endif - -@section('exhibitions-files') - @if(!empty($coll['exhibition_files'])) - - @endif -@endsection - -@section('exhibition-thanks') - -@endsection - -@if(!empty($products)) -@section('shopify') -
-

Suggested Curating Cambridge products

-
- @foreach($products as $record) - - @endforeach -
-
-@endsection -@endif - - -@if(!empty($events)) -@section('tnew-data') -
-

Special events for this exhibition

-
- @foreach($events as $production) - - @endforeach -
-
-@endsection -@endif +@include('includes.elements.exhibitions.similar-exhibits') diff --git a/resources/views/exhibitions/label.blade.php b/resources/views/exhibitions/label.blade.php index 21ddf435..a4352461 100644 --- a/resources/views/exhibitions/label.blade.php +++ b/resources/views/exhibitions/label.blade.php @@ -1,6 +1,5 @@ @extends('layouts.highlights') -@foreach($labels['data'] as $label) - @section('keywords', 'labels,cases') +@section('keywords', 'labels,cases') @section('description', $label['hero_image_alt_title']) @section('title', $label['title']) @section('hero_image', $label['hero_image']['data']['url']) @@ -25,17 +24,16 @@
@endsection -@endforeach @if(!empty($records)) -@section('mlt') -
-

Other highlight objects in our collection you might like

-
- @foreach($records as $record) - - @endforeach + @section('mlt') +
+

Other highlight objects in our collection you might like

+
+ @foreach($records as $record) + + @endforeach +
-
-@endsection + @endsection @endif diff --git a/resources/views/exhibitions/ttn-artist.blade.php b/resources/views/exhibitions/ttn-artist.blade.php index 919646d1..4f05e878 100644 --- a/resources/views/exhibitions/ttn-artist.blade.php +++ b/resources/views/exhibitions/ttn-artist.blade.php @@ -1,8 +1,8 @@ @extends('layouts.highlights') -@section('title', $artists[0]['display_name']) - +@section('title', $artist['display_name']) +@section('description', 'A page listing image cases for ' . $artist['display_name']) @section('content') - + @endsection @if(!empty($works)) diff --git a/resources/views/exhibitions/ttn-label.blade.php b/resources/views/exhibitions/ttn-label.blade.php index c2192d85..231cb3d0 100644 --- a/resources/views/exhibitions/ttn-label.blade.php +++ b/resources/views/exhibitions/ttn-label.blade.php @@ -1,18 +1,18 @@ @extends('layouts.highlights') @section('content') - + @endsection @if(!empty($records)) -@section('mlt') -
-

Other paintings that may interest you

-
- @foreach($records as $record) - - @endforeach + @section('mlt') +
+

Other paintings that may interest you

+
+ @foreach($records as $record) + + @endforeach +
-
-@endsection + @endsection @endif diff --git a/resources/views/galleries/gallery.blade.php b/resources/views/galleries/gallery.blade.php index 7accf921..cedadb7a 100644 --- a/resources/views/galleries/gallery.blade.php +++ b/resources/views/galleries/gallery.blade.php @@ -1,134 +1,28 @@ @extends('layouts.layout') - -@foreach($galleries['data'] as $gallery) - @section('title', $gallery['gallery_name']) - @section('description', $gallery['meta_description']) - @section('keywords', $gallery['meta_keywords']) - @if(isset($gallery['hero_image']['data']['full_url'])) +@section('title', $gallery['gallery_name']) +@section('description', $gallery['meta_description']) +@section('keywords', $gallery['meta_keywords']) +@if(isset($gallery['hero_image']['data']['full_url'])) @section('hero_image', $gallery['hero_image']['data']['url']) @section('hero_image_title', $gallery['hero_image_alt_text']) - @endif +@endif - @section('content') - @if(!empty($gallery['gallery_status'])) -
- @foreach($gallery['gallery_status'] as $status) - {{ $status }} - @endforeach -
- @endif +@section('content') + @include('includes.elements.galleries.status') - @if(isset($gallery['gallery_description'])) -
- @markdown($gallery['gallery_description']) -
- @endif + @include('includes.elements') - @if(isset($gallery['gallery_floor'])) -

- Gallery data -

-
-
    -
  • {{ $gallery['gallery_floor'] }}
  • -
-
- @endif + @include('includes.elements.galleries.info') - @if(!empty($gallery['star_objects'])) -

- Object stories -

-
- @foreach($gallery['star_objects'] as $object) - - @endforeach -
- @endif + @include('includes.elements.galleries.star-objects') - @isset($gallery['object_id_numbers']) - @inject('galleriesController', 'App\Http\Controllers\galleriesController') - @php - $records = $galleriesController::getObjects($gallery['object_id_numbers']); - @endphp - @if(!empty($records)) -

- Selected objects in gallery {{ $gallery['gallery_name'] }} -

-
- @foreach($records as $record) - - @endforeach -
- @endif - @endisset - @endsection + @include('includes.elements.galleries.adlib') +@endsection - @if(!empty($gallery['audio_guide'])) - @section('audio-guide') -
-

- Audio description -

-
-
-
-
- -
-
-
-
-
- @endsection - @endif +@include('includes.elements.galleries.audio-guide') - @section('360') - @if(!empty($gallery['image_360_pano'])) -
-

{{ $gallery['360_pano_title'] }}: {{ Carbon\Carbon::parse($gallery['360_pano_date'])->format('F Y') }}

-
-
-
-
- @section('360_image', $gallery['image_360_pano']['data']['full_url']) - @endif - @endsection +@include('includes.elements.galleries.360') - @section('sketchfab-collection') - @if(!empty($gallery['sketchfab_id_collection'])) -
-

3D scans of objects in gallery

-
-
- -
-
-
- @endif - @endsection +@include('includes.elements.galleries.sketchfab') - @section('sketchfab') - @if(!empty($gallery['sketchfab_sketchup_id'])) -
-

Sketchup model of this gallery

-
-
- -
-
-
- @endif - @endsection -@endforeach +@include('includes.elements.galleries.sketchup') diff --git a/resources/views/highlights/associate.blade.php b/resources/views/highlights/associate.blade.php index 4e7f9038..56643b56 100644 --- a/resources/views/highlights/associate.blade.php +++ b/resources/views/highlights/associate.blade.php @@ -1,59 +1,65 @@ @extends('layouts.highlights') -@foreach($pharos['data'] as $object) - @section('title', $object['title']) -@section('description', $object['meta_description']) -@section('keywords', $object['meta_keywords']) -@if(!empty($object['hero_image'])) - @section('hero_image', $object['hero_image']['data']['url']) -@section('hero_image_title', $object['hero_image_alt_text']) +@section('title', $pharos['title']) +@section('description', $pharos['meta_description']) +@section('keywords', $pharos['meta_keywords']) +@if(!empty($pharos['hero_image'])) + @section('hero_image', $pharos['hero_image']['data']['url']) + @section('hero_image_title', $pharos['hero_image_alt_text']) @else @section('hero_image',env('CONTENT_STORE') . 'img_20190105_153947.jpg') -@section('hero_image_title', "The inside of our Founder's entrance") + @section('hero_image_title', "The inside of our Founder's entrance") @endif @section('content') - @if(!is_null($object['hero_image'])) + @if(!is_null($pharos['hero_image']))
- {{ $object['hero_image_alt_text'] }} -
{{ $object['hero_image_alt_text'] }}
+ + {{ $pharos['hero_image_alt_text'] }} + +
+ {{ $pharos['hero_image_alt_text'] }} +
@endif
- @markdown($object['body']) + @markdown($pharos['body'])
@endsection + @if(!empty($highlights)) -@section('highlight') -
-

- Other highlight objects you might like -

-
- @foreach($highlights as $record) - - @endforeach + @section('highlight') +
+

+ Other highlight objects you might like +

+
+ @foreach($highlights as $record) + + @endforeach +
-
-@endsection + + @endsection @endif + @if(!empty($records)) -@section('mlt') -
-

- Other pathways and stories you might like -

-
- @foreach($records as $record) - - @endforeach + @section('mlt') +
+

+ Other pathways and stories you might like +

+
+ @foreach($records as $record) + + @endforeach +
-
-@endsection + @endsection @endif -@endforeach diff --git a/resources/views/highlights/byperiod.blade.php b/resources/views/highlights/byperiod.blade.php index 60f8e348..b1a3d293 100644 --- a/resources/views/highlights/byperiod.blade.php +++ b/resources/views/highlights/byperiod.blade.php @@ -1,19 +1,17 @@ @extends('layouts.layout') -@foreach($period['data'] as $detail) - @section('title', $detail['title']) -@if(array_key_exists('meta_description', $detail)) - @section('description', $detail['meta_description']) +@section('title', $period['title']) +@if(array_key_exists('meta_description', $period)) + @section('description', $period['meta_description']) @endif -@if(array_key_exists('meta_keywords', $detail)) - @section('keywords', $detail['meta_keywords']) +@if(array_key_exists('meta_keywords', $period)) + @section('keywords', $period['meta_keywords']) @endif -@section('hero_image',$detail['hero_image']['data']['url']) -@section('hero_image_title', $detail['hero_image_alt_text']) -@endforeach +@section('hero_image',$period['hero_image']['data']['url']) +@section('hero_image_title', $period['hero_image_alt_text']) @section('content')
- {!! $detail['introductory_text'] !!} + {!! $period['introductory_text'] !!}
diff --git a/resources/views/highlights/bytheme.blade.php b/resources/views/highlights/bytheme.blade.php index fddf4656..0d79e1f4 100644 --- a/resources/views/highlights/bytheme.blade.php +++ b/resources/views/highlights/bytheme.blade.php @@ -1,13 +1,12 @@ @extends('layouts.layout') -@foreach($theme['data'] as $th) - @section('title', $th['title']) -@section('description', 'A description of the theme related to ' . $th['title']) -@section('keywords', '') -@section('hero_image', $th['hero_image']['data']['url']) -@section('hero_image_title', $th['hero_image_alt_text']) +@section('title', $theme['title']) +@section('description', 'A description of the theme related to ' . $theme['title']) +@section('keywords', 'pharos,theme,' . $theme['title']) +@section('hero_image', $theme['hero_image']['data']['url']) +@section('hero_image_title', $theme['hero_image_alt_text']) @section('content')
- {!! $th['introductory_text']!!} + {!! $theme['introductory_text']!!}
@foreach($pharos['data'] as $record) @@ -20,4 +19,3 @@ @endforeach
@endsection -@endforeach diff --git a/resources/views/highlights/details.blade.php b/resources/views/highlights/details.blade.php index a8289706..d6b56506 100644 --- a/resources/views/highlights/details.blade.php +++ b/resources/views/highlights/details.blade.php @@ -1,35 +1,34 @@ @extends('layouts.highlights') -@foreach($pharos['data'] as $record) - @section('keywords', $record['meta_keywords']) -@section('description', $record['meta_description']) -@section('title', $record['title']) -@section('hero_image', $record['image']['data']['url']) -@section('hero_image_title', $record['image_alt_text']) +@section('keywords', $pharos['meta_keywords']) +@section('description', $pharos['meta_description']) +@section('title', $pharos['title']) +@section('hero_image', $pharos['image']['data']['url']) +@section('hero_image_title', $pharos['image_alt_text']) @section('content')
- {{ $record['image_alt_text'] }} -
{{$record['image_alt_text']}}
+
{{$pharos['image_alt_text']}}
- @markdown($record['description']) + @markdown($pharos['description'])

Themes and periods

- @if(isset($record['period_assigned'])) - {{$record['period_assigned']}} + @if(isset($pharos['period_assigned'])) + {{$pharos['period_assigned']}} @endif - @if(isset($record['themes'])) - @foreach($record['themes'] as $th) + @if(isset($pharos['themes'])) + @foreach($pharos['themes'] as $th) {{str_replace('-',' ',$th)}} @@ -38,31 +37,31 @@ class="btn btn-dark mr-2 mt-2">{{$record['period_assigned']}}
@endsection -@if(!is_null($record['map'])) -@section('map') - @map( - [ - 'lat' => $record['map']['lat'], - 'lng' => $record['map']['lng'], - 'zoom' => 6, - 'markers' => [ - ['title' => 'Place of origin', - 'lat' => $record['map']['lat'], - 'lng' => $record['map']['lng'], - 'popup' => 'Place of origin',], - ], - ] - ) -@endsection +@if(!is_null($pharos['map'])) + @section('map') + @map( + [ + 'lat' => $pharos['map']['lat'], + 'lng' => $pharos['map']['lng'], + 'zoom' => 6, + 'markers' => [ + ['title' => 'Place of origin', + 'lat' => $pharos['map']['lat'], + 'lng' => $pharos['map']['lng'], + 'popup' => 'Place of origin',], + ], + ] + ) + @endsection @endif @section('youtube') - @if(!empty($record['youtube_id'])) + @if(!empty($pharos['youtube_id']))
-
@@ -71,13 +70,13 @@ class="btn btn-dark mr-2 mt-2">{{$record['period_assigned']}} @endsection @section('sketchfab-collection') - @if(!empty($record['sketchfab_id'])) + @if(!empty($pharos['sketchfab_id']))

3D scan

-
@@ -87,102 +86,98 @@ class="btn btn-dark mr-2 mt-2">{{$record['period_assigned']}} @endsection -@if(!empty($record['audio_guide'])) -@section('audio-guide') - @include('includes.elements.audio-guide') -@endsection +@if(!empty($pharos['audio_guide'])) + @section('audio-guide') + @include('includes.elements.audio-guide') + @endsection @endif -@if(!empty($record['associated_pharos_content'])) -@section('pharos-pages') -
-

Stories, Contexts and Themes

-
- @foreach($record['associated_pharos_content'] as $pharosassoc) - - @endforeach +@if(!empty($pharos['associated_pharos_content'])) + @section('pharos-pages') +
+

Stories, Contexts and Themes

+
+ @foreach($pharos['associated_pharos_content'] as $pharosassoc) + + @endforeach +
-
-@endsection + @endsection @endif @if(!empty($records)) -@section('mlt') -
-

Other highlight objects you might like

-
- @foreach($records as $record) - - @endforeach + @section('mlt') +
+

Other highlight objects you might like

+
+ @foreach($records as $record) + + @endforeach +
-
-@endsection + @endsection @endif -@endforeach - @section('adlib') @if(!empty($adlib)) @foreach($adlib as $record)

Data from our collections database

- @include('includes/elements/expander') + @include('includes.elements.expander')
- @include('includes/elements/descriptive') - @include('includes/elements/legal') - @include('includes/elements/lifecycle') - @include('includes/elements/agents-subjects') - @include('includes/elements/medium') - @include('includes/elements/materials') - @include('includes/elements/identification') + @include('includes.elements.descriptive') + @include('includes.elements.legal') + @include('includes.elements.lifecycle') + @include('includes.elements.agents-subjects') + @include('includes.elements.medium') + @include('includes.elements.materials') + @include('includes.elements.identification')
@endforeach @else - @foreach($pharos['data'] as $record) -
-

Further information

-
    -
  • Collections ID: {{$record['adlib_id']}}
  • - @if(!is_null($record['place_of_origin'])) -
  • Place of origin: {{ $record['place_of_origin'] }}
  • - @endif - @if(!is_null($record['date'])) -
  • Date: {{ $record['date'] }}
  • - @endif - @if(!is_null($record['maker'] )) -
  • Maker: {{ $record['maker'] }}
  • - @endif - @if(!is_null($record['material'] )) -
  • Material: {{ $record['material'] }}
  • - @endif - @if(!is_null($record['map'])) -
  • Map coordinates: {{ $record['map']['lat'] }}, {{$record['map']['lng']}}
  • - @endif -
+
+

Further information

+
    +
  • Collections ID: {{$pharos['adlib_id']}}
  • + @if(!is_null($pharos['place_of_origin'])) +
  • Place of origin: {{ $pharos['place_of_origin'] }}
  • + @endif + @if(!is_null($pharos['date'])) +
  • Date: {{ $pharos['date'] }}
  • + @endif + @if(!is_null($pharos['maker'] )) +
  • Maker: {{ $pharos['maker'] }}
  • + @endif + @if(!is_null($pharos['material'] )) +
  • Material: {{ $pharos['material'] }}
  • + @endif + @if(!is_null($pharos['map'])) +
  • Map coordinates: {{ $pharos['map']['lat'] }}, {{$pharos['map']['lng']}}
  • + @endif +
-
- @endforeach +
@endif @endsection @if(!empty($shopify)) -@section('shopify') -
-

Suggested Curating Cambridge products

-
- @foreach($shopify as $record) - - @endforeach + @section('shopify') +
+

Suggested Curating Cambridge products

+
+ @foreach($shopify as $record) + + @endforeach +
-
-@endsection + @endsection @endif diff --git a/resources/views/highlights/fitz-object.blade.php b/resources/views/highlights/fitz-object.blade.php deleted file mode 100644 index 12599b9b..00000000 --- a/resources/views/highlights/fitz-object.blade.php +++ /dev/null @@ -1,14 +0,0 @@ -@extends('layouts.layout') -@foreach($week['data'] as $record) - @section('description', $record['meta_description']) -@section('title') - {{ strip_tags($record['title']) }} -@endsection -@section('hero_image', $record['hero_image']['data']['url']) -@section('hero_image_title', $record['hero_image_alt_text']) -@section('content') -
- {!! $record['body'] !!} -
-@endsection -@endforeach diff --git a/resources/views/highlights/fitz-objects.blade.php b/resources/views/highlights/fitz-objects.blade.php deleted file mode 100644 index 79f80bbc..00000000 --- a/resources/views/highlights/fitz-objects.blade.php +++ /dev/null @@ -1,20 +0,0 @@ -@extends('layouts.layout') -@section('title','Our staff choose their highlights from our collections') -@section('description', 'A collection of favourite objects chosen by staff from the collection of the Fitzwilliam Museum') -@section('keywords', 'museum,highlights,collection,objects') -@section('hero_image',env('CONTENT_STORE') . 'img_20190105_153947.jpg') -@section('hero_image_title', "The inside of our Founder's entrance") - -@section('content') -
- @foreach($week['data'] as $record) - - @endforeach -
- {{ $paginator->links() }} -@endsection diff --git a/resources/views/highlights/landing.blade.php b/resources/views/highlights/landing.blade.php index 454691b0..db4c43d3 100644 --- a/resources/views/highlights/landing.blade.php +++ b/resources/views/highlights/landing.blade.php @@ -5,7 +5,6 @@ @section('description','A search page for our highlight objects') @section('keywords', 'search,highlights, objects') @section('collection-parallax', env('CONTENT_STORE') . 'large_PD_8_1979_1_201709.jpg') - @include('includes.structure.collections-search-form') @include('includes.structure.theme-carousel') @include('includes.structure.period-carousel') diff --git a/resources/views/highlights/stop.blade.php b/resources/views/highlights/stop.blade.php index 91e66d92..16412176 100644 --- a/resources/views/highlights/stop.blade.php +++ b/resources/views/highlights/stop.blade.php @@ -1,20 +1,20 @@ @extends('layouts.layout') - -@foreach($stop['data'] as $record) - @section('keywords', $record['meta_keywords']) -@section('description', $record['meta_description']) -@section('title', 'Audio guide: ' . $record['title']) -@section('hero_image', $record['hero_image']['data']['url']) -@section('hero_image_title', $record['hero_image_alt_text']) +@section('keywords', $stop['meta_keywords']) +@section('description', $stop['meta_description']) +@section('title', 'Audio guide: ' . $stop['title']) +@section('hero_image', $stop['hero_image']['data']['url']) +@section('hero_image_title', $stop['hero_image_alt_text']) @section('content') -

Audio guide stop: {{ $record['stop_number'] }}

+

+ Audio guide stop: {{ $stop['stop_number'] }} +

@@ -23,26 +23,24 @@
-

Crowdsourced transcription of the audio file

+

+ Crowdsourced transcription of the audio file +

- {{ $record['hero_image_alt_text'] }} -
{{$record['hero_image_alt_text']}}
- - - Creative Commons Licence - +
{{$stop['hero_image_alt_text']}}
+ Download image + + CC BY-NC-SA 4.0
- @markdown($record['transcription']) + @markdown($stop['transcription'])

Co-production of this resource

@@ -54,38 +52,37 @@ class="float-end img-fluid p-2" alt="The MicroPasts logo" width="100" height="10 The below generously gave their time to transcribe the file.

- @markdown($record['transcribers']) + @markdown($stop['transcribers'])
@endsection -@if(!empty($record['associated_pharos_object'])) -@section('pharos-pages') -
-

Associated highlight record

-
- @foreach($record['associated_pharos_object'] as $pharosassoc) - - @endforeach +@if(!empty($stop['associated_pharos_object'])) + @section('pharos-pages') +
+

Associated highlight record

+
+ @foreach($stop['associated_pharos_object'] as $pharosassoc) + + @endforeach +
-
-@endsection + @endsection @endif @if(!empty($records)) -@section('mlt') -
-

Other audio guide stops you might like

-
- @foreach($records as $record) - - @endforeach + @section('mlt') +
+

Other audio guide stops you might like

+
+ @foreach($records as $record) + + @endforeach +
-
-@endsection + @endsection @endif -@endforeach diff --git a/resources/views/includes/elements/exhibitions/360.blade.php b/resources/views/includes/elements/exhibitions/360.blade.php new file mode 100644 index 00000000..50d4fb8d --- /dev/null +++ b/resources/views/includes/elements/exhibitions/360.blade.php @@ -0,0 +1,17 @@ +@section('360') + @if(!empty($exhibition['image_360_pano'])) +
+
+

+ 360 gallery image +

+
+
+
+
+
+ @endif +@endsection +@if(!empty($exhibition['image_360_pano'])) + @section('360_image_url', $exhibition['image_360_pano']['data']['full_url']) +@endif diff --git a/resources/views/includes/elements/exhibitions/artworks.blade.php b/resources/views/includes/elements/exhibitions/artworks.blade.php new file mode 100644 index 00000000..68247d3d --- /dev/null +++ b/resources/views/includes/elements/exhibitions/artworks.blade.php @@ -0,0 +1,48 @@ +@if(!empty($adlib)) + @php + $type = match($exhibition['type']){ 'display'=>'Temporary Display', default => 'Exhibition'} + @endphp +

Selected objects from the {{ $type }}

+
+ @foreach($adlib as $record) + @php + $pris = Arr::pluck($record['_source']['identifier'],'priref'); + $pris = array_filter($pris); + $pris= Arr::flatten($pris) + @endphp +
+
+
+ @if(array_key_exists('multimedia', $record['_source'])) + An image of {{ ucfirst($record['_source']['summary_title']) }} + @else + A stand in image for {{ ucfirst($record['_source']['summary_title']) }}} + @endif +
+
+ +
+

+ {{ ucfirst($record['_source']['summary_title']) }} +

+

+ @if(array_key_exists('department', $record['_source'])) + {{ $record['_source']['identifier'][0]['accession_number'] }}
+ @endif +

+
+
+
+
+ @endforeach +
+@endif diff --git a/resources/views/includes/elements/exhibitions/carousel.blade.php b/resources/views/includes/elements/exhibitions/carousel.blade.php new file mode 100644 index 00000000..e258fe16 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/carousel.blade.php @@ -0,0 +1,67 @@ +@if(!empty($exhibition['exhibition_carousel'])) + @section('excarousel') +
+
+
+ +
+
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/cases.blade.php b/resources/views/includes/elements/exhibitions/cases.blade.php new file mode 100644 index 00000000..c05f453b --- /dev/null +++ b/resources/views/includes/elements/exhibitions/cases.blade.php @@ -0,0 +1,23 @@ +@if(!empty($cases['data'])) + @section('exhibitionCaseCards') +
+
+

+ + Exhibition Case Introductions + +

+
+ @foreach($cases['data'] as $case) + + @endforeach +
+
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/curators.blade.php b/resources/views/includes/elements/exhibitions/curators.blade.php new file mode 100644 index 00000000..c19c30ac --- /dev/null +++ b/resources/views/includes/elements/exhibitions/curators.blade.php @@ -0,0 +1,23 @@ +@if(!empty($exhibition['associated_curators']) || !empty($exhibition['external_curators'])) + @section('curators') +
+
+

Curators and experts behind this exhibition

+
+ @foreach($exhibition['associated_curators'] as $curator) + + @endforeach + @foreach($exhibition['external_curators'] as $curator) + + @endforeach +
+
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/departments.blade.php b/resources/views/includes/elements/exhibitions/departments.blade.php new file mode 100644 index 00000000..e916245b --- /dev/null +++ b/resources/views/includes/elements/exhibitions/departments.blade.php @@ -0,0 +1,17 @@ +@if(!empty($exhibition['associated_departments'])) + @section('departments') +
+

Associated departments

+
+ @foreach($exhibition['associated_departments'] as $department) + + @endforeach +
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/events.blade.php b/resources/views/includes/elements/exhibitions/events.blade.php new file mode 100644 index 00000000..96892777 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/events.blade.php @@ -0,0 +1,13 @@ +@if(!empty($events)) + @section('tnew-data') +
+

Special events for this exhibition

+
+ @foreach($events as $production) + + @endforeach +
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/files.blade.php b/resources/views/includes/elements/exhibitions/files.blade.php new file mode 100644 index 00000000..97056482 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/files.blade.php @@ -0,0 +1,5 @@ +@section('exhibitions-files') + @if(!empty($exhibition['exhibition_files'])) + + @endif +@endsection diff --git a/resources/views/includes/elements/exhibitions/films.blade.php b/resources/views/includes/elements/exhibitions/films.blade.php new file mode 100644 index 00000000..897bc062 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/films.blade.php @@ -0,0 +1,42 @@ +@section('youtube') + @if(isset($exhibition['youtube_id']) && $exhibition['youtube_id']!= '' ) + @php + $type = match($exhibition['type']){ 'display'=>'Temporary Display', default => 'Exhibition'} + @endphp +

+ {{ $type }} films +

+
+
+ +
+
+ @endif + + @if(isset($exhibition['youtube_secondary_id']) && $exhibition['youtube_secondary_id']!= '' ) +
+
+ +
+
+ @endif + + @if(isset($exhibition['youtube_playlist_id'])) +

+ {{ $type }} films - a playlist +

+
+
+ +
+
+ @endif +@endsection diff --git a/resources/views/includes/elements/exhibitions/galleries.blade.php b/resources/views/includes/elements/exhibitions/galleries.blade.php new file mode 100644 index 00000000..4becd522 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/galleries.blade.php @@ -0,0 +1,22 @@ +@if(!empty($exhibition['associated_galleries'])) + @section('galleries') +
+
+

+ Associated Galleries +

+
+ @foreach($exhibition['associated_galleries'] as $gallery) + + @endforeach +
+
+
+ @endsection +@endif + diff --git a/resources/views/includes/elements/exhibitions/main-content.blade.php b/resources/views/includes/elements/exhibitions/main-content.blade.php new file mode 100644 index 00000000..7faa8891 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/main-content.blade.php @@ -0,0 +1,54 @@ +@section('content') +
+ + @isset($exhibition['tessitura_string']) + @if(!Carbon\Carbon::parse($exhibition['exhibition_end_date'])->isPast() && !Carbon\Carbon::parse($exhibition['exhibition_end_date'])->isPast()) + @include('includes.structure.tessitura') + @endif + @endisset + @isset($exhibition['exhibition_end_date']) + @if(Carbon\Carbon::parse($exhibition['exhibition_end_date'])->isPast()) + @include('includes.structure.expired') + @endif + @endisset + @if($exhibition['tessitura_string'] === NULL) + @if(!Carbon\Carbon::parse($exhibition['exhibition_end_date'])->isPast() && !Carbon\Carbon::parse($exhibition['exhibition_end_date'])->isPast() && $exhibition['exhibition_status'] === 'current') + @include('includes.structure.general') + @endif + @endisset + @if(isset($exhibition['exhibition_narrative']) || isset($exhibition['exhibition_abstract'])) +
+ @if(isset($exhibition['exhibition_narrative'])) + @markdown($exhibition['exhibition_narrative']) + @endif + @if(isset($exhibition['exhibition_abstract'])) + @markdown($exhibition['exhibition_abstract']) + @endif +
+ @endif + + @if( isset($exhibition['exhibition_url']) || isset($exhibition['exhibition_start_date'])) + @php + $type = match($exhibition['type']){ 'display'=>'Temporary Display', default => 'Exhibition'} + @endphp +

{{$type}} details

+
+
    + @if(isset($exhibition['exhibition_url'])) +
  • + {{$type}} website +
  • + @endif + @if(isset($exhibition['exhibition_start_date'])) +
  • + {{$type}} + run: {{ Carbon\Carbon::parse($exhibition['exhibition_start_date'])->format('l dS F Y') }} + to + {{ Carbon\Carbon::parse($exhibition['exhibition_end_date'])->format('l dS F Y') }} +
  • + @endif +
+
+ @endif +
+@endsection diff --git a/resources/views/includes/elements/exhibitions/partners.blade.php b/resources/views/includes/elements/exhibitions/partners.blade.php new file mode 100644 index 00000000..52bbee73 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/partners.blade.php @@ -0,0 +1,18 @@ +@if(!empty($exhibition['exhibition_partners'] )) + @section('research-funders') +
+
+

Funders and partners

+
+ @foreach($exhibition['exhibition_partners'] as $partner) + + @endforeach +
+
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/podcasts.blade.php b/resources/views/includes/elements/exhibitions/podcasts.blade.php new file mode 100644 index 00000000..9eaf626e --- /dev/null +++ b/resources/views/includes/elements/exhibitions/podcasts.blade.php @@ -0,0 +1,19 @@ +@if(!empty($podcasts)) + @section('exhibitionAudio') +
+
+

Audio

+
+ @foreach($podcasts['data'] as $podcast) + + @endforeach +
+
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/products.blade.php b/resources/views/includes/elements/exhibitions/products.blade.php new file mode 100644 index 00000000..c13de4d1 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/products.blade.php @@ -0,0 +1,14 @@ +@if(!empty($products)) + @section('shopify') +
+

+ Suggested Curating Cambridge products +

+
+ @foreach($products as $record) + + @endforeach +
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/similar-exhibits.blade.php b/resources/views/includes/elements/exhibitions/similar-exhibits.blade.php new file mode 100644 index 00000000..760f123a --- /dev/null +++ b/resources/views/includes/elements/exhibitions/similar-exhibits.blade.php @@ -0,0 +1,12 @@ +@if(!empty($records)) + @section('mlt') +
+

Similar exhibitions from our archives

+
+ @foreach($records as $record) + + @endforeach +
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/exhibitions/sketchfab.blade.php b/resources/views/includes/elements/exhibitions/sketchfab.blade.php new file mode 100644 index 00000000..63c0b85d --- /dev/null +++ b/resources/views/includes/elements/exhibitions/sketchfab.blade.php @@ -0,0 +1,16 @@ +@section('sketchfab') + @if(!empty($exhibition['sketchfab_id'])) +
+

3d model of this display or exhibition

+
+
+ +
+
+
+ @endif +@endsection diff --git a/resources/views/includes/elements/exhibitions/thanks.blade.php b/resources/views/includes/elements/exhibitions/thanks.blade.php new file mode 100644 index 00000000..1c4ea6b7 --- /dev/null +++ b/resources/views/includes/elements/exhibitions/thanks.blade.php @@ -0,0 +1,3 @@ +@section('exhibition-thanks') + +@endsection diff --git a/resources/views/includes/elements/galleries/360.blade.php b/resources/views/includes/elements/galleries/360.blade.php new file mode 100644 index 00000000..f2e81245 --- /dev/null +++ b/resources/views/includes/elements/galleries/360.blade.php @@ -0,0 +1,14 @@ +@section('360') + @if(!empty($gallery['image_360_pano'])) +
+

+ {{ $gallery['360_pano_title'] }}: {{ Carbon\Carbon::parse($gallery['360_pano_date'])->format('F Y') }}

+
+
+
+
+ @endif +@endsection +@if(!empty($gallery['image_360_pano'])) + @section('360_image', $gallery['image_360_pano']['data']['full_url']) +@endif diff --git a/resources/views/includes/elements/galleries/adlib.blade.php b/resources/views/includes/elements/galleries/adlib.blade.php new file mode 100644 index 00000000..f06225eb --- /dev/null +++ b/resources/views/includes/elements/galleries/adlib.blade.php @@ -0,0 +1,16 @@ +@isset($gallery['object_id_numbers']) + @inject('galleriesController', 'App\Http\Controllers\galleriesController') + @php + $records = $galleriesController::getObjects($gallery['object_id_numbers']); + @endphp + @if(!empty($records)) +

+ Selected objects in gallery {{ $gallery['gallery_name'] }} +

+
+ @foreach($records as $record) + + @endforeach +
+ @endif +@endisset diff --git a/resources/views/includes/elements/galleries/audio-guide.blade.php b/resources/views/includes/elements/galleries/audio-guide.blade.php new file mode 100644 index 00000000..2095d8d6 --- /dev/null +++ b/resources/views/includes/elements/galleries/audio-guide.blade.php @@ -0,0 +1,20 @@ +@if(!empty($gallery['audio_guide'])) + @section('audio-guide') +
+

+ Audio description +

+
+
+
+
+ +
+
+
+
+
+ @endsection +@endif diff --git a/resources/views/includes/elements/galleries/description.blade.php b/resources/views/includes/elements/galleries/description.blade.php new file mode 100644 index 00000000..42b7242b --- /dev/null +++ b/resources/views/includes/elements/galleries/description.blade.php @@ -0,0 +1,5 @@ +@if(isset($gallery['gallery_description'])) +
+ @markdown($gallery['gallery_description']) +
+@endif diff --git a/resources/views/includes/elements/galleries/info.blade.php b/resources/views/includes/elements/galleries/info.blade.php new file mode 100644 index 00000000..d283db4b --- /dev/null +++ b/resources/views/includes/elements/galleries/info.blade.php @@ -0,0 +1,10 @@ +@if(isset($gallery['gallery_floor'])) +

+ Gallery data +

+
+
    +
  • {{ $gallery['gallery_floor'] }}
  • +
+
+@endif diff --git a/resources/views/includes/elements/galleries/sketchfab.blade.php b/resources/views/includes/elements/galleries/sketchfab.blade.php new file mode 100644 index 00000000..192ee600 --- /dev/null +++ b/resources/views/includes/elements/galleries/sketchfab.blade.php @@ -0,0 +1,17 @@ +@section('sketchfab-collection') + @if(!empty($gallery['sketchfab_id_collection'])) +
+

+ 3D scans of objects in gallery +

+
+
+ +
+
+
+ @endif +@endsection diff --git a/resources/views/includes/elements/galleries/sketchup.blade.php b/resources/views/includes/elements/galleries/sketchup.blade.php new file mode 100644 index 00000000..e2c8bb0e --- /dev/null +++ b/resources/views/includes/elements/galleries/sketchup.blade.php @@ -0,0 +1,17 @@ +@section('sketchfab') + @if(!empty($gallery['sketchfab_sketchup_id'])) +
+

+ Sketchup model of this gallery +

+
+
+ +
+
+
+ @endif +@endsection diff --git a/resources/views/includes/elements/galleries/star-objects.blade.php b/resources/views/includes/elements/galleries/star-objects.blade.php new file mode 100644 index 00000000..4823cb68 --- /dev/null +++ b/resources/views/includes/elements/galleries/star-objects.blade.php @@ -0,0 +1,15 @@ +@if(!empty($gallery['star_objects'])) +

+ Object stories +

+
+ @foreach($gallery['star_objects'] as $object) + + @endforeach +
+@endif diff --git a/resources/views/includes/elements/galleries/status.blade.php b/resources/views/includes/elements/galleries/status.blade.php new file mode 100644 index 00000000..04a422e2 --- /dev/null +++ b/resources/views/includes/elements/galleries/status.blade.php @@ -0,0 +1,7 @@ +@if(!empty($gallery['gallery_status'])) +
+ @foreach($gallery['gallery_status'] as $status) + {{ $status }} + @endforeach +
+@endif diff --git a/resources/views/includes/jsonld/news.blade.php b/resources/views/includes/jsonld/news.blade.php index 10f2edad..e2ad21f4 100644 --- a/resources/views/includes/jsonld/news.blade.php +++ b/resources/views/includes/jsonld/news.blade.php @@ -3,21 +3,21 @@ { "@context" : "https://schema.org", "@type" : "Article", - "headline" : "{{ $project['article_title'] }}", + "headline" : "{{ $news['article_title'] }}", "author" : { "@type" : "Organization", "name" : "The Fitzwilliam Museum" }, - "datePublished" : "{{ $project['publication_date'] }}", - @if(isset($project['modified_on'])) - "dateModified" : "{{ $project['modified_on'] }}", + "datePublished" : "{{ $news['publication_date'] }}", + @if(isset($news['modified_on'])) + "dateModified" : "{{ $news['modified_on'] }}", @endif - @if(isset($project['field_image'])) - "image" : "{{ $project['field_image']['data']['full_url'] }}", + @if(isset($news['field_image'])) + "image" : "{{ $news['field_image']['data']['full_url'] }}", @else "image" : "{{ env('MISSING_IMAGE_URL') }}", @endif - "articleBody" : "{{ $project['article_body'] }}", + "articleBody" : "{{ $news['article_body'] }}", "url" : "{{ Request::url() }}", "mainEntityOfPage": { "@type": "WebPage", diff --git a/resources/views/includes/social/community-youtube-playlist.blade.php b/resources/views/includes/social/community-youtube-playlist.blade.php new file mode 100644 index 00000000..d7b2b6ff --- /dev/null +++ b/resources/views/includes/social/community-youtube-playlist.blade.php @@ -0,0 +1,7 @@ +
+
+ +
+
diff --git a/resources/views/includes/social/youtube-playlist.blade.php b/resources/views/includes/social/youtube-playlist.blade.php index 7e76ca2e..de4c3dbc 100644 --- a/resources/views/includes/social/youtube-playlist.blade.php +++ b/resources/views/includes/social/youtube-playlist.blade.php @@ -1,3 +1,4 @@ +@dd($project) @if($project['youtube_playlist_id'])
diff --git a/resources/views/includes/structure/breadcrumb.blade.php b/resources/views/includes/structure/breadcrumb.blade.php index 4bda65c4..4bd55104 100644 --- a/resources/views/includes/structure/breadcrumb.blade.php +++ b/resources/views/includes/structure/breadcrumb.blade.php @@ -1,3 +1,3 @@ -
+
{{ Breadcrumbs::render() }}
diff --git a/resources/views/includes/structure/oldnews.blade.php b/resources/views/includes/structure/oldnews.blade.php index 666cf076..35f06b30 100644 --- a/resources/views/includes/structure/oldnews.blade.php +++ b/resources/views/includes/structure/oldnews.blade.php @@ -1,4 +1,4 @@ -@if(Carbon\Carbon::parse($project['publication_date'])->diffInDays() > 120) +@if(Carbon\Carbon::parse($news['publication_date'])->diffInDays() > 120) - @endsection - @endif +
+ @endsection @endif +@endif - @if(!empty($profile['research_projects'])) - @section('research-projects') -
-
-

- Associated Research Projects -

-
- @foreach($profile['research_projects'] as $project) - - - @endforeach -
+@if(!empty($profile['research_projects'])) + @section('research-projects') +
+
+

+ Associated Research Projects +

+
+ @foreach($profile['research_projects'] as $project) + + + @endforeach
- @endsection - @endif - @if(!empty($profile['departments_affiliated'])) - @section('departments-affiliated') -
-
-

- Associated Departments -

-
- @foreach($profile['departments_affiliated'] as $department) - - - @endforeach -
+
+ @endsection +@endif +@if(!empty($profile['departments_affiliated'])) + @section('departments-affiliated') +
+
+

+ Associated Departments +

+
+ @foreach($profile['departments_affiliated'] as $department) + + + @endforeach
- @endsection - @endif +
+ @endsection +@endif - @if(!empty($profile['exhibitions_curated'])) - @section('exhibitions-curated') -
-
-

- Associated Exhibitions -

-
- @foreach($profile['exhibitions_curated'] as $exhibition) - - - @endforeach -
+@if(!empty($profile['exhibitions_curated'])) + @section('exhibitions-curated') +
+
+

+ Associated Exhibitions +

+
+ @foreach($profile['exhibitions_curated'] as $exhibition) + + + @endforeach
- @endsection - @endif +
+ @endsection +@endif -@endforeach @if(!empty($similar)) @section('mlt') diff --git a/resources/views/research/project.blade.php b/resources/views/research/project.blade.php index 8ad88844..d9a9dd66 100644 --- a/resources/views/research/project.blade.php +++ b/resources/views/research/project.blade.php @@ -1,114 +1,114 @@ @extends('layouts.layout') -@foreach($projects['data'] as $project) - @section('keywords', $project['meta_keywords']) - @section('description', $project['meta_description']) - @section('title', $project['title']) - @section('hero_image', $project['hero_image']['data']['url']) - @section('hero_image_title', $project['hero_image_alt_text']) - @section('content') +@section('keywords', $project['meta_keywords']) +@section('description', $project['meta_description']) +@section('title', $project['title']) +@section('hero_image', $project['hero_image']['data']['url']) +@section('hero_image_title', $project['hero_image_alt_text']) +@section('content')
- @markdown($project['project_overview']) + @markdown($project['project_overview'])
@if(!@empty ($project['project_principal'])) -

- Project information -

-
-
    - @if($project['project_principal']) -
  • Principal Investigator: {{ $project['project_principal']}}
  • - @endif - @if($project['co_investigator']) -
  • Co-Investigator: {{ $project['co_investigator']}}
  • - @endif - @if($project['project_start_date']) -
  • Project start date: {{ Carbon\Carbon::parse($project['project_start_date'])->format('l dS F Y') }}
  • - @endif - @if($project['project_end_date']) -
  • Project end date: {{ Carbon\Carbon::parse($project['project_end_date'])->format('l dS F Y')}}
  • - @endif - @if($project['project_url']) -
  • Project website: {{ $project['project_url']}}
  • - @endif - @if($project['award_value']) -
  • Funding award value: {{ $project['award_value'] }}
  • - @endif - @if($project['funding_reference_id']) -
  • Funding reference: {{ $project['funding_reference_id'] }}
  • - @endif -
-
+

+ Project information +

+
+
    + @if($project['project_principal']) +
  • Principal Investigator: {{ $project['project_principal']}}
  • + @endif + @if($project['co_investigator']) +
  • Co-Investigator: {{ $project['co_investigator']}}
  • + @endif + @if($project['project_start_date']) +
  • Project start + date: {{ Carbon\Carbon::parse($project['project_start_date'])->format('l dS F Y') }}
  • + @endif + @if($project['project_end_date']) +
  • Project end + date: {{ Carbon\Carbon::parse($project['project_end_date'])->format('l dS F Y')}}
  • + @endif + @if($project['project_url']) +
  • Project website: {{ $project['project_url']}}
  • + @endif + @if($project['award_value']) +
  • Funding award value: {{ $project['award_value'] }}
  • + @endif + @if($project['funding_reference_id']) +
  • Funding reference: {{ $project['funding_reference_id'] }}
  • + @endif +
+
@endif @if($project['publications']) -

Related publications

-
- @markdown($project['publications']) -
+

Related publications

+
+ @markdown($project['publications']) +
@endif @if(!empty($project['project_team'])) -

Project team

-
- @markdown($project['project_team']) -
+

Project team

+
+ @markdown($project['project_team']) +
@endif - @endsection - @if(!empty($project['project_partnerships'] )) +@endsection +@if(!empty($project['project_partnerships'] )) @section('research-funders') -
-

Funders and partners

-
- @foreach($project['project_partnerships'] as $partner) - - - @endforeach -
+
+

Funders and partners

+
+ @foreach($project['project_partnerships'] as $partner) + + + @endforeach +
- @endsection - @endif + @endsection +@endif - @if(isset($project['outcomes'])) - @section('research-projects') +@if(isset($project['outcomes'])) + @section('research-projects')
-

Outcomes of the project

-
- {!! $project['outcomes'] !!} -
+

Outcomes of the project

+
+ {!! $project['outcomes'] !!} +
- @endsection - @endif + @endsection +@endif - @if($project['youtube_id']) - @section('youtube') +@if($project['youtube_id']) + @section('youtube')
-
-
- +
+
+ +
-
- @endsection - @endif + @endsection +@endif - @endforeach - @if(!empty($records)) +@if(!empty($records)) @section('mlt') -
-

Other research projects you might like

-
- @foreach($records as $record) - - @endforeach +
+

Other research projects you might like

+
+ @foreach($records as $record) + + @endforeach +
-
@endsection - @endif +@endif diff --git a/resources/views/research/resource.blade.php b/resources/views/research/resource.blade.php index b5e7df26..405e225b 100644 --- a/resources/views/research/resource.blade.php +++ b/resources/views/research/resource.blade.php @@ -1,21 +1,25 @@ @extends('layouts.layout') -@foreach($resources['data'] as $project) - @section('keywords', $project['meta_keywords']) -@section('description', $project['meta_description']) -@section('title', $project['title']) -@section('hero_image', $project['hero_image']['data']['url']) -@section('hero_image_title', $project['hero_image_alt_text']) +@section('keywords', $resources['meta_keywords']) +@section('description', $resources['meta_description']) +@section('title', $resources['title']) +@section('hero_image', $resources['hero_image']['data']['url']) +@section('hero_image_title', $resources['hero_image_alt_text']) @section('content')
- @markdown($project['description']) -
-

Project information

-
- + @markdown($resources['description'])
+ @if(!is_null($resources['project_url'])) +

+ Project information +

+
+ +
+ @endif + @endsection -@endforeach diff --git a/resources/views/social/story.blade.php b/resources/views/social/story.blade.php index 29c94e01..27c2e9dd 100644 --- a/resources/views/social/story.blade.php +++ b/resources/views/social/story.blade.php @@ -21,7 +21,7 @@
@@ -52,11 +52,11 @@ class="img-fluid" alt="{{ $instagram['title'] }}" loading="lazy"
- @include('includes/elements/descriptive') + @include('includes.elements.descriptive') - @include('includes/elements/lifecycle') + @include('includes.elements.lifecycle') - @include('includes/elements/identification-insta') + @include('includes.elements.identification-insta')
@endforeach diff --git a/resources/views/thingstodo/index.blade.php b/resources/views/thingstodo/index.blade.php deleted file mode 100644 index 022164f9..00000000 --- a/resources/views/thingstodo/index.blade.php +++ /dev/null @@ -1,18 +0,0 @@ -@extends('layouts.layout') -@section('title','Discover things to do online with the Fitz') -@section('hero_image', env('CONTENT_STORE') . 'img_20190105_153947.jpg') -@section('hero_image_title', "The inside of our Founder's entrance") -@section('description', 'Discover things to do online with the Fitzwilliam Museum, Cambridge University') -@section('keywords', 'activities,stories,museum,cambridge') -@section('content') -
- @foreach($thingstodo['data'] as $things) - - @endforeach -
-@endsection diff --git a/routes/web.php b/routes/web.php index 1a75b402..207aae47 100644 --- a/routes/web.php +++ b/routes/web.php @@ -38,11 +38,6 @@ Route::get('about-us/spoliation', 'aboutusController@spoliation')->name('about.spoliation'); Route::get('about-us/spoliation/{slug}', 'aboutusController@spoliationClaim')->name('about.spoliation.claim'); -/* -Things to do - */ - Route::get('thingstodo/', 'thingstodoController@index')->name('things'); - /* Research section routes */ @@ -53,7 +48,7 @@ Route::get('research/active-researchers', 'researchController@profiles')->name('research-profiles'); Route::get('about-us/our-staff/profile/{slug}', 'researchController@profile')->name('research-profile'); -Route::get('research/affiliates/{slug}', 'researchController@affiliate')->name('research-affiliate'); +Route::get('research/affiliates/{slug}', 'researchController@affiliatedResearcher')->name('research-affiliate'); Route::get('research/affiliates', 'researchController@affiliates')->name('research-affiliates'); Route::get('research/external-curators/{slug}', 'exhibitionsController@externals')->name('exhibition-externals'); @@ -133,16 +128,15 @@ Route::get('objects-and-artworks/highlights/periods/', 'highlightsController@period')->name('periods'); Route::get('objects-and-artworks/highlights/themes/', 'highlightsController@theme')->name('themes'); Route::get('objects-and-artworks/highlights/context/', 'highlightsController@contextual')->name('context'); -Route::get('objects-and-artworks/highlights/periods/{period}', 'highlightsController@byperiod')->name('period'); +Route::get('objects-and-artworks/highlights/periods/{period}', 'highlightsController@byPeriod')->name('period'); -Route::get('objects-and-artworks/highlights/themes/{theme}', 'highlightsController@bytheme')->name('theme'); +Route::get('objects-and-artworks/highlights/themes/{theme}', 'highlightsController@byTheme')->name('theme'); Route::get('objects-and-artworks/highlights/context/{section}/', 'highlightsController@pharosSections')->name('context-sections'); Route::get('objects-and-artworks/highlights/context/{section}/{slug}/', 'highlightsController@associate')->name('context-section-detail'); Route::get('objects-and-artworks/highlights/{slug}/', 'highlightsController@details')->name('highlight'); Route::get('objects-and-artworks/audio-guide/', 'highlightsController@audioguide')->name('audio-guide'); Route::get('objects-and-artworks/audio-guide/{slug}/', 'highlightsController@stop')->name('audio-stop'); -Route::get('objects-and-artworks/staff-favourites/{slug}/', 'highlightsController@fitzobject')->name('fitz-object'); /* * Social */ From 71dcb325102ad589d3198f200268621a71b95006 Mon Sep 17 00:00:00 2001 From: Daniel Pett Date: Tue, 23 Aug 2022 10:13:46 +0100 Subject: [PATCH 3/5] Remove loops 1.Update MVC to remove foreach in single record views 2.Clean up logic in controllers and throw 404s when no data found (use of Collection and first(). 3. Add youtube playlist in learning community 4. Remove things to do pages and routes (not used) 5. Remove themes pages (no longer a directorial project) 6. Fix a couple of table names in models 7. Add IIIF svg as it was missing 8. Break up exhibitions page into elements 9. Break up galleries page into elements 10. Add more like this to FAQs 11. Remove unused timeline This references #491 and #479, but does not close them yet. --- resources/views/includes/css/css.blade.php | 4 +++- .../views/includes/css/photosphere-css.blade.php | 1 - .../views/includes/css/timeline-css.blade.php | 1 - .../includes/scripts/photosphere-js.blade.php | 2 +- resources/views/layouts/exhibitions.blade.php | 6 ------ resources/views/layouts/highlights.blade.php | 14 -------------- resources/views/layouts/layout.blade.php | 12 ------------ resources/views/visit/faqs.blade.php | 2 ++ 8 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 resources/views/includes/css/photosphere-css.blade.php delete mode 100644 resources/views/includes/css/timeline-css.blade.php diff --git a/resources/views/includes/css/css.blade.php b/resources/views/includes/css/css.blade.php index a62a274e..3a1e494f 100644 --- a/resources/views/includes/css/css.blade.php +++ b/resources/views/includes/css/css.blade.php @@ -16,4 +16,6 @@ } @include('includes.css.parallax') - +@hasSection('360') + +@endif diff --git a/resources/views/includes/css/photosphere-css.blade.php b/resources/views/includes/css/photosphere-css.blade.php deleted file mode 100644 index 6259253c..00000000 --- a/resources/views/includes/css/photosphere-css.blade.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/views/includes/css/timeline-css.blade.php b/resources/views/includes/css/timeline-css.blade.php deleted file mode 100644 index 1baf9ca9..00000000 --- a/resources/views/includes/css/timeline-css.blade.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/views/includes/scripts/photosphere-js.blade.php b/resources/views/includes/scripts/photosphere-js.blade.php index e7bc4ede..9d90b18a 100644 --- a/resources/views/includes/scripts/photosphere-js.blade.php +++ b/resources/views/includes/scripts/photosphere-js.blade.php @@ -2,7 +2,7 @@ diff --git a/resources/views/layouts/exhibitions.blade.php b/resources/views/layouts/exhibitions.blade.php index 8d66262e..7544722f 100644 --- a/resources/views/layouts/exhibitions.blade.php +++ b/resources/views/layouts/exhibitions.blade.php @@ -29,16 +29,10 @@ @endif @include('includes.structure.open') -@hasSection('360') - @include('includes.css.photosphere-css') -@endif -
@include('includes.structure.breadcrumb')
-
@yield('content') -
@yield('ttn-actions') @yield('tnew-data') @yield('exhibitions-files') diff --git a/resources/views/layouts/highlights.blade.php b/resources/views/layouts/highlights.blade.php index bc9071d0..432bf063 100644 --- a/resources/views/layouts/highlights.blade.php +++ b/resources/views/layouts/highlights.blade.php @@ -27,14 +27,6 @@ @include('includes.structure.highlight') -@hasSection('timeline') - @include('includes.css.timeline-css') -@endif - -@hasSection('360') - @include('includes.css.photosphere-css') -@endif -
@include('includes.structure.breadcrumb')
@@ -42,9 +34,7 @@
@yield('press-contact') @yield('content') - @yield('adlib') - @yield('timeline')
@@ -109,9 +99,5 @@ @include('includes.scripts.mapjs') @endif -@hasSection('timeline') - @include('includes.scripts.timeline-js') -@endif - diff --git a/resources/views/layouts/layout.blade.php b/resources/views/layouts/layout.blade.php index 16578e8a..55346659 100644 --- a/resources/views/layouts/layout.blade.php +++ b/resources/views/layouts/layout.blade.php @@ -32,14 +32,6 @@ @endif @include('includes.structure.open') - @hasSection('timeline') - @include('includes.css.timeline-css') - @endif - - @hasSection('360') - @include('includes.css.photosphere-css') - @endif -
@include('includes.structure.breadcrumb') @yield('press-contact') @@ -148,9 +140,5 @@ @include('includes.scripts.mapjs') @endif - @hasSection('timeline') - @include('includes.scripts.timeline-js') - @endif - diff --git a/resources/views/visit/faqs.blade.php b/resources/views/visit/faqs.blade.php index 3551c0b6..343351e4 100644 --- a/resources/views/visit/faqs.blade.php +++ b/resources/views/visit/faqs.blade.php @@ -27,3 +27,5 @@
@endsection + +@include('includes.structure.related-pages') From 85a5c257e6e42156c6d2f8646bb8d9f34bd77c4a Mon Sep 17 00:00:00 2001 From: Daniel Pett Date: Tue, 23 Aug 2022 10:33:39 +0100 Subject: [PATCH 4/5] Add code and contributing guidelines --- CODE_OF_CONDUCT | 49 ++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 CODE_OF_CONDUCT create mode 100644 CONTRIBUTING.md diff --git a/CODE_OF_CONDUCT b/CODE_OF_CONDUCT new file mode 100644 index 00000000..45e453a4 --- /dev/null +++ b/CODE_OF_CONDUCT @@ -0,0 +1,49 @@ +# Contributor Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Attempting collaboration before conflict +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- Violence, threats of violence, or inciting others to commit self-harm +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, intentionally spreading misinformation, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Abuse of the reporting process to intentionally harass or exclude others +- Advocating for, or encouraging, any of the above behavior +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting us anonymously through [this form](https://goo.gl/forms/chVYUnA4bP70WGsL2). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +If you are unsure whether an incident is a violation, or whether the space where the incident took place is covered by our Code of Conduct, **we encourage you to still report it**. We would prefer to have a few extra reports where we decide to take no action, than to leave an incident go unnoticed and unresolved that may result in an individual or group to feel like they can no longer participate in the community. Reports deemed as not a violation will also allow us to improve our Code of Conduct and processes surrounding it. If you witness a dangerous situation or someone in distress, we encourage you to report even if you are only an observer. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), [version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..0351decc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,67 @@ +# Contributing to Fitzwilliam Museum projects + +A big welcome and thank you for considering contributing to Fitzwilliam Museum open source projects! + +Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. +It also communicates that you agree to respect the time of the developers managing and developing these open source projects. +In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull +requests. + +## Quicklinks + +* [Code of Conduct](#code-of-conduct) +* [Getting Started](#getting-started) + * [Issues](#issues) + * [Pull Requests](#pull-requests) + +## Code of Conduct + +We take our open source community seriously and hold ourselves and other contributors to high standards of communication. +By participating and contributing to this project, you agree to uphold our [Code of Conduct](/CODE-OF-CONDUCT). + +## Getting Started + +Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both: + +- To report security vulnerabilities, please contact our [IT team](mailto:itoffice@fitzmuseum.cam.ac.uk) which is monitored by our team. +- Search for existing Issues and PRs before creating your own. +- We work hard to makes sure issues are handled in a timely manner but, depending on the impact, it could take a while to investigate the root cause. A friendly ping in the comment thread to the submitter or a contributor can help draw attention if your issue is blocking. +- If you've never contributed before, read the Laravel docs for resources and tips on how to get started. + +### Issues + +Issues should be used to report problems with the project, request a new feature, or to +discuss potential changes before a PR is created. When you create a new Issue, a +template will be loaded that will guide you through collecting and providing the +information we need to investigate. + +If you find an Issue that addresses the problem you're having, please add your own +reproduction information to the existing issue rather than creating a new one. + +Adding a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can also help +be indicating to our maintainers that a particular problem is affecting more than +just the reporter. + +### Pull Requests + +PRs to our libraries are always welcome and can be a quick way to get your fix or improvement slated for the next release. + +In general, your PRs should: + +- Only fix/add the functionality in question **OR** address wide-spread whitespace/style issues, not both at the same time! +- Add unit or integration tests for fixed or changed functionality (if a test suite already exists). +- Address a single concern in the least number of changed lines as possible. +- Be accompanied by a complete Pull Request template (loaded automatically when a PR is created). + +For changes that address core functionality or would require breaking changes (e.g. a major release), it's best to open +an Issue to discuss your proposal first. **This is not required but can save time creating and reviewing changes.** + +In general, we follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr) + +1. Fork the repository to your own Github account +2. Clone the project to your machine +3. Create a branch locally with a succinct but descriptive name +4. Commit changes to the branch +5. Following any formatting and testing guidelines specific to this repo +6. Push changes to your fork +7. Open a PR in our repository and follow the PR template so that we can efficiently review the changes. From d43ce466f57881cac82a4a78d247df858e5ffb4b Mon Sep 17 00:00:00 2001 From: Daniel Pett Date: Tue, 23 Aug 2022 10:35:59 +0100 Subject: [PATCH 5/5] Add code and contributing guidelines --- CODE_OF_CONDUCT => CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename CODE_OF_CONDUCT => CODE_OF_CONDUCT.md (100%) diff --git a/CODE_OF_CONDUCT b/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT rename to CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0351decc..6996e8f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ requests. ## Code of Conduct We take our open source community seriously and hold ourselves and other contributors to high standards of communication. -By participating and contributing to this project, you agree to uphold our [Code of Conduct](/CODE-OF-CONDUCT). +By participating and contributing to this project, you agree to uphold our [Code of Conduct](CODE-OF-CONDUCT.md). ## Getting Started