diff --git a/app/views/aspects/new.haml b/app/views/aspects/new.haml index 82a90bdb3..5493e0ce4 100644 --- a/app/views/aspects/new.haml +++ b/app/views/aspects/new.haml @@ -21,6 +21,10 @@ = aspect.check_box :contacts_visible, :checked => false, class: 'checkbox' = aspect.label :contacts_visible, t('aspects.edit.make_aspect_list_visible') + %p.checkbox_select + = aspect.check_box :chat_enabled, :checked => false, class: 'checkbox' + = aspect.label :chat_enabled, t('aspects.edit.grant_contacts_chat_privilege') + %br .bottom_submit_section diff --git a/app/views/contacts/_header.html.haml b/app/views/contacts/_header.html.haml index ef49831fa..6fdf4caf5 100644 --- a/app/views/contacts/_header.html.haml +++ b/app/views/contacts/_header.html.haml @@ -10,6 +10,12 @@ -else %i.entypo.lock.contacts-header-icon{:title => t('aspects.edit.aspect_list_is_not_visible')} + = link_to aspect_toggle_chat_privilege_path(@aspect), id: "chat_privilege_toggle", class: "contacts_button", method: :put, remote: true do + -if @aspect.chat_enabled? + %i.entypo.chat.enabled.contacts-header-icon{:title => t('aspects.edit.aspect_chat_is_enabled')} + -else + %i.entypo.chat.contacts-header-icon{:title => t('aspects.edit.aspect_chat_is_not_enabled')} + = link_to @aspect, method: "delete", data: { confirm: t('aspects.edit.confirm_remove_aspect') }, class: 'delete contacts_button', id: 'delete_aspect' do %i.entypo.trash.contacts-header-icon{:title => t('delete')} .pull-right