visible contacts option on aspect edit pane
This commit is contained in:
parent
94ae7a678b
commit
dcf6469ded
4 changed files with 16 additions and 7 deletions
|
|
@ -101,11 +101,16 @@ class AspectsController < ApplicationController
|
|||
|
||||
def update
|
||||
@aspect = current_user.aspects.where(:id => params[:id]).first
|
||||
if @aspect.update_attributes( params[:aspect] )
|
||||
|
||||
if @aspect.update_attributes!( params[:aspect] )
|
||||
#hack, we don't know why mass assignment is not working
|
||||
@aspect.contacts_visible = params[:aspect][:contacts_visible]
|
||||
@aspect.save
|
||||
flash[:notice] = I18n.t 'aspects.update.success',:name => @aspect.name
|
||||
else
|
||||
flash[:error] = I18n.t 'aspects.update.failure',:name => @aspect.name
|
||||
end
|
||||
|
||||
respond_with @aspect
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -16,13 +16,15 @@
|
|||
= render 'shared/contact_list', :aspect => @aspect, :contacts => @contacts
|
||||
|
||||
#aspect_edit_controls
|
||||
= link_to t('.rename'), '#'
|
||||
\/
|
||||
= link_to t('delete'), @aspect, :method => "delete", :confirm => t('.confirm_remove_aspect')
|
||||
|
||||
|
||||
#rename_aspect
|
||||
= form_for @aspect do |asp|
|
||||
= asp.text_field :name, :value => @aspect.name
|
||||
= asp.submit t('.rename_aspect')
|
||||
= asp.text_field :name
|
||||
%p.checkbox_select{:style => 'font-size:14px'}
|
||||
= asp.label :contacts_visible, t('.make_aspect_list_visible')
|
||||
= asp.check_box :contacts_visible
|
||||
%br
|
||||
%div{:style => "text-align:right;"}
|
||||
= asp.submit t('.save')
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
%hr{:style=>"width:300px;"}
|
||||
.section.contact_pictures
|
||||
%h4
|
||||
= @contacts_of_contact.length
|
||||
= t('.similar_contacts')
|
||||
- for person in @contacts_of_contact
|
||||
= person_image_link person
|
||||
|
|
|
|||
|
|
@ -144,8 +144,9 @@ en:
|
|||
remove_aspect: "Delete this aspect"
|
||||
confirm_remove_aspect: "Are you sure you want to delete this aspect?"
|
||||
add_existing: "Add an existing contact"
|
||||
rename_aspect: "Rename aspect"
|
||||
save: "Save"
|
||||
rename: "rename"
|
||||
make_aspect_list_visible: "make aspect list visible to others in aspect"
|
||||
aspect_contacts:
|
||||
done_editing: "done editing"
|
||||
show:
|
||||
|
|
|
|||
Loading…
Reference in a new issue