blacklight-spotlight 4.3.5 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spotlight/spotlight.esm.js +20 -11
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  4. data/app/assets/javascripts/spotlight/spotlight.js +20 -11
  5. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  6. data/app/assets/stylesheets/spotlight/_accessibility.scss +9 -0
  7. data/app/assets/stylesheets/spotlight/_browse.scss +1 -0
  8. data/app/assets/stylesheets/spotlight/_mixins.scss +1 -0
  9. data/app/components/spotlight/breadcrumbs_component.rb +1 -3
  10. data/app/components/spotlight/edit_view_links_component.html.erb +13 -0
  11. data/app/components/spotlight/edit_view_links_component.rb +16 -0
  12. data/app/components/spotlight/solr_document_legacy_embed_component.rb +1 -1
  13. data/app/components/spotlight/tag_list_form_component.html.erb +1 -1
  14. data/app/controllers/spotlight/accessibility_controller.rb +48 -0
  15. data/app/helpers/spotlight/main_app_helpers.rb +1 -1
  16. data/app/helpers/spotlight/title_helper.rb +4 -0
  17. data/app/javascript/spotlight/admin/blocks/resources_block.js +16 -7
  18. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +0 -1
  19. data/app/javascript/spotlight/admin/pages.js +1 -0
  20. data/app/javascript/spotlight/admin/visibility_toggle.js +1 -1
  21. data/app/javascript/spotlight/user/clear_form_button.js +2 -2
  22. data/app/models/sir_trevor_rails/block.rb +12 -0
  23. data/app/models/sir_trevor_rails/blocks/solr_documents_block.rb +4 -0
  24. data/app/models/sir_trevor_rails/blocks/solr_documents_embed_block.rb +3 -0
  25. data/app/models/sir_trevor_rails/blocks/uploaded_items_block.rb +4 -0
  26. data/app/models/spotlight/custom_field.rb +1 -1
  27. data/app/services/spotlight/exhibit_import_export_service.rb +1 -0
  28. data/app/views/spotlight/accessibility/alt_text.html.erb +64 -0
  29. data/app/views/spotlight/browse/_search_box.html.erb +9 -11
  30. data/app/views/spotlight/dashboards/_page.html.erb +1 -9
  31. data/app/views/spotlight/exhibits/_form.html.erb +2 -2
  32. data/app/views/spotlight/feature_pages/_header.html.erb +1 -4
  33. data/app/views/spotlight/pages/_form.html.erb +1 -1
  34. data/app/views/spotlight/pages/_page.html.erb +1 -5
  35. data/app/views/spotlight/searches/_form.html.erb +3 -3
  36. data/app/views/spotlight/shared/_exhibit_sidebar.html.erb +1 -0
  37. data/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +2 -2
  38. data/config/locales/spotlight.en.yml +11 -2
  39. data/config/routes.rb +2 -0
  40. data/lib/spotlight/version.rb +1 -1
  41. metadata +6 -2
@@ -6,3 +6,12 @@
6
6
  outline: $input-focus-border-color auto 5px;
7
7
  }
8
8
  }
9
+
10
+ // CSS for accessibility dashboard
11
+ .alt-text-status .bi-exclamation-triangle-fill {
12
+ fill: $warning;
13
+ }
14
+
15
+ .alt-text-status .bi-check-circle-fill {
16
+ fill: $success;
17
+ }
@@ -142,6 +142,7 @@ $image-overlay-max-height: 300px;
142
142
  .btn-reset {
143
143
  background-color: transparent;
144
144
  display: none;
145
+ margin-left: -42px;
145
146
  left: -40px;
146
147
  z-index: 20;
147
148
  }
@@ -14,5 +14,6 @@
14
14
  @extend .bg-warning !optional;
15
15
  content: 'Private';
16
16
  margin-left: 3px;
17
+ color: black;
17
18
  }
18
19
  }
@@ -15,9 +15,7 @@ module Spotlight
15
15
  end
16
16
 
17
17
  def path(path)
18
- return path unless path.instance_of?(::Spotlight::Exhibit)
19
-
20
- helpers.exhibit_path(path)
18
+ helpers.url_for(path)
21
19
  end
22
20
  end
23
21
  end
@@ -0,0 +1,13 @@
1
+ <div class="<%= classes %>">
2
+ <% if page.is_a?(Spotlight::HomePage) %>
3
+ <%= helpers.exhibit_view_link page, helpers.exhibit_root_path(page.exhibit) %> &middot;
4
+ <%= helpers.exhibit_edit_link page, helpers.edit_exhibit_home_page_path(page.exhibit), data: { turbolinks: false,
5
+ turbo: false } %>
6
+ <% else %>
7
+ <%= helpers.exhibit_view_link page %> &middot;
8
+ <%= helpers.exhibit_edit_link page, data: { turbolinks: false, turbo: false } %>
9
+ <% end %>
10
+ <% if delete_link %>
11
+ &middot; <%= helpers.exhibit_delete_link page %>
12
+ <% end %>
13
+ </div>
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ # Allows component addition to exhibit navbar
5
+ class EditViewLinksComponent < ViewComponent::Base
6
+ attr_reader :page, :classes, :delete_link
7
+
8
+ def initialize(page:, classes: 'page-links', delete_link: false)
9
+ super
10
+
11
+ @page = page
12
+ @classes = classes
13
+ @delete_link = delete_link
14
+ end
15
+ end
16
+ end
@@ -12,7 +12,7 @@ module Spotlight
12
12
  end
13
13
 
14
14
  def before_render
15
- set_slot(:embed, nil, block_context: block_context) unless embed
15
+ set_slot(:embed, nil, block_context:) unless embed
16
16
 
17
17
  super
18
18
  end
@@ -1,5 +1,5 @@
1
1
  <% if Spotlight::Engine.config.site_tags %>
2
- <div class="form-group row">
2
+ <div class="form-group mb-3 row">
3
3
  <label class="col-form-label col-md-2" for="tag_list">Tag list</label>
4
4
  <div class="col-md-10">
5
5
  <div class="overflow-scroll rounded border px-3 py-2 h-25" style="overflow: scroll; height: 25vh!important;">
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spotlight
4
+ ##
5
+ # Exhibit dashboard controller
6
+ class AccessibilityController < Spotlight::ApplicationController
7
+ before_action :authenticate_user!
8
+ load_and_authorize_resource :exhibit, class: Spotlight::Exhibit
9
+
10
+ include Spotlight::Base
11
+ include Spotlight::SearchHelper
12
+
13
+ def alt_text
14
+ authorize! :curate, @exhibit
15
+
16
+ @limit = 5
17
+ # Sort by newest except for the homepage, which is always first
18
+ pages_with_alt = @exhibit.pages.order(Arel.sql('id = 1 DESC, created_at DESC')).select { |elem| elem.content.any?(&:alt_text?) }
19
+ pages = params[:show_all] ? pages_with_alt : pages_with_alt.first(@limit)
20
+ @pages = pages.map { |page| get_alt_info(page) }
21
+ @has_alt_text = @pages.sum { |page| page[:has_alt_text] }
22
+ @total_alt_items = @pages.sum { |page| page[:can_have_alt_text] }
23
+
24
+ attach_alt_text_breadcrumbs
25
+ end
26
+
27
+ private
28
+
29
+ def get_alt_info(page)
30
+ can_have_alt_text = 0
31
+ has_alt_text = 0
32
+ page.content.each do |content|
33
+ content.item&.each_value do |item|
34
+ can_have_alt_text += 1
35
+ has_alt_text += 1 if item['alt_text'].present? || item['decorative'].present?
36
+ end
37
+ end
38
+ complete = can_have_alt_text.zero? || has_alt_text / can_have_alt_text == 1
39
+ { can_have_alt_text:, has_alt_text:, page:, status: has_alt_text, complete: }
40
+ end
41
+
42
+ def attach_alt_text_breadcrumbs
43
+ add_breadcrumb(t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit)
44
+ add_breadcrumb(t(:'spotlight.accessibility.header'), exhibit_dashboard_path(@exhibit))
45
+ add_breadcrumb(t(:'spotlight.accessibility.alt_text.header'), exhibit_alt_text_path(@exhibit))
46
+ end
47
+ end
48
+ end
@@ -31,7 +31,7 @@ module Spotlight
31
31
 
32
32
  # Expecting to upstream this override in https://github.com/projectblacklight/blacklight/pull/3343/files
33
33
  def document_presenter(document, view_config: nil, **kwargs)
34
- (view_config&.document_presenter_class || document_presenter_class(document)).new(document, self, view_config: view_config, **kwargs)
34
+ (view_config&.document_presenter_class || document_presenter_class(document)).new(document, self, view_config:, **kwargs)
35
35
  end
36
36
 
37
37
  def document_presenter_class(_document)
@@ -8,6 +8,10 @@ module Spotlight
8
8
  page_title t(:'spotlight.curation.header'), title
9
9
  end
10
10
 
11
+ def accessibility_page_title(title = nil)
12
+ page_title t(:'spotlight.accessibility.header'), title
13
+ end
14
+
11
15
  def configuration_page_title(title = nil)
12
16
  page_title t(:'spotlight.configuration.header'), title
13
17
  end
@@ -8,18 +8,16 @@ Core.Block.Resources = (function(){
8
8
  formable: true,
9
9
  autocompleteable: true,
10
10
  show_heading: true,
11
- show_alt_text: true,
12
-
13
11
  title: function() { return i18n.t("blocks:" + this.type + ":title"); },
14
12
  description: function() { return i18n.t("blocks:" + this.type + ":description"); },
15
- alt_text_guidelines: function() {
16
- if (this.show_alt_text) {
13
+ alt_text_guidelines: function() {
14
+ if (this.showAltText()) {
17
15
  return i18n.t("blocks:alt_text_guidelines:intro");
18
16
  }
19
17
  return "";
20
18
  },
21
19
  alt_text_guidelines_link: function() {
22
- if (this.show_alt_text) {
20
+ if (this.showAltText()) {
23
21
  var link_url = i18n.t("blocks:alt_text_guidelines:link_url");
24
22
  var link_label = i18n.t("blocks:alt_text_guidelines:link_label");
25
23
  return '<a target="_blank" href="' + link_url + '">' + link_label + '</a>';
@@ -45,12 +43,23 @@ Core.Block.Resources = (function(){
45
43
  },
46
44
 
47
45
  _altTextFieldsHTML: function(index, data) {
48
- if (this.show_alt_text) {
46
+ if (this.showAltText()) {
49
47
  return this.altTextHTML(index, data);
50
48
  }
51
49
  return "";
52
50
  },
53
51
 
52
+ showAltText: function() {
53
+ return this.editorOptions.altTextSettings[this._typeAsCamelCase()]
54
+ },
55
+
56
+ _typeAsCamelCase: function() {
57
+ return this.type
58
+ .split('_')
59
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
60
+ .join('');
61
+ },
62
+
54
63
  _itemPanel: function(data) {
55
64
  var index = "item_" + this.globalIndex++;
56
65
  var checked;
@@ -188,7 +197,7 @@ Core.Block.Resources = (function(){
188
197
  },
189
198
 
190
199
  attachAltTextHandlers: function(panel) {
191
- if (this.show_alt_text) {
200
+ if (this.showAltText()) {
192
201
  const decorativeCheckbox = $('input[name$="[decorative]"]', panel);
193
202
  const altTextInput = $('textarea[name$="[alt_text]"]', panel);
194
203
  const altTextBackupInput = $('input[name$="[alt_text_backup]"]', panel);
@@ -4,7 +4,6 @@ SirTrevor.Blocks.SolrDocumentsEmbed = (function(){
4
4
 
5
5
  return SirTrevor.Blocks.SolrDocumentsBase.extend({
6
6
  type: "solr_documents_embed",
7
- show_alt_text: false,
8
7
  icon_name: "item_embed",
9
8
 
10
9
  item_options: function() { return "" },
@@ -25,6 +25,7 @@ export default class {
25
25
  var editor = new SirTrevor.Editor({
26
26
  el: instance[0],
27
27
  blockTypes: instance.data('blockTypes'),
28
+ altTextSettings: instance.data('altTextSettings'),
28
29
  defaultType:["Text"],
29
30
  onEditorRender: function() {
30
31
  $.SerializedForm();
@@ -7,7 +7,7 @@ const VisibilityToggle = (e) => {
7
7
  if (e.target.matches('[data-checkboxsubmit-target="checkbox"]')) {
8
8
  const form = e.target.closest('form')
9
9
  if (form) {
10
- new CheckboxSubmit(form).clicked(e)
10
+ if (!Blacklight.BookmarkToggle) new CheckboxSubmit(form).clicked(e)
11
11
 
12
12
  // Add/remove the "private" label to the document row when visibility is toggled
13
13
  const docRow = form.closest('tr')
@@ -1,10 +1,10 @@
1
1
  export default class {
2
2
  connect() {
3
3
  var $clearBtn = $('.btn-reset');
4
- var $input = $clearBtn.parent().prev('input');
4
+ var $input = $clearBtn.prev('#browse_q');
5
5
  var btnCheck = function(){
6
6
  if ($input.val() !== '') {
7
- $clearBtn.css('display', 'inline-block');
7
+ $clearBtn.css('display', 'block');
8
8
  } else {
9
9
  $clearBtn.css('display', 'none');
10
10
  }
@@ -18,12 +18,24 @@ module SirTrevorRails
18
18
  send(:[], :format).present? ? send(:[], :format).to_sym : DEFAULT_FORMAT
19
19
  end
20
20
 
21
+ def alt_text?
22
+ self.class.alt_text?
23
+ end
24
+
25
+ def self.alt_text?
26
+ false
27
+ end
28
+
21
29
  # Sets a list of custom block types to speed up lookup at runtime.
22
30
  def self.custom_block_types
23
31
  # You can define your custom block types directly here or in your engine config.
24
32
  Spotlight::Engine.config.sir_trevor_widgets
25
33
  end
26
34
 
35
+ def self.custom_block_type_alt_text_settings
36
+ custom_block_types.index_with { |block_type| SirTrevorRails::Block.block_class(block_type).alt_text? }
37
+ end
38
+
27
39
  def initialize(hash, parent)
28
40
  @raw_data = hash
29
41
  @parent = parent
@@ -13,6 +13,10 @@ module SirTrevorRails
13
13
  @solr_helper = solr_helper
14
14
  end
15
15
 
16
+ def self.alt_text?
17
+ true
18
+ end
19
+
16
20
  def each_document
17
21
  return to_enum(:each_document) unless block_given?
18
22
 
@@ -5,6 +5,9 @@ module SirTrevorRails
5
5
  ##
6
6
  # Embed documents (using a special blacklight view configuration) and text block
7
7
  class SolrDocumentsEmbedBlock < SirTrevorRails::Blocks::SolrDocumentsBlock
8
+ def self.alt_text?
9
+ false
10
+ end
8
11
  end
9
12
  end
10
13
  end
@@ -12,6 +12,10 @@ module SirTrevorRails
12
12
  (item || {}).map { |_, file| file }.select { |file| file[:display].to_s == 'true' }
13
13
  end
14
14
 
15
+ def self.alt_text?
16
+ true
17
+ end
18
+
15
19
  def zpr_link?
16
20
  zpr_link == 'true'
17
21
  end
@@ -39,7 +39,7 @@ module Spotlight
39
39
  else
40
40
  configuration
41
41
  end
42
- conf['label']
42
+ conf['label'] || conf[:label]
43
43
  end
44
44
 
45
45
  def short_description=(short_description)
@@ -164,6 +164,7 @@ module Spotlight
164
164
 
165
165
  hash[:custom_fields].each do |attr|
166
166
  ar = exhibit.custom_fields.find_or_initialize_by(slug: attr[:slug])
167
+ attr[:configuration] = attr[:configuration].clone.transform_keys(&:to_s)
167
168
  ar.update(attr)
168
169
  end
169
170
 
@@ -0,0 +1,64 @@
1
+ <% content_for(:sidebar) do %>
2
+ <%= render 'spotlight/shared/exhibit_sidebar' %>
3
+ <% end %>
4
+
5
+ <%= accessibility_page_title t(:".header") %>
6
+
7
+ <p>
8
+ <%= t(:'.total_items', has_alt_text: @has_alt_text, total_alt_items: @total_alt_items).html_safe %>
9
+ </p>
10
+
11
+ <p>
12
+ <%= t(:'.note') %>
13
+ </p>
14
+ <table class="table table-striped">
15
+ <thead>
16
+ <tr class="d-flex">
17
+ <th class="col-6">
18
+ <%= t :'.table.page_title' %>
19
+ </th>
20
+ <th class="col-3">
21
+ <%= t :'.table.has_alt_text' %>
22
+ </th>
23
+ <th class="col-3">
24
+ <%= t :'.table.can_have_alt_text' %>
25
+ </th>
26
+ </tr>
27
+ </thead>
28
+ <tbody>
29
+ <% @pages.each do | page_dict | %>
30
+ <% page = page_dict[:page] %>
31
+ <tr class="d-flex">
32
+ <td class="col-6">
33
+ <h4 class="h5 mb-0">
34
+ <%= page.title %>
35
+ <span class="alt-text-status">
36
+ <% if page_dict[:complete] %>
37
+ <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" class="bi bi-check-circle-fill">
38
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
39
+ </svg>
40
+ <% else %>
41
+ <svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" class="bi bi-exclamation-triangle-fill">
42
+ <path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/>
43
+ </svg>
44
+ <% end %>
45
+ </span>
46
+ </h4>
47
+ <%= render Spotlight::EditViewLinksComponent.new(page:, classes:'page-links pt-0') %>
48
+ </td>
49
+ <td class="col-3">
50
+ <%= page_dict[:has_alt_text] %>
51
+ </td>
52
+ <td class="col-3">
53
+ <%= page_dict[:can_have_alt_text] %>
54
+ </td>
55
+ </tr>
56
+ <% end %>
57
+ </tbody>
58
+ </table>
59
+
60
+ <% unless params[:show_all] || @pages.length < @limit %>
61
+ <%= link_to '?show_all=true', class: 'ml-3' do %>
62
+ Show all<%= blacklight_icon('chevron_right') %>
63
+ <% end %>
64
+ <% end %>
@@ -1,21 +1,19 @@
1
1
  <div class="search-box-container">
2
2
  <%= form_tag exhibit_browse_path(current_exhibit, search), method: :get, class: 'browse-search-form search-query-form form-horizontal', role: 'search', 'aria-labelledby' => 'browse-search-form' do %>
3
3
  <%= render Blacklight::HiddenSearchStateComponent.new(params: search_state.params_for_search.except(:q, :search_field, :exhibit_id, :qt, :page)) %>
4
- <div class="form-group mb-3 row">
4
+ <div class="form-group mb-5 row">
5
5
  <label id="browse-search-form" class="col-sm-4 col-form-label h6" for="browse_q"><%= t(:'.label') %></label>
6
6
  <div class="col-sm-6">
7
7
  <div class="input-group">
8
8
  <%= text_field_tag :q, params[:q], placeholder: t(:'.placeholder'), class: "form-control", id: "browse_q" %>
9
- <span class="input-group-btn input-group-append">
10
- <button class="btn btn-reset btn-sm" type="reset">
11
- <span class="sr-only visually-hidden"><%= t(:'.reset') %></span>
12
- <%= blacklight_icon('highlight_off') %>
13
- </button>
14
- <button type="submit" class="btn btn-primary search-btn" id="browse-search">
15
- <span class="submit-search-text"><%= t(:'.submit') %></span>
16
- <%= blacklight_icon('search', aria_hidden: true) %>
17
- </button>
18
- </span>
9
+ <button class="btn btn-reset btn-sm" type="reset">
10
+ <span class="sr-only visually-hidden"><%= t(:'.reset') %></span>
11
+ <%= blacklight_icon('highlight_off') %>
12
+ </button>
13
+ <button type="submit" class="btn btn-primary search-btn" id="browse-search">
14
+ <span class="submit-search-text"><%= t(:'.submit') %></span>
15
+ <%= blacklight_icon('search', aria_hidden: true) %>
16
+ </button>
19
17
  </div>
20
18
  </div>
21
19
  </div>
@@ -1,15 +1,7 @@
1
1
  <tr class="d-flex">
2
2
  <td class="col-6">
3
3
  <h4 class="h5 mb-0"><%= page.title %></h4>
4
- <div class="page-links pt-0">
5
- <% if page.is_a?(Spotlight::HomePage) %>
6
- <%= link_to action_default_value(page, :view), current_exhibit %> &middot;
7
- <%= exhibit_edit_link page, edit_exhibit_home_page_path(page.exhibit), data: { turbolinks: false, turbo: false } %>
8
- <% else %>
9
- <%= exhibit_view_link page %> &middot;
10
- <%= exhibit_edit_link page, data: { turbolinks: false, turbo: false } %>
11
- <% end %>
12
- </div>
4
+ <%= render Spotlight::EditViewLinksComponent.new(page:, classes: 'page-links pt-0') %>
13
5
  </td>
14
6
  <td class="col-4"><%= page.last_edited_by.to_s if page.last_edited_by %></td>
15
7
  <td class="col-2"><%= l page.updated_at, format: :long %></td>
@@ -11,8 +11,8 @@
11
11
  <button id='another-email' class="btn btn-sm btn-info"><%= t('.add_contact_email_button') %></button>
12
12
  <div class="form-text text-muted mb-3"><%= t(:'.fields.contact_emails.help_block') %></div>
13
13
  <% end %>
14
- <%= f.form_group :published, label: { text: nil, class: 'pt-0' }, help: nil do %>
15
- <%= f.check_box :published, label: "" %>
14
+ <%= f.form_group :published, label: { class: 'pt-0 col-md-2 col-form-label' }, help: nil do %>
15
+ <%= f.check_box_without_bootstrap :published %>
16
16
  <div class="form-text text-muted mb-3"><%= t(:'.fields.published.help_block') %></div>
17
17
  <% end %>
18
18
 
@@ -11,10 +11,7 @@
11
11
  <%= p.hidden_field :title, value: page.title , class: 'form-control form-control-sm title-field', data: {:"edit-field-target" => 'true'} %>
12
12
  </h3>
13
13
  </div>
14
- <div class="page-links">
15
- <%= exhibit_view_link page, exhibit_root_path(page.exhibit) %> &middot;
16
- <%= exhibit_edit_link page, edit_exhibit_home_page_path(page.exhibit), data: { turbolinks: false } %>
17
- </div>
14
+ <%= render Spotlight::EditViewLinksComponent.new(page:) %>
18
15
  </div>
19
16
  </div>
20
17
  </div>
@@ -40,7 +40,7 @@
40
40
  </div>
41
41
  <div class="form-group mb-3">
42
42
  <%= f.label :content, class: 'sr-only visually-hidden' %>
43
- <%= f.text_area_without_bootstrap :content, value: { data: f.object.content.as_json }.to_json, class: content_editor_class(f.object), data: { 'block-types': SirTrevorRails::Block.custom_block_types } %>
43
+ <%= f.text_area_without_bootstrap :content, value: { data: f.object.content.as_json }.to_json, class: content_editor_class(f.object), data: { 'block-types': SirTrevorRails::Block.custom_block_types, 'alt-text-settings': SirTrevorRails::Block.custom_block_type_alt_text_settings } %>
44
44
  </div>
45
45
  </div>
46
46
 
@@ -1,11 +1,7 @@
1
1
  <% page = f.object %>
2
2
  <%= render layout: 'spotlight/shared/dd3_item', locals: { id: page.id.to_s, field: f, label: page.title, label_method: :title, enabled_method: :published } do |_, section| %>
3
3
  <% case section when :additional_options %>
4
- <div class="page-links">
5
- <%= exhibit_view_link page %> &middot;
6
- <%= exhibit_edit_link page, data: { turbolinks: false, turbo: false } %> &middot;
7
- <%= exhibit_delete_link page %>
8
- </div>
4
+ <%= render Spotlight::EditViewLinksComponent.new(page:, delete_link: true) %>
9
5
  <%- if page.feature_page? -%>
10
6
  <%= f.hidden_field :parent_page_id, data: {property: "parent_page"} %>
11
7
  <% end %>
@@ -35,10 +35,10 @@
35
35
  <%= f.text_field :title, control_col: "col-sm-5" %>
36
36
  <%= f.text_field :subtitle, control_col: "col-sm-5" %>
37
37
  <%= f.text_area :long_description, rows: 5 %>
38
- <%= f.form_group :search_box, label: { text: t(:'.search_box.label'), class: 'pt-0' }, help: t(:'.search_box.help_block') do %>
39
- <%= f.check_box :search_box, label: t(:'.search_box.checkbox_label') %>
38
+ <%= f.form_group :search_box, label: { text: t(:'.search_box.label'), class: 'pt-0 col-md-2 col-sm-2 col-form-label' }, help: t(:'.search_box.help_block') do %>
39
+ <%= f.check_box_without_bootstrap :search_box %>
40
40
  <% end %>
41
- <%= f.form_group label: { text: t(:".default_index_view_type"), class: 'pt-0' } do %>
41
+ <%= f.form_group label: { text: t(:".default_index_view_type") } do %>
42
42
  <% available_document_index_views.each do |key, view| %>
43
43
  <%= f.radio_button :default_index_view_type, key, label: view.display_label %>
44
44
  <% end %>
@@ -4,6 +4,7 @@
4
4
  <% if current_exhibit.analytics_provider&.enabled? %>
5
5
  <%= nav_link t(:'spotlight.curation.sidebar.analytics'), spotlight.analytics_exhibit_dashboard_path(current_exhibit) %>
6
6
  <% end %>
7
+ <%= nav_link t(:'spotlight.accessibility.header'), spotlight.exhibit_alt_text_path(current_exhibit) %>
7
8
  </ul>
8
9
  <%= render 'spotlight/shared/configuration_sidebar' if can? :update, current_exhibit %>
9
10
  <%= render 'spotlight/shared/curation_sidebar' %>
@@ -1,5 +1,5 @@
1
1
  <div class="content-block item-text row d-block clearfix">
2
- <div class="items-col spotlight-flexbox <%= 'col-md-6' if uploaded_items_block.text? %> col-12 <%= uploaded_items_block.content_align == 'right' ? 'float-right float-end' : 'float-left float-start' %> uploaded-items-block">
2
+ <div class="items-col spotlight-flexbox <%= uploaded_items_block.text? ? "col-md-6" : "col-md-12" %> <%= uploaded_items_block.content_align == 'right' ? 'float-right float-end' : 'float-left float-start' %> uploaded-items-block">
3
3
  <% if uploaded_items_block.files.present? %>
4
4
  <% uploaded_items_block.files.each do |file| %>
5
5
  <div class="box" data-id="<%= file[:id] %>">
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
 
30
30
  <% if uploaded_items_block.text? %>
31
- <div class="text-col col-md-6 mw-100">
31
+ <div class="text-col col-md-6 mw-100 w-auto">
32
32
  <%= content_tag(:h3, uploaded_items_block.title) if uploaded_items_block.title.present? %>
33
33
  <%= sir_trevor_markdown uploaded_items_block.text %>
34
34
  </div>
@@ -191,6 +191,16 @@ en:
191
191
  instructions: Enter details for each librarian, curator or other contact person for this exhibit. Select the contacts you want to be show in the sidebar of the about pages. Drag and drop contacts to specify the order in which they are shown in the sidebar.
192
192
  page_options:
193
193
  published: Publish
194
+ accessibility:
195
+ alt_text:
196
+ header: Alternative text
197
+ note: Items displayed via Item Embed are excluded from these totals, as it not currently possible to add alt text using this widget.
198
+ table:
199
+ can_have_alt_text: Total items on page
200
+ has_alt_text: Items with alt text
201
+ page_title: Page title
202
+ total_items: Of the items displayed via widgets, <b>%{has_alt_text} of %{total_alt_items}</b> have entered alt text (or a checked decorative box).
203
+ header: Accessibility
194
204
  admin_users:
195
205
  create:
196
206
  error: There was a problem adding the user as an exhibits adminstrator
@@ -899,9 +909,8 @@ en:
899
909
  help_secondary: To create a browse category-specific masthead, you should use an image that is at least 120 pixels tall and 1200 pixels wide. For best results use an image at least 1800 pixels wide. You can crop larger images using the cropping tool below.
900
910
  query_params: Search parameters
901
911
  search_box:
902
- checkbox_label: Display
903
912
  help_block: Displays a search box that enables users to search within the browse category results
904
- label: Search box
913
+ label: Display search box
905
914
  search_description: Description
906
915
  search_group: Group
907
916
  search_masthead: Masthead
data/config/routes.rb CHANGED
@@ -74,6 +74,8 @@ Spotlight::Engine.routes.draw do
74
74
  get :analytics
75
75
  end
76
76
 
77
+ get '/accessibility/alt-text', to: 'accessibility#alt_text', as: 'alt_text'
78
+
77
79
  resources :resources do
78
80
  collection do
79
81
  get :monitor
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '4.3.5'
4
+ VERSION = '4.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.5
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-11-07 00:00:00.000000000 Z
14
+ date: 2024-11-26 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activejob-status
@@ -925,6 +925,8 @@ files:
925
925
  - app/components/spotlight/document_admin_table_component.html.erb
926
926
  - app/components/spotlight/document_admin_table_component.rb
927
927
  - app/components/spotlight/document_component.rb
928
+ - app/components/spotlight/edit_view_links_component.html.erb
929
+ - app/components/spotlight/edit_view_links_component.rb
928
930
  - app/components/spotlight/exhibit_navbar_component.html.erb
929
931
  - app/components/spotlight/exhibit_navbar_component.rb
930
932
  - app/components/spotlight/header_component.html.erb
@@ -940,6 +942,7 @@ files:
940
942
  - app/controllers/concerns/spotlight/controller.rb
941
943
  - app/controllers/concerns/spotlight/search_helper.rb
942
944
  - app/controllers/spotlight/about_pages_controller.rb
945
+ - app/controllers/spotlight/accessibility_controller.rb
943
946
  - app/controllers/spotlight/admin_users_controller.rb
944
947
  - app/controllers/spotlight/appearances_controller.rb
945
948
  - app/controllers/spotlight/application_controller.rb
@@ -1209,6 +1212,7 @@ files:
1209
1212
  - app/views/spotlight/about_pages/_page_options.html.erb
1210
1213
  - app/views/spotlight/about_pages/_sidebar.html.erb
1211
1214
  - app/views/spotlight/about_pages/index.html.erb
1215
+ - app/views/spotlight/accessibility/alt_text.html.erb
1212
1216
  - app/views/spotlight/admin_users/index.html.erb
1213
1217
  - app/views/spotlight/appearances/edit.html.erb
1214
1218
  - app/views/spotlight/browse/_search.html.erb