diff --git a/app/controllers/admin/education/diplomas_controller.rb b/app/controllers/admin/education/diplomas_controller.rb index c01478528f3ab6566f2ac222d1bd80e0e3c9359e..b05767a1435f8b80ff4b510c1927ff5fbd16fd61 100644 --- a/app/controllers/admin/education/diplomas_controller.rb +++ b/app/controllers/admin/education/diplomas_controller.rb @@ -11,6 +11,12 @@ class Admin::Education::DiplomasController < Admin::Education::ApplicationContro breadcrumb end + def static + @about = @diploma + @website = @diploma.websites&.first + render layout: false + end + def new breadcrumb end diff --git a/app/models/education/diploma.rb b/app/models/education/diploma.rb index cdbb4aef7261d6a3b0114f81078c919e171d80e2..c75d71cc1142af8321e99d926614d104a730f0d1 100644 --- a/app/models/education/diploma.rb +++ b/app/models/education/diploma.rb @@ -23,6 +23,7 @@ # class Education::Diploma < ApplicationRecord include WithUniversity + include WithBlocks include WithGit include WithSlug diff --git a/app/views/admin/education/diplomas/show.html.erb b/app/views/admin/education/diplomas/show.html.erb index 8955a3fc549b3dc1089e2613c7fe355d4f1da02d..965286b07b2aef54e43e6a29cfee955869848020 100644 --- a/app/views/admin/education/diplomas/show.html.erb +++ b/app/views/admin/education/diplomas/show.html.erb @@ -2,6 +2,7 @@ <div class="row"> <div class="col-lg-8"> + <%= render 'admin/communication/blocks/list', about: @diploma %> <div class="card flex-fill w-100"> <div class="card-header"> <h2 class="card-title mb-0 h5"> @@ -11,6 +12,7 @@ <%= render 'admin/education/programs/list', programs: @programs, hide_diploma: true %> + </div> </div> <div class="col-lg-4"> @@ -37,6 +39,9 @@ <% content_for :action_bar_left do %> <%= destroy_link @diploma %> + <%= link_to t('static'), + static_admin_education_diploma_path(@diploma), + class: button_classes('btn-light') if current_user.server_admin? %> <% end %> <% content_for :action_bar_right do %> diff --git a/app/views/admin/education/diplomas/static.html.erb b/app/views/admin/education/diplomas/static.html.erb index 57d6284710e6a86f2a4d33d245ce894e29b58e92..66af43f700743814d639f7612f5d653f480ac8b0 100644 --- a/app/views/admin/education/diplomas/static.html.erb +++ b/app/views/admin/education/diplomas/static.html.erb @@ -8,4 +8,5 @@ level: <%= @about.level_i18n %> ects: <%= @about.ects %> duration: > <%= prepare_text_for_static @about.duration %> +<%= render 'admin/communication/blocks/static', about: @about %> --- diff --git a/config/routes/admin/education.rb b/config/routes/admin/education.rb index 39576a5edf1e34553da0ebc7dad858e01fcd1738..e49cba17aa8ba69a18a8b36460a6545db4eb3b6c 100644 --- a/config/routes/admin/education.rb +++ b/config/routes/admin/education.rb @@ -36,5 +36,9 @@ namespace :education do end resources :academic_years resources :cohorts, only: [:index, :show] - resources :diplomas + resources :diplomas do + member do + get :static + end + end end