- model_name = abstract_model.to_param - can_list = authorized? :index, abstract_model - can_delete = authorized? :delete, abstract_model - can_export = authorized? :export, abstract_model - can_create = authorized? :new, abstract_model - can_see_history = authorized? :history, abstract_model - if @model_config %li{:class => (params[:action] == 'index' && 'active')}= link_to @model_config.label_plural, index_path(:model_name => model_name) if can_list %li{:class => (params[:action] == 'new' && 'active')}= link_to t("admin.index.add_new"), new_path(:model_name => model_name) if can_create %li{:class => (params[:action] == 'for_model' && 'active')}= link_to t("admin.history.name"), history_model_path(:model_name => model_name) if can_see_history %li{:class => (params[:action] == 'export' && 'active')}= link_to t("admin.breadcrumbs.export").capitalize, export_path(model_name) if can_export - if params[:action] == 'index' - if (can_delete || can_export) %li.dropdown{:style => 'float:right', :'data-dropdown' => "dropdown"} %a.dropdown-toggle{:href => '#'}= t('admin.index.selected') + "..." %ul.dropdown-menu %li= link_to_function t("admin.index.export_selected"), "jQuery('#bulk_action').val('export'); jQuery('#bulk_form').submit()" if can_export %li= link_to_function t("admin.index.delete_selected"), "jQuery('#bulk_action').val('delete'); jQuery('#bulk_form').submit()" if can_delete - if @filterable_fields.present? %li.dropdown{:style => 'float:right', :'data-dropdown' => "dropdown"} %a.dropdown-toggle{:href => '#'}= t('admin.index.add_filter') + "..." %ul.dropdown-menu#filters - @filterable_fields.each do |field| - field_options = case field.type - when :enum - h options_for_select(field.with(:object => abstract_model.model.new).enum).gsub("\n", '') - else - '' %li %a{:href => '#', "data-field-label" => field.label, "data-field-name" => field.name, "data-field-options" => field_options, "data-field-type" => field.type, "data-field-value" => ""}= field.label