Commit 8ff6364d authored by Ivanq's avatar Ivanq

Show issues

parent 483d34ad
.issues { .issues {
width: 1024px; width: 1024px;
margin: 0 auto; margin: 0 auto 16px;
border-spacing: 0; border-spacing: 0;
border: 1px solid #DDF; border: 1px solid #DDF;
......
...@@ -41,16 +41,7 @@ ...@@ -41,16 +41,7 @@
<a class="button button-blue" id="new_issue">New issue</a> <a class="button button-blue" id="new_issue">New issue</a>
</div> </div>
<table id="issues" class="issues"> <table id="issues" class="issues"></table>
<tr>
<td>
<img src="../../img/issue-opened.svg" class="issue-icon">Is it possible at all?
</td>
<td class="issues-right">
Opened 5 days ago by <a href="">IvanqthebestIvanqthebestIvanqthebestIvanqthebestIvanqthebestIvanqthebestIvanqthebestIvanqthebestIvanqthebestIvanqthebest</a>
</td>
</tr>
</table>
<template id="edit_icon_tmpl"> <template id="edit_icon_tmpl">
<img src="../../img/edit.svg" class="edit-icon" id="edit_icon" width="16" height="16"> <img src="../../img/edit.svg" class="edit-icon" id="edit_icon" width="16" height="16">
...@@ -64,7 +55,7 @@ ...@@ -64,7 +55,7 @@
<script type="text/javascript" src="../../js/git.js"></script> <script type="text/javascript" src="../../js/git.js"></script>
<script type="text/javascript" src="../../js/repo.js"></script> <script type="text/javascript" src="../../js/repo.js"></script>
<script type="text/javascript" src="../js/common.js"></script> <script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/path_common.js"></script> <script type="text/javascript" src="../js/user_common.js"></script>
<script type="text/javascript" src="js/main.js"></script> <script type="text/javascript" src="js/main.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -5,5 +5,31 @@ repo.addMerger() ...@@ -5,5 +5,31 @@ repo.addMerger()
.then(content => { .then(content => {
showTitle(content.title); showTitle(content.title);
showTabs(1); showTabs(1);
document.getElementById("new_issue").href = "new/?" + address document.getElementById("new_issue").href = "new/?" + address;
return repo.getIssues(Number.isSafeInteger(additional) ? additional : 0);
})
.then(issues => {
issues.issues.forEach(issue => {
let tr = document.createElement("tr");
tr.onclick = () => {
location.href = "view/?" + address + "/" + issue.id + "@" + issue.json_id;
};
let title = document.createElement("td");
title.textContent = issue.title;
tr.appendChild(title);
let icon = document.createElement("img");
icon.src = "../../img/issue-" + (issue.open ? "opened" : "closed") + ".svg";
icon.className = "issue-icon";
title.insertBefore(icon, title.firstChild);
let info = document.createElement("td");
info.textContent = "Opened on " + repo.translateDate(issue.date_added) + " by " + issue.cert_user_id;
info.className = "issues-right";
tr.appendChild(info);
document.getElementById("issues").appendChild(tr);
});
}); });
\ 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