blacklight-frontend 7.10.0 → 7.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +2 -4
  2. package/app/assets/images/blacklight/list.svg +1 -0
  3. package/app/assets/images/blacklight/logo.png +0 -0
  4. package/app/assets/images/blacklight/search.svg +1 -0
  5. package/app/assets/images/favicon.ico +0 -0
  6. package/app/assets/javascripts/blacklight/blacklight.js +54 -30
  7. package/app/assets/stylesheets/blacklight/_balanced_list.scss +2 -2
  8. package/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +1 -1
  9. package/app/assets/stylesheets/blacklight/_constraints.scss +8 -5
  10. package/app/assets/stylesheets/blacklight/_controls.scss +10 -1
  11. package/app/assets/stylesheets/blacklight/_facets.scss +5 -3
  12. package/app/assets/stylesheets/blacklight/_header.scss +6 -6
  13. package/app/assets/stylesheets/blacklight/_icons.scss +5 -1
  14. package/app/assets/stylesheets/blacklight/_pagination.scss +1 -1
  15. package/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +1 -0
  16. package/app/assets/stylesheets/blacklight/blacklight_defaults.scss +5 -1
  17. package/app/javascript/blacklight/button_focus.js +1 -0
  18. package/app/javascript/blacklight/core.js +16 -3
  19. package/app/javascript/blacklight/modal.js +12 -6
  20. package/app/javascript/blacklight/search_context.js +5 -3
  21. package/package.json +9 -3
  22. package/CONTRIBUTING.md +0 -50
  23. package/Gemfile.lock +0 -374
  24. package/VERSION +0 -1
  25. package/app/builders/blacklight/action_builder.rb +0 -57
  26. package/app/components/blacklight/constraint_layout_component.html.erb +0 -23
  27. package/app/components/blacklight/constraint_layout_component.rb +0 -16
  28. package/app/components/blacklight/document_component.html.erb +0 -29
  29. package/app/components/blacklight/document_component.rb +0 -121
  30. package/app/components/blacklight/document_metadata_component.html.erb +0 -5
  31. package/app/components/blacklight/document_metadata_component.rb +0 -21
  32. package/app/components/blacklight/facet_field_component.html.erb +0 -25
  33. package/app/components/blacklight/facet_field_component.rb +0 -11
  34. package/app/components/blacklight/facet_field_list_component.html.erb +0 -18
  35. package/app/components/blacklight/facet_field_list_component.rb +0 -22
  36. package/app/components/blacklight/facet_field_no_layout_component.rb +0 -13
  37. package/app/components/blacklight/facet_item_component.rb +0 -120
  38. package/app/components/blacklight/facet_item_pivot_component.rb +0 -84
  39. package/app/components/blacklight/metadata_field_component.html.erb +0 -8
  40. package/app/components/blacklight/metadata_field_component.rb +0 -31
  41. package/app/components/blacklight/metadata_field_layout_component.html.erb +0 -2
  42. package/app/components/blacklight/metadata_field_layout_component.rb +0 -16
  43. package/app/values/blacklight/types.rb +0 -31
  44. package/config/i18n-tasks.yml +0 -17
  45. package/docker-compose.yml +0 -35
package/Gemfile.lock DELETED
@@ -1,374 +0,0 @@
1
- PATH
2
- remote: /Users/pjreed/dev/blacklight
3
- specs:
4
- blacklight (7.10.0)
5
- deprecation
6
- globalid
7
- jbuilder (~> 2.7)
8
- kaminari (>= 0.15)
9
- rails (>= 5.1, < 7)
10
- view_component
11
-
12
- GEM
13
- remote: https://rubygems.org/
14
- specs:
15
- actioncable (6.0.3.2)
16
- actionpack (= 6.0.3.2)
17
- nio4r (~> 2.0)
18
- websocket-driver (>= 0.6.1)
19
- actionmailbox (6.0.3.2)
20
- actionpack (= 6.0.3.2)
21
- activejob (= 6.0.3.2)
22
- activerecord (= 6.0.3.2)
23
- activestorage (= 6.0.3.2)
24
- activesupport (= 6.0.3.2)
25
- mail (>= 2.7.1)
26
- actionmailer (6.0.3.2)
27
- actionpack (= 6.0.3.2)
28
- actionview (= 6.0.3.2)
29
- activejob (= 6.0.3.2)
30
- mail (~> 2.5, >= 2.5.4)
31
- rails-dom-testing (~> 2.0)
32
- actionpack (6.0.3.2)
33
- actionview (= 6.0.3.2)
34
- activesupport (= 6.0.3.2)
35
- rack (~> 2.0, >= 2.0.8)
36
- rack-test (>= 0.6.3)
37
- rails-dom-testing (~> 2.0)
38
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
39
- actiontext (6.0.3.2)
40
- actionpack (= 6.0.3.2)
41
- activerecord (= 6.0.3.2)
42
- activestorage (= 6.0.3.2)
43
- activesupport (= 6.0.3.2)
44
- nokogiri (>= 1.8.5)
45
- actionview (6.0.3.2)
46
- activesupport (= 6.0.3.2)
47
- builder (~> 3.1)
48
- erubi (~> 1.4)
49
- rails-dom-testing (~> 2.0)
50
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
51
- activejob (6.0.3.2)
52
- activesupport (= 6.0.3.2)
53
- globalid (>= 0.3.6)
54
- activemodel (6.0.3.2)
55
- activesupport (= 6.0.3.2)
56
- activerecord (6.0.3.2)
57
- activemodel (= 6.0.3.2)
58
- activesupport (= 6.0.3.2)
59
- activestorage (6.0.3.2)
60
- actionpack (= 6.0.3.2)
61
- activejob (= 6.0.3.2)
62
- activerecord (= 6.0.3.2)
63
- marcel (~> 0.3.1)
64
- activesupport (6.0.3.2)
65
- concurrent-ruby (~> 1.0, >= 1.0.2)
66
- i18n (>= 0.7, < 2)
67
- minitest (~> 5.1)
68
- tzinfo (~> 1.1)
69
- zeitwerk (~> 2.2, >= 2.2.2)
70
- addressable (2.7.0)
71
- public_suffix (>= 2.0.2, < 5.0)
72
- ast (2.4.1)
73
- autoprefixer-rails (9.8.2)
74
- execjs
75
- bcrypt (3.1.13)
76
- bindex (0.8.1)
77
- bootstrap (4.5.0)
78
- autoprefixer-rails (>= 9.1.0)
79
- popper_js (>= 1.14.3, < 2)
80
- sassc-rails (>= 2.0.0)
81
- builder (3.2.4)
82
- byebug (11.1.3)
83
- capybara (3.33.0)
84
- addressable
85
- mini_mime (>= 0.1.3)
86
- nokogiri (~> 1.8)
87
- rack (>= 1.6.0)
88
- rack-test (>= 0.6.3)
89
- regexp_parser (~> 1.5)
90
- xpath (~> 3.2)
91
- childprocess (3.0.0)
92
- concurrent-ruby (1.1.6)
93
- crass (1.0.6)
94
- deprecation (1.0.0)
95
- activesupport
96
- devise (4.7.2)
97
- bcrypt (~> 3.0)
98
- orm_adapter (~> 0.1)
99
- railties (>= 4.1.0)
100
- responders
101
- warden (~> 1.2.3)
102
- devise-guests (0.7.0)
103
- devise
104
- diff-lcs (1.3)
105
- docile (1.3.2)
106
- engine_cart (2.3.0)
107
- rails
108
- equivalent-xml (0.6.0)
109
- nokogiri (>= 1.4.3)
110
- erubi (1.9.0)
111
- execjs (2.7.0)
112
- faraday (1.0.1)
113
- multipart-post (>= 1.2, < 3)
114
- ffi (1.13.1)
115
- globalid (0.4.2)
116
- activesupport (>= 4.2.0)
117
- highline (2.0.3)
118
- i18n (1.8.3)
119
- concurrent-ruby (~> 1.0)
120
- i18n-tasks (0.9.31)
121
- activesupport (>= 4.0.2)
122
- ast (>= 2.1.0)
123
- erubi
124
- highline (>= 2.0.0)
125
- i18n
126
- parser (>= 2.2.3.0)
127
- rails-i18n
128
- rainbow (>= 2.2.2, < 4.0)
129
- terminal-table (>= 1.5.1)
130
- jbuilder (2.10.0)
131
- activesupport (>= 5.0.0)
132
- jquery-rails (4.4.0)
133
- rails-dom-testing (>= 1, < 3)
134
- railties (>= 4.2.0)
135
- thor (>= 0.14, < 2.0)
136
- kaminari (1.2.1)
137
- activesupport (>= 4.1.0)
138
- kaminari-actionview (= 1.2.1)
139
- kaminari-activerecord (= 1.2.1)
140
- kaminari-core (= 1.2.1)
141
- kaminari-actionview (1.2.1)
142
- actionview
143
- kaminari-core (= 1.2.1)
144
- kaminari-activerecord (1.2.1)
145
- activerecord
146
- kaminari-core (= 1.2.1)
147
- kaminari-core (1.2.1)
148
- loofah (2.6.0)
149
- crass (~> 1.0.2)
150
- nokogiri (>= 1.5.9)
151
- mail (2.7.1)
152
- mini_mime (>= 0.1.1)
153
- marcel (0.3.3)
154
- mimemagic (~> 0.3.2)
155
- method_source (1.0.0)
156
- mimemagic (0.3.5)
157
- mini_mime (1.0.2)
158
- mini_portile2 (2.4.0)
159
- minitest (5.14.1)
160
- multipart-post (2.1.1)
161
- nio4r (2.5.2)
162
- nokogiri (1.10.9)
163
- mini_portile2 (~> 2.4.0)
164
- orm_adapter (0.5.0)
165
- parallel (1.19.2)
166
- parser (2.7.1.4)
167
- ast (~> 2.4.1)
168
- popper_js (1.16.0)
169
- public_suffix (4.0.5)
170
- puma (4.3.5)
171
- nio4r (~> 2.0)
172
- rack (2.2.3)
173
- rack-proxy (0.6.5)
174
- rack
175
- rack-test (1.1.0)
176
- rack (>= 1.0, < 3)
177
- rails (6.0.3.2)
178
- actioncable (= 6.0.3.2)
179
- actionmailbox (= 6.0.3.2)
180
- actionmailer (= 6.0.3.2)
181
- actionpack (= 6.0.3.2)
182
- actiontext (= 6.0.3.2)
183
- actionview (= 6.0.3.2)
184
- activejob (= 6.0.3.2)
185
- activemodel (= 6.0.3.2)
186
- activerecord (= 6.0.3.2)
187
- activestorage (= 6.0.3.2)
188
- activesupport (= 6.0.3.2)
189
- bundler (>= 1.3.0)
190
- railties (= 6.0.3.2)
191
- sprockets-rails (>= 2.0.0)
192
- rails-controller-testing (1.0.4)
193
- actionpack (>= 5.0.1.x)
194
- actionview (>= 5.0.1.x)
195
- activesupport (>= 5.0.1.x)
196
- rails-dom-testing (2.0.3)
197
- activesupport (>= 4.2.0)
198
- nokogiri (>= 1.6)
199
- rails-html-sanitizer (1.3.0)
200
- loofah (~> 2.3)
201
- rails-i18n (6.0.0)
202
- i18n (>= 0.7, < 2)
203
- railties (>= 6.0.0, < 7)
204
- railties (6.0.3.2)
205
- actionpack (= 6.0.3.2)
206
- activesupport (= 6.0.3.2)
207
- method_source
208
- rake (>= 0.8.7)
209
- thor (>= 0.20.3, < 2.0)
210
- rainbow (3.0.0)
211
- rake (13.0.1)
212
- regexp_parser (1.7.1)
213
- responders (3.0.1)
214
- actionpack (>= 5.0)
215
- railties (>= 5.0)
216
- retriable (3.1.2)
217
- rexml (3.2.4)
218
- rsolr (2.3.0)
219
- builder (>= 2.1.2)
220
- faraday (>= 0.9.0)
221
- rspec-collection_matchers (1.2.0)
222
- rspec-expectations (>= 2.99.0.beta1)
223
- rspec-core (3.9.2)
224
- rspec-support (~> 3.9.3)
225
- rspec-expectations (3.9.2)
226
- diff-lcs (>= 1.2.0, < 2.0)
227
- rspec-support (~> 3.9.0)
228
- rspec-its (1.3.0)
229
- rspec-core (>= 3.0.0)
230
- rspec-expectations (>= 3.0.0)
231
- rspec-mocks (3.9.1)
232
- diff-lcs (>= 1.2.0, < 2.0)
233
- rspec-support (~> 3.9.0)
234
- rspec-rails (4.0.1)
235
- actionpack (>= 4.2)
236
- activesupport (>= 4.2)
237
- railties (>= 4.2)
238
- rspec-core (~> 3.9)
239
- rspec-expectations (~> 3.9)
240
- rspec-mocks (~> 3.9)
241
- rspec-support (~> 3.9)
242
- rspec-support (3.9.3)
243
- rubocop (0.89.1)
244
- parallel (~> 1.10)
245
- parser (>= 2.7.1.1)
246
- rainbow (>= 2.2.2, < 4.0)
247
- regexp_parser (>= 1.7)
248
- rexml
249
- rubocop-ast (>= 0.3.0, < 1.0)
250
- ruby-progressbar (~> 1.7)
251
- unicode-display_width (>= 1.4.0, < 2.0)
252
- rubocop-ast (0.3.0)
253
- parser (>= 2.7.1.4)
254
- rubocop-rails (2.7.1)
255
- activesupport (>= 4.2.0)
256
- rack (>= 1.1)
257
- rubocop (>= 0.87.0)
258
- rubocop-rspec (1.43.2)
259
- rubocop (~> 0.87)
260
- ruby-progressbar (1.10.1)
261
- rubyzip (1.3.0)
262
- sass-rails (6.0.0)
263
- sassc-rails (~> 2.1, >= 2.1.1)
264
- sassc (2.4.0)
265
- ffi (~> 1.9)
266
- sassc-rails (2.1.2)
267
- railties (>= 4.0.0)
268
- sassc (>= 2.0)
269
- sprockets (> 3.0)
270
- sprockets-rails
271
- tilt
272
- selenium-webdriver (3.142.7)
273
- childprocess (>= 0.5, < 4.0)
274
- rubyzip (>= 1.2.2)
275
- simplecov (0.18.5)
276
- docile (~> 1.1)
277
- simplecov-html (~> 0.11)
278
- simplecov-html (0.12.2)
279
- solr_wrapper (2.2.0)
280
- faraday
281
- retriable
282
- ruby-progressbar
283
- rubyzip
284
- sprockets (4.0.2)
285
- concurrent-ruby (~> 1.0)
286
- rack (> 1, < 3)
287
- sprockets-rails (3.2.1)
288
- actionpack (>= 4.0)
289
- activesupport (>= 4.0)
290
- sprockets (>= 3.0.0)
291
- sqlite3 (1.4.2)
292
- terminal-table (1.8.0)
293
- unicode-display_width (~> 1.1, >= 1.1.1)
294
- thor (0.20.3)
295
- thread_safe (0.3.6)
296
- tilt (2.0.10)
297
- turbolinks (5.2.1)
298
- turbolinks-source (~> 5.2)
299
- turbolinks-source (5.2.0)
300
- twitter-typeahead-rails (0.11.1.pre.corejavascript)
301
- actionpack (>= 3.1)
302
- jquery-rails
303
- railties (>= 3.1)
304
- tzinfo (1.2.7)
305
- thread_safe (~> 0.1)
306
- unicode-display_width (1.7.0)
307
- view_component (2.18.1)
308
- activesupport (>= 5.0.0, < 7.0)
309
- warden (1.2.8)
310
- rack (>= 2.0.6)
311
- web-console (4.0.3)
312
- actionview (>= 6.0.0)
313
- activemodel (>= 6.0.0)
314
- bindex (>= 0.4.0)
315
- railties (>= 6.0.0)
316
- webdrivers (3.9.4)
317
- nokogiri (~> 1.6)
318
- rubyzip (~> 1.0)
319
- selenium-webdriver (~> 3.0)
320
- webpacker (4.2.2)
321
- activesupport (>= 4.2)
322
- rack-proxy (>= 0.6.1)
323
- railties (>= 4.2)
324
- websocket-driver (0.7.2)
325
- websocket-extensions (>= 0.1.0)
326
- websocket-extensions (0.1.5)
327
- xpath (3.2.0)
328
- nokogiri (~> 1.8)
329
- zeitwerk (2.3.0)
330
-
331
- PLATFORMS
332
- ruby
333
-
334
- DEPENDENCIES
335
- activerecord-jdbcsqlite3-adapter
336
- blacklight!
337
- bootstrap (~> 4.0)
338
- byebug
339
- capybara (~> 3)
340
- devise
341
- devise-guests (~> 0.6)
342
- engine_cart (~> 2.1)
343
- equivalent-xml
344
- i18n-tasks
345
- jbuilder (~> 2.7)
346
- jquery-rails
347
- puma (~> 4.1)
348
- rails (~> 6.0.3, >= 6.0.3.2)
349
- rails-controller-testing
350
- rsolr (>= 1.0, < 3)
351
- rspec-collection_matchers (>= 1.0)
352
- rspec-its
353
- rspec-rails (~> 4.0.0.beta2)
354
- rubocop (~> 0.85)
355
- rubocop-rails (~> 2.6)
356
- rubocop-rspec (~> 1.43)
357
- sass-rails (>= 6)
358
- selenium-webdriver (>= 3.13.1)
359
- simplecov
360
- solr_wrapper (>= 0.3)
361
- sqlite3 (~> 1.4)
362
- thor (~> 0.20)
363
- turbolinks (~> 5)
364
- twitter-typeahead-rails (= 0.11.1.pre.corejavascript)
365
- tzinfo-data
366
- web-console (>= 3.3.0)
367
- webdrivers (~> 3.0)
368
- webpacker (~> 4.0)
369
-
370
- RUBY VERSION
371
- ruby 2.7.0p0
372
-
373
- BUNDLED WITH
374
- 2.1.4
package/VERSION DELETED
@@ -1 +0,0 @@
1
- 7.10.0
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Blacklight
4
- # Dynamically creates methods on the given controller (typically CatalogController)
5
- # for handling configured show tools
6
- class ActionBuilder
7
- def initialize(klass, name, opts)
8
- @klass = klass
9
- @name = name
10
- @opts = opts
11
- end
12
-
13
- attr_reader :klass, :name, :opts
14
-
15
- # Define a simple action handler for the tool as long as the method
16
- # doesn't already exist or the `:define_method` option is not `false`
17
- def build
18
- return if skip?
19
-
20
- callback = opts.fetch(:callback, nil).inspect
21
- validator = opts.fetch(:validator, nil).inspect
22
- klass.class_eval <<EORUBY, __FILE__, __LINE__ + 1
23
- def #{name}
24
- @response, @documents = action_documents
25
-
26
- if request.post? && #{callback} &&
27
- (#{validator}.blank? || send(#{validator}))
28
-
29
- send(#{callback}, @documents)
30
-
31
- flash[:success] ||= I18n.t("blacklight.#{name}.success", default: nil)
32
-
33
- respond_to do |format|
34
- format.html do
35
- return render "#{name}_success" if request.xhr?
36
- redirect_to action_success_redirect_path
37
- end
38
- end
39
- else
40
- respond_to do |format|
41
- format.html do
42
- return render layout: false if request.xhr?
43
- # Otherwise draw the full page
44
- end
45
- end
46
- end
47
- end
48
- EORUBY
49
- end
50
-
51
- private
52
-
53
- def skip?
54
- klass.method_defined?(name) || opts[:define_method] == false
55
- end
56
- end
57
- end
@@ -1,23 +0,0 @@
1
- <span class="btn-group applied-filter constraint <%= @classes %>">
2
- <span class="constraint-value btn btn-outline-secondary">
3
- <% if @label.present? %>
4
- <span class="filter-name"><%= @label %></span>
5
- <% end %>
6
- <% if @value.present? %>
7
- <%= content_tag :span, @value, class: 'filter-value', title: strip_tags(@value) %>
8
- <% end %>
9
- </span>
10
- <% if @remove_path.present? %>
11
- <%= link_to(@remove_path, class: 'btn btn-outline-secondary remove') do %>
12
- <span class="remove-icon">✖</span>
13
- <span class="sr-only">
14
- <%= if @label.blank?
15
- t('blacklight.search.filters.remove.value', value: @value)
16
- else
17
- t('blacklight.search.filters.remove.label_value', label: @label, value: @value)
18
- end
19
- %>
20
- </span>
21
- <% end %>
22
- <% end %>
23
- </span>
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Blacklight
4
- class ConstraintLayoutComponent < ::ViewComponent::Base
5
- def initialize(value:, label: nil, remove_path: nil, classes: nil)
6
- @value = value
7
- @label = label
8
- @remove_path = remove_path
9
- @classes = Array(classes).join(' ')
10
- end
11
-
12
- def render?
13
- @value.present?
14
- end
15
- end
16
- end
@@ -1,29 +0,0 @@
1
- <%= content_tag @component,
2
- id: @id,
3
- data: {
4
- 'document-id': @document.id.to_s.parameterize,
5
- 'document-counter': @counter,
6
- },
7
- itemscope: true,
8
- itemtype: @document.itemtype,
9
- class: classes.flatten.join(' ') do %>
10
- <%= header %>
11
- <% if body.present? %>
12
- <%= body %>
13
- <% else %>
14
- <div class="document-main-section">
15
- <header class="documentHeader row">
16
- <%= content_tag @title_component, class: 'index_title document-title-heading' do %>
17
- <%= before_title %><%= title %><%= after_title %>
18
- <% end %>
19
- <%= actions %>
20
- </header>
21
-
22
- <%= content %>
23
- <%= metadata %>
24
- </div>
25
-
26
- <%= thumbnail %>
27
- <% end %>
28
- <%= footer %>
29
- <% end %>
@@ -1,121 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Blacklight
4
- class DocumentComponent < ::ViewComponent::Base
5
- # Available content areas; some have defaults provided by
6
- # the accessors below.
7
- with_content_areas :header, :body, :footer,
8
- :before_title, :title, :after_title,
9
- :actions, :metadata, :thumbnail,
10
- :partials
11
- with_collection_parameter :document
12
-
13
- # rubocop:disable Metrics/ParameterLists
14
- # @param document [Blacklight::Document]
15
- # @param presenter [Blacklight::DocumentPresenter]
16
- # @param id [String] HTML id for the root element
17
- # @param classes [Array, String] additional HTML classes for the root element
18
- # @param component [Symbol, String] HTML tag type to use for the root element
19
- # @param title_component [Symbol, String] HTML tag type to use for the title element
20
- # @param metadata_component [Blacklight::DocumentMetadataComponent]
21
- # @param counter [Number, nil]
22
- # @param show [Boolean] are we showing only a single document (vs a list of search results); used for backwards-compatibility
23
- def initialize(document: nil, presenter: nil, id: nil, classes: [], component: :article, title_component: :h4, metadata_component: Blacklight::DocumentMetadataComponent, counter: nil, show: false)
24
- if presenter.nil? && document.nil?
25
- raise ArgumentError, 'missing keyword: :document or :presenter'
26
- end
27
-
28
- @document = document || presenter&.document
29
- @presenter = presenter
30
-
31
- @component = component
32
- @title_component = title_component
33
- @id = id || ('document' if show)
34
- @classes = classes
35
-
36
- @metadata_component = metadata_component
37
-
38
- @counter = counter
39
-
40
- @show = show
41
- end
42
- # rubocop:enable Metrics/ParameterLists
43
-
44
- # HTML classes to apply to the root element
45
- def classes
46
- [
47
- @classes,
48
- @view_context.render_document_class(@document),
49
- 'document',
50
- ("document-position-#{@counter}" if @counter)
51
- ].compact.flatten
52
- end
53
-
54
- # Content for the document title area; should be an inline element
55
- def title
56
- @title || begin
57
- if show?
58
- content_tag('span', presenter.heading, itemprop: "name")
59
- else
60
- @view_context.link_to_document @document, counter: @counter, itemprop: 'name'
61
- end
62
- end
63
- end
64
-
65
- # Content for the document actions area
66
- def actions
67
- return if @show
68
-
69
- @actions || begin
70
- @view_context.render_index_doc_actions @document, wrapping_class: "index-document-functions col-sm-3 col-lg-2"
71
- end
72
- end
73
-
74
- # Content for the document thumbnail area
75
- def thumbnail
76
- return if @show
77
-
78
- @thumbnail || begin
79
- return unless presenter.thumbnail.exists?
80
-
81
- content_tag :div, class: "document-thumbnail" do
82
- presenter.thumbnail.thumbnail_tag({ alt: '' }, 'aria-hidden': true, tabindex: -1, counter: @counter)
83
- end
84
- end
85
- end
86
-
87
- # Content for the document metadata area
88
- def metadata
89
- @metadata || @view_context.render(@metadata_component.new(fields: presenter.field_presenters, show: show?))
90
- end
91
-
92
- # Content that goes before the document title (e.g. the counter)
93
- def before_title
94
- @before_title || counter
95
- end
96
-
97
- private
98
-
99
- def counter
100
- return unless @counter
101
-
102
- content_tag :span, class: 'document-counter' do
103
- t('blacklight.search.documents.counter', counter: @counter)
104
- end
105
- end
106
-
107
- def presenter
108
- @presenter ||= begin
109
- if show?
110
- @view_context.presenter(@document)
111
- else
112
- @view_context.index_presenter(@document)
113
- end
114
- end
115
- end
116
-
117
- def show?
118
- @show
119
- end
120
- end
121
- end
@@ -1,5 +0,0 @@
1
- <dl class="document-metadata dl-invert row">
2
- <% @fields.each do |field| -%>
3
- <%= @view_context.render(field_component(field).new(field: field, show: @show)) %>
4
- <% end -%>
5
- </dl>
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Blacklight
4
- class DocumentMetadataComponent < ::ViewComponent::Base
5
- with_collection_parameter :fields
6
-
7
- # @param fields [Enumerable<Blacklight::FieldPresenter>] Document field presenters
8
- def initialize(fields:, show: false)
9
- @fields = fields
10
- @show = show
11
- end
12
-
13
- def render?
14
- @fields.any?
15
- end
16
-
17
- def field_component(field)
18
- field.try(:component) || Blacklight::MetadataFieldComponent
19
- end
20
- end
21
- end
@@ -1,25 +0,0 @@
1
- <div class="card facet-limit blacklight-<%= @facet_field.key %> <%= 'facet-limit-active' if @facet_field.active? %>">
2
- <h3 class="card-header p-0 facet-field-heading" id="<%= @facet_field.html_id %>-header">
3
- <button
4
- class="btn btn-block p-2 text-left collapse-toggle <%= "collapsed" if @facet_field.collapsed? %>"
5
- data-toggle="collapse"
6
- data-target="#<%= @facet_field.html_id %>"
7
- aria-expanded="<%= @facet_field.collapsed? ? 'false' : 'true' %>"
8
- >
9
- <%= label %>
10
- </button>
11
- </h3>
12
- <div id="<%= @facet_field.html_id %>" aria-labelledby="<%= @facet_field.html_id %>-header" class="panel-collapse facet-content collapse <%= "show" unless @facet_field.collapsed? %>">
13
- <div class="card-body">
14
- <%= body %>
15
-
16
- <% if @facet_field.modal_path %>
17
- <div class="more_facets">
18
- <%= link_to t("more_#{@facet_field.key}_html", scope: 'blacklight.search.facets', default: :more_html, field_name: @facet_field.label),
19
- @facet_field.modal_path,
20
- data: { blacklight_modal: 'trigger' } %>
21
- </div>
22
- <% end %>
23
- </div>
24
- </div>
25
- </div>
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Blacklight
4
- class FacetFieldComponent < ::ViewComponent::Base
5
- with_content_areas :label, :body
6
-
7
- def initialize(facet_field:)
8
- @facet_field = facet_field
9
- end
10
- end
11
- end