Skip to content

Commit

Permalink
Merge pull request #2393 from samvera/2353-pages_save_button_css
Browse files Browse the repository at this point in the history
Fix incorrectly colored save button
  • Loading branch information
sephirothkod authored Dec 7, 2024
2 parents 2842283 + eb21c2e commit a1d7cef
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
100 changes: 100 additions & 0 deletions app/views/hyrax/pages/_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<%# OVERRIDE from Hyrax v5.0.1 to correct button coloring since simpleform overrides hyku classes. %>
<%= render "shared/nav_safety_modal" %>
<div class="card tabs">

<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<a href="#about" role="tab" data-toggle="tab" class="nav-link active nav-safety-confirm">
<%= t(:'hyrax.pages.tabs.about_page') %>
</a>
</li>
<li class="nav-item" role="presentation">
<a href="#help" role="tab" data-toggle="tab" class="nav-link nav-safety-confirm">
<%= t(:'hyrax.pages.tabs.help_page') %>
</a>
</li>
<li class="nav-item" role="presentation">
<a href="#agreement" role="tab" data-toggle="tab" class="nav-link nav-safety-confirm">
<%= t(:'hyrax.pages.tabs.agreement_page') %>
</a>
</li>
<li class="nav-item" role="presentation">
<a href="#terms" role="tab" data-toggle="tab" class="nav-link nav-safety-confirm">
<%= t(:'hyrax.pages.tabs.terms_page') %>
</a>
</li>
</ul>

<div class="tab-content">
<div id="about" class="tab-pane show active">
<div class="card labels">
<%= simple_form_for ContentBlock.for(:about), url: hyrax.page_path(ContentBlock.for(:about)), html: { class: 'nav-safety' } do |f| %>
<div class="card-body">
<div class="field form-group">
<%= f.label :about %><br />
<%= f.text_area :about, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %>
</div>
</div>
<div class="card-footer d-flex justify-content-end">
<%# OVERRIDE change button to submit %>
<%= f.submit t(:'hyrax.pages.update'), class: 'btn btn-primary text-white mr-2' %>
<%= link_to t(:'hyrax.pages.cancel'), hyrax.admin_admin_sets_path, class: 'btn btn-light' %>
</div>
<% end %>
</div>
</div>
<div id="help" class="tab-pane">
<div class="card labels">
<%= simple_form_for ContentBlock.for(:help), url: hyrax.page_path(ContentBlock.for(:help)), html: { class: 'nav-safety' } do |f| %>
<div class="card-body">
<div class="field form-group">
<%= f.label :help %><br />
<%= f.text_area :help, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %>
</div>
</div>
<div class="card-footer d-flex justify-content-end">
<%# OVERRIDE change button to submit %>
<%= f.submit t(:'hyrax.pages.update'), class: 'btn btn-primary text-white mr-2' %>
<%= link_to t(:'hyrax.pages.cancel'), hyrax.admin_admin_sets_path, class: 'btn btn-light' %>
</div>
<% end %>
</div>
</div>
<div id="agreement" class="tab-pane">
<div class="card labels">
<%= simple_form_for ContentBlock.for(:agreement), url: hyrax.page_path(ContentBlock.for(:agreement)), html: { class: 'nav-safety' } do |f| %>
<div class="card-body">
<div class="field form-group">
<%= f.label :agreement %><br />
<%= f.text_area :agreement, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %>
</div>
</div>
<div class="card-footer d-flex justify-content-end">
<%# OVERRIDE change button to submit %>
<%= f.submit t(:'hyrax.pages.update'), class: 'btn btn-primary text-white mr-2' %>
<%= link_to t(:'hyrax.pages.cancel'), hyrax.admin_admin_sets_path, class: 'btn btn-light' %>
</div>
<% end %>
</div>
</div>
<div id="terms" class="tab-pane">
<div class="card labels">
<%= simple_form_for ContentBlock.for(:terms), url: hyrax.page_path(ContentBlock.for(:terms)), html: { class: 'nav-safety' } do |f| %>
<div class="card-body">
<div class="field form-group">
<%= f.label :terms %><br />
<%= f.text_area :terms, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %>
</div>
</div>
<div class="card-footer d-flex justify-content-end">
<%# OVERRIDE change button to submit %>
<%= f.submit t(:'hyrax.pages.update'), class: 'btn btn-primary text-white mr-2' %>
<%= link_to t(:'hyrax.pages.cancel'), hyrax.admin_admin_sets_path, class: 'btn btn-light' %>
</div>
<% end %>
</div>
</div>
</div>

</div>
<%= tinymce :content_block %>
1 change: 1 addition & 0 deletions config/locales/hyrax.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a1d7cef

Please sign in to comment.