summaryrefslogtreecommitdiff
path: root/app/views/users
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-19 10:21:29 +0200
committerPeter Kozak <spag@golwen.net>2013-04-19 10:21:29 +0200
commit75bc8af34e4ea625725206f015b04730fad8de63 (patch)
tree2ce662091816588d839eee6ab448df228b83a3e7 /app/views/users
parent4c4deedd65d8c459795ed83d282022a07f38757e (diff)
list voicemail accounts in user view
Diffstat (limited to 'app/views/users')
-rw-r--r--app/views/users/_voicemail_accounts.html.haml7
-rw-r--r--app/views/users/show.html.haml10
2 files changed, 13 insertions, 4 deletions
diff --git a/app/views/users/_voicemail_accounts.html.haml b/app/views/users/_voicemail_accounts.html.haml
new file mode 100644
index 0000000..4410b09
--- /dev/null
+++ b/app/views/users/_voicemail_accounts.html.haml
@@ -0,0 +1,7 @@
+-# VoicemailAccount
+-#
+- if (can?( :index, VoicemailAccount ) && user.voicemail_accounts.count > 0 ) || can?( :create, VoicemailAccount )
+ %h2= t('voicemail_accounts.index.page_title')
+ - if can?( :index, VoicemailAccount ) && user.voicemail_accounts.count > 0
+ = render "voicemail_accounts/index_core", {:voicemail_accounts => user.voicemail_accounts, :voicemail_accountable => user}
+ = render :partial => 'shared/create_link', :locals => {:parent => user, :child_class => VoicemailAccount} \ No newline at end of file
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 8421c40..697604a 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -43,12 +43,11 @@
%strong ...
%p
=link_to t("call_histories.index.page_title"), sip_account_call_histories_path(sip_account)
- %br
- =link_to t("voicemail_messages.index.page_title"), sip_account_voicemail_messages_path(sip_account)
+ - if ! sip_account.voicemail_account.blank?
+ %br
+ =link_to t("voicemail_messages.index.page_title"), voicemail_account_voicemail_messages_path(sip_account.voicemail_account)
%br
=link_to t("call_forwards.index.page_title"), sip_account_call_forwards_path(sip_account)
- /%br
- /=link_to t("voicemail_settings.index.page_title"), sip_account_voicemail_settings_path(sip_account)
%br
=link_to t("softkeys.index.page_title"), sip_account_softkeys_path(sip_account)
%br
@@ -85,6 +84,9 @@
- cache(['user_show_fax_accounts_overview', I18n.locale, @user, @user.fax_accounts]) do
= render :partial => 'fax_accounts', :locals => {:user => @user}
+ - cache(['user_show_voicemail_accounts_overview', I18n.locale, @user, @user.voicemail_accounts]) do
+ = render :partial => 'voicemail_accounts', :locals => {:user => @user}
+
- cache(['user_show_conferences_overview', I18n.locale, @user, @user.conferences]) do
= render :partial => 'conferences', :locals => {:user => @user}