Skip to content

Commit

Permalink
Merge pull request #465
Browse files Browse the repository at this point in the history
Fix departments
  • Loading branch information
portableant authored Aug 7, 2022
2 parents 444b5f2 + 8f37eb4 commit fe0a5b3
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 109 deletions.
208 changes: 101 additions & 107 deletions resources/views/collections/details.blade.php
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
3 changes: 1 addition & 2 deletions resources/views/research/project.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
</div>
@endif
@endsection

@if(!empty($project['project_partnerships'] ))
@section('research-funders')
<div class="container">
Expand All @@ -78,7 +77,7 @@
<div class="container">
<h3>Outcomes of the project</h3>
<div class="col-12 shadow-sm p-3 mx-auto mb-3">
@markdown($project['outcomes'])
{!! $project['outcomes'] !!}
</div>
</div>
@endsection
Expand Down

0 comments on commit fe0a5b3

Please sign in to comment.