Option to show editor and mode to templates list
This commit is contained in:
parent
7be9624789
commit
d481674e86
2 changed files with 23 additions and 10 deletions
|
@ -24,7 +24,8 @@ router.all('/*', (req, res, next) => {
|
|||
|
||||
router.get('/', (req, res) => {
|
||||
res.render('templates/templates', {
|
||||
title: _('Templates')
|
||||
title: _('Templates'),
|
||||
showEditor: config.views.template.showeditor || false
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -176,14 +177,24 @@ router.post('/ajax', (req, res) => {
|
|||
draw: req.body.draw,
|
||||
recordsTotal: total,
|
||||
recordsFiltered: filteredTotal,
|
||||
data: data.map((row, i) => [
|
||||
(Number(req.body.start) || 0) + 1 + i,
|
||||
'<span class="glyphicon glyphicon-file" aria-hidden="true"></span> ' + htmlescape(row.name || ''),
|
||||
templates.editorName(row.editorName),
|
||||
row.editorData && row.editorData.indexOf('"mjml":') > -1 ? 'MJML' : 'HTML',
|
||||
htmlescape(striptags(row.description) || ''),
|
||||
'<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span><a href="/templates/edit/' + row.id + '"> ' + _('Edit') + '</a>' ]
|
||||
)
|
||||
data: data.map((row, i) => {
|
||||
let templateRow = [
|
||||
(Number(req.body.start) || 0) + 1 + i,
|
||||
'<span class="glyphicon glyphicon-file" aria-hidden="true"></span> ' + htmlescape(row.name || '')
|
||||
];
|
||||
if (config.views.template.showeditor) {
|
||||
templateRow.push(
|
||||
templates.editorName(row.editorName),
|
||||
row.editorData && row.editorData.indexOf('"mjml":') > -1 ? 'MJML' : 'HTML'
|
||||
);
|
||||
}
|
||||
templateRow.push(
|
||||
htmlescape(striptags(row.description) || ''),
|
||||
'<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span><a href="/templates/edit/' + row.id + '"> ' + _('Edit') + '</a>'
|
||||
);
|
||||
return templateRow;
|
||||
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<hr>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table data-topic-url="/templates" data-sort-column="1" data-sort-order="asc" class="table table-bordered table-hover data-table-ajax display nowrap" width="100%" data-row-sort="0,1,0,0,0,0">
|
||||
<table data-topic-url="/templates" data-sort-column="1" data-sort-order="asc" class="table table-bordered table-hover data-table-ajax display nowrap" width="100%" data-row-sort="0,1,{{#if showEditor}}0,0,{{/if}}0,0">
|
||||
<thead>
|
||||
<th style="width: 1%">
|
||||
#
|
||||
|
@ -20,12 +20,14 @@
|
|||
<th style="width: 30%">
|
||||
{{#translate}}Name{{/translate}}
|
||||
</th>
|
||||
{{#if showEditor}}
|
||||
<th style="width: 110px">
|
||||
{{#translate}}Editor{{/translate}}
|
||||
</th>
|
||||
<th style="width: 60px">
|
||||
{{#translate}}Mode{{/translate}}
|
||||
</th>
|
||||
{{/if}}
|
||||
<th>
|
||||
{{#translate}}Description{{/translate}}
|
||||
</th>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue