From 4d3d4353694f95cbe9f8a1e266f5011f922c4d82 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Thu, 30 Jan 2020 14:47:02 -0700 Subject: [PATCH] feat: use new format icons --- app/Controllers/Partials/Resource.php | 19 +++++++++++-------- .../partials/content-lc_resource.blade.php | 2 +- .../content-single-lc_resource.blade.php | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/Controllers/Partials/Resource.php b/app/Controllers/Partials/Resource.php index 0166054..9c410e6 100644 --- a/app/Controllers/Partials/Resource.php +++ b/app/Controllers/Partials/Resource.php @@ -128,7 +128,7 @@ public static function getFormat() return false; } - public static function getFormatSlug() + public static function getFormatIcon() { global $post; @@ -139,11 +139,12 @@ public static function getFormatSlug() switch ($format->slug) { case 'academic-paper': case 'thesis': - return 'academic-paper'; + return 'academic'; break; - case 'article': - case 'document': case 'blog-post': + return 'blog'; + break; + case 'article': case 'journal-article': case 'magazine-article': case 'newspaper-article': @@ -162,10 +163,9 @@ public static function getFormatSlug() return 'case-study'; break; case 'curriculum': - return 'educational-curriculum'; + return 'curriculum'; break; case 'film': - case 'interview': case 'video': return 'video'; break; @@ -180,11 +180,14 @@ public static function getFormatSlug() break; case 'software': case 'toolkit': - case 'template': return 'toolkit'; break; + case 'template': + return 'template'; + break; + case 'document': default: - return 'article'; + return 'document'; } } } diff --git a/resources/views/partials/content-lc_resource.blade.php b/resources/views/partials/content-lc_resource.blade.php index ce6a784..e1b6998 100644 --- a/resources/views/partials/content-lc_resource.blade.php +++ b/resources/views/partials/content-lc_resource.blade.php @@ -1,6 +1,6 @@
  • - @svg(Archive::getFormatSlug(), 'icon--' . Archive::getFormatSlug(), ['focusable' => 'false', 'aria-hidden' => 'true']) {{ __('resource format', 'coop-library') }}: {{ Archive::getFormat() }} + @svg(Archive::getFormatIcon(), 'icon--' . Archive::getFormatIcon(), ['focusable' => 'false', 'aria-hidden' => 'true']) {{ __('resource format', 'coop-library') }}: {{ Archive::getFormat() }} @if($current_language !== Archive::getLanguage()) · {{ $languages[Archive::getLanguage()] }} diff --git a/resources/views/partials/content-single-lc_resource.blade.php b/resources/views/partials/content-single-lc_resource.blade.php index d569ec1..da33ffd 100644 --- a/resources/views/partials/content-single-lc_resource.blade.php +++ b/resources/views/partials/content-single-lc_resource.blade.php @@ -1,7 +1,7 @@