'rebuild' is not always accurate, using 'build' as the more proper term

This commit is contained in:
Andrew Davidson 2016-01-23 21:01:57 -05:00
parent c7465cc151
commit b9b4a68b11
7 changed files with 35 additions and 28 deletions

29
app.js
View file

@ -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) {
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: "###",
tags: "###",
regenerateDate: moment(lastBuildDate).format("YYYY-MM-DD HH:mm"),
uploadDate: moment(lastUploadDate).format("YYYY-MM-DD HH:mm"),
user: req.user});
})
})
})
})
photos: photoCount,
tags: "TBD",
buildCount: buildPosts.length + buildPhotos.length,
uploadCount: uploadPosts.length + uploadPhotos.length,
user: req.user
});
});
});
});
});
});
});
});
}
);

View file

@ -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) {

View file

@ -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")

View file

@ -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

View file

@ -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}

View file

@ -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

View file

@ -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