just have a remove from aspect icon when viewing an aspect in contacts index

This commit is contained in:
danielgrippi 2011-06-27 16:26:54 -07:00
parent f9a23b8120
commit 44b77c58a3
4 changed files with 31 additions and 12 deletions

View file

@ -20,6 +20,13 @@ class AspectMembershipsController < ApplicationController
flash.now[:notice] = I18n.t 'aspect_memberships.destroy.success'
respond_to do |format|
format.all {}
format.html{
redirect_to :back
}
end
else
flash.now[:error] = I18n.t 'aspect_memberships.destroy.failure'
errors = membership ? membership.errors.full_messages : t('aspect_memberships.destroy.no_membership')

View file

@ -12,7 +12,8 @@ class ContactsController < ApplicationController
@my_contacts_count = current_user.contacts.receiving.count
if params["a_id"]
@contacts = current_user.aspects.find(params["a_id"]).contacts.includes(:aspects, :person => :profile).order('profiles.last_name ASC').paginate(:page => params[:page], :per_page => 25)
@aspect_ = current_user.aspects.find(params["a_id"])
@contacts = @aspect_.contacts.includes(:aspects, :person => :profile).order('profiles.last_name ASC').paginate(:page => params[:page], :per_page => 25)
elsif params[:set] != "all"
@contacts = current_user.contacts.receiving.includes(:aspects, :person => :profile).order('profiles.last_name ASC').paginate(:page => params[:page], :per_page => 25)
else

View file

@ -5,14 +5,6 @@
:javascript
$(document).ready(function(){
$("#people_stream").infinitescroll({
navSelector : ".pagination",
nextSelector : ".next_page",
itemSelector : ".stream_element",
loadingText: "",
loadingImg: '/images/ajax-loader.gif',
bufferPx: 400
});
});
- content_for :page_title do
@ -53,9 +45,21 @@
.stream_element{:id => contact.person.id}
.right
= render :partial => 'people/relationship_action',
:locals => { :person => contact.person, :contact => contact,
:current_user => current_user }
- if @aspect_
= link_to(image_tag('/images/icons/monotone_close_exit_delete.png', :height => 20, :width => 20),
{:controller => "aspect_memberships",
:action => 'destroy',
:id => 42,
:aspect_id => @aspect_.id,
:person_id => contact.person.id},
:title => "Remove #{contact.person.first_name} from \"#{@aspect_.name}\"",
:method => 'delete')
- else
= render :partial => 'people/relationship_action',
:locals => { :person => contact.person, :contact => contact,
:current_user => current_user }
= person_image_link(contact.person)
.content
%span.from

View file

@ -3031,6 +3031,13 @@ ul#left_nav
:min-height 30px
.right
:top 16px
a
@include opacity(0.3)
&:hover
@include opacity(1)
.from
:position relative
a