From edeef6ff716af46770eab62d3f72b4023adbf38c Mon Sep 17 00:00:00 2001 From: Daniel Pett Date: Mon, 22 Aug 2022 11:20:23 +0100 Subject: [PATCH] Amend staff lists functions for alumni This closes #478 --- app/Models/StaffProfiles.php | 6 +- resources/views/research/profile.blade.php | 393 +++++++++++---------- 2 files changed, 208 insertions(+), 191 deletions(-) diff --git a/app/Models/StaffProfiles.php b/app/Models/StaffProfiles.php index 383ecbec..f6562373 100644 --- a/app/Models/StaffProfiles.php +++ b/app/Models/StaffProfiles.php @@ -29,7 +29,8 @@ public static function list(Request $request): LengthAwarePaginator 'limit' => $perPage, 'offset' => $offset, 'sort' => 'last_name', - 'filter[research_active][in]' => 'yes' + 'filter[research_active][in]' => 'yes', + 'filter[employment_status][in]' => 'employed', ) ); $staff = $api->getData(); @@ -63,7 +64,8 @@ public static function allstaff(Request $request): LengthAwarePaginator 'offset' => $offset, 'meta' => '*', 'sort' => 'last_name', - 'filter[status][in]' => 'published' + 'filter[status][in]' => 'published', + 'filter[employment_status][in]' => 'employed', ) ); $staff = $directus->getData(); diff --git a/resources/views/research/profile.blade.php b/resources/views/research/profile.blade.php index 911a71ce..8206d776 100644 --- a/resources/views/research/profile.blade.php +++ b/resources/views/research/profile.blade.php @@ -1,82 +1,93 @@ @extends('layouts.layout') @foreach($profiles['data'] as $profile) @section('keywords', $profile['meta_keywords']) -@section('description', $profile['meta_description']) -@if(!is_null($profile['hero_image'])) - @section('hero_image', $profile['hero_image']['data']['url']) -@section('hero_image_title', $profile['hero_image_alt_text']) -@else - @section('hero_image','https://fitz-cms-images.s3.eu-west-2.amazonaws.com/baroque.jpg') -@section('hero_image_title', 'The baroque feasting table by Ivan Day in Feast and Fast') -@endif + @section('description', $profile['meta_description']) + @if(!is_null($profile['hero_image'])) + @section('hero_image', $profile['hero_image']['data']['url']) + @section('hero_image_title', $profile['hero_image_alt_text']) + @else + @section('hero_image','https://fitz-cms-images.s3.eu-west-2.amazonaws.com/baroque.jpg') + @section('hero_image_title', 'The baroque feasting table by Ivan Day in Feast and Fast') + @endif -@section('title') - @isset($profile['title']) - {{$profile['title'] ?? ''}} - @endisset - {{ $profile['display_name'] }} -@endSection + @section('title') + @isset($profile['title']) + {{$profile['title'] ?? ''}} + @endisset + {{ $profile['display_name'] }} + @endSection -@section('content') -
-
- @if(!is_null($profile['profile_image'])) -
- - Profile image for {{ $profile['display_name'] }} - -
- @endif -

- {{ $profile['job_title'] }} -

- {!! $profile['biography'] !!} + @section('content') - @isset($profile['pronouns']) -

- Pronouns: {{ $profile['pronouns'] }} -

- @endisset - @isset($profile['email_address']) -

- Email: {{ $profile['email_address'] }} -

- @endisset -
-
-@endsection + @if($profile['employment_status'] === 'alumni') +
+ +
+ @endif + @if($profile['employment_status'] === 'employed') +
+
+ @if(!is_null($profile['profile_image'])) +
+ + Profile image for {{ $profile['display_name'] }} + +
+ @endif +

+ {{ $profile['job_title'] }} +

+ {!! $profile['biography'] !!} -@if(!empty($profile['publications'])) - @section('publications') -
-
-
-
- +
+ @endif + @endsection + @if($profile['employment_status'] === 'employed') + @if(!empty($profile['publications'])) + @section('publications') +
+
+
+
+ -
-
- {!! $profile['publications'] !!} -
-
-
+
+
+
+ {!! $profile['publications'] !!} +
+
+
- @isset($profile['professional_memberships']) -
- +
+
+
    +
  • {{ $profile['college_affiliated'] }}
  • +
+
+
+
+ @endisset - @if(Arr::hasAny($profile, array('orcid','githubid','google_scholar_id','twitter_handle'))) - @if(null !== ($profile['orcid']) || null !== ($profile['githubid']) || null !== ($profile['google_scholar_id']) || null !== ($profile['twitter_handle']) ) -
- + @endif + @endisset
- @endif - @endisset -
-
-
-@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