diff --git a/app.js b/app.js index e75a341..665b51f 100644 --- a/app.js +++ b/app.js @@ -106,9 +106,9 @@ app.locals.PROJECT = { }; app.locals.FILETYPE = { - html: 'HTML片段', - css: 'CSS链接', - js: 'JS链接' + html: 'HTML', + css: 'CSS', + js: 'JS' }; app.locals.MODULETYPE = { diff --git a/public/css/app.css b/public/css/app.css index 65cc234..fae1716 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -126,6 +126,10 @@ body { text-align: right; } +.table td:first-child a { + margin-left: -6px; +} + .table .btn { margin-left: 5px; } diff --git a/views/component/gridview.jade b/views/component/gridview.jade index f896dec..6a13c2e 100644 --- a/views/component/gridview.jade +++ b/views/component/gridview.jade @@ -35,7 +35,7 @@ table.table.table-striped.table-hover thead tr th 标题 - th= controllerName == 'module' ? '项目类型' : '项目' + th 文件名 th 作者 th 创建时间 th 最后更新 @@ -46,14 +46,11 @@ table.table.table-striped.table-hover each m in model.data tr td - a(href="http://#{m.project == 'global' ? 'www' : m.project}.#{setting.domain + (controllerName == 'page' ? '' : '/ssi')}/#{m.path}",target="_blank")= m.title + - var url = 'http://' + (m.project == 'global' ? 'www' : m.project) + '.' + setting.domain + (controllerName == 'page' ? '' : '/ssi') + '/' + m.path; + a(href="#{url}",target="_blank")= '【' + (PROJECT[m.project] || '全局') + (m.filetype ? FILETYPE[m.filetype] : '') + '】' + m.title if(controllerName == 'module') code.btn-copy(href="javascript:;",title=m.path) 复制代码 - td - if(controllerName == 'module') - a(href="/#{controllerName}/?project=#{m.project}&filetype=#{m.filetype}")= (PROJECT[m.project] || '全局') + FILETYPE[m.filetype] - else - a(href="/#{controllerName}/?project=#{m.project}")= PROJECT[m.project] + td= m.filename td a(href="/#{controllerName}/?author=#{m.author}")= m.author td= moment(new Date(m.createdAt)).format('YYYY-MM-DD HH:MM:SS') @@ -74,6 +71,7 @@ table.table.table-striped.table-hover else span.label.label-danger 草稿 td - a.btn.btn-default.btn-delete(href="/#{controllerName}/delete/#{m._id}") 删除 + if(user && user.roles.indexOf(1) == 0 /* super administrator */) + a.btn.btn-default.btn-delete(href="/#{controllerName}/delete/#{m._id}") 删除 a.btn.btn-default(href="/#{controllerName}/edit/#{m._id}") 编辑 include ../component/pagination \ No newline at end of file diff --git a/views/page/_modal.jade b/views/page/_modal.jade index 5c338ff..2aa61ae 100644 --- a/views/page/_modal.jade +++ b/views/page/_modal.jade @@ -33,11 +33,12 @@ script#tpl-page-module(type="text/html"). var background = (module[4] ? 'background-color:' + module[4] : '') + (module[5] ? 'background-image:url(' + module[5] + ')' : ''); var style = background ? ' style="' + background + '"' : ''; - if(content){ - if (type == 'bundle') { %> -
> - -
+ if(content){ %> + + <% if (type == 'bundle') { %> +
> + +
<% } if (type == 'slider') { %>