RS, DG; display the correct tab on manage, change edit to manage
This commit is contained in:
parent
a7c6e22e01
commit
da8ec589b7
7 changed files with 28 additions and 26 deletions
|
|
@ -53,8 +53,8 @@ class AspectsController < ApplicationController
|
|||
respond_with @aspect
|
||||
end
|
||||
|
||||
def edit
|
||||
@aspects = current_user.aspects
|
||||
def manage
|
||||
@aspect = :manage
|
||||
@remote_requests = Request.for_user current_user
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
module ApplicationHelper
|
||||
|
||||
def current_aspect?(aspect)
|
||||
@aspect != :all && @aspect.id == aspect.id
|
||||
!@aspect.is_a?(Symbol) && @aspect.id == aspect.id
|
||||
end
|
||||
|
||||
def object_path(object, opts = {})
|
||||
|
|
|
|||
|
|
@ -68,26 +68,7 @@
|
|||
%li= link_to "logout", destroy_user_session_path
|
||||
|
||||
= render "shared/aspect_nav"
|
||||
|
||||
#aspect_header
|
||||
.container
|
||||
.span-5.last
|
||||
- if @person
|
||||
%h1
|
||||
= @person.real_name
|
||||
- else
|
||||
- if @aspect == :all
|
||||
%h1
|
||||
= link_to "All Aspects", root_path
|
||||
- else
|
||||
%h1
|
||||
= link_to @aspect.name, @aspect
|
||||
|
||||
.page_title
|
||||
= yield :page_title
|
||||
|
||||
.span-19.last{ :style => "position:relative;" }
|
||||
= yield :publish
|
||||
= render "shared/sub_header"
|
||||
|
||||
.container
|
||||
.span-5.last
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
%li{:class => ("selected" if @aspect == :all)}
|
||||
= link_to "All Aspects", root_url
|
||||
|
||||
%li{ :style => "margin-right:0;" }
|
||||
= link_to ( (@request_count == 0)? "manage" : "manage (#{@request_count})"), edit_aspect_path(Aspect.first), :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects"
|
||||
%li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)}
|
||||
= link_to ( (@request_count == 0)? "manage" : "manage (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects"
|
||||
|
||||
.yo{ :style => "display:none;"}
|
||||
#add_aspect_pane
|
||||
|
|
|
|||
20
app/views/shared/_sub_header.haml
Normal file
20
app/views/shared/_sub_header.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#aspect_header
|
||||
.container
|
||||
.span-5.last
|
||||
- if @person
|
||||
%h1
|
||||
= @person.real_name
|
||||
- else
|
||||
%h1
|
||||
- if @aspect == :all
|
||||
= link_to "All Aspects", root_path
|
||||
- elsif @aspect == :manage
|
||||
= link_to "Manage Aspects", root_path
|
||||
- else
|
||||
= link_to @aspect.name, @aspect
|
||||
|
||||
.page_title
|
||||
= yield :page_title
|
||||
|
||||
.span-19.last{ :style => "position:relative;" }
|
||||
= yield :publish
|
||||
|
|
@ -27,7 +27,8 @@ Diaspora::Application.routes.draw do
|
|||
resources :photos, :except => [:index]
|
||||
resources :albums
|
||||
|
||||
resources :aspects
|
||||
match 'aspects/manage', :to => 'aspects#manage'
|
||||
resources :aspects, :except => [:edit]
|
||||
match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends'
|
||||
match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue