Orbit/app/views/admin/authorizations/index.html.erb

39 lines
2.1 KiB
Plaintext
Raw Normal View History

<div class="mini-layout row-fluid">
<div class="mini-layout-sidebar span2">
<div class="nano">
<div class="content">
<ul class="nav nav-pills nav-stacked">
<% @module_apps.each do |module_app| %>
<li class="<%= @module_app == module_app ? 'active' : '' %>">
2013-07-25 09:45:39 +00:00
<%= link_to content_tag(:i, nil, class: (module_app.get_registration.get_icon_class rescue nil)) + ' ' + module_app.title, admin_authorizations_path(module_app.key, (@type if (@type && module_app.authorizable_models.include?(@type.camelize)))) %>
</li>
<% end %>
</ul>
</div>
</div>
</div>
<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.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 %>
<%= @error %>
<% else %>
<%= select_tag @type.underscore.humanize, options_from_collection_for_select(@objects, "id", "title", @object.id), :onchange => "window.location.href = '/admin/authorizations/'+'#{@module_app.key}/#{@type}/'+$(this).val();" if @objects %>
<ul id="card-list" class="checkbox-card clearfix">
<%= render partial: 'user', collection: @users %>
</ul>
<% end %>
</div>
</div>
<!-- footer -->
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + ' ' + t(:add), '#', class: 'btn btn-primary select_user_modal', rel: admin_modal_select_authorizations_path(@module_app.key, @type, @object) %>
<%= link_to content_tag(:i, nil, class: "icon-trash") + ' ' + t(:delete), '#', id: 'remove_users', class: 'btn btn-danger', rel: admin_remove_users_authorizations_path(@module_app.key, @type, @object) %>
</div>
</div>