Merge pull request #5459 from svbergerem/aspect-chat-control-disabled-chat

Only show aspect chat control if chat is enabled
This commit is contained in:
Jonne Haß 2014-12-05 14:41:11 +01:00
commit 60a5d2a5ba
2 changed files with 7 additions and 5 deletions

View file

@ -10,11 +10,12 @@
-else -else
%i.entypo.lock.contacts-header-icon{:title => t('aspects.edit.aspect_list_is_not_visible')} %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 AppConfig.chat.enabled?
-if @aspect.chat_enabled? = link_to aspect_toggle_chat_privilege_path(@aspect), id: "chat_privilege_toggle", class: "contacts_button", method: :put, remote: true do
%i.entypo.chat.enabled.contacts-header-icon{:title => t('aspects.edit.aspect_chat_is_enabled')} -if @aspect.chat_enabled?
-else %i.entypo.chat.enabled.contacts-header-icon{:title => t('aspects.edit.aspect_chat_is_enabled')}
%i.entypo.chat.contacts-header-icon{:title => t('aspects.edit.aspect_chat_is_not_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 = 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')} %i.entypo.trash.contacts-header-icon{:title => t('delete')}

View file

@ -7,6 +7,7 @@ require 'spec_helper'
describe ContactsController, :type => :controller do describe ContactsController, :type => :controller do
describe '#index' do describe '#index' do
before do before do
AppConfig.chat.enabled = true
@aspect = bob.aspects.create(:name => "another aspect") @aspect = bob.aspects.create(:name => "another aspect")
bob.share_with alice.person, @aspect bob.share_with alice.person, @aspect
sign_in :user, bob sign_in :user, bob