DG MS; cool header with background in new stream

This commit is contained in:
danielgrippi 2012-05-22 19:00:22 -07:00
parent 0c7492b94d
commit c6b8d75313
7 changed files with 99 additions and 28 deletions

View file

@ -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") + ")")
}
});

View file

@ -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
}
});

View file

@ -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;

View file

@ -383,6 +383,11 @@
}
}
#stream-interactions,
#stream-content {
padding-top : 90px;
}
}
#stream-content {

View file

@ -4,17 +4,6 @@
<div class="container">
<div id="top-right-nav">
{{#if showFollowButton}}
<a href="#" onClick="alert('Not yet implemented!')" id="follow-button">
<span class="label label-inverse">
<i class="icon-plus icon-white"></i>
<span>
FOLLOW
</span>
</span>
</a>
{{/if}}
{{#if current_user.guid}}
<a href="/" id="home-button">
<span class="label label-inverse">
@ -24,6 +13,12 @@
</span>
</span>
</a>
<a href="/users/sign_out" title="Log out" id="logout-button">
<span class="label label-inverse">
<i class="icon-off icon-white"></i>
</span>
</a>
{{else}}
<a href="/" id="home-button">
<span class="label label-inverse">
@ -33,14 +28,6 @@
</span>
</a>
{{/if}}
{{#if is_own_profile}}
<a href="/users/sign_out" title="Log out" id="logout-button">
<span class="label label-inverse">
<i class="icon-off icon-white"></i>
</span>
</a>
{{/if}}
</div>
<section id="profile-info"/>

View file

@ -1,6 +1,56 @@
<div id="header">
<div class="container" style="position:relative;">
<div id="top-right-nav">
{{#if current_user.guid}}
<a href="/notifications" title="Notifications" id="notifications-button">
<span class="label label-inverse">
{{current_user.notifications_count}}
</span>
</a>
<a href="/people/{{current_user.guid}}?ex=true" id="profile-button">
<span class="label label-inverse">
<i class="icon-user icon-white"></i>
<span>
PROFILE
</span>
</span>
</a>
<a href="/" id="home-button">
<span class="label label-inverse">
<i class="icon-home icon-white"></i>
<span>
HOME
</span>
</span>
</a>
<a href="/users/sign_out" title="Log out" id="logout-button">
<span class="label label-inverse">
<i class="icon-off icon-white"></i>
</span>
</a>
{{else}}
<a href="/" id="home-button">
<span class="label label-inverse">
<span>
DIASPORA
</span>
</span>
</a>
{{/if}}
</div>
<h1>
DIASPORA
</h1>
</div>
</div>
<div id="stream">
<div class="container">
<div class="row">
<div class="background offset5"></div>
</div>

View file

@ -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