Commit afa2422e authored by Ivanq's avatar Ivanq

Add navigation to issue list

parent 45bfbfc6
......@@ -40,4 +40,16 @@
width: 16px;
margin-right: 8px;
vertical-align: top;
}
.navigation {
width: 1024px;
margin: 16px auto;
}
.navigation > * {
margin-left: 8px;
}
.navigation > *:first-child {
margin-left: 0;
}
\ No newline at end of file
......@@ -43,6 +43,11 @@
<table id="issues" class="issues"></table>
<div class="navigation">
<a class="button button-disabled" id="navigation_back">&#8592; Back</a>
<a class="button button-disabled" id="navigation_next">Next &#8594;</a>
</div>
<template id="edit_icon_tmpl">
<img src="../../img/edit.svg" class="edit-icon" id="edit_icon" width="16" height="16">
</template>
......
let currentPage = Number.isSafeInteger(+additional) ? +additional : 0;
repo.addMerger()
.then(() => {
return repo.getContent();
......@@ -7,6 +9,7 @@ repo.addMerger()
showTabs(1);
document.getElementById("new_issue").href = "new/?" + address;
additional = +additional;
return repo.getIssues(Number.isSafeInteger(additional) ? additional : 0);
})
.then(issues => {
......@@ -32,4 +35,16 @@ repo.addMerger()
document.getElementById("issues").appendChild(tr);
});
if(currentPage > 0) {
let button = document.getElementById("navigation_back");
button.classList.remove("button-disabled");
button.href = "?" + address + "/" + (currentPage - 1);
}
if(issues.nextPage) {
let button = document.getElementById("navigation_next");
button.classList.remove("button-disabled");
button.href = "?" + address + "/" + (currentPage + 1);
}
});
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment