aspects now have edit pages accessible through the top nav
This commit is contained in:
parent
44d3c4bacd
commit
b029475421
10 changed files with 134 additions and 116 deletions
|
|
@ -86,6 +86,22 @@ class AspectsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@aspect = current_user.aspect_by_id params[:id]
|
||||||
|
@contacts = current_user.contacts.where(:pending => false)
|
||||||
|
unless @aspect
|
||||||
|
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
||||||
|
else
|
||||||
|
@aspect_ids = [@aspect.id]
|
||||||
|
@aspect_contacts = hashes_for_contacts Contact.all(:user_id => current_user.id, :aspect_ids.in => [@aspect.id], :pending => false)
|
||||||
|
@aspect_contacts_count = @aspect_contacts.count
|
||||||
|
|
||||||
|
@all_contacts = hashes_for_contacts @contacts
|
||||||
|
|
||||||
|
respond_with @aspect
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def manage
|
def manage
|
||||||
@aspect = :manage
|
@aspect = :manage
|
||||||
@contacts = current_user.contacts.where(:pending => false)
|
@contacts = current_user.contacts.where(:pending => false)
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#edit_aspect_pane
|
#edit_aspect_pane
|
||||||
- if @contacts.count > 0
|
- if @contacts.count > 0
|
||||||
%h4= t('.add_existing')
|
%h4= t('aspects.edit.add_existing')
|
||||||
= render 'shared/contact_list', :aspect_id => aspect.id, :contact_hashes => contacts, :manage => defined?(manage)
|
= render 'shared/contact_list', :aspect_id => aspect.id, :contact_hashes => contacts, :manage => defined?(manage)
|
||||||
|
|
||||||
= render 'shared/add_contact', :aspect_id => aspect.id
|
= render 'shared/add_contact', :aspect_id => aspect.id
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
%hr
|
%hr
|
||||||
= form_for aspect do |asp|
|
= form_for aspect do |asp|
|
||||||
= asp.text_field :name, :value => aspect.name
|
= asp.text_field :name, :value => aspect.name
|
||||||
= asp.submit t('.rename_aspect')
|
= asp.submit t('aspects.edit.rename_aspect')
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
.big_buttons
|
.big_buttons
|
||||||
= button_to t('.remove_aspect'), aspect, :method => "delete", :confirm => t('.confirm_remove_aspect')
|
= button_to t('aspects.edit.remove_aspect'), aspect, :method => "delete", :confirm => t('aspects.edit.confirm_remove_aspect')
|
||||||
|
|
||||||
|
|
|
||||||
27
app/views/aspects/edit.html.haml
Normal file
27
app/views/aspects/edit.html.haml
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
|
- content_for :head do
|
||||||
|
= include_javascripts :aspects
|
||||||
|
|
||||||
|
|
||||||
|
.span-24.last
|
||||||
|
%h3
|
||||||
|
= "Editing #{@aspect.name}"
|
||||||
|
|
||||||
|
.span-6.append-1
|
||||||
|
- if @contacts.count > 0
|
||||||
|
%h4= t('.add_existing')
|
||||||
|
= render 'shared/contact_list', :aspect_id => @aspect.id, :contact_hashes => @all_contacts
|
||||||
|
|
||||||
|
= render 'shared/add_contact', :aspect_id => @aspect.id
|
||||||
|
|
||||||
|
.span-4.last
|
||||||
|
= form_for @aspect do |asp|
|
||||||
|
= asp.text_field :name, :value => @aspect.name
|
||||||
|
= asp.submit t('.rename_aspect')
|
||||||
|
|
||||||
|
.big_buttons
|
||||||
|
= button_to t('.remove_aspect'), @aspect, :method => "delete", :confirm => t('.confirm_remove_aspect')
|
||||||
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
.container#head{:style => "position:relative;"}
|
.container{:style => "position:relative;"}
|
||||||
|
|
||||||
- if current_user
|
- if current_user
|
||||||
= link_to image_tag('logo_small.png', :height => "16px", :width => "161px", :class => "diaspora_header_logo"), root_path
|
= link_to image_tag('logo_small.png', :height => "16px", :width => "161px", :class => "diaspora_header_logo"), root_path
|
||||||
- else
|
- else
|
||||||
|
|
@ -41,19 +40,19 @@
|
||||||
%li= link_to t('.logout'), destroy_user_session_path
|
%li= link_to t('.logout'), destroy_user_session_path
|
||||||
|
|
||||||
-unless @landing_page
|
-unless @landing_page
|
||||||
#aspect_nav
|
%ul#aspect_nav
|
||||||
%ul
|
%li{:class => ("selected" if @aspect == :all)}
|
||||||
%li{:class => ("selected" if @aspect == :all)}
|
= link_to t('_home'), root_path, :class => 'home_selector'
|
||||||
= link_to t('_home'), root_path, :class => 'home_selector'
|
|
||||||
|
|
||||||
- for aspect in @all_aspects
|
- for aspect in @all_aspects
|
||||||
%li{:data=>{:guid=>aspect.id}, :class => ("selected" if current_aspect?(aspect))}
|
%li{:data=>{:guid=>aspect.id}, :class => ("selected" if current_aspect?(aspect))}
|
||||||
= link_to aspect.name, '#', :class => 'aspect_selector'
|
= link_to aspect.name, '#', :class => 'aspect_selector'
|
||||||
|
= link_to '▼', edit_aspect_path(aspect), :class => 'aspect_selector_edit'
|
||||||
|
|
||||||
%li
|
%li
|
||||||
= link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect')
|
= link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect')
|
||||||
|
|
||||||
.fancybox_content
|
.fancybox_content
|
||||||
#add_aspect_pane
|
#add_aspect_pane
|
||||||
= render "aspects/new_aspect"
|
= render "aspects/new_aspect"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
:locals => {:person => person,
|
:locals => {:person => person,
|
||||||
:contact => contact,
|
:contact => contact,
|
||||||
:aspects_with_person => @aspects_with_person,
|
:aspects_with_person => @aspects_with_person,
|
||||||
:aspects_without_person => @aspects.reject{ |aspect| @aspects_with_person.include?(aspect)}}
|
:aspects_without_person => @all_aspects.reject{ |aspect| @aspects_with_person.include?(aspect)}}
|
||||||
%br
|
%br
|
||||||
%hr{:style=>"width:300px;"}
|
%hr{:style=>"width:300px;"}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
|
|
||||||
%ul#aspect_list
|
%ul#aspect_list
|
||||||
- for aspect in @aspects
|
- for aspect in @all_aspects
|
||||||
%li.aspect{:data=>{:guid=>aspect.id}}
|
%li.aspect{:data=>{:guid=>aspect.id}}
|
||||||
|
|
||||||
.aspect_name
|
.aspect_name
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
.description
|
.description
|
||||||
= t('.ready_to_share')
|
= t('.ready_to_share')
|
||||||
%ul.inline_aspect_listing
|
%ul.inline_aspect_listing
|
||||||
- for aspect in @aspects
|
- for aspect in @all_aspects
|
||||||
%li= aspect
|
%li= aspect
|
||||||
|
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,11 @@ en:
|
||||||
all_contacts: "All contacts"
|
all_contacts: "All contacts"
|
||||||
cannot_remove: "Cannot remove person from last aspect. (If you want to disconnect from this person you must remove contact.)"
|
cannot_remove: "Cannot remove person from last aspect. (If you want to disconnect from this person you must remove contact.)"
|
||||||
aspects:
|
aspects:
|
||||||
|
edit:
|
||||||
|
remove_aspect: "Delete this aspect"
|
||||||
|
confirm_remove_aspect: "Are you sure you want to delete this aspect?"
|
||||||
|
add_existing: "Add an existing contact"
|
||||||
|
rename_aspect: "Rename aspect"
|
||||||
all_aspects_contacts:
|
all_aspects_contacts:
|
||||||
all_contacts: "All contacts"
|
all_contacts: "All contacts"
|
||||||
manage_aspects: "manage aspects"
|
manage_aspects: "manage aspects"
|
||||||
|
|
@ -181,11 +186,6 @@ en:
|
||||||
work: "Work"
|
work: "Work"
|
||||||
index:
|
index:
|
||||||
handle_explanation: "This is your diaspora handle. Like an email address, you can give this to people to reach you."
|
handle_explanation: "This is your diaspora handle. Like an email address, you can give this to people to reach you."
|
||||||
edit_aspect_pane:
|
|
||||||
remove_aspect: "Delete this aspect"
|
|
||||||
confirm_remove_aspect: "Are you sure you want to delete this aspect?"
|
|
||||||
add_existing: "Add an existing contact"
|
|
||||||
rename_aspect: "Rename aspect"
|
|
||||||
notifications:
|
notifications:
|
||||||
request_accepted: "accepted your share request."
|
request_accepted: "accepted your share request."
|
||||||
new_request: "offered to share with you."
|
new_request: "offered to share with you."
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ Diaspora::Application.routes.draw do
|
||||||
match 'aspects/add_to_aspect', :to => 'aspects#add_to_aspect', :as => 'add_to_aspect'
|
match 'aspects/add_to_aspect', :to => 'aspects#add_to_aspect', :as => 'add_to_aspect'
|
||||||
match 'aspects/remove_from_aspect',:to => 'aspects#remove_from_aspect', :as => 'remove_from_aspect'
|
match 'aspects/remove_from_aspect',:to => 'aspects#remove_from_aspect', :as => 'remove_from_aspect'
|
||||||
match 'aspects/manage', :to => 'aspects#manage'
|
match 'aspects/manage', :to => 'aspects#manage'
|
||||||
resources :aspects, :except => [:edit]
|
resources :aspects
|
||||||
|
|
||||||
#public routes
|
#public routes
|
||||||
match 'webfinger', :to => 'publics#webfinger'
|
match 'webfinger', :to => 'publics#webfinger'
|
||||||
|
|
|
||||||
|
|
@ -919,62 +919,81 @@ label
|
||||||
:height 100px
|
:height 100px
|
||||||
:width 100px
|
:width 100px
|
||||||
|
|
||||||
#aspect_nav
|
ul#aspect_nav
|
||||||
:margin
|
:margin
|
||||||
:top 3px
|
:top 3px
|
||||||
:bottom 2px
|
:bottom 2px
|
||||||
:bottom 0
|
:bottom 0
|
||||||
:color #000
|
:color #000
|
||||||
|
|
||||||
ul
|
:position relative
|
||||||
:position relative
|
:padding 0
|
||||||
:padding 0
|
:bottom 3px
|
||||||
:bottom 3px
|
:margin
|
||||||
:margin
|
:bottom 0
|
||||||
:bottom 0
|
|
||||||
|
|
||||||
> li
|
> li
|
||||||
:display inline
|
:display inline
|
||||||
:margin 0
|
:padding 1px 8px
|
||||||
:right 2px
|
:margin 0
|
||||||
:padding 4px 0
|
:right 2px
|
||||||
|
|
||||||
|
:-webkit-border-radius 2px
|
||||||
|
:-moz-border-radius 2px
|
||||||
|
:border-radius 2px
|
||||||
|
|
||||||
|
:text-shadow 0 1px 0 #444
|
||||||
|
|
||||||
|
:color #999
|
||||||
|
:max-width 120px
|
||||||
|
:overflow hidden
|
||||||
|
:text-overflow ellipsis
|
||||||
|
|
||||||
|
.aspect_selector_edit
|
||||||
|
:position absolute
|
||||||
|
:margin
|
||||||
|
:left -3px
|
||||||
|
:display none
|
||||||
|
:color #555
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
:color #eee
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
:background
|
||||||
|
:color #000
|
||||||
|
:color #eee
|
||||||
|
|
||||||
|
.aspect_selector_edit
|
||||||
|
:display inline
|
||||||
|
|
||||||
|
&.selected
|
||||||
|
:text-shadow 0 1px 0 #fff
|
||||||
|
:font
|
||||||
|
:weight bold
|
||||||
|
:background
|
||||||
|
:color rgb(235,235,235)
|
||||||
|
|
||||||
|
:border
|
||||||
|
:bottom 1px solid #fff
|
||||||
|
|
||||||
|
:color #444
|
||||||
|
|
||||||
|
.aspect_selector_edit
|
||||||
|
:margin
|
||||||
|
:left -4px
|
||||||
|
:color #777
|
||||||
|
&:hover
|
||||||
|
:color #999
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
:color #888
|
||||||
a
|
a
|
||||||
:-webkit-border-radius 2px
|
:color #000
|
||||||
:-moz-border-radius 2px
|
|
||||||
:border-radius 2px
|
|
||||||
|
|
||||||
:text-shadow 0 1px 0 #444
|
|
||||||
|
|
||||||
:padding 1px 5px
|
|
||||||
|
|
||||||
:color #999
|
|
||||||
:max-width 120px
|
|
||||||
:overflow hidden
|
|
||||||
:text-overflow ellipsis
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
:background
|
|
||||||
:color #000
|
|
||||||
:color #eee
|
|
||||||
|
|
||||||
&.selected a
|
|
||||||
:text-shadow 0 1px 0 #fff
|
|
||||||
:font
|
|
||||||
:weight bold
|
|
||||||
:background
|
|
||||||
:color rgb(235,235,235)
|
|
||||||
|
|
||||||
:border
|
|
||||||
:bottom 1px solid #fff
|
|
||||||
|
|
||||||
:color #444
|
|
||||||
&:hover
|
|
||||||
:color #888
|
|
||||||
a
|
|
||||||
:color #000
|
|
||||||
.new_requests
|
.new_requests
|
||||||
:color red
|
:color red
|
||||||
|
|
||||||
|
|
||||||
#global_search
|
#global_search
|
||||||
:display inline
|
:display inline
|
||||||
:position relative
|
:position relative
|
||||||
|
|
@ -1211,48 +1230,6 @@ ul#settings_nav
|
||||||
:margin 0
|
:margin 0
|
||||||
:padding 0
|
:padding 0
|
||||||
|
|
||||||
|
|
||||||
#edit_aspect_pane
|
|
||||||
:background
|
|
||||||
:color rgb(250,250,250)
|
|
||||||
:border 1px solid #ddd
|
|
||||||
:padding 11px
|
|
||||||
|
|
||||||
:-webkit-border-radius 4px
|
|
||||||
:-moz-border-radius 4px
|
|
||||||
:border-radius 4px
|
|
||||||
|
|
||||||
h2,h3
|
|
||||||
:border
|
|
||||||
:bottom 1px solid #999
|
|
||||||
|
|
||||||
h2,h3,h4
|
|
||||||
:font
|
|
||||||
:weight bold
|
|
||||||
:text
|
|
||||||
:shadow 0 1px #fff
|
|
||||||
|
|
||||||
h4 > span
|
|
||||||
:font
|
|
||||||
:weight normal
|
|
||||||
:size 12px
|
|
||||||
:color #999
|
|
||||||
|
|
||||||
.avatar
|
|
||||||
:margin-right -1px
|
|
||||||
:width 30px
|
|
||||||
:height 30px
|
|
||||||
|
|
||||||
#edit_aspect_pane
|
|
||||||
:margin
|
|
||||||
:top 12px
|
|
||||||
:background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FBFBFB), to(#F5F5F5))
|
|
||||||
:background -moz-linear-gradient(top, #FBFBFB, #F5F5F5)
|
|
||||||
|
|
||||||
:border 1px solid #eee
|
|
||||||
:top 1px solid #fff
|
|
||||||
:bottom 1px solid #fff
|
|
||||||
|
|
||||||
#left_pane
|
#left_pane
|
||||||
.aspect_listings
|
.aspect_listings
|
||||||
a
|
a
|
||||||
|
|
@ -1277,7 +1254,6 @@ ul#settings_nav
|
||||||
:border
|
:border
|
||||||
:bottom 1px solid #ddd
|
:bottom 1px solid #ddd
|
||||||
|
|
||||||
|
|
||||||
.floating.empty_message
|
.floating.empty_message
|
||||||
:margin
|
:margin
|
||||||
:bottom 24px
|
:bottom 24px
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue