Breadcrumb for dashboard (tags and categories cannot link to original module index)
This commit is contained in:
parent
fe10cc62d9
commit
d190a50046
|
@ -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
|
||||
|
|
|
@ -345,4 +345,42 @@ module OrbitBackendHelper
|
|||
end
|
||||
end
|
||||
|
||||
# ===============================================================
|
||||
# Breadcrumbs
|
||||
# ===============================================================
|
||||
|
||||
def back_end_breadcrumb
|
||||
res = ''
|
||||
divider = "<span class='divider'>/</span>"
|
||||
res << "<li><a href='#{admin_dashboards_path}'>#{t(:dashboard_)}</a>#{divider}</li>"
|
||||
case controller.controller_name
|
||||
when 'authorizations'
|
||||
res << "<li><a href='/#{params[:controller]}/#{@module_app.key}'>#{@module_app.title}</a>#{divider}</li>"
|
||||
case params[:type]
|
||||
when 'approval'
|
||||
res << "<li class='active'>#{t(:approval_)}</li>"
|
||||
when 'category'
|
||||
res << "<li class='active'>#{t(:category_auth)}</li>"
|
||||
when nil
|
||||
res << "<li class='active'>#{t(:module_authorization)}</li>"
|
||||
else
|
||||
res << "<li class='active'>#{params[:type].underscore.humanize.capitalize} #{t(:authorization_)}</li>"
|
||||
end
|
||||
when 'categories'
|
||||
res << "<li>#{@module_app.title}#{divider}</li>"
|
||||
res << "<li class='active'>#{t(:categories)}</li>"
|
||||
when 'module_tags'
|
||||
res << "<li>#{@module_app.title}#{divider}</li>"
|
||||
res << "<li class='active'>#{t(:tags)}</li>"
|
||||
else
|
||||
if params[:action].eql?('index')
|
||||
res << "<li>#{@module_app.title}</li>"
|
||||
else
|
||||
res << "<li><a href='/#{params[:controller]}'>#{@module_app.title}</a>#{divider}</li>"
|
||||
res << "<li class='active'>#{t(params[:action], scope: 'restful_actions')}</li>"
|
||||
end
|
||||
end
|
||||
res.html_safe
|
||||
end
|
||||
|
||||
end
|
|
@ -15,7 +15,7 @@
|
|||
<div class="mini-layout-body span10">
|
||||
<%= 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 %>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<li><a href="<%= admin_dashboards_path %>"><%= t(:dashboard_) %></a> <span class="divider">/</span></li>
|
||||
<% case controller.controller_name %>
|
||||
<% when 'authorizations' %>
|
||||
|
||||
<% when 'categories' %>
|
||||
|
||||
<% when 'tags' %>
|
||||
|
||||
<% else %>
|
||||
<li><a href="<%= params[:controller] %>"><%= @module_app.title %></li>
|
||||
<% end %>
|
||||
<li class="active">All</li>
|
|
@ -24,8 +24,7 @@
|
|||
<div class="wrap-inner">
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><a href="/orbit_4.0.1/admin/dashboards/dashboards.shtml">Dashboard</a> <span class="divider">/</span></li>
|
||||
<li class="active">All</li>
|
||||
<%= back_end_breadcrumb %>
|
||||
</ul>
|
||||
<%= yield :right_nav %>
|
||||
</div>
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in New Issue