45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
<%
|
|
function layoutDiv() {
|
|
var el = '';
|
|
var repo;
|
|
var branch = 'main';
|
|
if (page.repo) {
|
|
repo = page.repo
|
|
} else if (page.layout === 'wiki' && page.wiki) {
|
|
let proj = theme.wiki.tree[page.wiki];
|
|
if (proj && proj.repo) {
|
|
repo = proj.repo;
|
|
if (proj.branch != undefined) {
|
|
branch = proj.branch;
|
|
}
|
|
}
|
|
}
|
|
if (repo == undefined) {
|
|
return el;
|
|
}
|
|
item.api = theme.api_host.ghapi + '/repos/' + repo + '/issues?per_page=' + item.limit;
|
|
if (item.labels) {
|
|
item.api += '&labels=' + item.labels;
|
|
}
|
|
el += '<widget class="widget-wrapper timeline">';
|
|
if (item.title) {
|
|
el += '<div class="widget-header cap theme dis-select">';
|
|
el += '<span class="name">' + item.title + '</span>';
|
|
el += '</div>';
|
|
}
|
|
el += '<div class="widget-body fs14">';
|
|
el += '<div class="tag-plugin timeline stellar-timeline-api"';
|
|
['api', 'user'].forEach(key => {
|
|
if (item[key]) {
|
|
el += ' ' + key + '="' + item[key] + '"';
|
|
}
|
|
});
|
|
el += '>';
|
|
el += '</div>';
|
|
el += '</div>';
|
|
el += '</widget>';
|
|
return el;
|
|
}
|
|
%>
|
|
<%- layoutDiv() %>
|