Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrectly colored save button #2393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions app/views/hyrax/pages/_form.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<%# Copied 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">
<%= 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">
<%= 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">
<%= 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">
<%= 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
Loading