-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit will add title attribute to sidebar links for hover information display. Some translations were missing in the yml so I added those as well but only for English. At some point we might want to add support for other languages. Bulkrax and AllinsonFlex had some of the partials in the sidebar so those were also modified and the revisions for those gems were updated. Ref: - samvera-labs/allinson_flex#120 - samvera/bulkrax#838 - #41
- Loading branch information
Showing
7 changed files
with
108 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
module Hyku | ||
# Draws a collapsable list widget using the Bootstrap 3 / Collapse.js plugin | ||
class CollapsableSectionPresenter < Hyrax::CollapsableSectionPresenter | ||
# Override Hyrax 3.5.0 to pass in html_options | ||
# rubocop:disable Metrics/ParameterLists | ||
def initialize(view_context:, text:, id:, icon_class:, open:, html_options: {}) | ||
# rubocop:enable Metrics/ParameterLists | ||
super(view_context: view_context, text: text, id: id, icon_class: icon_class, open: open) | ||
@html_options = html_options | ||
end | ||
|
||
attr_reader :html_options | ||
|
||
private | ||
|
||
def button_tag | ||
tag.a({ role: 'button', | ||
class: "#{button_class}collapse-toggle", | ||
data: { toggle: 'collapse' }, | ||
href: "##{id}", | ||
onclick: "toggleCollapse(this)", | ||
'aria-expanded' => open, | ||
'aria-controls' => id }.merge(html_options)) do | ||
safe_join([tag.span('', class: icon_class, 'aria-hidden': true), | ||
tag.span(text)], ' ') | ||
end | ||
end | ||
end | ||
end |
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
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