Skip to content

Commit

Permalink
show numbers for paging; hide bar for datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettcher committed Oct 17, 2022
1 parent a0ebe79 commit f68cf3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions frontend/js/apicalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ async function setDatasetView() {
$('#datasetViewTable').show();
$('#modifyDatasetButtonGroup').hide();
$('#filterForm').hide();
$('#pageNumbers').hide();
$('#pagingBar').hide();
if (window.sessionStorage.auth_token) {
$('#modifyDatasetButtonGroup').show();
}
Expand Down Expand Up @@ -437,12 +437,12 @@ async function showListingOrSingleDataset() {
if (window.sessionStorage.auth_token) {
$('#addNewDatasetForm').show();
$('#filterForm').show();
$('#pageNumbers').show();
$('#pagingBar').show();
}
listDatasets(getType(), getFilterSearch(), getFilterName(), getFilterUrl(), getFilterKeys(), getPage());
} else if (getId() == "new") {
$('#datasetListTable').hide();
$('#pageNumbers').hide();
$('#pagingBar').hide();
$('#storageTypeChooser').hide();
$('#datasetViewTable').show();
$('#filterForm').hide();
Expand Down Expand Up @@ -671,9 +671,17 @@ async function updatePagingHrefs() {
$('#page_prev_2').attr("href", basehref + "&page=" + Math.max(1, current_page - 2));
$('#page_prev_1').attr("href", basehref + "&page=" + Math.max(1, current_page - 1));
$('#page_next_1').attr("href", basehref + "&page=" + Math.min(max_page, current_page + 1));
$('#page_mext_2').attr("href", basehref + "&page=" + Math.min(max_page, current_page + 2));
$('#page_next_2').attr("href", basehref + "&page=" + Math.min(max_page, current_page + 2));
$('#page_last').attr("href", basehref + "&page=" + max_page);
$('#pageInput').attr("max", max_page);

$('#pageInput').attr("placeholder", current_page);
$('#pageInput').val(current_page);
$('#page_prev_2').text("<< (" + Math.max(1, current_page - 2) + ")");
$('#page_prev_1').text("Previous (" + Math.max(1, current_page - 1) + ")");
$('#page_next_1').text("Next (" + Math.min(max_page, current_page + 1) + ")");
$('#page_next_2').text(">> (" + Math.min(max_page, current_page + 2) + ")");
$('#page_last').text("Last (" + max_page + ")");
}

function gotoButtonPressed() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/storage_content.html.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</tbody>
</table>

<div class="table-responsive">
<div class="table-responsive" id ="pagingBar">
<table class="table">
<td style="width:14%">
<span>
Expand Down

0 comments on commit f68cf3a

Please sign in to comment.