diff --git a/app/forms/hyrax/oer_form.rb b/app/forms/hyrax/oer_form.rb
index 458c6b363..c48fb3cb8 100644
--- a/app/forms/hyrax/oer_form.rb
+++ b/app/forms/hyrax/oer_form.rb
@@ -22,6 +22,7 @@ class OerForm < Hyrax::Forms::WorkForm
discipline rights_statement]
delegate :related_members_attributes=, :previous_version, :newer_version, :alternate_version, :related_item, to: :model
+ include VideoEmbedFormBehavior
def secondary_terms
super - [:rendering_ids]
diff --git a/app/forms/video_embed_form_behavior.rb b/app/forms/video_embed_form_behavior.rb
index 093b61ae8..35aa0cd55 100644
--- a/app/forms/video_embed_form_behavior.rb
+++ b/app/forms/video_embed_form_behavior.rb
@@ -7,7 +7,7 @@ module VideoEmbedFormBehavior
self.terms += %i[video_embed]
end
- def secondary_terms
+ def primary_terms
super + %i[video_embed]
end
end
diff --git a/app/models/concerns/video_embed_behavior.rb b/app/models/concerns/video_embed_behavior.rb
index 8fb84b650..27848fc76 100644
--- a/app/models/concerns/video_embed_behavior.rb
+++ b/app/models/concerns/video_embed_behavior.rb
@@ -6,8 +6,10 @@ module VideoEmbedBehavior
included do
validates :video_embed,
format: {
- with: /(http:\/\/|https:\/\/)(www\.)?(player\.vimeo\.com|youtube\.com\/embed)/,
- message: "Error: must be a valid YouTube or Vimeo Embed URL."
+ with: %r{(http://|https://)(www\.)?(player\.vimeo\.com|youtube\.com/embed)},
+ message: lambda do |_object, _data|
+ I18n.t('errors.messages.valid_embed_url', default: 'must be a valid YouTube or Vimeo Embed URL.')
+ end
},
if: :video_embed?
diff --git a/app/models/oer.rb b/app/models/oer.rb
index 874bf0a84..19ed59963 100644
--- a/app/models/oer.rb
+++ b/app/models/oer.rb
@@ -12,6 +12,7 @@ class Oer < ActiveFedora::Base
pdf_splitter_service: IiifPrint::TenantConfig::PdfSplitter
)
include PdfBehavior
+ include VideoEmbedBehavior
self.indexer = OerIndexer
# Change this to restrict which works can be added as a child.
diff --git a/app/views/themes/cultural_show/hyrax/base/show.html.erb b/app/views/themes/cultural_show/hyrax/base/show.html.erb
index 83c869d5d..8c9133f90 100644
--- a/app/views/themes/cultural_show/hyrax/base/show.html.erb
+++ b/app/views/themes/cultural_show/hyrax/base/show.html.erb
@@ -21,7 +21,7 @@
<%= render 'representative_media', presenter: @presenter, viewer: true %>
- <% elsif @presenter.pdf_viewer? %>
+ <% elsif @presenter.show_pdf_viewer? %>
<%= render 'pdf_js', file_set_presenter: pdf_file_set_presenter(@presenter) %>
diff --git a/app/views/themes/scholarly_show/hyrax/base/show.html.erb b/app/views/themes/scholarly_show/hyrax/base/show.html.erb
index 4a0d4db30..13924621a 100644
--- a/app/views/themes/scholarly_show/hyrax/base/show.html.erb
+++ b/app/views/themes/scholarly_show/hyrax/base/show.html.erb
@@ -32,7 +32,7 @@
<% render 'work_description', presenter: @presenter %>
- <% elsif @presenter.pdf_viewer? %>
+ <% elsif @presenter.show_pdf_viewer? %>
<%= render 'pdf_js', file_set_presenter: pdf_file_set_presenter(@presenter) %>
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 0a15ba9e6..f0386db1f 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -1,5 +1,8 @@
---
de:
+ errors:
+ messages:
+ valid_embed_url: "muss eine gültige YouTube- oder Vimeo-Einbettungs-URL sein."
activefedora:
models:
cdl: CDL
diff --git a/config/locales/en.yml b/config/locales/en.yml
index e684f7fa5..3b2af2869 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,5 +1,8 @@
---
en:
+ errors:
+ messages:
+ valid_embed_url: "must be a valid YouTube or Vimeo Embed URL."
single_signon:
index:
sign_in_with_provider: Sign in with %{provider}
diff --git a/config/locales/es.yml b/config/locales/es.yml
index d3d377e49..ba7e846c8 100644
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -1,5 +1,8 @@
---
es:
+ errors:
+ messages:
+ valid_embed_url: "debe ser una URL de incrustación válida de YouTube o Vimeo."
activefedora:
models:
cdl: CDL
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 0811701bf..048f0267c 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -1,5 +1,8 @@
---
fr:
+ errors:
+ messages:
+ valid_embed_url: "doit être une URL d'incorporation valide de YouTube ou Vimeo."
activefedora:
models:
cdl: CDL
diff --git a/config/locales/it.yml b/config/locales/it.yml
index 37a1fda58..dce49a5af 100644
--- a/config/locales/it.yml
+++ b/config/locales/it.yml
@@ -1,5 +1,8 @@
---
it:
+ errors:
+ messages:
+ valid_embed_url: "deve essere un URL di incorporamento valido di YouTube o Vimeo."
activefedora:
models:
cdl: CDL
diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml
index e6431457c..c48edf227 100644
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -1,5 +1,8 @@
---
pt-BR:
+ errors:
+ messages:
+ valid_embed_url: "deve ser uma URL de incorporação válida do YouTube ou Vimeo."
activefedora:
models:
cdl: CDL
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 05571d4ac..b4805eae4 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -1,5 +1,8 @@
---
zh:
+ errors:
+ messages:
+ valid_embed_url: "必须是有效的YouTube或Vimeo嵌入URL。"
activefedora:
models:
cdl: CDL