Skip to content

Commit

Permalink
add a few content blocks in from adventist
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Sep 21, 2023
1 parent e60efac commit 0a6a266
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/controllers/hyrax/content_blocks_controller_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

# OVERRIDE Hyrax v3.4.0 to add home_text to permitted_params - Adding themes
module Hyrax
module ContentBlocksControllerDecorator
# override hyrax v2.9.0 added the home_text content block to permitted_params - Adding Themes
def permitted_params
params.require(:content_block).permit(:marketing,
:announcement,
:home_text,
:homepage_about_section_heading,
:homepage_about_section_content,
:researcher)
end
end
end

Hyrax::ContentBlocksController.prepend Hyrax::ContentBlocksControllerDecorator
42 changes: 42 additions & 0 deletions app/views/hyrax/content_blocks/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<li>
<a href="#researcher" role="tab" data-toggle="tab" class="nav-safety-confirm"><%= t(:'hyrax.content_blocks.tabs.featured_researcher') %></a>
</li>
<li>
<a href="#homepage_about_section_heading" role="tab" data-toggle="tab" class="nav-safety-confirm"><%= t(:'hyrax.content_blocks.tabs.homepage_about_section_heading') %></a>
</li>
<li>
<a href="#homepage_about_section_content" role="tab" data-toggle="tab" class="nav-safety-confirm"><%= t(:'hyrax.content_blocks.tabs.homepage_about_section_content') %></a>
</li>
</ul>
<div class="tab-content">
<div id="announcement_text" class="tab-pane active">
Expand Down Expand Up @@ -90,6 +96,42 @@
<% end %>
</div>
</div>
<div id="homepage_about_section_heading" class="tab-pane">
<div class="panel panel-default labels">
<%= simple_form_for ContentBlock.for(:homepage_about_section_heading), url: hyrax.content_block_path(ContentBlock.for(:homepage_about_section_heading)), html: {class: 'nav-safety'} do |f| %>
<div class="panel-body">
<div class="field form-group">
<%= f.label :homepage_about_section_heading %><br />
<%# the following line was changed from hyrax to give some context for what this context block does %>
<p class="content-block-instructions"><%= t(:'hyrax.content_blocks.instructions.homepage_about_section_heading_instructions') %></p>
<%= f.text_area :homepage_about_section_heading, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %>
</div>
</div>
<div class="panel-footer">
<%= link_to t(:'hyrax.content_blocks.cancel'), hyrax.admin_admin_sets_path, class: 'btn btn-default pull-right' %>
<%= f.button :submit, class: 'btn btn-primary pull-right' %>
</div>
<% end %>
</div>
</div>
<div id="homepage_about_section_content" class="tab-pane">
<div class="panel panel-default labels">
<%= simple_form_for ContentBlock.for(:homepage_about_section_content), url: hyrax.content_block_path(ContentBlock.for(:homepage_about_section_content)), html: {class: 'nav-safety'} do |f| %>
<div class="panel-body">
<div class="field form-group">
<%= f.label :homepage_about_section_content %><br />
<%# the following line was changed from hyrax to give some context for what this context block does %>
<p class="content-block-instructions"><%= t(:'hyrax.content_blocks.instructions.homepage_about_section_content_instructions') %></p>
<%= f.text_area :homepage_about_section_content, value: f.object.value, class: 'form-control tinymce', rows: 20, cols: 120 %>
</div>
</div>
<div class="panel-footer">
<%= link_to t(:'hyrax.content_blocks.cancel'), hyrax.admin_admin_sets_path, class: 'btn btn-default pull-right' %>
<%= f.button :submit, class: 'btn btn-primary pull-right' %>
</div>
<% end %>
</div>
</div>
</div>
</div>
<%= tinymce :content_block %>

0 comments on commit 0a6a266

Please sign in to comment.