Remove unused aspect files

This commit is contained in:
Steffen van Bergerem 2015-03-09 16:51:09 +01:00
parent 31d7904701
commit d3c0259026
9 changed files with 0 additions and 154 deletions

View file

@ -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

View file

@ -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)

View file

@ -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'

View file

@ -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)

View file

@ -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)

View file

@ -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);

View file

@ -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);

View file

@ -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)

View file

@ -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)