summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/views/phone_numbers/show.html.haml15
-rw-r--r--app/views/sip_accounts/show.html.haml10
2 files changed, 10 insertions, 15 deletions
diff --git a/app/views/phone_numbers/show.html.haml b/app/views/phone_numbers/show.html.haml
index de6cb1b..9fe6ea4 100644
--- a/app/views/phone_numbers/show.html.haml
+++ b/app/views/phone_numbers/show.html.haml
@@ -9,15 +9,16 @@
%strong= t('phone_numbers.show.number') + ":"
= @phone_number.to_s
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @phone_number.phone_numberable, :child => @phone_number }
+
- if @ringtoneable_classes.has_key?(@phone_number.phone_numberable.class.to_s)
%p
- %strong= t('ringtones.name') + ':'
- - if @phone_number.ringtones.count > 0
- = link_to @phone_number.ringtones.first, phone_number_ringtone_path(@phone_number, @phone_number.ringtones.first)
- - else
- = link_to t('ringtones.set_a_ringtone'), new_phone_number_ringtone_path(@phone_number)
-
-= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @phone_number.phone_numberable, :child => @phone_number }
+ %strong= t('ringtones.name') + ':'
+ - if @phone_number.ringtones.count > 0
+ = @phone_number.ringtones.first
+ = render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @phone_number, :child => @phone_number.ringtones.first }
+ - else
+ = render :partial => 'shared/create_link', :locals => { :parent => @phone_number, :child_class => Ringtone }
- if @forwardable_classes.has_key?(@phone_number.phone_numberable.class.to_s)
%h3= t("call_forwards.index.page_title")
diff --git a/app/views/sip_accounts/show.html.haml b/app/views/sip_accounts/show.html.haml
index fd955dd..0aaf920 100644
--- a/app/views/sip_accounts/show.html.haml
+++ b/app/views/sip_accounts/show.html.haml
@@ -71,15 +71,9 @@
%strong= t('ringtones.name') + ':'
- if @sip_account.ringtones.count > 0
= @sip_account.ringtones.first
- %p
- %a.btn.btn-small.btn-warning{:href => edit_sip_account_ringtone_path(@sip_account, @sip_account.ringtones.first) }
- %i.icon-edit.icon-white
- =t('ringtones.index.actions.edit')
+ = render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @sip_account, :child => @sip_account.ringtones.first }
- else
- %p
- %a.btn.btn-small.btn-default{ :href => new_sip_account_ringtone_path(@sip_account) }
- %i.icon-plus
- = t('ringtones.set_a_ringtone')
+ = render :partial => 'shared/create_link', :locals => { :parent => @sip_account, :child_class => Ringtone }
- if @sip_account.phone_numbers.count > 0 || can?(:create, @sip_account.phone_numbers.build)
%h2= t('phone_numbers.index.page_title')