-
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.
Tools and metadata beside one another
- Loading branch information
1 parent
2df069f
commit 00d90d3
Showing
4 changed files
with
56 additions
and
17 deletions.
There are no files selected for viewing
20 changes: 8 additions & 12 deletions
20
app/components/blacklight/document/show_tools_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,13 +1,9 @@ | ||
|
||
<div class="dropdown document-tools-btn"> | ||
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> | ||
<%= t('blacklight.tools.title') %> | ||
</button> | ||
<%= render Blacklight::Document::ActionsComponent.new(document: document, | ||
tag: 'ul', | ||
classes: 'dropdown-menu', | ||
wrapping_tag: 'li', | ||
wrapping_classes: 'dropdown-item', | ||
actions: actions, | ||
url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h)) %> | ||
</div> | ||
<%= render Blacklight::Document::ActionsComponent.new(document: document, | ||
tag: 'ul', | ||
classes: 'list-group list-group-flush', | ||
wrapping_tag: 'li', | ||
wrapping_classes: 'list-group-item', | ||
actions: actions, | ||
url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h)) %> | ||
|
13 changes: 13 additions & 0 deletions
13
app/components/blacklight/document/tools_dropdown_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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
<div class="dropdown document-tools-btn"> | ||
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> | ||
<%= t('blacklight.tools.title') %> | ||
</button> | ||
<%= render Blacklight::Document::ActionsComponent.new(document: document, | ||
tag: 'ul', | ||
classes: 'dropdown-menu', | ||
wrapping_tag: 'li', | ||
wrapping_classes: 'dropdown-item', | ||
actions: actions, | ||
url_opts: Blacklight::Parameters.sanitize(params.to_unsafe_h)) %> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
app/components/blacklight/document/tools_dropdown_component.rb
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,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Blacklight | ||
module Document | ||
# Render the tools that display on the sidebar of the show page | ||
class ShowToolsComponent < Blacklight::Component | ||
# @param [Blacklight::Document] document | ||
def initialize(document:) | ||
@document = document | ||
end | ||
|
||
attr_reader :document | ||
|
||
def render? | ||
helpers.show_doc_actions? | ||
end | ||
|
||
def actions | ||
helpers.document_actions(document) | ||
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