Skip to content

Commit

Permalink
Handle different view names when paginating
Browse files Browse the repository at this point in the history
At some point we should consolidate these into the same logical name since the page number is optional but…
  • Loading branch information
acdha committed Jul 26, 2019
1 parent 37ad09f commit 0ba40aa
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/templates/issue_pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ <h1>
{% endblock %}

{% block subcontent %}
{% if VIEW_NAME == "chronam_issues_first_pages" %}
{% include "includes/issue_frontpages_ctrl.html" %}
{% else %}
{% if issue %}
{% include "includes/issue_pages_ctrl.html" %}
{% else %}
{% include "includes/issue_frontpages_ctrl.html" %}
{% endif %}

<div class="search_results_body gallery issues">
Expand Down Expand Up @@ -69,10 +69,10 @@ <h2>This issue has no available digitized pages{% if display_label %}: {{ displa
</div>
</div>

{% if VIEW_NAME == "chronam_issues_first_pages" %}
{% include "includes/issue_frontpages_ctrl.html" %}
{% else %}
{% if issue %}
{% include "includes/issue_pages_ctrl.html" %}
{% else %}
{% include "includes/issue_frontpages_ctrl.html" %}
{% endif %}
{% endblock %}

Expand All @@ -82,10 +82,10 @@ <h2>This issue has no available digitized pages{% if display_label %}: {{ displa
jQuery(function($) {
$("form[name='page_number_form']").submit(function() {
var pageNumber = $("input[type=text]", this).val();
{% if VIEW_NAME == "chronam_issues_first_pages" %}
window.location.href = '{% url 'chronam_issues_first_pages' title.lccn %}' + pageNumber;
{% else %}
{% if issue %}
window.location.href = '{% url 'chronam_issue_pages' issue.title.lccn issue.date_issued issue.edition %}' + pageNumber;
{% else %}
window.location.href = '{% url 'chronam_issues_first_pages' title.lccn %}' + pageNumber;
{% endif %}
return false;
});
Expand Down

0 comments on commit 0ba40aa

Please sign in to comment.