diff --git a/app/controllers/admin/education/diplomas_controller.rb b/app/controllers/admin/education/diplomas_controller.rb index 19c7641746a69d7a1dfa69d7df00566f7c3d6cdf..0898fac6fb041c9feb6d6f988a22f869d4f2aa96 100644 --- a/app/controllers/admin/education/diplomas_controller.rb +++ b/app/controllers/admin/education/diplomas_controller.rb @@ -14,12 +14,7 @@ class Admin::Education::DiplomasController < Admin::Education::ApplicationContro def static @about = @diploma @website = @diploma.websites&.first - if @website.nil? - redirect_to [:admin, @diploma] - else - @programs = @website.education_programs.root.ordered - render layout: false - end + render layout: false end def new diff --git a/app/views/admin/education/diplomas/_programs.html.erb b/app/views/admin/education/diplomas/_programs.html.erb index b7797ebc549728663f1489e58f4841180682a6e9..45c74bd2cbea1feb291dd7e1cdea7371008537c8 100644 --- a/app/views/admin/education/diplomas/_programs.html.erb +++ b/app/views/admin/education/diplomas/_programs.html.erb @@ -9,6 +9,6 @@ indentation = ' ' * depth <% children = program.children.ordered %> <% if children.any? %> <%= indentation %> children: -<%= render 'programs', programs: program.children.ordered, depth: depth + 4 %> +<%= render 'admin/education/diplomas/programs', programs: program.children.ordered, depth: depth + 4 %> <% end %> <% end %> diff --git a/app/views/admin/education/diplomas/static.html.erb b/app/views/admin/education/diplomas/static.html.erb index 569e6db89a05bbc7aa0d471970369d130fefa946..38deaae71596f480531d5c7a4a93cf8c55948c33 100644 --- a/app/views/admin/education/diplomas/static.html.erb +++ b/app/views/admin/education/diplomas/static.html.erb @@ -1,10 +1,15 @@ --- title: > <%= prepare_text_for_static @about.name %> -<%= render 'admin/application/static/permalink' %> +<%= render 'admin/application/static/permalink' if @website %> <%= render 'admin/application/static/design', full_width: true, toc_offcanvas: true %> +<% +if @website + @programs = @website.education_programs.root.ordered +%> programs: <%= render 'admin/education/diplomas/programs', programs: @programs, depth: 2 %> +<% end %> short_name: > <%= prepare_text_for_static @about.short_name %> <%= render 'admin/application/summary/static' %>