use app.router.navagate for nav elements that don't expand (i.e. aspects, tags)

This commit is contained in:
danielgrippi 2012-01-08 14:41:43 -08:00
parent e0f8959647
commit 665517abfc
5 changed files with 18 additions and 25 deletions

View file

@ -4,8 +4,7 @@
%ul#aspect_nav.left_nav
%li.all_aspects
.root_element
= link_to t('aspects.index.your_aspects'), aspects_path
= link_to t('aspects.index.your_aspects'), aspects_path, :class => 'home_selector'
- if @stream.is_a?(Stream::Aspect)
%ul.sub_nav

View file

@ -2,9 +2,8 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
#aspect_stream_header
%h3
= stream.title
%h3#aspect_stream_header.stream_title
= stream.title
= render 'shared/publisher', :selected_aspects => stream.aspects, :aspect_ids => stream.aspect_ids, :for_all_aspects => stream.for_all_aspects?, :aspect => stream.aspect
= render 'aspects/no_posts_message'

View file

@ -1,14 +0,0 @@
#selected_aspect_contacts.section
.title.no_icon
%h5
= @stream.contacts_title
.content
- if @stream.people.size > 0
- for person in @stream.people.sample(15)
= person_image_link(person)
= link_to @stream.contacts_link_title, @stream.contacts_link, :id => "view_all_contacts_link"
- else
= t('.no_contacts')
= link_to t('.manage_your_aspects'), contacts_link

View file

@ -31,21 +31,21 @@
.section
%ul.left_nav
%li
= link_to t("streams.multi.title"), multi_path, :class => 'home_selector'
= link_to t("streams.multi.title"), multi_path, :class => 'home_selector', :rel => 'backbone'
= render 'aspects/aspect_listings', :stream => @stream
%ul.left_nav
%li
= link_to t('streams.mentions.title'), mentions_path, :class => 'home_selector'
= link_to t('streams.mentions.title'), mentions_path, :class => 'home_selector', :rel => 'backbone'
%ul.left_nav
%li
= link_to t('streams.comment_stream.title'), comment_stream_path, :class => 'home_selector'
= link_to t('streams.comment_stream.title'), comment_stream_path, :class => 'home_selector', :rel => 'backbone'
%ul.left_nav
%li
= link_to t('streams.like_stream.title'), like_stream_path, :class => 'home_selector'
= link_to t('streams.like_stream.title'), like_stream_path, :class => 'home_selector', :rel => 'backbone'
#followed_tags_listing
= render 'tags/followed_tags_listings'
@ -58,7 +58,7 @@
/= render 'aspects/selected_contacts', :stream => @stream
#selected_aspect_contacts.section
.title.no_icon
%h5
%h5.stream_title
= @stream.title
.content

View file

@ -10,7 +10,7 @@ var app = {
},
initialize: function() {
app.router = new app.Router;
app.router = new app.Router();
if(this._user){
app.header = new app.views.Header;
@ -19,6 +19,15 @@ var app = {
}
Backbone.history.start({pushState: true});
// there's probably a better way to do this...
$("a[rel=backbone]").bind("click", function(evt){
evt.preventDefault();
var link = $(this);
$(".stream_title").text(link.text())
app.router.navigate(link.attr("href").substring(1) ,true)
})
}
};