From 00d90d32baaafad8da85a1e013831ff19fc30a08 Mon Sep 17 00:00:00 2001 From: Brittny Lapierre Date: Mon, 6 Nov 2023 15:59:02 -0500 Subject: [PATCH] Tools and metadata beside one another --- .../document/show_tools_component.html.erb | 20 +++++++--------- .../tools_dropdown_component.html.erb | 13 +++++++++++ .../document/tools_dropdown_component.rb | 23 +++++++++++++++++++ .../blacklight/document_component.html.erb | 17 ++++++++++---- 4 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 app/components/blacklight/document/tools_dropdown_component.html.erb create mode 100644 app/components/blacklight/document/tools_dropdown_component.rb diff --git a/app/components/blacklight/document/show_tools_component.html.erb b/app/components/blacklight/document/show_tools_component.html.erb index f08c93986..c7652d729 100644 --- a/app/components/blacklight/document/show_tools_component.html.erb +++ b/app/components/blacklight/document/show_tools_component.html.erb @@ -1,13 +1,9 @@ - \ No newline at end of file +<%= 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)) %> + diff --git a/app/components/blacklight/document/tools_dropdown_component.html.erb b/app/components/blacklight/document/tools_dropdown_component.html.erb new file mode 100644 index 000000000..f08c93986 --- /dev/null +++ b/app/components/blacklight/document/tools_dropdown_component.html.erb @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/app/components/blacklight/document/tools_dropdown_component.rb b/app/components/blacklight/document/tools_dropdown_component.rb new file mode 100644 index 000000000..0ea7fb451 --- /dev/null +++ b/app/components/blacklight/document/tools_dropdown_component.rb @@ -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 diff --git a/app/components/blacklight/document_component.html.erb b/app/components/blacklight/document_component.html.erb index cf96a6e19..583eb6590 100644 --- a/app/components/blacklight/document_component.html.erb +++ b/app/components/blacklight/document_component.html.erb @@ -13,17 +13,24 @@ <% else %>

- <%= render(Blacklight::Document::SidebarComponent.new(presenter: @presenter)) %> <%= title %> <% if @component.to_s == 'div' %> <%= render(ViewerComponent.new(documentId: @document.id, prefix: 'oocihm')) %> <% end %> <%= embed %> <%= content %> - <%= metadata %> - <% metadata_sections.each do |section| %> - <%= section %> - <% end %> + +
+
+ <%= metadata %> + <% metadata_sections.each do |section| %> + <%= section %> + <% end %> +
+
+ <%= render(Blacklight::Document::SidebarComponent.new(presenter: @presenter)) %> +
+
<% partials.each do |partial| %> <%= partial %>