'rebuild' is not always accurate, using 'build' as the more proper term
This commit is contained in:
parent
c7465cc151
commit
b9b4a68b11
7 changed files with 35 additions and 28 deletions
41
app.js
41
app.js
|
@ -134,23 +134,30 @@ app.get('/admin',
|
|||
function(req, res, next) {
|
||||
Post.countPosts(function (err, postCount) {
|
||||
Category.countCategories(function (err, categoryCount) {
|
||||
Post.getLastBuildDate(function (err, lastBuildDate) {
|
||||
Post.getLastUploadDate( function (err, lastUploadDate) {
|
||||
res.render('admin-dashboard', {
|
||||
successNotice: req.flash('successNotice'),
|
||||
failureNotice: req.flash('failureNotice'),
|
||||
categories: categoryCount,
|
||||
posts: postCount,
|
||||
galleries: "###",
|
||||
photos: "###",
|
||||
tags: "###",
|
||||
regenerateDate: moment(lastBuildDate).format("YYYY-MM-DD HH:mm"),
|
||||
uploadDate: moment(lastUploadDate).format("YYYY-MM-DD HH:mm"),
|
||||
user: req.user});
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
Photo.countPhotos(function (err, photoCount) {
|
||||
Post.getNeedsBuild(function (err, buildPosts) {
|
||||
Photo.getNeedsBuild(function (err, buildPhotos) {
|
||||
Post.getNeedsUpload(function (err, uploadPosts) {
|
||||
Photo.getNeedsUpload(function (err, uploadPhotos) {
|
||||
res.render('admin-dashboard', {
|
||||
successNotice: req.flash('successNotice'),
|
||||
failureNotice: req.flash('failureNotice'),
|
||||
categories: categoryCount,
|
||||
posts: postCount,
|
||||
galleries: "###",
|
||||
photos: photoCount,
|
||||
tags: "TBD",
|
||||
buildCount: buildPosts.length + buildPhotos.length,
|
||||
uploadCount: uploadPosts.length + uploadPhotos.length,
|
||||
user: req.user
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -148,8 +148,8 @@ module.exports = function(app) {
|
|||
}
|
||||
);
|
||||
|
||||
// GET /admin/post/rebuild
|
||||
app.get('/admin/post/rebuild/:uuid?',
|
||||
// GET /admin/post/build
|
||||
app.get('/admin/post/build/:uuid?',
|
||||
function(req, res, next) {
|
||||
if (req.params.uuid) {
|
||||
Static.updateBuildFolder(function (err) {
|
||||
|
|
|
@ -13,18 +13,18 @@ block content
|
|||
div(class="col-md-6")
|
||||
div(class="panel panel-success")
|
||||
div(class="panel-heading")
|
||||
h3(class="panel-title") Last Upload (UTC)
|
||||
h3(class="panel-title") Pending Uploads
|
||||
|
||||
div(class="panel-body")
|
||||
h3 #{uploadDate}
|
||||
h3 #{uploadCount}
|
||||
|
||||
div(class="col-md-6")
|
||||
div(class="panel panel-danger")
|
||||
div(class="panel-heading")
|
||||
h3(class="panel-title") Last Rebuild (UTC)
|
||||
h3(class="panel-title") Pending Builds
|
||||
|
||||
div(class="panel-body")
|
||||
h3 #{rebuildDate}
|
||||
h3 #{buildCount}
|
||||
|
||||
div(class="row")
|
||||
div(class="col-md-4")
|
||||
|
|
|
@ -21,7 +21,7 @@ block content
|
|||
| -
|
||||
a(href="/admin/post/delete/#{post.get('uuid')}") Delete
|
||||
| -
|
||||
a(href="/admin/post/rebuild/#{post.get('uuid')}") Rebuild
|
||||
a(href="/admin/post/build/#{post.get('uuid')}") Build
|
||||
| -
|
||||
a(href="/admin/post/upload/#{post.get('uuid')}") Upload
|
||||
|
||||
|
|
|
@ -15,6 +15,6 @@ block content
|
|||
| #{post.getShortDate()} --
|
||||
a(href="/admin/post/edit/#{post.get('uuid')}") Edit
|
||||
| -
|
||||
a(href="/admin/post/rebuild/#{post.get('uuid')}") Rebuild
|
||||
a(href="/admin/post/build/#{post.get('uuid')}") Build
|
||||
|
||||
div(class='row') !{content}
|
||||
|
|
|
@ -17,11 +17,11 @@ div(class="col-sm-2 sidebar")
|
|||
li: a(href="/admin/gallery/list") All Galleries
|
||||
|
||||
ul(class="nav nav-sidebar")
|
||||
form(action="/admin/rebuild/", method="get")
|
||||
form(action="/admin/build/", method="get")
|
||||
button(class="btn btn-lg btn-success")
|
||||
span(class="glyphicon glyphicon-repeat") Build
|
||||
|
||||
ul(class="nav nav-sidebar")
|
||||
form(action="/admin/publish/", method="get")
|
||||
form(action="/admin/upload/", method="get")
|
||||
button(class="btn btn-lg btn-warning")
|
||||
span(class="glyphicon glyphicon-upload") Upload
|
||||
|
|
|
@ -20,4 +20,4 @@ block content
|
|||
td
|
||||
a(href="/admin/post/edit/#{post.get('uuid')}") Edit
|
||||
| -
|
||||
a(href="/admin/post/rebuild/#{post.get('uuid')}") Rebuild
|
||||
a(href="/admin/post/build/#{post.get('uuid')}") Build
|
||||
|
|
Loading…
Reference in a new issue