app/views/spotlight/appearances/edit.html.erb in blacklight-spotlight-0.32.0 vs app/views/spotlight/appearances/edit.html.erb in blacklight-spotlight-0.33.0
- old
+ new
@@ -14,33 +14,53 @@
</ul>
</div>
<% end %>
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist">
- <li role="presentation" class="active">
+ <% if Spotlight::Engine.config.exhibit_themes.many? %>
+ <li role="presentation" class="active">
+ <a href="#site-theme" aria-controls="site-theme" role="tab" data-toggle="tab"><%= t(:'.site_theme.heading') %></a>
+ </li>
+ <% end %>
+
+ <li role="presentation" <%= 'class="active"'.html_safe unless Spotlight::Engine.config.exhibit_themes.many? %>>
<a href="#site-masthead" aria-controls="site-masthead" role="tab" data-toggle="tab"><%= t(:'.site_masthead.heading') %></a>
</li>
-
+
<li role="presentation">
<a href="#site-thumbnail" aria-controls="site-thumbnail" role="tab" data-toggle="tab"><%= t(:'.site_thumbnail.heading') %></a>
</li>
<li role="presentation">
<a href="#main-menu" aria-controls="main-menu" role="tab" data-toggle="tab"><%= t(:'.main_navigation.menu') %></a>
</li>
</ul>
<div class="tab-content">
- <div role="tabpanel" class="tab-pane active" id="site-masthead">
+ <% if Spotlight::Engine.config.exhibit_themes.many? %>
+ <div role="tabpanel" class="tab-pane active" id="site-theme">
+ <p class="instructions"><%= t(:'.site_theme.help') %></p>
+ <%= f.form_group :theme, label: { text: t(:'.site_theme.label') } do %>
+ <% Spotlight::Engine.config.exhibit_themes.each do |theme| %>
+ <div class="col-md-6">
+ <%= image_tag "spotlight/themes/#{theme}_preview", width: 100, height: 100 %>
+ <%= f.radio_button :theme, theme, label: t(:".site_theme.#{theme}", default: theme.to_s.titleize), inline: true %>
+ </div>
+ <% end %>
+ <% end %>
+ </div>
+ <% end %>
+
+ <div role="tabpanel" class="tab-pane <%= 'active' unless Spotlight::Engine.config.exhibit_themes.many? %>" id="site-masthead">
<p class="instructions"><%= t(:'.site_masthead.help') %></p>
<%= f.fields_for(:masthead, current_exhibit.masthead || current_exhibit.build_masthead) do |m| %>
- <%= render '/spotlight/featured_images/form', f: m, jcrop_options: default_masthead_jcrop_options %>
+ <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.masthead_initial_crop_selection, crop_type: :masthead %>
<% end %>
</div>
-
+
<div role="tabpanel" class="tab-pane" id="site-thumbnail">
<p class="instructions"><%= t(:'.site_thumbnail.help') %></p>
<%= f.fields_for(:thumbnail, current_exhibit.thumbnail || current_exhibit.build_thumbnail) do |m| %>
- <%= render '/spotlight/featured_images/form', f: m, jcrop_options: default_site_thumbnail_jcrop_options %>
+ <%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.thumbnail_initial_crop_selection, crop_type: :thumbnail %>
<% end %>
</div>
<div role="tabpanel" class="tab-pane" id="main-menu">
<%= field_set_tag do %>