From d3c02590267774436c0001c2b49c30afab02a86b Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Mon, 9 Mar 2015 16:51:09 +0100 Subject: [PATCH] Remove unused aspect files --- app/helpers/aspects_helper.rb | 58 ------------------- .../aspect_memberships/_add_to_aspect.haml | 7 --- ...ct_membership_dropdown_blueprint.html.haml | 19 ------ .../_remove_from_aspect.haml | 7 --- .../aspect_memberships/add_to_aspect.js.haml | 7 --- app/views/aspect_memberships/create.js.erb | 20 ------- app/views/aspect_memberships/destroy.js.erb | 10 ---- .../remove_from_aspect.js.haml | 7 --- app/views/shared/_contact_list.html.haml | 19 ------ 9 files changed, 154 deletions(-) delete mode 100644 app/helpers/aspects_helper.rb delete mode 100644 app/views/aspect_memberships/_add_to_aspect.haml delete mode 100644 app/views/aspect_memberships/_aspect_membership_dropdown_blueprint.html.haml delete mode 100644 app/views/aspect_memberships/_remove_from_aspect.haml delete mode 100644 app/views/aspect_memberships/add_to_aspect.js.haml delete mode 100644 app/views/aspect_memberships/create.js.erb delete mode 100644 app/views/aspect_memberships/destroy.js.erb delete mode 100644 app/views/aspect_memberships/remove_from_aspect.js.haml delete mode 100644 app/views/shared/_contact_list.html.haml diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb deleted file mode 100644 index 0c781e986..000000000 --- a/app/helpers/aspects_helper.rb +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -module AspectsHelper - def add_to_aspect_button(aspect_id, person_id) - link_to content_tag(:div, nil, :class => 'icons-monotone_plus_add_round'), - { :controller => 'aspect_memberships', - :action => 'create', - :format => :json, - :aspect_id => aspect_id, - :person_id => person_id - }, - :method => 'post', - :class => 'add btn', - 'data-aspect_id' => aspect_id, - 'data-person_id' => person_id - end - - def remove_from_aspect_button(membership_id, aspect_id, person_id) - link_to content_tag(:div, nil, :class => 'icons-monotone_check_yes'), - { :controller => "aspect_memberships", - :action => 'destroy', - :id => membership_id - }, - :method => 'delete', - :class => 'added btn', - 'data-membership_id' => membership_id, - 'data-aspect_id' => aspect_id, - 'data-person_id' => person_id - end - - def aspect_membership_button(aspect, contact, person) - return if person && person.closed_account? - - membership = contact.aspect_memberships.where(:aspect_id => aspect.id).first - if contact.nil? || membership.nil? - add_to_aspect_button(aspect.id, person.id) - else - remove_from_aspect_button(membership.id, aspect.id, person.id) - end - end - - def aspect_visibility_link(aspect) - if aspect.contacts_visible? - icon = 'icons-padlock-open' - title = t('aspects.edit.aspect_list_is_visible'); - else - icon = 'icons-padlock-closed' - title = t('aspects.edit.aspect_list_is_not_visible'); - end - - link_to aspect_toggle_contact_visibility_path(@aspect), class: 'contact_visibility_link btn', title: title, method: :put, remote: true do - concat t('aspects.edit.set_visibility') - concat content_tag(:span, nil, class: "contact_visibility_padlock " + icon) - end - end -end diff --git a/app/views/aspect_memberships/_add_to_aspect.haml b/app/views/aspect_memberships/_add_to_aspect.haml deleted file mode 100644 index 8012ec4b7..000000000 --- a/app/views/aspect_memberships/_add_to_aspect.haml +++ /dev/null @@ -1,7 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -= remove_from_aspect_button(aspect_id,person_id) - diff --git a/app/views/aspect_memberships/_aspect_membership_dropdown_blueprint.html.haml b/app/views/aspect_memberships/_aspect_membership_dropdown_blueprint.html.haml deleted file mode 100644 index 77fc34aba..000000000 --- a/app/views/aspect_memberships/_aspect_membership_dropdown_blueprint.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -.dropdown{:class => ["hang_#{hang}", defined?(dropdown_class) && dropdown_class]} - .button.toggle{:class => ("in_aspects" if selected_aspects.size > 0), :tabindex => '0'} - - if selected_aspects.size == all_aspects.size - = t('all_aspects') - - elsif selected_aspects.size == 1 - = selected_aspects.first.name - - else - = t('shared.aspect_dropdown.toggle', :count => selected_aspects.size) - ▼ - - .wrapper - %ul.dropdown_list{:unSelectable => 'on', 'data-person_id' => (person.id if defined?(person) && person), 'data-service_uid' => (service_uid if defined?(service_uid)), 'data-person-short-name' => (person.first_name if defined?(person) && person)} - - for aspect in all_aspects - = aspect_dropdown_list_item(aspect, aspect_membership_ids[aspect.id] ) - - - if (dropdown_may_create_new_aspect && defined?(person) && person) - %li.newItem - .add_aspect - = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id, :remote => true), :rel => 'facebox' diff --git a/app/views/aspect_memberships/_remove_from_aspect.haml b/app/views/aspect_memberships/_remove_from_aspect.haml deleted file mode 100644 index 02a76b07c..000000000 --- a/app/views/aspect_memberships/_remove_from_aspect.haml +++ /dev/null @@ -1,7 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -= aspect_membership_button(aspect, contact, person) - diff --git a/app/views/aspect_memberships/add_to_aspect.js.haml b/app/views/aspect_memberships/add_to_aspect.js.haml deleted file mode 100644 index 86ad128d9..000000000 --- a/app/views/aspect_memberships/add_to_aspect.js.haml +++ /dev/null @@ -1,7 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -= remove_from_aspect_button(@aspect_id,@person_id) - diff --git a/app/views/aspect_memberships/create.js.erb b/app/views/aspect_memberships/create.js.erb deleted file mode 100644 index 69abb4b4b..000000000 --- a/app/views/aspect_memberships/create.js.erb +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2010-2011, Diaspora Inc. This file is -// licensed under the Affero General Public License version 3 or later. See -// the COPYRIGHT file. - -// TODO handle this completely in Backbone.js, then remove this view! - -var element = $(".add[data-aspect_id=<%= @aspect.id %>][data-person_id=<%= @contact.person_id%>]"); - -if( $("#no_contacts").is(':visible') ) { - $("#no_contacts").fadeOut(200); -} - -element.parent().html("<%= escape_javascript(render('aspect_memberships/add_to_aspect', :aspect_id => @aspect.id, :person_id => @person.id)) %>"); - -if($('#aspects_list').length == 1) { - $('.aspect_list').attr('data-contact_id', "<%= @contact_id %>"); - $('.aspect_list ul').find('.add').each(function(a,b){$(b).attr('href', $(b).attr('href').replace('contacts','aspect_memberships'));}) -}; - -element.fadeTo(200,1); diff --git a/app/views/aspect_memberships/destroy.js.erb b/app/views/aspect_memberships/destroy.js.erb deleted file mode 100644 index 8c7eb4106..000000000 --- a/app/views/aspect_memberships/destroy.js.erb +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2010-2011, Diaspora Inc. This file is -// licensed under the Affero General Public License version 3 or later. See -// the COPYRIGHT file. - -// TODO handle this completely in Backbone.js, then remove this view! - -var element = $(".added[data-aspect_id=<%= @aspect.id %>][data-person_id=<%= @contact.person_id%>]"); -element.parent().html("<%= escape_javascript(render('aspect_memberships/remove_from_aspect', :aspect => @aspect, :person => @contact.person, :contact => @contact)) %>"); -element.fadeTo(200,1); - diff --git a/app/views/aspect_memberships/remove_from_aspect.js.haml b/app/views/aspect_memberships/remove_from_aspect.js.haml deleted file mode 100644 index a5ddc290c..000000000 --- a/app/views/aspect_memberships/remove_from_aspect.js.haml +++ /dev/null @@ -1,7 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -= aspect_membership_button(aspect, person, contact) - diff --git a/app/views/shared/_contact_list.html.haml b/app/views/shared/_contact_list.html.haml deleted file mode 100644 index 44e0eb18d..000000000 --- a/app/views/shared/_contact_list.html.haml +++ /dev/null @@ -1,19 +0,0 @@ --# Copyright (c) 2010-2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -.contact_list_controls - = search_field_tag :contact_search, "", id: "contact_list_search", class: 'contact_list_search', results: 5, placeholder: t('.all_contacts') - = t('contacts', count: @aspect_contacts_count) - -.contact_list.searchable - %ul.contacts - - for contact in contacts - %li.contact{:data=>{:contact_id=>contact.id}} - = person_image_tag contact.person - %h4.name - = link_to contact.person.name, contact.person - .pull-right - = aspect_membership_button(aspect, contact, contact.person) -