app/views/spotlight/appearances/edit.html.erb in blacklight-spotlight-0.1.0 vs app/views/spotlight/appearances/edit.html.erb in blacklight-spotlight-0.2.0
- old
+ new
@@ -2,27 +2,31 @@
<div id="content" class="col-md-9">
<%= administration_page_title %>
<%= bootstrap_form_for @appearance, url: spotlight.exhibit_appearance_path(@exhibit), layout: :horizontal, label_col: 'col-md-3', control_col: 'col-sm-5' do |f| %>
<%= field_set_tag do %>
+ <h3><%= t(:'.exhibit_style.heading') %></h3>
+ <%= f.check_box(:searchable, label: t(:'.exhibit_style.searchable.label')) %>
+ <% end %>
+ <%= field_set_tag do %>
<h3><%= t(:'.main_navigation.menu') %></h3>
<p class="instructions"><%= t(:'.main_navigation.help') %></p>
- <div class="panel-group dd main_navigation_admin col-sm-7" id="nested-navigation">
+ <div class="panel-group dd main_navigation_admin col-sm-7" id="nested-navigation" data-behavior="nestable" data-max-depth="1">
<ol class="dd-list">
<%= f.fields_for :main_navigations do |navigation| %>
<% @appearance.main_navigations.each do |nav| %>
<%= navigation.fields_for nav.id.to_s, nav do |label| %>
<li class="dd-item dd3-item" data-id="<%= nav.id %>">
<div class="dd3-content panel panel-default">
<div class="dd-handle dd3-handle"><%= t :drag %></div>
- <div class="panel-heading page" data-behavior="restore-default">
+ <div class="panel-heading" data-behavior="restore-default">
<%= label.hidden_field :id %>
<div class="row">
<div class="col-sm-8">
- <h3 class="panel-title" data-in-place-edit-target=".edit-in-place">
+ <h3 class="panel-title" data-in-place-edit-target=".edit-in-place" data-in-place-edit-field-target="[data-edit-field-target='true']">
<a href="#edit-in-place" class="field-label edit-in-place"><%= nav.label_or_default %></a>
- <%= label.hidden_field :label, data: {:"default-value" => nav.default_label} %>
+ <%= label.hidden_field :label, data: {:"default-value" => nav.default_label, :"edit-field-target" => 'true'} %>
</h3>
</div>
<div class="col-sm-4">
<%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn restore-default btn-default btn-sm pull-right #{'hidden' if nav.label.blank? || nav.label == nav.default_label}" %>
</div>
@@ -51,27 +55,64 @@
<%= f.form_group :default_per_page, label: { text: t(:'.default_per_page')} do %>
<% @appearance.per_page_options.each do |key| %>
<%= f.radio_button :default_per_page, key, label: key.to_s %>
<% end %>
<% end %>
+ <% end %>
+ <h3><%= t(:'.sort_fields.heading')%></h3>
+ <%= field_set_tag do %>
+ <p class="instructions"><%= t(:'.sort_fields.help') %></p>
- <%= f.form_group :thumbnail_size, label: { text: t(:'.thumbnail_size')} do %>
- <%= f.radio_button :thumbnail_size, 'small', label: t(:'.thumbnail.small') %>
- <%= f.radio_button :thumbnail_size, 'medium', label: t(:'.thumbnail.medium') %>
- <%= f.radio_button :thumbnail_size, 'large', label: t(:'.thumbnail.large') %>
+ <%= f.fields_for :sort_fields, @appearance.sort_fields do |vt| %>
+ <ol class="dd-list col-md-7 disabled-sort-option sort_fields_admin">
+ <li>
+ <div class="panel panel-default">
+ <div class="panel-content">
+ <div class="panel-heading">
+ <h3 class="panel-title">
+ <% default_field = @appearance.default_sort_field %>
+ <%= vt.fields_for default_field, @appearance.sort_fields[default_field] do |sort| %>
+ <%= sort.check_box_without_bootstrap :enable, { checked: true, disabled: true, data: { readonly: true } } %>
+ <%= sort.hidden_field :enabled, value: '1', data: { readonly: true } %>
+ <%= sort.hidden_field :label, {value: @appearance.sort_fields[default_field][:label], readonly: true } %>
+ <%= sort.hidden_field :weight, {value: "-1", readonly: true } %>
+ <%= @appearance.sort_fields[default_field][:label] %>
+ <% end %>
+ </h3>
+ (<%= translate_sort_fields(@appearance.configuration.blacklight_config.sort_fields[default_field]) %>)
+ </div>
+ </div>
+ </div>
+ </li>
+ </ol>
+ <div class="panel-group dd sort_fields_admin col-sm-7" id="nested-sort-fields" data-behavior="nestable" data-max-depth="1">
+ <ol class="dd-list">
+ <% @appearance.configuration.blacklight_config.sort_fields.except(default_field).each_with_index do |(k, config), index| %>
+ <li class="dd-item dd3-item" data-id="<%= k %>-id">
+ <div class="dd3-content panel panel-default">
+ <div class="dd-handle dd3-handle"><%= t(:drag) %></div>
+ <div class="panel-heading" data-behavior="restore-default">
+ <div class="row">
+ <div class="col-sm-12">
+ <%= vt.fields_for k, @appearance.sort_fields[k] do |sort| %>
+ <%= sort.check_box_without_bootstrap :enabled %>
+ <h3 class="panel-title" data-in-place-edit-target=".edit-in-place" data-in-place-edit-field-target="[data-edit-field-target='true']">
+ <a href="#edit-in-place" class="field-label edit-in-place"><%= @appearance.sort_fields[k][:label] %></a>
+ <%= sort.hidden_field :label, {data: {:"edit-field-target" => "true"}} %>
+ </h3>
+ (<%= translate_sort_fields(config) %>)
+ <%= sort.hidden_field :weight, {value: index, data: {property: "weight"}} %>
+ <% end %>
+ </div>
+ </div>
+ </div>
+ </div>
+ </li>
+ <% end %>
+ </ol>
+ </div>
<% end %>
-
- <%= f.form_group :sort_fields, label: {text: t(:'.sort_fields')} do %>
- <%= f.fields_for :sort_fields, @appearance.sort_fields do |vt| %>
- <%= vt.check_box :relevance, { checked: true, disabled: true, data: { readonly: true }} %>
- <% @appearance.sort_options.each do |k| %>
- <%= vt.check_box k %>
- <% end %>
- <% end %>
- <% end %>
-
<% end %>
-
<div class="form-actions">
<div class="primary-actions">
<%= f.submit nil, class: 'btn btn-primary' %>
</div>
</div>