Skip to content

Commit

Permalink
fine tuning the display of exhibitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsteward committed Sep 29, 2021
1 parent 704ff41 commit 60c858e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
8 changes: 6 additions & 2 deletions modules/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function getObjectsInGalleryStats(callback) {
function getCurrentExhibitions(callback) {
const params = {
venue: 'HAM',
status: 'current'
status: 'current',
sort: 'enddate',
sortorder: 'asc'
};
const url = makeURL('exhibition', params);

Expand All @@ -84,7 +86,9 @@ function getCurrentExhibitions(callback) {
function getUpcomingExhibitions(callback) {
const params = {
venue: 'HAM',
status: 'upcoming'
status: 'upcoming',
sort: 'begindate',
sortorder: 'asc'
};
const url = makeURL('exhibition', params);

Expand Down
20 changes: 14 additions & 6 deletions views/production.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,26 @@
<h2 class="card-title">Current Exhibitions</h2>

<ul class="list-group">
{{#each apistats.exhibitions.current}}
<li class="list-group-item"><a href="{{url}}">{{title}}</a> <br/><span class="figure-caption">Closes on {{enddate}}</span></li>
{{/each}}
{{#if apistats.exhibitions.current.length}}
{{#each apistats.exhibitions.current}}
<li class="list-group-item"><a href="{{url}}">{{title}}</a> <br/><span class="figure-caption">closes on {{enddate}}</span></li>
{{/each}}
{{else}}
<li class="list-group-item">No current exhibitions</li>
{{/if}}
</ul>
</div>
<div class="card-body">
<h2 class="card-title">Upcoming Exhibitions</h2>

<ul class="list-group">
{{#each apistats.exhibitions.upcoming}}
<li class="list-group-item"><a href="{{url}}">{{title}}</a> <br/><span class="figure-caption">Opens on {{begindate}}</span></li>
{{/each}}
{{#if apistats.exhibitions.upcoming.length}}
{{#each apistats.exhibitions.upcoming}}
<li class="list-group-item"><a href="{{url}}">{{title}}</a> <br/><span class="figure-caption">opens on {{begindate}}</span></li>
{{/each}}
{{else}}
<li class="list-group-item">No upcoming exhibitions</li>
{{/if}}
</ul>
</div>
</div>
Expand Down

0 comments on commit 60c858e

Please sign in to comment.