From ea00d35f1fc4743972b0b2c6c12d6228d8dc2c88 Mon Sep 17 00:00:00 2001 From: danielvincent <danielgrippi@gmail.com> Date: Tue, 19 Oct 2010 12:10:22 -0700 Subject: [PATCH] padding on stream fix. added add aspect button in aspect nav. --- app/controllers/aspects_controller.rb | 2 +- app/views/aspects/manage.html.haml | 8 +++-- app/views/people/_person.html.haml | 25 ++++++++------- app/views/photos/_photo.haml | 4 +++ app/views/shared/_aspect_nav.haml | 4 ++- .../status_messages/_status_message.html.haml | 2 +- app/views/users/edit.html.haml | 5 +-- config/locales/diaspora/en.yml | 2 ++ public/javascripts/view.js | 2 +- public/stylesheets/sass/application.sass | 32 +++++++++++-------- 10 files changed, 52 insertions(+), 34 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 26aafb771f..35ddbaec9f 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -23,7 +23,7 @@ class AspectsController < ApplicationController else flash[:error] = I18n.t('aspects.create.failure') end - respond_with :location => aspects_manage_path + respond_with @aspect end def new diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 6c0e0150c0..6cd67166d5 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -6,9 +6,11 @@ = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'aspect-edit.js' -%h2 - Manage aspects - = link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect')) +#section_header + %h2 + Manage aspects + .right + = link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :class => "new_aspect add_aspect_button button", :title => t('.add_a_new_aspect')) .span-4.append-1.last %h3=t('.requests') diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 3e20a658ae..b08a2db61e 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -10,18 +10,19 @@ %span.from = link_to person.real_name, person_path(person) + .right{:style=>"display:inline;"} + - if person.id == current_user.person.id + thats you! + - elsif current_user.friends.include?(person) + Already friends + - elsif current_user.pending_requests.find_by_person_id(person.id) + = link_to =t('.pending_request'), aspects_manage_path + - else + = form_for Request.new do |f| + = f.select(:aspect_id, @aspects_dropdown_array) + = f.hidden_field :destination_url, :value => person.diaspora_handle + = f.submit t('.add_friend') + .info = person.diaspora_handle - .right{ :style => "display:inline;top:0;" } - - if person.id == current_user.person.id - thats you! - - elsif current_user.friends.include?(person) - Already friends - - elsif current_user.pending_requests.find_by_person_id(person.id) - = link_to =t('.pending_request'), aspects_manage_path - - else - = form_for Request.new do |f| - = f.select(:aspect_id, @aspects_dropdown_array) - = f.hidden_field :destination_url, :value => person.diaspora_handle - = f.submit t('.add_friend') diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 9d48ac8b6e..01baaf74e5 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -18,6 +18,10 @@ - for aspect in current_user.aspects_with_post( post.id ) %li= link_to aspect.name, aspect + - if current_user.owns?(post) + .right + = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" + =t('.posted_a_new_photo_to') = link_to post.album.name, object_path(post.album) diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index d4e4e404fc..11d836d892 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -9,12 +9,14 @@ - for aspect in @aspects %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect + %li + = link_to '+', '#add_aspect_pane', :class => "add_aspect_button" %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} = link_to ( (@request_count == 0)? t('.manage') : "#{t('.manage')} (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => t('.manage_your_aspects') - .yo{ :style => "display:none;"} + .fancybox_content #add_aspect_pane = render "aspects/new_aspect" diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 8b2437ae9f..47485d6856 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -19,7 +19,7 @@ %li= link_to aspect.name, aspect - if current_user.owns?(post) - .destroy_link + .right = render "shared/reshare", :post => post, :current_user => current_user = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 984be9a53d..48b266c09c 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -12,8 +12,9 @@ } }); -%h2 - Settings +#section_header + %h2 + Settings %ul#settings_nav %li=link_to 'Profile', '#', :class => 'profile' %li=link_to 'Account', '#', :class => 'account' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 2e41d08919..2b4aff4c4a 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -149,6 +149,8 @@ en: photo: show_comments: "show comments" posted_a_new_photo_to: "posted a new photo to" + delete: "Delete" + are_you_sure: "Are you sure?" new: new_photo: "New Photo" back_to_list: "Back to List" diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 7d903d1e88..677a369795 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -26,7 +26,7 @@ $(document).ready(function(){ }); //buttons////// - $("#add_aspect_button").fancybox({ 'titleShow' : false , 'hideOnOverlayClick' : false }); + $(".add_aspect_button").fancybox({ 'titleShow' : false , 'hideOnOverlayClick' : false }); $("#add_request_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); $(".invite_user_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); $(".add_request_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 8e330790b9..360d64967d 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -187,6 +187,7 @@ ul#stream :min-height 50px :list-style none :padding 12px 0 + :right 12px :border :bottom 1px solid #eee @@ -195,12 +196,9 @@ ul#stream :color #fafafa :border :bottom 1px solid #ddd - .destroy_link + .right :display inline - .right - :top 0 - .avatar :border-radius 5px @@ -216,9 +214,6 @@ li.message :margin :right 15px - .delete:hover - :background #eee - .content :margin :top -4px @@ -292,14 +287,14 @@ li.message :color #005D9C -.destroy_link .reshare_pane .reshare_button a.inactive +.right .reshare_pane .reshare_button a.inactive :color #ccc &:hover :text :decoration none :cursor default -.destroy_link .reshare_pane +.right .reshare_pane :margin :left 5px :right 5px @@ -495,12 +490,13 @@ ul.comment_set a :padding 3px -li.message .from .destroy_link +li.message .from .right :display none :position absolute - :right 0 + :right 12px :font :size 12px + :color #999 a :color #999 :font @@ -1036,5 +1032,15 @@ header :display none #section_header - :background - :color #aaa + :width 100% + :border + :bottom 2px solid #777 + :position relative + + :margin + :bottom 2em + :padding + :bottom 1em + + h2 + :display inline -- GitLab