1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-02 20:30:05 +02:00
This commit is contained in:
s2
2018-05-18 12:57:15 +02:00
parent f96e61fd63
commit 80699aa7c5
8 changed files with 202 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
(function($) {
require('electron').ipcRenderer.on('ping', (event, message) => {
console.log(message) // Prints 'whoooooooh!'
})
let ipcRenderer = require('electron').ipcRenderer;
ipcRenderer.on('fileList', (event, files) => {
$('body').html(gitlit.templates.main({files: files}));
});
})(jQuery);

View File

@@ -1,17 +1,26 @@
window.gitlit = window.gitlit || {};
gitlit.templates = {
main: ejs.compile(`
<table class="table table-striped">
<table class="table">
<tr>
<th>file</th>
<th>status</th>
<th>action</th>
</tr>
<tr>
<td>ciccio.txt</td>
<td>locked</td>
<td></td>
</tr>
<% files.forEach((file) => { %>
<tr class="<%= file.lockedBy ? 'alert alert-danger' : '' %>">
<td><%= file.file %></td>
<td><%= file.lockedBy ? file.lockedBy + ' (id: ' + file.id + ')' : 'not locked' %></td>
<td>
<a class="btn btn-<%= file.lockedBy ? 'danger' : 'primary' %>"
href="javascript:///">
<%= file.lockedBy ? 'Unlock' : 'Lock' %>
</a>
</td>
</tr>
<% }); %>
</table>
`)
};