diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index e507bf6d0..6e013d3d5 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -86,6 +86,22 @@ class AspectsController < ApplicationController 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 @aspect = :manage @contacts = current_user.contacts.where(:pending => false) diff --git a/app/views/aspects/_edit_aspect_pane.html.haml b/app/views/aspects/_edit_aspect_pane.html.haml index 34de8e729..e472d17cb 100644 --- a/app/views/aspects/_edit_aspect_pane.html.haml +++ b/app/views/aspects/_edit_aspect_pane.html.haml @@ -7,7 +7,7 @@ #edit_aspect_pane - 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/add_contact', :aspect_id => aspect.id @@ -15,9 +15,9 @@ %hr = form_for aspect do |asp| = asp.text_field :name, :value => aspect.name - = asp.submit t('.rename_aspect') + = asp.submit t('aspects.edit.rename_aspect') %hr .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') diff --git a/app/views/aspects/edit.html.haml b/app/views/aspects/edit.html.haml new file mode 100644 index 000000000..e70d52579 --- /dev/null +++ b/app/views/aspects/edit.html.haml @@ -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') + diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index dc07b0797..010416522 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -.container#head{:style => "position:relative;"} - +.container{:style => "position:relative;"} - if current_user = link_to image_tag('logo_small.png', :height => "16px", :width => "161px", :class => "diaspora_header_logo"), root_path - else @@ -41,19 +40,19 @@ %li= link_to t('.logout'), destroy_user_session_path -unless @landing_page - #aspect_nav - %ul - %li{:class => ("selected" if @aspect == :all)} - = link_to t('_home'), root_path, :class => 'home_selector' + %ul#aspect_nav + %li{:class => ("selected" if @aspect == :all)} + = link_to t('_home'), root_path, :class => 'home_selector' - - for aspect in @all_aspects - %li{:data=>{:guid=>aspect.id}, :class => ("selected" if current_aspect?(aspect))} - = link_to aspect.name, '#', :class => 'aspect_selector' + - for aspect in @all_aspects + %li{:data=>{:guid=>aspect.id}, :class => ("selected" if current_aspect?(aspect))} + = link_to aspect.name, '#', :class => 'aspect_selector' + = link_to '▼', edit_aspect_path(aspect), :class => 'aspect_selector_edit' - %li - = link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect') + %li + = link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect') - .fancybox_content - #add_aspect_pane - = render "aspects/new_aspect" + .fancybox_content + #add_aspect_pane + = render "aspects/new_aspect" diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index 716ec4681..31b37f76d 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -31,7 +31,7 @@ :locals => {:person => person, :contact => contact, :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 %hr{:style=>"width:300px;"} @@ -52,6 +52,6 @@ .span-4.last - unless person.profile.birthday.blank? - %h3 + %h3 =t('.born') = birthday_format(person.profile.birthday) diff --git a/app/views/users/getting_started/_step_2.html.haml b/app/views/users/getting_started/_step_2.html.haml index 8f6bcf4a7..4e53f7da0 100644 --- a/app/views/users/getting_started/_step_2.html.haml +++ b/app/views/users/getting_started/_step_2.html.haml @@ -26,7 +26,7 @@ %ul#aspect_list - - for aspect in @aspects + - for aspect in @all_aspects %li.aspect{:data=>{:guid=>aspect.id}} .aspect_name diff --git a/app/views/users/getting_started/_step_4.html.haml b/app/views/users/getting_started/_step_4.html.haml index 9d4c02855..3661bf972 100644 --- a/app/views/users/getting_started/_step_4.html.haml +++ b/app/views/users/getting_started/_step_4.html.haml @@ -8,7 +8,7 @@ .description = t('.ready_to_share') %ul.inline_aspect_listing - - for aspect in @aspects + - for aspect in @all_aspects %li= aspect %br diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index a7633c99b..b05c83d36 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -127,6 +127,11 @@ en: all_contacts: "All contacts" cannot_remove: "Cannot remove person from last aspect. (If you want to disconnect from this person you must remove contact.)" 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_contacts: "All contacts" manage_aspects: "manage aspects" @@ -181,11 +186,6 @@ en: work: "Work" index: 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: request_accepted: "accepted your share request." new_request: "offered to share with you." diff --git a/config/routes.rb b/config/routes.rb index e8b45c3ac..cc14be4e1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ Diaspora::Application.routes.draw do resources :comments, :only => [:create] resources :requests, :only => [:destroy, :create] resources :services - + resources :notifications resources :posts, :only => [:show], :path => '/p/' @@ -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/remove_from_aspect',:to => 'aspects#remove_from_aspect', :as => 'remove_from_aspect' match 'aspects/manage', :to => 'aspects#manage' - resources :aspects, :except => [:edit] + resources :aspects #public routes match 'webfinger', :to => 'publics#webfinger' diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 6a9e50783..da1d591f1 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -919,62 +919,81 @@ label :height 100px :width 100px -#aspect_nav +ul#aspect_nav :margin :top 3px :bottom 2px :bottom 0 :color #000 - ul - :position relative - :padding 0 - :bottom 3px - :margin - :bottom 0 + :position relative + :padding 0 + :bottom 3px + :margin + :bottom 0 - > li - :display inline - :margin 0 - :right 2px - :padding 4px 0 + > li + :display inline + :padding 1px 8px + :margin 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 - :-webkit-border-radius 2px - :-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 + :color #000 .new_requests :color red + #global_search :display inline :position relative @@ -1211,48 +1230,6 @@ ul#settings_nav :margin 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 .aspect_listings a @@ -1277,7 +1254,6 @@ ul#settings_nav :border :bottom 1px solid #ddd - .floating.empty_message :margin :bottom 24px