created post author view.

This commit is contained in:
danielgrippi 2012-02-20 20:26:24 -08:00
parent 6965d6da24
commit 7466808112
5 changed files with 36 additions and 22 deletions

View file

@ -5,7 +5,8 @@ app.pages.PostViewer = app.views.Base.extend({
subviews : {
"#post-content" : "postView",
"#post-nav" : "navView",
"#post-feedback" : "feedbackView"
"#post-feedback" : "feedbackView",
"#header-container" : "authorView"
},
postView : function(){
@ -25,6 +26,10 @@ app.pages.PostViewer = app.views.Base.extend({
return new app.views.PostViewerFeedback({ model : this.model })
},
authorView : function() {
return new app.views.PostViewerAuthor({ model : this.model })
},
postRenderTemplate : function() {
this.bindNavHooks();
},

View file

@ -1,31 +1,15 @@
<!-- header to be extracted -->
<div class="header">
<div class="header-container">
<div id="post-author" class="media">
<div class="img">
<a href="/people/{{author.guid}}" class="author-name">
<img src="{{author.avatar.small}}" class="avatar smaller"/>
</a>
</div>
<div class="bd">
<a href="/people/{{author.guid}}" class="author-name">
{{author.name}}
</a>
<div class="post-time">
<i class="icon-time"></i>
{{created_at}}
</div>
</div>
</div>
</div>
<div id="header-container"> </div>
</div>
<div id="post-content"></div>
<div id="post-nav"></div>
<!-- extraction needed! -->
<div id="post-reactions">
<div id="post-feedback"></div>

View file

@ -0,0 +1,16 @@
<div class="img">
<a href="/people/{{author.guid}}" class="author-name">
<img src="{{author.avatar.small}}" class="avatar smaller"/>
</a>
</div>
<div class="bd">
<a href="/people/{{author.guid}}" class="author-name">
{{author.name}}
</a>
<div class="post-time">
<i class="icon-time"></i>
<time datetime="{{created_at}}" />
</div>
</div>

View file

@ -0,0 +1,9 @@
app.views.PostViewerAuthor = app.views.Base.extend({
id : "post-author",
className : "media",
templateName: "post-viewer/author"
})

View file

@ -252,7 +252,7 @@ $light-grey: #999;
width: 100%;
}
.header-container {
#header-container {
padding: 20px;
}