Skip to content
This repository has been archived by the owner on Sep 28, 2018. It is now read-only.

Commit

Permalink
footer in a post section UI improved
Browse files Browse the repository at this point in the history
  • Loading branch information
yssk22 committed May 9, 2011
1 parent 0718ed2 commit d6f95f7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
20 changes: 19 additions & 1 deletion apps/posts/_attachments/js/posts.js
Expand Up @@ -94,4 +94,22 @@
button.bind('click', onClick); button.bind('click', onClick);
}; };


})(jQuery); })(jQuery);

$(function(){
function f(s){
if( s > 10 ){
return s;
}else{
return '0' + s;
}
}

$('time').each(function(){
var self = $(this);
var t = new Date(self.attr('datetime'))
var date = [f(t.getFullYear()), f(t.getMonth() + 1), f(t.getDate())].join('-');
var time = [f(t.getHours()), f(t.getMinutes() + 1), f(t.getSeconds())].join(':');
self.html(date + ' ' + time);
});
});
16 changes: 9 additions & 7 deletions apps/posts/_attachments/templates/parts/post.ejs
Expand Up @@ -16,15 +16,17 @@
<%- markdown(this.content) %> <%- markdown(this.content) %>
</div> </div>
<footer> <footer>
<a class="permalink" title="<%= this.title %>"
href="<%= url('/p/' + this._id) %>"><%= _("posts.permalink") %></a>
<a class="posts-edit" title="<%= _('posts.edit') %>: <%= this.title %>"
href="<%= url('/admin/edit/' + this._id) %>"><%= _("posts.edit") %></a>
<a class="posts-delete" title="<%= _('posts.delete') %>: <%= this.title %>"
href="<%= url('/p/' + this._id) %>"><%= _("posts.delete") %></a>
<time datetime="<%= this.updated_at %>" class="updated_at"><%= this.updated_at %></time> <time datetime="<%= this.updated_at %>" class="updated_at"><%= this.updated_at %></time>
<time datetime="<%= this.created_at %>" class="created_at"><%= this.updated_at %></time> <time datetime="<%= this.created_at %>" class="created_at" pubdate="pubdate"><%= this.updated_at %></time>
<%- $system.linkToUser(this.updated_by) %> <%- $system.linkToUser(this.updated_by) %>
<div class="actions">
<a class="permalink" title="<%= this.title %>"
href="<%= url('/p/' + this._id) %>"><%= _("posts.permalink") %></a>
<a class="posts-edit" title="<%= _('posts.edit') %>: <%= this.title %>"
href="<%= url('/admin/edit/' + this._id) %>"><%= _("posts.edit") %></a>
<a class="posts-delete" title="<%= _('posts.delete') %>: <%= this.title %>"
href="<%= url('/p/' + this._id) %>"><%= _("posts.delete") %></a>
</div>
</footer> </footer>
<script type="text/javascript"> <script type="text/javascript">
$(function(){$('article.post[data-docid="<%= this._id %>"]').bindDelete();}); $(function(){$('article.post[data-docid="<%= this._id %>"]').bindDelete();});
Expand Down

0 comments on commit d6f95f7

Please sign in to comment.