forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes TryGhost#195 posts date on content page
- adds dateFormat handlebars helper for client side with extra option to format in time since style - adds this extra dateFormat option to existing server side helper. - adds scss for draft and scheduled status - adds true/false values to post for draft and published to validate in handlebars - changes admin>content post collection query to order posts by updated_at values in router.js - adds minified moment.js and links to moment.js and helper.js for clientside
- Loading branch information
Showing
9 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*globals Handlebars, moment | ||
*/ | ||
(function () { | ||
"use strict"; | ||
Handlebars.registerHelper('dateFormat', function (context, block) { | ||
var f = block.hash.format || "MMM Do, YYYY", | ||
timeago = block.hash.timeago, | ||
date; | ||
if (timeago) { | ||
date = moment(context).fromNow(); | ||
} else { | ||
date = moment(context).format(f); | ||
} | ||
return date; | ||
}); | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1164,3 +1164,11 @@ main { | |
} | ||
|
||
} | ||
|
||
.status-draft { | ||
color: $red; | ||
} | ||
.status-scheduled { | ||
color: $orange; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
<a class="permalink{{#if featured}} featured{{/if}}" href="#"> | ||
<h3 class="entry-title">{{title}}</h3> | ||
<section class="entry-meta"> | ||
<time datetime="2013-01-04" class="date">5 minutes ago</time> | ||
<time datetime="2013-01-04" class="date"> | ||
{{#if published}}Published | ||
{{#if updated_at}}{{dateFormat updated_at timeago="True"}} | ||
{{else}}{{dateFormat published_at timeago="True"}}{{/if}} | ||
{{else}}<span class="status-draft">Draft</span>{{/if}} | ||
</time> | ||
{{!<span class="views">1,934</span>}} | ||
</section> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters