diff options
author | Peter Kozak <spag@golwen.net> | 2013-04-26 12:14:39 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-04-26 12:14:39 +0200 |
commit | af24d971e2cd913ad6ad3bcf58e47469090b1eda (patch) | |
tree | 20b155e7921186b33873378682e71be4e5b827bb /app | |
parent | 24e872cdd9be4f5f3397a93bad3ef2c21e3fd419 (diff) |
breadcrumbs added
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/voicemail_accounts_controller.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/voicemail_accounts_controller.rb b/app/controllers/voicemail_accounts_controller.rb index 0bfa160..2e96cb7 100644 --- a/app/controllers/voicemail_accounts_controller.rb +++ b/app/controllers/voicemail_accounts_controller.rb @@ -10,6 +10,7 @@ class VoicemailAccountsController < ApplicationController load_and_authorize_resource :phone_number, :through => [:sip_account, :conference, :hunt_group, :automatic_call_distributor, :user, :tenant] before_filter :set_and_authorize_parent + before_filter :spread_breadcrumbs def index @voicemail_accounts = @parent.voicemail_accounts @@ -75,4 +76,17 @@ class VoicemailAccountsController < ApplicationController authorize! :read, @parent end + def spread_breadcrumbs + if @parent.class == User + add_breadcrumb t("users.index.page_title"), tenant_users_path(@parent.current_tenant) + add_breadcrumb @parent, tenant_user_path(@parent.current_tenant, @parent) + end + + add_breadcrumb t("voicemail_accounts.index.page_title"), method( :"#{@parent.class.name.underscore}_voicemail_accounts_url" ).(@parent) + + if !@voicemail_account.to_s.blank? + add_breadcrumb @voicemail_account.name + end + end + end |