diff --git a/app/controllers/admin/education/programs_controller.rb b/app/controllers/admin/education/programs_controller.rb index c537d49421a0b03475d351cd534e5d9cc3e79775..eac2d1773f066193df7242812dca1aa27769d1f3 100644 --- a/app/controllers/admin/education/programs_controller.rb +++ b/app/controllers/admin/education/programs_controller.rb @@ -110,7 +110,7 @@ class Admin::Education::ProgramsController < Admin::Education::ApplicationContro def program_params params.require(:education_program).permit( - :name, :short_name, :slug, :level, :capacity, :continuing, :initial, :apprenticeship, :description, :published, + :name, :short_name, :slug, :capacity, :continuing, :initial, :apprenticeship, :description, :published, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :prerequisites, :objectives, :presentation, :registration, :pedagogy, :content, :registration_url, :evaluation, :accessibility, :pricing, :contacts, :opportunities, :results, :other, :main_information, diff --git a/app/models/education/program.rb b/app/models/education/program.rb index f771c240205042fd33893a9b3b8e984d36a05a9d..daafad3e4d40c6acc918ccb535c44ad9f25a4e61 100644 --- a/app/models/education/program.rb +++ b/app/models/education/program.rb @@ -15,7 +15,6 @@ # featured_image_alt :string # featured_image_credit :text # initial :boolean -# level :integer # name :string # objectives :text # opportunities :text @@ -93,20 +92,6 @@ class Education::Program < ApplicationRecord has_one_attached_deletable :downloadable_summary - # Deprecated, now in diploma - enum level: { - not_applicable: 0, - primary: 40, - secondary: 60, - high: 80, - first_year: 100, - second_year: 200, - dut: 210, - bachelor: 300, - master: 500, - doctor: 800 - } - validates_presence_of :name after_save :update_children_paths, if: :saved_change_to_path? diff --git a/app/views/admin/education/teachers/show/_programs.html.erb b/app/views/admin/education/teachers/show/_programs.html.erb index 6359d3abe1210b7074c2a10df9f83546e3d19145..1a3e7c573723118cf68bced5ed28774302245b80 100644 --- a/app/views/admin/education/teachers/show/_programs.html.erb +++ b/app/views/admin/education/teachers/show/_programs.html.erb @@ -9,7 +9,7 @@ <thead> <tr> <th><%= Education::Program.model_name.human %></th> - <th><%= Education::Program.human_attribute_name('level') %></th> + <th><%= Education::Diploma.human_attribute_name('level') %></th> <th><%= University::Person::Involvement.human_attribute_name('description') %></th> <th></th> </tr> @@ -19,7 +19,7 @@ <% program = involvement.target %> <tr> <td><%= link_to_if can?(:read, program), program, [:admin, program] %></td> - <td><%= program.level_i18n %></td> + <td><%= program.diploma.level_i18n if program.diploma.present? %></td> <td><%= involvement.description %></td> <td class="text-end"> <%= link_to t('quit'), diff --git a/app/views/admin/research/journals/volumes/index.html.erb b/app/views/admin/research/journals/volumes/index.html.erb index 3fca16bdd1d89b1d412628fed32fdd5cf490d9af..95d7f70af8d410bf36145da334b05a89d8464101 100644 --- a/app/views/admin/research/journals/volumes/index.html.erb +++ b/app/views/admin/research/journals/volumes/index.html.erb @@ -20,7 +20,7 @@ </td> <td><%= image_tag volume.featured_image.variant(resize: 'x200'), height: 100 if volume.featured_image.attached? %></td> - <td><%= volume.published_at %></td> + <td><%= l(volume.published_at.to_time, format: :date_with_explicit_month) if volume.published_at.present? %></td> <td class="text-end"> <div class="btn-group" role="group"> <%= edit_link volume, journal_id: @journal.id %> diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index a9652bec1cf93d67633164f94cc06affa1719fa7..d3ced70ac0430d7e64e1716be83a33e1e3904a71 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -49,7 +49,6 @@ en: featured_image: Featured image featured_image_alt: Alt text initial: Initial training - level: Level main_information: Main information name: Name objectives: Objectifs diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 777c44f832947337e62a99dfdd0d404d2e3bcae2..bf7277324196038d60382e25a97d52a88309d471 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -49,7 +49,6 @@ fr: featured_image: Image à la une featured_image_alt: Texte alternatif initial: Formation initiale - level: Niveau main_information: Informations essentielles name: Nom objectives: Objectifs diff --git a/db/migrate/20221128112830_remove_level_from_education_programs.rb b/db/migrate/20221128112830_remove_level_from_education_programs.rb new file mode 100644 index 0000000000000000000000000000000000000000..31ac95ff981f88df80c3131dc0c49a8597b33a42 --- /dev/null +++ b/db/migrate/20221128112830_remove_level_from_education_programs.rb @@ -0,0 +1,5 @@ +class RemoveLevelFromEducationPrograms < ActiveRecord::Migration[7.0] + def change + remove_column :education_programs, :level, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 6d4b896306f5cda87f74d202cf3cbf8a749fbd55..3b7866e9c87b83f291bb50ea0440d926dd63dee3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_10_31_155827) do +ActiveRecord::Schema[7.0].define(version: 2022_11_28_112830) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -453,7 +453,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_10_31_155827) do create_table "education_programs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" - t.integer "level" t.integer "capacity" t.boolean "continuing" t.datetime "created_at", null: false