From 5d48741019ff31a373ef0a8d8fe234d8d215c81e Mon Sep 17 00:00:00 2001 From: braydonjustice Date: Wed, 27 Nov 2024 23:27:08 -0800 Subject: [PATCH 1/3] Changed pages save button to 'submit' type to stop simpleform from injecting classes into the button. Fixes button color being white instead fo blue. --- app/views/hyrax/pages/_form.html.erb | 96 ++++++++++++++++++++++++++++ config/locales/hyrax.en.yml | 1 + 2 files changed, 97 insertions(+) create mode 100644 app/views/hyrax/pages/_form.html.erb diff --git a/app/views/hyrax/pages/_form.html.erb b/app/views/hyrax/pages/_form.html.erb new file mode 100644 index 000000000..1044dd37c --- /dev/null +++ b/app/views/hyrax/pages/_form.html.erb @@ -0,0 +1,96 @@ +<%# Copied from Hyrax v5.0.1 to correct button coloring since simpleform overrides hyku classes. %> +<%= render "shared/nav_safety_modal" %> +
+ + + +
+
+
+ <%= simple_form_for ContentBlock.for(:about), url: hyrax.page_path(ContentBlock.for(:about)), html: { class: 'nav-safety' } do |f| %> +
+
+ <%= f.label :about %>
+ <%= f.text_area :about, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %> +
+
+ + <% end %> +
+
+
+
+ <%= simple_form_for ContentBlock.for(:help), url: hyrax.page_path(ContentBlock.for(:help)), html: { class: 'nav-safety' } do |f| %> +
+
+ <%= f.label :help %>
+ <%= f.text_area :help, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %> +
+
+ + <% end %> +
+
+
+
+ <%= simple_form_for ContentBlock.for(:agreement), url: hyrax.page_path(ContentBlock.for(:agreement)), html: { class: 'nav-safety' } do |f| %> +
+
+ <%= f.label :agreement %>
+ <%= f.text_area :agreement, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %> +
+
+ + <% end %> +
+
+
+
+ <%= simple_form_for ContentBlock.for(:terms), url: hyrax.page_path(ContentBlock.for(:terms)), html: { class: 'nav-safety' } do |f| %> +
+
+ <%= f.label :terms %>
+ <%= f.text_area :terms, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %> +
+
+ + <% end %> +
+
+
+ +
+<%= tinymce :content_block %> \ No newline at end of file diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml index c18a64c8f..8def5a040 100644 --- a/config/locales/hyrax.en.yml +++ b/config/locales/hyrax.en.yml @@ -942,6 +942,7 @@ en: change_tab_message: Are you sure you want to leave this tab? Any unsaved data will be lost. pages: cancel: Cancel + update: Save changes tabs: about_page: About Page agreement_page: Deposit Agreement From 7a50d1bdd85ae8ff0ed7e0961ac813eb2b2afeb3 Mon Sep 17 00:00:00 2001 From: Braydon Justice Date: Fri, 6 Dec 2024 15:43:54 -0800 Subject: [PATCH 2/3] Add OVERRIDE comments Co-authored-by: Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com> --- app/views/hyrax/pages/_form.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/hyrax/pages/_form.html.erb b/app/views/hyrax/pages/_form.html.erb index 1044dd37c..76b6b3d1a 100644 --- a/app/views/hyrax/pages/_form.html.erb +++ b/app/views/hyrax/pages/_form.html.erb @@ -1,4 +1,4 @@ -<%# Copied from Hyrax v5.0.1 to correct button coloring since simpleform overrides hyku classes. %> +<%# OVERRIDE from Hyrax v5.0.1 to correct button coloring since simpleform overrides hyku classes. %> <%= render "shared/nav_safety_modal" %>
@@ -52,7 +52,7 @@
<% end %> @@ -68,7 +68,7 @@ <% end %> @@ -84,7 +84,7 @@ <% end %> From eb21c2eec88f92fb9d80f58f472ee0709eb6e520 Mon Sep 17 00:00:00 2001 From: Braydon Justice Date: Fri, 6 Dec 2024 16:42:13 -0800 Subject: [PATCH 3/3] seperated override comments --- app/views/hyrax/pages/_form.html.erb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/hyrax/pages/_form.html.erb b/app/views/hyrax/pages/_form.html.erb index 76b6b3d1a..065afa96a 100644 --- a/app/views/hyrax/pages/_form.html.erb +++ b/app/views/hyrax/pages/_form.html.erb @@ -36,6 +36,7 @@ @@ -52,7 +53,8 @@ <% end %> @@ -68,7 +70,8 @@ <% end %> @@ -84,7 +87,8 @@ <% end %> @@ -93,4 +97,4 @@ -<%= tinymce :content_block %> \ No newline at end of file +<%= tinymce :content_block %>