From c6b8d75313d0bde13342f411b1ddca9be3248e9b Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 22 May 2012 19:00:22 -0700 Subject: [PATCH] DG MS; cool header with background in new stream --- app/assets/javascripts/app/pages/stream.js | 4 ++ .../app/views/post/stream_frame.js | 10 ++-- app/assets/stylesheets/new_styles/_base.scss | 24 +++++++++ .../stylesheets/new_styles/_canvas.scss | 5 ++ app/assets/templates/profile.jst.hbs | 25 +++------ app/assets/templates/stream.jst.hbs | 52 ++++++++++++++++++- app/presenters/user_presenter.rb | 7 ++- 7 files changed, 99 insertions(+), 28 deletions(-) diff --git a/app/assets/javascripts/app/pages/stream.js b/app/assets/javascripts/app/pages/stream.js index 7dec17e8e..578b1c6fb 100644 --- a/app/assets/javascripts/app/pages/stream.js +++ b/app/assets/javascripts/app/pages/stream.js @@ -25,5 +25,9 @@ app.pages.Stream = app.views.Base.extend({ this.stream.on("frame:interacted", function(post){ interactions.setInteractions(post) }) + }, + + postRenderTemplate : function() { + this.$("#header").css("background-image", "url(" + app.currentUser.get("wallpaper") + ")") } }); diff --git a/app/assets/javascripts/app/views/post/stream_frame.js b/app/assets/javascripts/app/views/post/stream_frame.js index 6d2decc25..ecc503373 100644 --- a/app/assets/javascripts/app/views/post/stream_frame.js +++ b/app/assets/javascripts/app/views/post/stream_frame.js @@ -8,21 +8,17 @@ app.views.Post.StreamFrame = app.views.Base.extend({ '.stream-frame-feedback' : 'feedbackView' }, - initialize : function(options) { this.stream = options.stream this.smallFrameView = new app.views.Post.SmallFrame({model : this.model}) this.feedbackView = new app.views.FeedbackActions({ model: this.model }) }, - events : _.extend({ + events : { 'click .content' : 'triggerInteracted' - }, app.views.Post.SmallFrame.prototype.events), - + }, triggerInteracted : function() { this.stream.trigger("frame:interacted", this.model) - }, - - goToPost : $.noop + } }); diff --git a/app/assets/stylesheets/new_styles/_base.scss b/app/assets/stylesheets/new_styles/_base.scss index 7a75574dd..ab3d361dc 100644 --- a/app/assets/stylesheets/new_styles/_base.scss +++ b/app/assets/stylesheets/new_styles/_base.scss @@ -281,6 +281,30 @@ $bring-dark-accent-forward-color: #DDD; } } +#header { + position : fixed; + top : 0; + width : 100%; + padding : 15px; + z-index : 30; + + -webkit-box-shadow : inset 0 -10px 10px -8px rgba(0,0,0,0.8); + -moz-box-shadow : inset 0 -10px 10px -8px rgba(0,0,0,0.8); + + border-bottom : 1px solid #333; + + color : #fff; + background : { + color : #333; + size : cover; + attachment : fixed; + } + + h1 { + @include opacity(0.4); + } +} + /* bootstrap label fixes for Roboto */ .label { padding : 2px 5px; diff --git a/app/assets/stylesheets/new_styles/_canvas.scss b/app/assets/stylesheets/new_styles/_canvas.scss index 76a0738dc..1796e3b1d 100644 --- a/app/assets/stylesheets/new_styles/_canvas.scss +++ b/app/assets/stylesheets/new_styles/_canvas.scss @@ -383,6 +383,11 @@ } } + + #stream-interactions, + #stream-content { + padding-top : 90px; + } } #stream-content { diff --git a/app/assets/templates/profile.jst.hbs b/app/assets/templates/profile.jst.hbs index 64c977c85..500ef2275 100644 --- a/app/assets/templates/profile.jst.hbs +++ b/app/assets/templates/profile.jst.hbs @@ -4,17 +4,6 @@
- {{#if showFollowButton}} - - - - - FOLLOW - - - - {{/if}} - {{#if current_user.guid}} @@ -24,6 +13,12 @@ + + + + + + {{else}} @@ -33,14 +28,6 @@ {{/if}} - - {{#if is_own_profile}} - - - - - - {{/if}}
diff --git a/app/assets/templates/stream.jst.hbs b/app/assets/templates/stream.jst.hbs index 1da65dd22..0ed5dd02f 100644 --- a/app/assets/templates/stream.jst.hbs +++ b/app/assets/templates/stream.jst.hbs @@ -1,6 +1,56 @@ + +
-
diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index 3612d562d..ba35b80fd 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -13,7 +13,8 @@ class UserPresenter :aspects => aspects, :services => services, :following_count => self.user.contacts.receiving.count, - :configured_services => self.configured_services + :configured_services => self.configured_services, + :wallpaper => self.wallpaper } ).to_json(options) end @@ -26,6 +27,10 @@ class UserPresenter user.services.map{|service| service.provider } end + def wallpaper + user.person.profile.wallpaper.url + end + def aspects AspectPresenter.as_collection(user.aspects) end