summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-04-26 10:45:45 +0200
committerPeter Kozak <spag@golwen.net>2013-04-26 10:45:45 +0200
commit02818937b8f7de0ae2417337c30771827d7c1c9e (patch)
tree5c3a3a4170beb7bbcf2f258eac56dbe98a4c1ebf
parent5129d7701de57224030468ef547859f7b651a6cd (diff)
breadcrumbs added
-rw-r--r--app/controllers/generic_files_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/generic_files_controller.rb b/app/controllers/generic_files_controller.rb
index b3c0390..ddedbe5 100644
--- a/app/controllers/generic_files_controller.rb
+++ b/app/controllers/generic_files_controller.rb
@@ -11,6 +11,7 @@ class GenericFilesController < ApplicationController
load_and_authorize_resource :generic_file, :through => [:sip_account, :conference, :hunt_group, :automatic_call_distributor, :user, :tenant]
before_filter :set_and_authorize_parent
+ before_filter :spread_breadcrumbs
def index
@generic_files = @parent.generic_files
@@ -69,4 +70,18 @@ class GenericFilesController < 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("generic_files.index.page_title"), method( :"#{@parent.class.name.underscore}_generic_files_url" ).(@parent)
+
+ if @generic_file
+ add_breadcrumb @generic_file
+ end
+
+ end
end