From a44ca157e6c7063ab7a0698234e1ff24bdaa7610 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 22 Mar 2011 17:14:37 -0700 Subject: [PATCH 1/5] added text to private message notification; user picture in popup --- app/views/notifications/_popup.haml | 1 + config/locales/diaspora/en.yml | 1 + public/stylesheets/sass/application.sass | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/app/views/notifications/_popup.haml b/app/views/notifications/_popup.haml index 5f4a17a6d..0dbc75d4c 100644 --- a/app/views/notifications/_popup.haml +++ b/app/views/notifications/_popup.haml @@ -2,5 +2,6 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. += person_image_tag(person) = link_to "#{person.name.titleize}", person_path(person.id) = object_link(note) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 6068fa2e7..2d1fe2fa9 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -276,6 +276,7 @@ en: notifications: request_accepted: "accepted your share request." new_request: "offered to share with you." + private_message: "sent you a message." comment_on_post: "commented on your" also_commented: "also commented on %{post_author}'s" mentioned: "has mentioned you in their" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index a619bb1eb..41331bb38 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1615,6 +1615,18 @@ h3 span.current_gs_step :padding 12px :color #fff + :vertical + :align middle + + .avatar + :display inline-block + :height 20px + :width 20px + :margin + :right 5px + :vertical + :align middle + .bottom_notification :position fixed :bottom 0 From 2b8b824230fcdd70d676c477ec24e8c71d3e44a8 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 22 Mar 2011 17:25:32 -0700 Subject: [PATCH 2/5] fixed private mention popup in firefox --- app/views/conversations/new.haml | 1 + public/stylesheets/vendor/autoSuggest.css | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/views/conversations/new.haml b/app/views/conversations/new.haml index 5f5dc359d..bd1e9d59d 100644 --- a/app/views/conversations/new.haml +++ b/app/views/conversations/new.haml @@ -37,6 +37,7 @@ = t('.to') .span-10.last = text_field_tag "contact_autocomplete" + .clearfix .span-2 %h4 diff --git a/public/stylesheets/vendor/autoSuggest.css b/public/stylesheets/vendor/autoSuggest.css index 225d3c410..802db6f58 100644 --- a/public/stylesheets/vendor/autoSuggest.css +++ b/public/stylesheets/vendor/autoSuggest.css @@ -32,6 +32,8 @@ ul.as-selections li.as-selection-item { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddeefe), to(#bfe0f1)); border: 1px solid #acc3ec; padding: 0; + padding-top: 3px; + padding-bottom: 3px; padding-left: 6px; border-radius: 5px; -webkit-border-radius: 5px; From fe44ee8230bd9bf5f71e3f02184336e3e992fa78 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 22 Mar 2011 17:29:03 -0700 Subject: [PATCH 3/5] fix tab order in publisher; removed 'to mention...' text --- app/views/shared/_publisher.html.haml | 12 +++++------- config/locales/diaspora/en.yml | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index a1c434c0a..bd541a011 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -28,31 +28,29 @@ %params #publisher_textarea_wrapper %ul#photodropzone - = status.text_area :fake_text, :rows => 2, :value => h(params[:prefill]) + = status.text_area :fake_text, :rows => 2, :value => h(params[:prefill]), :tabindex => 1 = status.hidden_field :text, :value => '', :class => 'clear_on_submit' - for aspect_id in aspect_ids = hidden_field_tag 'aspect_ids[]', aspect_id.to_s .options_and_submit - .mention_helper - - if aspect != :profile - %i= t('.mention_helper_text') - - else + - if aspect == :profile + .mention_helper .badges %i= t('.publishing_to') = aspect_badges(aspects_with_person, :link => false) .public_toggle %span#publisher_service_icons - = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage')#, :style=>"display:none;" + = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage') - if aspect == :all || :profile = status.hidden_field( :public) = image_tag "icons/globe.png", :title => t('.public'), :class => 'public_icon dim', :width => 16, :height => 16 - if current_user.services - for service in current_user.services = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider, :class => "service_icon dim", :id =>"#{service.provider}" - = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button' + = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button', :tabindex => 2 .facebox_content #question_mark_pane diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 2d1fe2fa9..73b35100f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -514,7 +514,6 @@ en: shared: publisher: - mention_helper_text: "to mention someone, press '@' and start typing their name" posting: "Posting..." share: "Share" post_a_message_to: "Post a message to %{aspect}" From 0cab18d5aa6bf0286e63d4ec7d314226b84e86a3 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 22 Mar 2011 17:43:11 -0700 Subject: [PATCH 4/5] autofocus username on login page --- app/views/sessions/new.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/sessions/new.haml b/app/views/sessions/new.haml index a738248c6..a567c9ec0 100644 --- a/app/views/sessions/new.haml +++ b/app/views/sessions/new.haml @@ -9,6 +9,7 @@ :javascript $(document).ready( function(){ + $("#user_username").focus(); $("form").submit(function(){ $(this).fadeOut(200, function(){ $('#logo').animate({ From e45a3503d056a5e0e2056860ecd2e17f8b8d61eb Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Tue, 22 Mar 2011 17:23:23 -0700 Subject: [PATCH 5/5] on aspect edit the contacts are now sorted by first name --- app/controllers/aspects_controller.rb | 2 +- db/seeds.rb | 6 +++--- spec/controllers/aspects_controller_spec.rb | 11 +++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index ed2d1faa1..19ccd919e 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -104,7 +104,7 @@ class AspectsController < ApplicationController def edit @aspect = current_user.aspects.where(:id => params[:id]).includes(:contacts => {:person => :profile}).first - @contacts = current_user.contacts.includes(:person => :profile) + @contacts = current_user.contacts.includes(:person => :profile).all.sort!{|x, y| x.person.profile.first_name <=> y.person.profile.first_name }.reverse! unless @aspect render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404 else diff --git a/db/seeds.rb b/db/seeds.rb index 60211460c..31c18380f 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -26,6 +26,6 @@ eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe") connect_users(bob, bob.aspects.first, alice, alice.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first) -alice.services << Services::Facebook.create(:user_id => alice.id, :uid => 'a1') -bob.services << Services::Facebook.create(:user_id => bob.id, :uid => 'b2') -eve.services << Services::Facebook.create(:user_id => eve.id, :uid => 'e3') +alice.services << Services::Facebook.create(:user_id => alice.id, :uid => 'a1', :access_token => "secret 1") +bob.services << Services::Facebook.create(:user_id => bob.id, :uid => 'b2', :access_token => "secret 2") +eve.services << Services::Facebook.create(:user_id => eve.id, :uid => 'e3', :access_token => "secret 3") diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index e1b421951..9a7f6ce21 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -284,10 +284,21 @@ describe AspectsController do end describe '#edit' do + before do + @bob = bob + @eve = eve + end it 'renders' do get :edit, :id => @alices_aspect_1.id response.should be_success end + + it 'assigns the contacts in alphabetical order' do + connect_users(@alice, @alices_aspect_1, @eve, @eve.aspects.first) + + get :edit, :id => @alices_aspect_1.id + assigns[:contacts].should == [@alice.contact_for(@bob.person), @alice.contact_for(@eve.person)] + end end describe "#toggle_contact_visibility" do