summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-06 03:01:28 -0500
committerPeter Kozak <spag@golwen.net>2013-03-06 03:01:28 -0500
commit134150c4f6b1f0a50c837e00a3c2bbe186dfb14e (patch)
tree0585d09f6485eacb94a93b3c47638f6006a006fc /app/views
parentee959b78ebfdd5cce50f2e2935e62ebba96ae3c4 (diff)
show sim_cards in user view depending on existence and ability
Diffstat (limited to 'app/views')
-rw-r--r--app/views/users/show.html.haml5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 8148005..ea90ab4 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -75,10 +75,11 @@
- cache(['user_show_phones_overview', I18n.locale, @user, @user.phones]) do
= render :partial => 'phones', :locals => {:user => @user}
- - if GsParameter.get('SIM_CARDS') == true
+ - if GsParameter.get('SIM_CARDS') == true && (@user.sim_cards.count > 0 || can?( :create, SimCard ))
- cache(['user_show_sim_cards_overview', I18n.locale, @user, @user.sim_cards]) do
%h2=t('sim_cards.index.page_title')
- = render :partial => 'sim_cards/index_core', :locals => {:parent => SimCardProvider.first, :sim_cards => @user.sim_cards}
+ - if @user.sim_cards.count > 0
+ = render :partial => 'sim_cards/index_core', :locals => {:parent => SimCardProvider.first, :sim_cards => @user.sim_cards}
= render :partial => 'shared/create_link', :locals => {:parent => SimCardProvider.first, :child_class => SimCard}
- cache(['user_show_fax_accounts_overview', I18n.locale, @user, @user.fax_accounts]) do