diff --git a/app/models/communication/website/page/accessibility.rb b/app/models/communication/website/page/accessibility.rb index f4837f53a3884b07d7038040f8db8de4b25fb04f..aa0ec83cb50c573f29b9ef51bb93c4acce0ac531 100644 --- a/app/models/communication/website/page/accessibility.rb +++ b/app/models/communication/website/page/accessibility.rb @@ -41,4 +41,7 @@ # class Communication::Website::Page::Accessibility < Communication::Website::Page + def draftable? + false + end end diff --git a/app/models/communication/website/page/communication_post.rb b/app/models/communication/website/page/communication_post.rb index 708bd5524ab66263a4165e9931384a6f6be20112..7b36eb47e27c36e6edae6de8b8345fa9b90669b9 100644 --- a/app/models/communication/website/page/communication_post.rb +++ b/app/models/communication/website/page/communication_post.rb @@ -41,6 +41,18 @@ # class Communication::Website::Page::CommunicationPost < Communication::Website::Page + def full_width + true + end + + def full_width_by_default? + true + end + + def editable_width? + false + end + def current_git_path "#{git_path_prefix}posts/_index.html" end diff --git a/app/models/communication/website/page/education_diploma.rb b/app/models/communication/website/page/education_diploma.rb index 5603a78e1d531005f6043c5237e428460e079c29..cec9c8b2a7067a975bd0168ee1851301d4106a4d 100644 --- a/app/models/communication/website/page/education_diploma.rb +++ b/app/models/communication/website/page/education_diploma.rb @@ -41,6 +41,18 @@ # class Communication::Website::Page::EducationDiploma < Communication::Website::Page + def full_width + true + end + + def full_width_by_default? + true + end + + def editable_width? + false + end + def current_git_path "#{git_path_prefix}diplomas/_index.html" end diff --git a/app/models/communication/website/page/education_program.rb b/app/models/communication/website/page/education_program.rb index be2cdf123f9094f3cc0e9e49097fc527922fd479..87e0bb52ced13dd054dcb49c0ddfe52854560222 100644 --- a/app/models/communication/website/page/education_program.rb +++ b/app/models/communication/website/page/education_program.rb @@ -41,6 +41,18 @@ # class Communication::Website::Page::EducationProgram < Communication::Website::Page + def full_width + true + end + + def full_width_by_default? + true + end + + def editable_width? + false + end + def current_git_path "#{git_path_prefix}programs/_index.html" end diff --git a/app/models/communication/website/page/home.rb b/app/models/communication/website/page/home.rb index 754a7a00ce78680f0c2e21a2dbe7e55a5fee28c8..05d09454154c449ed73cfd0635c4dc2853a109f6 100644 --- a/app/models/communication/website/page/home.rb +++ b/app/models/communication/website/page/home.rb @@ -49,6 +49,10 @@ class Communication::Website::Page::Home < Communication::Website::Page true end + def full_width_by_default? + true + end + def draftable? false end diff --git a/app/models/communication/website/page/legal_term.rb b/app/models/communication/website/page/legal_term.rb index 2a9dfeb2a4419b095df265e053d83b35c5a5d277..5d3668c13a3f6296dd19d4946a43b38ed778fcb6 100644 --- a/app/models/communication/website/page/legal_term.rb +++ b/app/models/communication/website/page/legal_term.rb @@ -41,4 +41,7 @@ # class Communication::Website::Page::LegalTerm < Communication::Website::Page + def draftable? + false + end end diff --git a/app/models/communication/website/page/sitemap.rb b/app/models/communication/website/page/sitemap.rb index 6ffd3d0272935b48cfe42d70883743669f86f5ef..659b213ae2b12d5f799d3ee0ac9a94a250e76af4 100644 --- a/app/models/communication/website/page/sitemap.rb +++ b/app/models/communication/website/page/sitemap.rb @@ -41,4 +41,15 @@ # class Communication::Website::Page::Sitemap < Communication::Website::Page + def draftable? + false + end + + def full_width + false + end + + def editable_width? + false + end end diff --git a/app/models/communication/website/page/with_type.rb b/app/models/communication/website/page/with_type.rb index 8600451a55601600e0efb55ac05d092d3164c159..27f32f5121d92b89f713835e900433387fd2198c 100644 --- a/app/models/communication/website/page/with_type.rb +++ b/app/models/communication/website/page/with_type.rb @@ -30,10 +30,14 @@ module Communication::Website::Page::WithType true end - def full_width_by_default? + def editable_width? true end + def full_width_by_default? + false + end + def published_by_default? true end diff --git a/app/views/admin/communication/websites/pages/_form.html.erb b/app/views/admin/communication/websites/pages/_form.html.erb index 21bcb9fac5645010234e1ec3877842669597c022..99b5900fd6f580dcfff886f52e7d57d41f2a454b 100644 --- a/app/views/admin/communication/websites/pages/_form.html.erb +++ b/app/views/admin/communication/websites/pages/_form.html.erb @@ -55,7 +55,7 @@ url = page.new_record? ? admin_communication_website_pages_path label_method: ->(p) { sanitize p[:label] }, value_method: ->(p) { p[:id] } unless page.is_home? %> <%= f.input :bodyclass if can?(:edit, @website) %> - <%= f.input :full_width %> + <%= f.input :full_width if page.editable_width? %> </div> </div> <% else %> diff --git a/app/views/admin/communication/websites/pages/static.html.erb b/app/views/admin/communication/websites/pages/static.html.erb index c92e909cf5bb7eee130a26a9046b9d74a2fecec0..05742e3f09c71d853a7ed68b7766654b5fb23a62 100644 --- a/app/views/admin/communication/websites/pages/static.html.erb +++ b/app/views/admin/communication/websites/pages/static.html.erb @@ -3,15 +3,7 @@ title: > <%= @about.title %> breadcrumb_title: "<%= @about.breadcrumb_title.blank? ? @about.title : @about.breadcrumb_title %>" <%= render 'admin/application/static/permalink' %> -<% -case @about.kind -when 'education_programs', - 'education_diplomas', - 'communication_posts' %> -<%= render 'admin/application/static/design', full_width: true, toc_offcanvas: true %> -<% else %> <%= render 'admin/application/static/design' %> -<% end %> <% if @about.kind_persons? %> has: administrators: <%= @website.has_administrators? %>