Browse Source

Use Thema subjects.

pull/27/head
Ned Zimmerman 7 years ago
parent
commit
b31b98314b
No known key found for this signature in database
GPG Key ID: FF56334A013120CA
  1. 82
      app/controllers/PageCatalog.php
  2. 6
      resources/views/page-catalog.blade.php

82
app/controllers/PageCatalog.php

@ -21,87 +21,7 @@ class PageCatalog extends Controller
public function subjectGroups()
{
return [
'business-finance' => [
'title' => __('Business and Finance', 'aldine'),
'subjects' => [
'accounting' => 'Accounting',
'finance' => 'Finance',
'information-systems' => 'Information Systems',
'management' => 'Management',
'marketing' => 'Marketing',
'economics' => 'Economics',
],
],
'engineering-technology' => [
'title' => __('Engineering & Technology', 'aldine'),
'subjects' => [
'architecture' => 'Architecture',
'bioengineering' => 'Bioengineering',
'chemical' => 'Chemical',
'civil' => 'Civil',
'electrical' => 'Electrical',
'mechanical' => 'Mechanical',
'mining-and-materials' => 'Mining and Materials',
'urban-planning' => 'Urban Planning',
'computer-science' => 'Computer Science',
],
],
'health-sciences' => [
'title' => __('Health Sciences', 'aldine'),
'subjects' => [
'nursing' => 'Nursing',
'dentistry' => 'Dentistry',
'medicine' => 'Medicine',
],
],
'humanities-arts' => [
'title' => __('Humanities & Arts', 'aldine'),
'subjects' => [
'archaeology' => 'Archaeology',
'art' => 'Art',
'classics' => 'Classics',
'literature' => 'Literature',
'history' => 'History',
'media' => 'Media',
'music' => 'Music',
'philosophy' => 'Philosophy',
'religion' => 'Religion',
'language' => 'Language',
],
],
'reference' => [
'title' => __('Reference', 'aldine'),
'subjects' => [
'student-guides' => 'Student Guides',
'teaching-guides' => 'Teaching Guides',
],
],
'science' => [
'title' => __('Sciences', 'aldine'),
'subjects' => [
'biology' => 'Biology',
'chemistry' => 'Chemistry',
'environent-and-earth-sciences' => 'Environment and Earth Sciences',
'geography' => 'Geography',
'mathematics' => 'Mathematics',
'physics' => 'Physics',
],
],
'social-sciences' => [
'title' => __('Social Sciences', 'aldine'),
'subjects' => [
'anthropology' => 'Anthropology',
'gender-studies' => 'Gender Studies',
'linguistics' => 'Linguistics',
'museums-libraries-and-information-sciences' => 'Museums, Libraries, and Information Sciences',
'political-science' => 'Political Science',
'psychology' => 'Psychology',
'social-work' => 'Social Work',
'sociology' => 'Sociology',
],
],
];
return \Pressbooks\Metadata\get_thema_subjects();
}
public function catalogData()

6
resources/views/page-catalog.blade.php

@ -16,10 +16,12 @@
<div id="filter" class="filter-groups">
@foreach($subject_groups as $key => $val)
<div class="{{ $key }} subjects" id="{{ $key }}">
<a href="#{{ $key }}">{{ $val['title'] }} <svg class="arrow" width="13" height="8" viewBox="0 0 13 8" xmlns="http://www.w3.org/2000/svg"><path d="M6.255 8L0 0h12.51z" fill="#b01109" fill-rule="evenodd"/></svg></a>
<a href="#{{ $key }}">{{ $val['label'] }} <svg class="arrow" width="13" height="8" viewBox="0 0 13 8" xmlns="http://www.w3.org/2000/svg"><path d="M6.255 8L0 0h12.51z" fill="#b01109" fill-rule="evenodd"/></svg></a>
<ul class="filter-list">
@foreach($val['subjects'] as $k => $v)
@foreach($val['children'] as $k => $v)
@if(strlen($k) === 2)
<li><a data-filter="{{ $k }}">{{ $v }}<span class="close">&times;</span></a></li>
@endif
@endforeach
</ul>
</div>

Loading…
Cancel
Save