From 7466808112bf98b26c270a7afa1568df80c82124 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 20 Feb 2012 20:26:24 -0800 Subject: [PATCH] created post author view. --- public/javascripts/app/pages/post-viewer.js | 7 +++++- .../app/templates/post-viewer.handlebars | 24 ++++--------------- .../templates/post-viewer/author.handlebars | 16 +++++++++++++ .../javascripts/app/views/post_author_view.js | 9 +++++++ public/stylesheets/sass/new-templates.scss | 2 +- 5 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 public/javascripts/app/templates/post-viewer/author.handlebars create mode 100644 public/javascripts/app/views/post_author_view.js diff --git a/public/javascripts/app/pages/post-viewer.js b/public/javascripts/app/pages/post-viewer.js index eedadfb7b..bb868f4e9 100644 --- a/public/javascripts/app/pages/post-viewer.js +++ b/public/javascripts/app/pages/post-viewer.js @@ -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(); }, diff --git a/public/javascripts/app/templates/post-viewer.handlebars b/public/javascripts/app/templates/post-viewer.handlebars index 6182ec7c4..3c690065f 100644 --- a/public/javascripts/app/templates/post-viewer.handlebars +++ b/public/javascripts/app/templates/post-viewer.handlebars @@ -1,31 +1,15 @@
-
-
-
- - - -
- -
- - {{author.name}} - - -
- - {{created_at}} -
-
-
-
+
+ + +
diff --git a/public/javascripts/app/templates/post-viewer/author.handlebars b/public/javascripts/app/templates/post-viewer/author.handlebars new file mode 100644 index 000000000..904f4d0c6 --- /dev/null +++ b/public/javascripts/app/templates/post-viewer/author.handlebars @@ -0,0 +1,16 @@ + + + diff --git a/public/javascripts/app/views/post_author_view.js b/public/javascripts/app/views/post_author_view.js new file mode 100644 index 000000000..4a114217a --- /dev/null +++ b/public/javascripts/app/views/post_author_view.js @@ -0,0 +1,9 @@ +app.views.PostViewerAuthor = app.views.Base.extend({ + + id : "post-author", + className : "media", + + templateName: "post-viewer/author" + +}) + diff --git a/public/stylesheets/sass/new-templates.scss b/public/stylesheets/sass/new-templates.scss index 8f30f09ab..e57759500 100644 --- a/public/stylesheets/sass/new-templates.scss +++ b/public/stylesheets/sass/new-templates.scss @@ -252,7 +252,7 @@ $light-grey: #999; width: 100%; } -.header-container { +#header-container { padding: 20px; }