-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix departments
- Loading branch information
Showing
2 changed files
with
102 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,111 @@ | ||
@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('content') | ||
<div class="col-12 shadow-sm p-3 mx-auto mb-3 "> | ||
{!! $coll['collection_description'] !!} | ||
</div> | ||
@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)) | ||
<div class="container"> | ||
<h3> | ||
Related objects | ||
</h3> | ||
<div class="row"> | ||
@foreach($records as $record) | ||
@php | ||
$pris = Arr::pluck($record['_source']['identifier'],'priref'); | ||
$pris = array_filter($pris); | ||
$pris= Arr::flatten($pris); | ||
@endphp | ||
@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']) | ||
|
||
<div class="col-md-4 mb-3"> | ||
<div class="card h-100"> | ||
<div class="results_image"> | ||
@if(array_key_exists('multimedia', $record['_source'])) | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}"><img class="results_image__thumbnail" src="{{ env('COLLECTION_URL') }}/imagestore/{{ $record['_source']['multimedia'][0]['processed']['preview']['location'] }}" | ||
loading="lazy" alt="An image of {{ ucfirst($record['_source']['summary_title']) }}" | ||
/></a> | ||
@else | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}"><img class="results_image__thumbnail" src="https://content.fitz.ms/fitz-website/assets/no-image-available.png?key=directus-medium-crop" | ||
alt="A stand in image for {{ ucfirst($record['_source']['summary_title']) }}}"/></a> | ||
@endif | ||
</div> | ||
<div class="card-body "> | ||
<div class="contents-label mb-3"> | ||
@section('content') | ||
<div class="col-12 shadow-sm p-3 mx-auto mb-3 "> | ||
{!! $coll['collection_description'] !!} | ||
</div> | ||
@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)) | ||
<div class="container"> | ||
<h3> | ||
@if(array_key_exists('title',$record['_source'] )) | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}">{{ ucfirst($record['_source']['title'][0]['value']) }}</a> | ||
@else | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}">{{ ucfirst($record['_source']['summary_title']) }}</a> | ||
@endif </h3> | ||
<p class="text-info">{{ $record['_source']['identifier'][0]['accession_number'] }}</p> | ||
Selected Related Objects | ||
</h3> | ||
<div class="row"> | ||
@foreach($records as $record) | ||
@php | ||
$pris = Arr::pluck($record['_source']['identifier'],'priref'); | ||
$pris = array_filter($pris); | ||
$pris= Arr::flatten($pris); | ||
@endphp | ||
|
||
<div class="col-md-4 mb-3"> | ||
<div class="card h-100"> | ||
<div class="results_image"> | ||
@if(array_key_exists('multimedia', $record['_source'])) | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}"><img | ||
class="results_image__thumbnail" | ||
src="{{ env('COLLECTION_URL') }}/imagestore/{{ $record['_source']['multimedia'][0]['processed']['preview']['location'] }}" | ||
loading="lazy" | ||
alt="An image of {{ ucfirst($record['_source']['summary_title']) }}" | ||
/></a> | ||
@else | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}"><img | ||
class="results_image__thumbnail" | ||
src="https://content.fitz.ms/fitz-website/assets/no-image-available.png?key=directus-medium-crop" | ||
alt="A stand in image for {{ ucfirst($record['_source']['summary_title']) }}}"/></a> | ||
@endif | ||
</div> | ||
<div class="card-body "> | ||
<div class="contents-label mb-3"> | ||
<h3> | ||
@if(array_key_exists('title',$record['_source'] )) | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}">{{ ucfirst($record['_source']['title'][0]['value']) }}</a> | ||
@else | ||
<a href="{{ env('COLLECTION_URL') }}/id/object/{{ $pris[0] }}">{{ ucfirst($record['_source']['summary_title']) }}</a> | ||
@endif | ||
</h3> | ||
<p class="text-info">{{ $record['_source']['identifier'][0]['accession_number'] }}</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endif | ||
@endisset | ||
@endsection | ||
|
||
@if(!empty($coll['associated_departments'])) | ||
@section('departments') | ||
<div class="container"> | ||
<h3>Associated departments</h3> | ||
<div class="row"> | ||
@foreach($coll['associated_departments'] as $department) | ||
<x-image-card | ||
:altTag="$department['departments_id']['hero_image_alt_text']" | ||
:title="$department['departments_id']['title']" | ||
:image="$department['departments_id']['hero_image']" | ||
:route="'department'" | ||
:params="[$department['departments_id']['slug']]"></x-image-card> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endif | ||
@endisset | ||
@endsection | ||
@endif | ||
|
||
@if(!empty($coll['associated_galleries'])) | ||
@section('galleries') | ||
<div class="container"> | ||
<h3>Associated Galleries</h3> | ||
<div class="row"> | ||
@foreach($coll['associated_galleries'] as $gallery) | ||
<x-image-card | ||
:altTag="$gallery['galleries_id']['hero_image_alt_text']" | ||
:title="$gallery['galleries_id']['gallery_name']" | ||
:image="$gallery['galleries_id']['hero_image']" | ||
:route="'gallery'" | ||
:params="[$gallery['galleries_id']['slug']]"></x-image-card> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endsection | ||
@endif | ||
@endsection | ||
|
||
@if(!empty($coll['curators'])) | ||
@section('curators') | ||
<div class="container"> | ||
<h3>Associated staff</h3> | ||
<div class="row"> | ||
@foreach($coll['curators'] as $curator) | ||
<x-image-card | ||
:altTag="$curator['staff_profiles_id']['profile_image_alt_text']" | ||
:title="$curator['staff_profiles_id']['display_name']" | ||
:image="$curator['staff_profiles_id']['profile_image']" | ||
:route="'research-profile'" | ||
:params="[$curator['staff_profiles_id']['slug']]"></x-image-card> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endsection | ||
@endif | ||
@if(!empty($coll['associated_galleries'])) | ||
@section('galleries') | ||
<div class="container"> | ||
<h3> | ||
Associated Galleries | ||
</h3> | ||
<div class="row"> | ||
@foreach($coll['associated_galleries'] as $gallery) | ||
<x-image-card | ||
:altTag="$gallery['galleries_id']['hero_image_alt_text']" | ||
:title="$gallery['galleries_id']['gallery_name']" | ||
:image="$gallery['galleries_id']['hero_image']" | ||
:route="'gallery'" | ||
:params="[$gallery['galleries_id']['slug']]"></x-image-card> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endsection | ||
@endif | ||
|
||
|
||
@if(!empty($coll['curators'])) | ||
@section('curators') | ||
<div class="container"> | ||
<h3>Associated staff</h3> | ||
<div class="row"> | ||
@foreach($coll['curators'] as $curator) | ||
<x-image-card | ||
:altTag="$curator['staff_profiles_id']['profile_image_alt_text']" | ||
:title="$curator['staff_profiles_id']['display_name']" | ||
:image="$curator['staff_profiles_id']['profile_image']" | ||
:route="'research-profile'" | ||
:params="[$curator['staff_profiles_id']['slug']]"></x-image-card> | ||
@endforeach | ||
</div> | ||
</div> | ||
@endsection | ||
@endif | ||
@endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters