From 46cdcd340e05b0071791260c64a509a794518ca5 Mon Sep 17 00:00:00 2001 From: LaRita Robinson Date: Wed, 20 Nov 2024 16:35:36 -0500 Subject: [PATCH 1/5] Move oers partials from pals repo --- app/views/hyrax/oers/_attribute_rows.html.erb | 1 + .../hyrax/oers/_related_item.html.erb | 4 + .../cultural_show/hyrax/oers/show.html.erb | 74 +++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 app/views/themes/cultural_show/hyrax/oers/_related_item.html.erb create mode 100644 app/views/themes/cultural_show/hyrax/oers/show.html.erb diff --git a/app/views/hyrax/oers/_attribute_rows.html.erb b/app/views/hyrax/oers/_attribute_rows.html.erb index b86c23b7a..eea43464c 100644 --- a/app/views/hyrax/oers/_attribute_rows.html.erb +++ b/app/views/hyrax/oers/_attribute_rows.html.erb @@ -12,6 +12,7 @@ <%= presenter.attribute_to_html(:date_created, html_dl: true) %> <%= presenter.attribute_to_html(:table_of_contents, html_dl: true) %> <%= presenter.attribute_to_html(:subject, render_as: :faceted, html_dl: true) %> +<%= presenter.attribute_to_html(:based_near_label, html_dl: true) %> <%= presenter.attribute_to_html(:rights_statement, render_as: :rights_statement, html_dl: true) %> <%= presenter.attribute_to_html(:license, render_as: :license, html_dl: true) %> <%= presenter.attribute_to_html(:rights_holder, render_as: :linked, html_dl: true) %> diff --git a/app/views/themes/cultural_show/hyrax/oers/_related_item.html.erb b/app/views/themes/cultural_show/hyrax/oers/_related_item.html.erb new file mode 100644 index 000000000..d2307a7df --- /dev/null +++ b/app/views/themes/cultural_show/hyrax/oers/_related_item.html.erb @@ -0,0 +1,4 @@ + + <%= "#{relationship.titlecase}" %>: + <%= link_to(member.link_name, contextual_path(member, @presenter)) %> + \ No newline at end of file diff --git a/app/views/themes/cultural_show/hyrax/oers/show.html.erb b/app/views/themes/cultural_show/hyrax/oers/show.html.erb new file mode 100644 index 000000000..9a20b320f --- /dev/null +++ b/app/views/themes/cultural_show/hyrax/oers/show.html.erb @@ -0,0 +1,74 @@ +<% content_for(:extra_body_classes, 'works-show text-show-theme-partial ') %> +<% provide :page_title, @presenter.page_title %> +<%= render 'shared/citations' %> +<%= render './shared/additional_citations' %> +
+
+
+
+ <%= render 'work_title', presenter: @presenter %> +
+
+
+ <%= render 'workflow_actions_widget', presenter: @presenter %> + <% if @presenter.iiif_viewer? %> +
+ <%= render 'representative_media', presenter: @presenter, viewer: true %> +
+ <% elsif Flipflop.default_pdf_viewer? && @presenter.show_pdf_viewer? && @presenter.file_set_presenters.any?(&:pdf?) %> +
+ <%= render 'pdf_js', file_set_presenter: pdf_file_set_presenter(@presenter) %> +
+ <% end %> +
+ <%= render "show_actions", presenter: @presenter %> +
+
+ <%= render 'representative_media', presenter: @presenter, viewer: false unless @presenter.iiif_viewer? || @presenter.show_pdf_viewer? %> + <% if !@presenter.iiif_viewer? %> +
+
+ <%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %> + <%= render 'citations', presenter: @presenter %> + + <%#= render 'analytics_button', presenter: @presenter %> +
+
+ <% end %> +
+
+ <%= render 'work_description', presenter: @presenter %> + <%= render 'metadata', presenter: @presenter %> +
+
+
+ <%= render 'relationships', presenter: @presenter %> +
+ <% if @presenter.class == Hyrax::OerPresenter %> +
+ <%= render 'related_items', presenter: @presenter %> +
+ <% end %> + <% if @presenter.iiif_viewer? %> +
+
+ <%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %> + <%= render 'citations', presenter: @presenter %> + + <%#= render 'analytics_button', presenter: @presenter %> +
+
+ <% end %> +
+
+
+ <%= render 'items', presenter: @presenter %> + <%# TODO: we may consider adding these partials in the future %> + <%# = render 'sharing_with', presenter: @presenter %> + <%# = render 'user_activity', presenter: @presenter %> +
+
+
+
+
+ From 2d92a9d1a5143c784e0398b782d241a2771507db Mon Sep 17 00:00:00 2001 From: LaRita Robinson Date: Thu, 21 Nov 2024 11:02:25 -0500 Subject: [PATCH 2/5] Handle based near label for collections --- .../hyrax/presenter_renderer_decorator.rb | 13 +++++++++++++ .../hyrax/homepage/_recent_document.html.erb | 1 + 2 files changed, 14 insertions(+) create mode 100644 app/presenters/hyrax/presenter_renderer_decorator.rb diff --git a/app/presenters/hyrax/presenter_renderer_decorator.rb b/app/presenters/hyrax/presenter_renderer_decorator.rb new file mode 100644 index 000000000..58e974b05 --- /dev/null +++ b/app/presenters/hyrax/presenter_renderer_decorator.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# OVERRIDE Hyrax 5 to display based near label instead of URI +# @TODO Move this behavior into Hyrax in a flexible manner +module Hyrax + module PresenterRendererDecorator + def value(field_name, locals = {}) + field_name == :based_near ? super(:based_near_label, locals) : super(field_name, locals) + end + end +end + +Hyrax::PresenterRenderer.prepend(Hyrax::PresenterRendererDecorator) diff --git a/app/views/themes/neutral_repository/hyrax/homepage/_recent_document.html.erb b/app/views/themes/neutral_repository/hyrax/homepage/_recent_document.html.erb index c8ca85c2f..8555b3c3d 100644 --- a/app/views/themes/neutral_repository/hyrax/homepage/_recent_document.html.erb +++ b/app/views/themes/neutral_repository/hyrax/homepage/_recent_document.html.erb @@ -1,3 +1,4 @@ +<%# OVERRIDE Hyrax v5.0.0rc2 template for client theming and shared search %>

<%= t('hyrax.homepage.recently_uploaded.document.title_label') %>

<%= link_to(generate_work_url(recent_document, request)) do %> From f3e58fc4879cd6eaab21b75eb854b9f51eb32e85 Mon Sep 17 00:00:00 2001 From: LaRita Robinson Date: Thu, 21 Nov 2024 13:27:51 -0500 Subject: [PATCH 3/5] Fix branding Indicators default to true... not loading them prevented branding. --- .../hyrax/dashboard/collections_controller_decorator.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/hyrax/dashboard/collections_controller_decorator.rb b/app/controllers/hyrax/dashboard/collections_controller_decorator.rb index 8424eceb0..674974a84 100644 --- a/app/controllers/hyrax/dashboard/collections_controller_decorator.rb +++ b/app/controllers/hyrax/dashboard/collections_controller_decorator.rb @@ -28,10 +28,12 @@ def update_valkyrie_collection result = transactions['change_set.update_collection'] .with_step_args( 'collection_resource.save_collection_banner' => { update_banner_file_ids: params["banner_files"], - alttext: params["banner_text"]&.first }, + alttext: params["banner_text"]&.first, + banner_unchanged_indicator: params["banner_unchanged"] }, 'collection_resource.save_collection_logo' => { update_logo_file_ids: params["logo_files"], alttext_values: params["alttext"], - linkurl_values: params["linkurl"] }, + linkurl_values: params["linkurl"], + logo_unchanged_indicator: false }, 'collection_resource.save_collection_thumbnail' => { update_thumbnail_file_ids: params["thumbnail_files"], thumbnail_unchanged_indicator: params["thumbnail_unchanged"], alttext_values: params["thumbnail_text"] } From 798fc294574f1c046e57cd11882bf5b77e3d8176 Mon Sep 17 00:00:00 2001 From: LaRita Robinson Date: Thu, 21 Nov 2024 13:47:54 -0500 Subject: [PATCH 4/5] Add "Other" to discipline options --- config/authorities/discipline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/authorities/discipline.yml b/config/authorities/discipline.yml index 6ddbacade..c12c1f0ef 100644 --- a/config/authorities/discipline.yml +++ b/config/authorities/discipline.yml @@ -127,3 +127,5 @@ terms: term: Engineering - Industrial - id: Law term: Law + - id: Other + term: Other From 9f5a5ec2e9d2d8e275df1f934328fdb787474ee0 Mon Sep 17 00:00:00 2001 From: LaRita Robinson Date: Thu, 21 Nov 2024 14:39:00 -0500 Subject: [PATCH 5/5] Fix discipline spec Added "Other" --- spec/services/hyrax/discipline_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/services/hyrax/discipline_service_spec.rb b/spec/services/hyrax/discipline_service_spec.rb index 43be77e75..ddf2312cd 100644 --- a/spec/services/hyrax/discipline_service_spec.rb +++ b/spec/services/hyrax/discipline_service_spec.rb @@ -5,7 +5,7 @@ it "has a select list" do expect(subject.first).to eq ["Languages - Spanish", "Languages - Spanish"] - expect(subject.size).to eq 64 + expect(subject.size).to eq 65 end end