-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Genia Kazymova
committed
Feb 18, 2025
1 parent
1b3c0c0
commit 26a4281
Showing
7 changed files
with
58 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="accordion-item facet-limit blacklight-<%= @facet_field.key %> <%= 'facet-limit-active' if @facet_field.active? %>"> | ||
<div class="accordion-header" id="<%= header_html_id %>"> | ||
</div> | ||
<div id="<%= html_id %>" role="region" aria-labelledby="<%= header_html_id %>" class="panel-collapse facet-content collapse <%= "show" unless @facet_field.collapsed? %>"> | ||
<div class="accordion-body"> | ||
<%= body %> | ||
|
||
<% if @facet_field.modal_path %> | ||
<div class="more_facets"> | ||
<%= link_to t("more_#{@facet_field.key}_html", scope: 'blacklight.search.facets', default: :more_html, field_name: @facet_field.label), | ||
@facet_field.modal_path, | ||
data: { blacklight_modal: 'trigger', turbo: false } %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module TrlnArgon | ||
class FacetFieldComponent < Blacklight::FacetFieldComponent | ||
end | ||
end |
35 changes: 20 additions & 15 deletions
35
app/components/trln_argon/multi_select_facet_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
<%= render(@layout.new(facet_field: @facet_field)) do |component| %> | ||
<% component.with_label do %> | ||
<%= @facet_field.label %> | ||
<div class="row align-items-center"> | ||
<label class="col-12 col-md-3 col-form-label fw-bold" id="<%= @facet_field.key %>_label" for="<%= @facet_field.key %>_select"> | ||
<%= @facet_field.label %> | ||
</label> | ||
<div class="col-12 col-md-9"> | ||
<%= render(@layout.new(facet_field: @facet_field)) do |component| %> | ||
<% component.with_body do %> | ||
<div class="facet-multi-select p-2"> | ||
<select id="<%= @facet_field.key %>_select" aria-labelledby="<%= @facet_field.key %>_label" | ||
<%= tag.attributes(select_attributes.merge(placeholder: t('blacklight_advanced_search.form.placeholder'))) %>> | ||
<% presenters.each do |presenter| %> | ||
<option <%= tag.attributes(option_attributes(presenter: presenter)) %>> | ||
<%= "#{presenter.label} (#{number_with_delimiter(presenter.hits)})" %> | ||
</option> | ||
<% end %> | ||
</select> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% component.with_body do %> | ||
<div class="facet-multi-select p-2"> | ||
<select <%= tag.attributes(select_attributes.merge(placeholder: t('blacklight_advanced_search.form.placeholder'))) %>> | ||
<% presenters.each do |presenter| %> | ||
<option <%= tag.attributes(option_attributes(presenter: presenter)) %>> | ||
<%= "#{presenter.label} (#{number_with_delimiter(presenter.hits)})" %> | ||
</option> | ||
<% end %> | ||
</select> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters