1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00
Files
gitlit/app/js/templates.js

43 lines
919 B
JavaScript

window.gitlit = window.gitlit || {};
gitlit.templates = {
main: ejs.compile(`
<table class="table table-striped">
<tr>
<th>file</th>
<th>status</th>
<th>action</th>
</tr>
<% files.forEach((file) => { %>
<tr>
<td><%= file.file %></td>
<td><%= file.lockedBy ? file.lockedBy + ' (id: ' + file.id + ')' : 'not locked' %></td>
<td>
<a class="btn btn-primary js-lock"
href="javascript:///"
data-file="<%= file.file %>"
style="<%= file.lockedBy ? 'display: none;' : '' %>"
>
Lock
</a>
<a class="btn btn-danger js-unlock"
href="javascript:///"
data-file="<%= file.file %>"
style="<%= file.lockedBy ? '' : 'display: none;' %>"
>
Unlock
</a>
</td>
</tr>
<% }); %>
</table>
<div class="float-right">
<a class="btn btn-secondary js-refresh" href="javascript:///">
Refresh
</a>
</div>
`)
};