diff --git a/app/assets/javascripts/people.js b/app/assets/javascripts/people.js index a2cf5a9ab9d8b81a11caab7a53731706faa609e2..57ae2a3bf4508e0504e7b11e74215dee6d615b01 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 6dabf020ed53c37038a9317d3a6c38c467030dca..8d6b9ddd10103c96e4a98bc77e385999380b92c2 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 ef32be5ce2e24c3151b979852e016fa427b264ad..a826ca2baf925fba4b21d62d46d4159e1238ff74 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 49094f62e5c20a74755ba3daf082948797c2fba4..81827ea4b3b5d06c8e7ccc7e927c9829a1802e11 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 - - //.profile_button - // = link_to content_tag(:div, nil, :class => 'icons-ignoreuser', :title => t('people.show.message'), :id => 'block_user_button'), '/block', :rel => 'facebox' + .white_bar - %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 95b6d932eb0488e2f59f52cc367214b7a7308bdf..4204c6286777fddbbb9bc7db7b8baf5ec1c8fe46 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"