From e78ab14fc51c3f73c2012e568e9dc1fc8ec3068a Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 23 Feb 2012 12:18:29 -0800 Subject: [PATCH] remove top-level divs from handlebars templates -- move that logic into the backbone view. --- public/javascripts/app/pages/post-viewer.js | 2 +- .../content/activity-streams-photo.handlebars | 13 +++---- .../content/multi-photo.handlebars | 20 +++++------ .../post-viewer/content/note.handlebars | 2 +- .../content/photo-backdrop.handlebars | 2 +- .../post-viewer/content/rich-media.handlebars | 2 +- .../status-with-photo-backdrop.handlebars | 2 +- .../post-viewer/content/status.handlebars | 8 ++--- public/stylesheets/sass/new-templates.scss | 34 +++++++++---------- 9 files changed, 39 insertions(+), 46 deletions(-) diff --git a/public/javascripts/app/pages/post-viewer.js b/public/javascripts/app/pages/post-viewer.js index 898262a2c..dd6fe8d7a 100644 --- a/public/javascripts/app/pages/post-viewer.js +++ b/public/javascripts/app/pages/post-viewer.js @@ -24,7 +24,7 @@ app.pages.PostViewer = app.views.Base.extend({ this.postView = new app.views.Post({ model : this.model, - className : "post loaded", + className : this.options.postTemplateName + " post loaded", templateName : "post-viewer/content/" + this.options.postTemplateName, attributes : {"data-template" : this.options.postTemplateName} }); diff --git a/public/javascripts/app/templates/post-viewer/content/activity-streams-photo.handlebars b/public/javascripts/app/templates/post-viewer/content/activity-streams-photo.handlebars index 3091970a0..30e543995 100644 --- a/public/javascripts/app/templates/post-viewer/content/activity-streams-photo.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/activity-streams-photo.handlebars @@ -1,10 +1,7 @@ -
-
-
- - - -
+
+
- diff --git a/public/javascripts/app/templates/post-viewer/content/multi-photo.handlebars b/public/javascripts/app/templates/post-viewer/content/multi-photo.handlebars index fc7b28e82..d33548782 100644 --- a/public/javascripts/app/templates/post-viewer/content/multi-photo.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/multi-photo.handlebars @@ -1,13 +1,11 @@ -
-

- {{{text}}} -

+

+ {{{text}}} +

-
- {{#each photos}} -
- -
- {{/each}} -
+
+ {{#each photos}} +
+ +
+ {{/each}}
diff --git a/public/javascripts/app/templates/post-viewer/content/note.handlebars b/public/javascripts/app/templates/post-viewer/content/note.handlebars index b03c4b950..40f1369b4 100644 --- a/public/javascripts/app/templates/post-viewer/content/note.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/note.handlebars @@ -1,4 +1,4 @@ -
+

A HEADING

diff --git a/public/javascripts/app/templates/post-viewer/content/photo-backdrop.handlebars b/public/javascripts/app/templates/post-viewer/content/photo-backdrop.handlebars index e52f14735..eca34ca0b 100644 --- a/public/javascripts/app/templates/post-viewer/content/photo-backdrop.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/photo-backdrop.handlebars @@ -1,4 +1,4 @@ {{#each photos}} -
+
{{/each}} diff --git a/public/javascripts/app/templates/post-viewer/content/rich-media.handlebars b/public/javascripts/app/templates/post-viewer/content/rich-media.handlebars index a85c8b956..5ffc618f2 100644 --- a/public/javascripts/app/templates/post-viewer/content/rich-media.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/rich-media.handlebars @@ -1,4 +1,4 @@ -
+
{{{o_embed_cache.data.html}}} diff --git a/public/javascripts/app/templates/post-viewer/content/status-with-photo-backdrop.handlebars b/public/javascripts/app/templates/post-viewer/content/status-with-photo-backdrop.handlebars index fc1175b58..5afce299c 100644 --- a/public/javascripts/app/templates/post-viewer/content/status-with-photo-backdrop.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/status-with-photo-backdrop.handlebars @@ -1,5 +1,5 @@ {{#each photos}} -
+

{{{../text}}} diff --git a/public/javascripts/app/templates/post-viewer/content/status.handlebars b/public/javascripts/app/templates/post-viewer/content/status.handlebars index 992194ac6..8585a42c9 100644 --- a/public/javascripts/app/templates/post-viewer/content/status.handlebars +++ b/public/javascripts/app/templates/post-viewer/content/status.handlebars @@ -1,5 +1,3 @@ -
-

- {{{text}}} -

-
+

+ {{{text}}} +

diff --git a/public/stylesheets/sass/new-templates.scss b/public/stylesheets/sass/new-templates.scss index 31399ef6e..c732294dd 100644 --- a/public/stylesheets/sass/new-templates.scss +++ b/public/stylesheets/sass/new-templates.scss @@ -111,10 +111,6 @@ $light-grey: #999; } /* styles */ - -.bump-left { @include animation(bump-left) } -.bump-right { @include animation(bump-right) } - .multi-photo { .img-bounding-box { @include center(horizontal); @@ -137,7 +133,7 @@ $light-grey: #999; width: 100%; } -.note { +.note-content { width: 550px; padding-bottom: 50px; @@ -151,16 +147,19 @@ $light-grey: #999; } } -.status { +.status, +.status-with-photo-backdrop +{ h1 { font-weight: bold; font-size: 40px; } +} - &.photo-backdrop { - h1 { - font-size: 100px; - } +.status-with-photo-backdrop { + h1 { + font-size: 100px; + color: #fff; } } @@ -175,10 +174,8 @@ $light-grey: #999; background-color: rgba(0,0,0,0.5); } -.backdrop, -.photo-backdrop { +.post { @include center(); - @include background-cover(); position: absolute; @@ -189,6 +186,13 @@ $light-grey: #999; height: 100%; } +.photo-fill { + @include background-cover(); + position: absolute; + height: 100%; + width: 100%; +} + .photo-backdrop { h1 { color: #fff; @@ -516,7 +520,3 @@ $light-grey: #999; } } } - -#post-content { - padding-top: 50px; -}