From 5223a2d906f09ef6afd510e1657d85c894630205 Mon Sep 17 00:00:00 2001 From: sjain1107 Date: Fri, 23 Aug 2013 18:50:47 +0530 Subject: [PATCH 1/4] Adding ignore user icon Adding ignore user icon Added jquery Changed profile.js --- app/assets/javascripts/people.js | 10 ++++++++++ app/assets/javascripts/profile.js | 3 ++- app/assets/stylesheets/profile.css.scss | 6 ++---- app/views/people/_profile_sidebar.html.haml | 17 +++++++++-------- config/locales/diaspora/en.yml | 1 + 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/people.js b/app/assets/javascripts/people.js index a2cf5a9ab..57ae2a3bf 100644 --- a/app/assets/javascripts/people.js +++ b/app/assets/javascripts/people.js @@ -9,4 +9,14 @@ $(document).ready(function() { $('#profile_buttons .profile_button div').tooltip({placement: 'bottom'}); $('#profile_buttons .sharing_message_container').tooltip({placement: 'bottom'}); + $("#block_user_button").click(function(evt) { + if(!confirm(Diaspora.I18n.t('ignore_user'))) { return } + var personId = $(this).data('person-id'); + var block = new app.models.Block(); + block.save({block : {person_id : personId}}); + $('#profile_buttons').attr('class', 'blocked'); + $('#sharing_message').attr('class', 'icons-circle'); + $('.profile_button, .white_bar').remove(); + return false; + }); }); diff --git a/app/assets/javascripts/profile.js b/app/assets/javascripts/profile.js index 6dabf020e..8d6b9ddd1 100644 --- a/app/assets/javascripts/profile.js +++ b/app/assets/javascripts/profile.js @@ -2,4 +2,5 @@ * licensed under the Affero General Public License version 3 or later. See * the COPYRIGHT file. */ -//= require jquery.autoSuggest.custom \ No newline at end of file +//= require jquery.autoSuggest.custom + diff --git a/app/assets/stylesheets/profile.css.scss b/app/assets/stylesheets/profile.css.scss index ef32be5ce..a826ca2ba 100644 --- a/app/assets/stylesheets/profile.css.scss +++ b/app/assets/stylesheets/profile.css.scss @@ -41,8 +41,7 @@ .mutual { background-color: rgb(142, 222, 61); .profile_button { - //width: 50px; - width: 75px; + width: 50px; } } .only_sharing { @@ -54,8 +53,7 @@ .receiving { background-color: rgb(211, 211, 211); .profile_button { - //width: 75px; - width: 150px; + width: 75px; } } .not_sharing { diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index 49094f62e..81827ea4b 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -14,19 +14,20 @@ - if @contact.receiving? .profile_button = link_to content_tag(:div, nil, :class => 'icons-mention', :title => t('people.show.mention'), :id => 'mention_button'), new_status_message_path(:person_id => @person.id), :rel => 'facebox' - //.white_bar + .white_bar - if @contact.mutual? - // remove the following line when adding the ignore button - .white_bar + + .profile_button = link_to content_tag(:div, nil, :class => 'icons-message', :title => t('people.show.message'), :id => 'message_button'), new_conversation_path(:contact_id => @contact.id, :name => @contact.person.name), :rel => 'facebox' - //.white_bar + .white_bar - //.profile_button - // = link_to content_tag(:div, nil, :class => 'icons-ignoreuser', :title => t('people.show.message'), :id => 'block_user_button'), '/block', :rel => 'facebox' - - %br + .profile_button + = link_to content_tag(:div, nil, :class => 'icons-ignoreuser block_user', :title => t('ignore'), :id => 'block_user_button', :data => { :person_id => @person.id }), '#', :rel => "nofollow" if @block.blank? + + + %br -if contact.sharing? || person == current_user.person %ul#profile_information diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 95b6d932e..4204c6286 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -20,6 +20,7 @@ en: cancel: "Cancel" delete: "Delete" hide: "Hide" + ignore: "Ignore" undo: "Undo?" or: "or" ago: "%{time} ago" From 5ff05139a3b7f2beddf14d761d36ff4878debaa2 Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Wed, 28 Aug 2013 12:51:39 +0200 Subject: [PATCH 2/4] fix failing cuke - blocking from profile page --- features/desktop/blocks_user.feature | 2 +- features/step_definitions/posts_steps.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/features/desktop/blocks_user.feature b/features/desktop/blocks_user.feature index a82c55e33..6057252a7 100644 --- a/features/desktop/blocks_user.feature +++ b/features/desktop/blocks_user.feature @@ -20,7 +20,7 @@ Feature: Blocking a user from the stream Scenario: Blocking a user from the profile page When I am on the home page And I follow "Alice Smith" - When I click on the first block button + When I click on the profile block button And I confirm the alert And I am on the home page Then I should not see any posts in my stream diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index ade6b1cfc..672b2eb8f 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -39,6 +39,10 @@ When /^I click on the first block button/ do find(".block_user").click end +When /^I click on the profile block button/ do + find("#profile_buttons .block_user").click +end + When /^I expand the post$/ do expand_first_post end From b2ff1878e31e0a9ee9326cd37793cb930e66e98f Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Sat, 31 Aug 2013 00:02:42 +0200 Subject: [PATCH 3/4] move ui feedback into success callback --- app/assets/javascripts/people.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/people.js b/app/assets/javascripts/people.js index 57ae2a3bf..d9f9eeb2b 100644 --- a/app/assets/javascripts/people.js +++ b/app/assets/javascripts/people.js @@ -10,13 +10,17 @@ $(document).ready(function() { $('#profile_buttons .profile_button div').tooltip({placement: 'bottom'}); $('#profile_buttons .sharing_message_container').tooltip({placement: 'bottom'}); $("#block_user_button").click(function(evt) { - if(!confirm(Diaspora.I18n.t('ignore_user'))) { return } + if(!confirm(Diaspora.I18n.t('ignore_user'))) { return; } var personId = $(this).data('person-id'); var block = new app.models.Block(); - block.save({block : {person_id : personId}}); - $('#profile_buttons').attr('class', 'blocked'); - $('#sharing_message').attr('class', 'icons-circle'); - $('.profile_button, .white_bar').remove(); + block.save({block : {person_id : personId}}, { + success: function() { + $('#profile_buttons').attr('class', 'blocked'); + $('#sharing_message').attr('class', 'icons-circle'); + $('.profile_button, .white_bar').remove(); + } + }); + return false; - }); + }); }); From e47e5bd3be0a421d8dbeae8070c8cf61d8d7bce9 Mon Sep 17 00:00:00 2001 From: sjain1107 Date: Sat, 31 Aug 2013 17:25:39 +0530 Subject: [PATCH 4/4] Added success function and modified changelog.md --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 41ea41ac5..fee48921c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -23,6 +23,8 @@ * Disable "mark all as read" link if all notifications are read [#4463](https://github.com/diaspora/diaspora/pull/4463) * Collapse aspect list and tag followings list when switching to other views [#4462](https://github.com/diaspora/diaspora/pull/4462) * Highlight current stream in left sidebar [#4445](https://github.com/diaspora/diaspora/pull/4445) +* Added ignore user icon [#4417](https://github.com/diaspora/diaspora/pull/4417) + # 0.2.0.0