Skip to content

Commit

Permalink
fix: add fallback icons for new formats (fix #169)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed Jan 29, 2020
1 parent 3f3f483 commit f0c3b4a
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions app/Controllers/Partials/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,54 @@ public static function getFormatSlug()
if ($formats) {
$format = maybe_swap_term($formats[0], 'en');
switch ($format->slug) {
case 'presentation-slides':
return 'presentation';
case 'academic-paper':
case 'thesis':
return 'academic-paper';
break;
case 'article':
case 'document':
case 'blog-post':
case 'journal-article':
case 'magazine-article':
case 'newspaper-article':
case 'web-article':
return 'article';
break;
case 'audio':
case 'podcast':
case 'radio-broadcast':
return 'audio';
break;
case 'book':
return 'book';
break;
case 'case-study':
return 'case-study';
break;
case 'curriculum':
return 'educational-curriculum';
break;
case 'film':
case 'interview':
case 'video':
return 'video';
break;
case 'online-training-webinar':
return 'online-training';
break;
case 'presentation-slide':
return 'presentation';
break;
case 'report':
return 'report';
break;
case 'software':
case 'toolkit':
case 'template':
return 'toolkit';
break;
default:
return $format->slug;
return 'article';
}
}
}
Expand Down

0 comments on commit f0c3b4a

Please sign in to comment.