Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 0948486d rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Also use the view for the queue

parent 9a7306b2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!3Dev kubat
...@@ -122,22 +122,18 @@ ipcRenderer.on('reload-db-responce', (event, arg) => { ...@@ -122,22 +122,18 @@ ipcRenderer.on('reload-db-responce', (event, arg) => {
/* Create the right panel: the queue */ /* Create the right panel: the queue */
ipcRenderer.on('reload-queue-responce', (event, arg) => { ipcRenderer.on('reload-queue-responce', (event, arg) => {
var karaList = '';
logger.debug('instance', `Web page got reload-queue`); logger.debug('instance', `Web page got reload-queue`);
document.getElementById('panelRight').innerHTML = '';
arg.forEach(kara => { arg.forEach(kara => {
karaList += `<li class="card p-2 bd-highlight shadow-none d-flex flex-row bd-highlight mb-3 karaCard"> ejs.renderFile(
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>${kara.language}</b></span> __dirname + '/views/karaListItem.ejs',
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>${kara.cat}</b></span> { kara: kara },
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b>${kara.type}</b></span> (err, data) => {
<span class="karaElement p-2 bd-highlight mr-auto"><b>${kara.source}<br> ${kara.title}</b> <i>[${kara.author}]</i></span> if (err) logger.error('instance', err);
<span class="karaElement p-3 bd-highlight"><b>${kara.position}</b></span> document.getElementById('panelRight').innerHTML = `
<div class="karaElement p-2 bd-highlight"> ${document.getElementById('panelRight').innerHTML}
<div class="d-flex flex-row bd-highlight mb-3 btn-group karaActionBtnGroup" role="group"> ${data}`;
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-minus"></i></button> }
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-play"></i></button> );
</div>
</div>
</li>`;
}); });
document.getElementById('panelRight').innerHTML = karaList;
}); });
<!-- vim: ts=4 syntax=html <%# vim: ts=4 syntax=html
The template for the kara card in lists --!> The template for the kara card in lists %>
<li class="card p-2 bd-highlight shadow-none d-flex flex-row bd-highlight mb-3 karaCard"> <li class="card p-2 bd-highlight shadow-none d-flex flex-row bd-highlight mb-3 karaCard">
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b><%= kara.language %></b></span> <span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b><%= kara.language %></b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b><%= kara.cat %></b></span> <span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b><%= kara.cat %></b></span>
<span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b><%= kara.type %></b></span> <span class="karaElement text-uppercase p-2 bd-highlight badge badge-light"><b><%= kara.type %></b></span>
<span class="karaElement p-2 bd-highlight mr-auto"><b><%= kara.source %><br> <%= kara.title %></b> <i>[<%= kara.author %>]</i></span> <span class="karaElement p-2 bd-highlight mr-auto"><b><%= kara.source %><br> <%= kara.title %></b> <i>[<%= kara.author %>]</i></span>
<% if (kara.hasOwnProperty('position')) { %>
<span class="karaElement p-3 bd-highlight"><b><%= kara.position %></b></span>
<% } %>
<div class="karaElement p-2 bd-highlight"> <div class="karaElement p-2 bd-highlight">
<div class="d-flex flex-row bd-highlight mb-3 btn-group karaActionBtnGroup" role="group"> <div class="d-flex flex-row bd-highlight mb-3 btn-group karaActionBtnGroup" role="group">
<button class="btn btn-outline-light karaActionBtn"><i class="fas fa-plus"></i></button> <button class="btn btn-outline-light karaActionBtn"><i class="fas fa-plus"></i></button>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter