diff --git a/app/controllers/admin/authorizations_controller.rb b/app/controllers/admin/authorizations_controller.rb index 07b0de7f..04681242 100644 --- a/app/controllers/admin/authorizations_controller.rb +++ b/app/controllers/admin/authorizations_controller.rb @@ -136,7 +136,7 @@ class Admin::AuthorizationsController < OrbitBackendController @module_app = ModuleApp.first(conditions: {:key => params[:module]} ) if params[:module] @type = params[:type].underscore if params[:type] if @type - @klass = @type.classify.constantize + @klass = @type.classify.constantize rescue nil @object = @klass.find(params[:id]) rescue nil end end diff --git a/app/helpers/orbit_backend_helper.rb b/app/helpers/orbit_backend_helper.rb index b5c8eca2..aa8075c4 100644 --- a/app/helpers/orbit_backend_helper.rb +++ b/app/helpers/orbit_backend_helper.rb @@ -345,4 +345,42 @@ module OrbitBackendHelper end end + # =============================================================== + # Breadcrumbs + # =============================================================== + + def back_end_breadcrumb + res = '' + divider = "/" + res << "
  • #{t(:dashboard_)}#{divider}
  • " + case controller.controller_name + when 'authorizations' + res << "
  • #{@module_app.title}#{divider}
  • " + case params[:type] + when 'approval' + res << "
  • #{t(:approval_)}
  • " + when 'category' + res << "
  • #{t(:category_auth)}
  • " + when nil + res << "
  • #{t(:module_authorization)}
  • " + else + res << "
  • #{params[:type].underscore.humanize.capitalize} #{t(:authorization_)}
  • " + end + when 'categories' + res << "
  • #{@module_app.title}#{divider}
  • " + res << "
  • #{t(:categories)}
  • " + when 'module_tags' + res << "
  • #{@module_app.title}#{divider}
  • " + res << "
  • #{t(:tags)}
  • " + else + if params[:action].eql?('index') + res << "
  • #{@module_app.title}
  • " + else + res << "
  • #{@module_app.title}#{divider}
  • " + res << "
  • #{t(params[:action], scope: 'restful_actions')}
  • " + end + end + res.html_safe + end + end \ No newline at end of file diff --git a/app/views/admin/authorizations/index.html.erb b/app/views/admin/authorizations/index.html.erb index 4d0600ca..41d6b55d 100644 --- a/app/views/admin/authorizations/index.html.erb +++ b/app/views/admin/authorizations/index.html.erb @@ -15,7 +15,7 @@
    <%= link_to t(:module_authorization), admin_authorizations_path(@module_app.key) %> <% @module_app.authorizable_models.each do |authorizable_model| %> - <%= link_to (authorizable_model.eql?('Category') ? t(:category_auth) : "#{authorizable_model.underscore.humanize} #{t(:authorization_)}"), admin_authorizations_path(@module_app.key, type: authorizable_model) %> + <%= link_to (authorizable_model.eql?('Category') ? t(:category_auth) : "#{authorizable_model.underscore.humanize.capitalize} #{t(:authorization_)}"), admin_authorizations_path(@module_app.key, type: authorizable_model.downcase) %> <% end %> <%= link_to t(:approval_), admin_authorizations_path(@module_app.key, type: 'approval') if @module_app.is_approvable %> <% if @error %> diff --git a/app/views/layouts/_breadcrumb_back_end.html.erb b/app/views/layouts/_breadcrumb_back_end.html.erb new file mode 100644 index 00000000..1bafb6d9 --- /dev/null +++ b/app/views/layouts/_breadcrumb_back_end.html.erb @@ -0,0 +1,12 @@ +
  • <%= t(:dashboard_) %> /
  • +<% case controller.controller_name %> + <% when 'authorizations' %> + + <% when 'categories' %> + + <% when 'tags' %> + + <% else %> +
  • <%= @module_app.title %>
  • +<% end %> +
  • All
  • \ No newline at end of file diff --git a/app/views/layouts/back_end.html.erb b/app/views/layouts/back_end.html.erb index f03e9aec..b102562a 100644 --- a/app/views/layouts/back_end.html.erb +++ b/app/views/layouts/back_end.html.erb @@ -24,8 +24,7 @@
    <%= yield :right_nav %>
    diff --git a/config/locales/new_ui.en.yml b/config/locales/new_ui.en.yml index e0e0a0bd..b6f072b3 100644 --- a/config/locales/new_ui.en.yml +++ b/config/locales/new_ui.en.yml @@ -40,6 +40,14 @@ en: previous: Previous remove: Remove remove_default: Remove default + restful_actions: + create: Create + delete: Delete + edit: Edit + index: Index + new: New + show: Show + update: Update search: tags: Search tags select_all: Select all