created post author view.
This commit is contained in:
parent
6965d6da24
commit
7466808112
5 changed files with 36 additions and 22 deletions
|
|
@ -5,7 +5,8 @@ app.pages.PostViewer = app.views.Base.extend({
|
||||||
subviews : {
|
subviews : {
|
||||||
"#post-content" : "postView",
|
"#post-content" : "postView",
|
||||||
"#post-nav" : "navView",
|
"#post-nav" : "navView",
|
||||||
"#post-feedback" : "feedbackView"
|
"#post-feedback" : "feedbackView",
|
||||||
|
"#header-container" : "authorView"
|
||||||
},
|
},
|
||||||
|
|
||||||
postView : function(){
|
postView : function(){
|
||||||
|
|
@ -25,6 +26,10 @@ app.pages.PostViewer = app.views.Base.extend({
|
||||||
return new app.views.PostViewerFeedback({ model : this.model })
|
return new app.views.PostViewerFeedback({ model : this.model })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
authorView : function() {
|
||||||
|
return new app.views.PostViewerAuthor({ model : this.model })
|
||||||
|
},
|
||||||
|
|
||||||
postRenderTemplate : function() {
|
postRenderTemplate : function() {
|
||||||
this.bindNavHooks();
|
this.bindNavHooks();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,15 @@
|
||||||
<!-- header to be extracted -->
|
<!-- header to be extracted -->
|
||||||
|
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="header-container">
|
<div id="header-container"> </div>
|
||||||
<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>
|
</div>
|
||||||
|
|
||||||
<div id="post-content"></div>
|
<div id="post-content"></div>
|
||||||
<div id="post-nav"></div>
|
<div id="post-nav"></div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- extraction needed! -->
|
||||||
|
|
||||||
<div id="post-reactions">
|
<div id="post-reactions">
|
||||||
<div id="post-feedback"></div>
|
<div id="post-feedback"></div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
9
public/javascripts/app/views/post_author_view.js
Normal file
9
public/javascripts/app/views/post_author_view.js
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
app.views.PostViewerAuthor = app.views.Base.extend({
|
||||||
|
|
||||||
|
id : "post-author",
|
||||||
|
className : "media",
|
||||||
|
|
||||||
|
templateName: "post-viewer/author"
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
@ -252,7 +252,7 @@ $light-grey: #999;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-container {
|
#header-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue