diff --git a/app/views/admin/administration/locations/static.html.erb b/app/views/admin/administration/locations/static.html.erb index bb7429622e11e958663a93df9263ee99ee7727f5..0e75b24c7be59b8288a314e165deb20cb80e95a0 100644 --- a/app/views/admin/administration/locations/static.html.erb +++ b/app/views/admin/administration/locations/static.html.erb @@ -19,5 +19,21 @@ contact_details: geolocation: latitude: <%= @about.latitude %> longitude: <%= @about.longitude %> +programs: +<% @about.programs.each do |program| %> + - <%= program.path %> +<% end %> +diplomas: +<% @about.diplomas.each do |diploma| %> + - name: > + <%= diploma.to_s %> + path: <%= diploma.slug %> + programs: <% @programs = @about.education_programs.where(diploma: diploma).root.ordered %> +<%= render 'admin/education/programs/static_list', + diploma: diploma, + programs: @programs, + all_programs: @about.programs, + depth: 4 %> +<% end %> <%= render 'admin/communication/blocks/content/static', about: @about %> --- diff --git a/app/views/admin/education/diplomas/static.html.erb b/app/views/admin/education/diplomas/static.html.erb index f904c860702e08d03051850f0396077450141a1c..f568f283461b2ac0a609f3ae2f648f255457fba8 100644 --- a/app/views/admin/education/diplomas/static.html.erb +++ b/app/views/admin/education/diplomas/static.html.erb @@ -9,7 +9,7 @@ title: > <% if @website @programs = @website.education_programs.where(diploma: @about).root.ordered %> programs: -<%= render 'admin/education/diplomas/programs', diploma: @about, programs: @programs %> +<%= render 'admin/education/programs/static_list', diploma: @about, programs: @programs %> <% end %> short_name: > <%= prepare_text_for_static @about.short_name %> diff --git a/app/views/admin/education/diplomas/_programs.html.erb b/app/views/admin/education/programs/_static_list.html.erb similarity index 52% rename from app/views/admin/education/diplomas/_programs.html.erb rename to app/views/admin/education/programs/_static_list.html.erb index af697c37f81cff55735e5400d14983c09ce66e68..831d928dcf6169469e3baa361b23165137d0a78c 100644 --- a/app/views/admin/education/diplomas/_programs.html.erb +++ b/app/views/admin/education/programs/_static_list.html.erb @@ -6,9 +6,13 @@ indentation = ' ' * depth <%= indentation %>- label: > <%= indentation %> <%= program.to_s %> <%= indentation %> path: "<%= program.current_permalink_in_website(@website)&.path %>" -<% children = program.children.where(diploma: diploma) %> +<% +children = program.children.where(diploma: diploma) +# Limit to a global list of programs, for example on a location +children = children.where(id: all_programs) if all_programs +%> <% if children.any? %> <%= indentation %> children: -<%= render 'admin/education/diplomas/programs', diploma: diploma, programs: children, depth: depth + 4 %> +<%= render 'admin/education/programs/static_list', diploma: diploma, programs: children, depth: depth + 4 %> <% end %> <% end %>