From d48a7058a6686da18890a84a6092dc3f62a9101a Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Wed, 1 Feb 2023 12:38:27 +0100 Subject: [PATCH] Fix #744 --- app/models/communication/website/page/accessibility.rb | 4 ++++ app/models/communication/website/page/legal_term.rb | 4 ++++ app/models/communication/website/page/privacy_policy.rb | 4 ++++ app/models/communication/website/page/sitemap.rb | 4 ++++ app/models/communication/website/page/with_type.rb | 4 ++++ app/views/admin/communication/websites/pages/static.html.erb | 5 ++++- 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/models/communication/website/page/accessibility.rb b/app/models/communication/website/page/accessibility.rb index a9819518e..ef0fd5864 100644 --- a/app/models/communication/website/page/accessibility.rb +++ b/app/models/communication/website/page/accessibility.rb @@ -44,5 +44,9 @@ class Communication::Website::Page::Accessibility < Communication::Website::Page def draftable? false end + + def is_listed_among_children? + false + end end diff --git a/app/models/communication/website/page/legal_term.rb b/app/models/communication/website/page/legal_term.rb index 61ef387ca..607cf9cf2 100644 --- a/app/models/communication/website/page/legal_term.rb +++ b/app/models/communication/website/page/legal_term.rb @@ -44,5 +44,9 @@ class Communication::Website::Page::LegalTerm < Communication::Website::Page def draftable? false end + + def is_listed_among_children? + false + end end diff --git a/app/models/communication/website/page/privacy_policy.rb b/app/models/communication/website/page/privacy_policy.rb index 4b7d8da26..e94f7b885 100644 --- a/app/models/communication/website/page/privacy_policy.rb +++ b/app/models/communication/website/page/privacy_policy.rb @@ -44,5 +44,9 @@ class Communication::Website::Page::PrivacyPolicy < Communication::Website::Page def draftable? false end + + def is_listed_among_children? + false + end end diff --git a/app/models/communication/website/page/sitemap.rb b/app/models/communication/website/page/sitemap.rb index b1c16f4ec..6da00584b 100644 --- a/app/models/communication/website/page/sitemap.rb +++ b/app/models/communication/website/page/sitemap.rb @@ -56,6 +56,10 @@ class Communication::Website::Page::Sitemap < Communication::Website::Page def show_toc? true end + + def is_listed_among_children? + false + end def static_layout 'sitemap' diff --git a/app/models/communication/website/page/with_type.rb b/app/models/communication/website/page/with_type.rb index e8d5829bf..c465ecd00 100644 --- a/app/models/communication/website/page/with_type.rb +++ b/app/models/communication/website/page/with_type.rb @@ -54,6 +54,10 @@ module Communication::Website::Page::WithType true end + def is_listed_among_children? + true + end + def editable_width? true end diff --git a/app/views/admin/communication/websites/pages/static.html.erb b/app/views/admin/communication/websites/pages/static.html.erb index e9297aaa5..84092f13b 100644 --- a/app/views/admin/communication/websites/pages/static.html.erb +++ b/app/views/admin/communication/websites/pages/static.html.erb @@ -19,7 +19,10 @@ bodyclass: <%= @about.best_bodyclass %> <%= render 'admin/application/featured_image/static' %> <% if @about.children.published.any? %> children: -<% @about.children.published.ordered.each do |child| %> +<% +@about.children.published.ordered.each do |child| + next unless child.is_listed_among_children? +%> - <%= child.path %> <% end %> <% end %> -- GitLab