Skip to content

Commit

Permalink
[WV-861]Refactored pagination section for consistency: - Wrapped pagi…
Browse files Browse the repository at this point in the history
…nation links in a form with class pagination-form. - Added onclick=displayLoadingBanner to pagination links to show the loading banner during navigation.

Refactored pagination section for consistency:
- Wrapped pagination links in a `<form>` with class `pagination-form`.
- Added `onclick="displayLoadingBanner()"` to pagination links to show the loading banner during navigation.
  • Loading branch information
itcreativeusa committed Dec 14, 2024
1 parent 72fbb8a commit daddbd9
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions templates/politician/politician_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ <h1>Politicians</h1>
{% endif %}
<input type="text" name="politician_search" id="politician_search_id" value="{{ politician_search }}" />
<input id="politician_search_submit" type="submit" value="Search for Politician" />
<!-- Pagination Section -->
<form method="get" action="" class="pagination-form">
<div class="float-right">
{% if previous_page_url %}
<a href="{{ previous_page_url }}" onclick="displayLoadingBanner()">Previous page</a> |
{% endif %}
Page {{ current_page_number|add:1 }}
{% if next_page_url %}
| <a href="{{ next_page_url }}" onclick="displayLoadingBanner()">Next page</a>
{% endif %}
</div>
</form>
<!-- End of Pagination Section -->
&nbsp;&nbsp;
<label for="show_politicians_with_email_id">
<input type="checkbox" name="show_politicians_with_email" id="show_politicians_with_email_id" value="1"
Expand Down Expand Up @@ -121,18 +134,6 @@ <h1>Politicians</h1>
{% if exclude_politician_analysis_done %}checked{% endif %} /> Exclude Analyzed
</label>
</form>
<!-- Pagination Section -->
{% if not hide_pagination %}
<span class="float-right">
{% if previous_page_url %}
<a href="{{ previous_page_url }}">Previous page</a> |
{% endif %}
Page {{ current_page_number|add:1 }}
{% if next_page_url %}
| <a href="{{ next_page_url }}">Next page</a>
{% endif %}
</span>
{% endif %}

{% if politician_list %}
<table class="table">
Expand Down Expand Up @@ -260,15 +261,15 @@ <h1>Politicians</h1>
</tr>
{% endfor %}
</table>
<!-- Pagination Section -->
<!-- Pagination Section -->
{% if not hide_pagination %}
<span class="float-right">
{% if previous_page_url %}
<a href="{{ previous_page_url }}">Previous page</a> |
<a href="{{ previous_page_url }}" onclick="displayLoadingBanner()">Previous page</a> |
{% endif %}
Page {{ current_page_number|add:1 }}
{% if next_page_url %}
| <a href="{{ next_page_url }}">Next page</a>
| <a href="{{ next_page_url }}" onclick="displayLoadingBanner()">Next page</a>
{% endif %}
</span>
{% endif %}
Expand All @@ -288,7 +289,7 @@ <h1>Politicians</h1>

function clearSearch() {
displayLoadingBanner();
$('#politician_search_id').value = '';
$('#politician_search_id').val('');
$('form[name="state_code_form"]').submit();
}

Expand Down

0 comments on commit daddbd9

Please sign in to comment.