diff --git a/app/controllers/admin/education/programs_controller.rb b/app/controllers/admin/education/programs_controller.rb index 30e6561f067ae08e94c3bbbb490ce7a771ddcfaf..bddf6e5125abf63e795c8d12782611137ad8bb76 100644 --- a/app/controllers/admin/education/programs_controller.rb +++ b/app/controllers/admin/education/programs_controller.rb @@ -112,7 +112,8 @@ class Admin::Education::ProgramsController < Admin::Education::ApplicationContro :name, :short_name, :slug, :capacity, :continuing, :initial, :apprenticeship, :meta_description, :summary, :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, + :evaluation, :accessibility, :contacts, :opportunities, :results, :other, :main_information, + :pricing, :pricing_apprenticeship, :pricing_continuing, :pricing_initial, :downloadable_summary, :downloadable_summary_delete, :parent_id, :diploma_id, school_ids: [], university_person_involvements_attributes: [:id, :person_id, :description, :position, :_destroy] diff --git a/app/models/education/program.rb b/app/models/education/program.rb index e636a892ca1036b8c8f8c019a52bfaef4b5482f4..8644effa2e608d63f19e73a8c387cdcbe2e56b98 100644 --- a/app/models/education/program.rb +++ b/app/models/education/program.rb @@ -2,41 +2,44 @@ # # Table name: education_programs # -# id :uuid not null, primary key -# accessibility :text -# apprenticeship :boolean -# capacity :integer -# contacts :text -# content :text -# continuing :boolean -# duration :text -# evaluation :text -# featured_image_alt :string -# featured_image_credit :text -# initial :boolean -# meta_description :text -# name :string -# objectives :text -# opportunities :text -# other :text -# path :string -# pedagogy :text -# position :integer default(0) -# prerequisites :text -# presentation :text -# pricing :text -# published :boolean default(FALSE) -# registration :text -# registration_url :string -# results :text -# short_name :string -# slug :string indexed -# summary :text -# created_at :datetime not null -# updated_at :datetime not null -# diploma_id :uuid indexed -# parent_id :uuid indexed -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# accessibility :text +# apprenticeship :boolean +# capacity :integer +# contacts :text +# content :text +# continuing :boolean +# duration :text +# evaluation :text +# featured_image_alt :string +# featured_image_credit :text +# initial :boolean +# meta_description :text +# name :string +# objectives :text +# opportunities :text +# other :text +# path :string +# pedagogy :text +# position :integer default(0) +# prerequisites :text +# presentation :text +# pricing :text +# pricing_apprenticeship :text +# pricing_continuing :text +# pricing_initial :text +# published :boolean default(FALSE) +# registration :text +# registration_url :string +# results :text +# short_name :string +# slug :string indexed +# summary :text +# created_at :datetime not null +# updated_at :datetime not null +# diploma_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed # # Indexes # @@ -83,6 +86,9 @@ class Education::Program < ApplicationRecord :pedagogy, :prerequisites, :pricing, + :pricing_apprenticeship, + :pricing_continuing, + :pricing_initial, :registration, :content, :results diff --git a/app/views/admin/education/programs/_form.html.erb b/app/views/admin/education/programs/_form.html.erb index 8e07bec089633a10e49897b81faca8cad8a37339..d12264e1807defb7e55ab1ca16043b5898e2877e 100644 --- a/app/views/admin/education/programs/_form.html.erb +++ b/app/views/admin/education/programs/_form.html.erb @@ -110,9 +110,20 @@ <div class="col-xxl-6"> <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :pricing %> </div> + <div class="col-xxl-6"> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :pricing_initial %> + </div> + <div class="col-xxl-6"> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :pricing_continuing %> + </div> + <div class="col-xxl-6"> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :pricing_apprenticeship %> + </div> <div class="col-xxl-6"> <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :registration %> - <%= f.input :registration_url %> + </div> + <div class="col-xxl-6"> + <%= f.input :registration_url %> </div> <div class="col-xxl-6"> <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :accessibility %> diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index cecf882d285418e1a74fcd373ac86185aaa3daae..92a209d813c04777d57951cf46bc94985f5fd883 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -99,6 +99,9 @@ <%= render 'admin/application/property/text', object: @program, property: :registration %> <%= render 'admin/application/property/text', object: @program, property: :other %> <%= render 'admin/application/property/text', object: @program, property: :pricing %> + <%= render 'admin/application/property/text', object: @program, property: :pricing_initial %> + <%= render 'admin/application/property/text', object: @program, property: :pricing_continuing %> + <%= render 'admin/application/property/text', object: @program, property: :pricing_apprenticeship %> <%= render 'admin/application/property/text', object: @program, property: :accessibility %> <%= render 'admin/application/property/text', object: @program, property: :contacts %> <% if @program.registration_url.present? %> diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 8ad8110960304e1c974095e0243f83bcfd109bfa..aa8841780ba7af0eba07e421ca9a55f5a339b5b5 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -80,6 +80,9 @@ apprenticeship: <%= @about.apprenticeship %> :pedagogy, :prerequisites, :pricing, + :pricing_initial, + :pricing_continuing, + :pricing_apprenticeship, :registration, :results ].each do |property| %> diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index 38766f83388f7d5f72d3860bfed9a8b73cd842dd..d6e98ff69e9d61d03e32aa8eaa4631c0a3c8b8c5 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -62,7 +62,10 @@ en: pedagogy: Méthodes mobilisées prerequisites: Prérequis presentation: In brief - pricing: Tarifs + pricing: Costs + pricing_initial: Costs for initial training + pricing_continuing: Costs for continuous training + pricing_apprenticeship: Costs for apprenticeship published: Published? registration: Modalités et délais d’accès registration_url: Registration link (URL) diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 4e2252160d136362df4cff92f0e9131ea04d8415..c51ffe26f3071d94b72a7fe567c95a1ed8b25fa4 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -62,7 +62,10 @@ fr: pedagogy: Méthodes mobilisées prerequisites: Prérequis presentation: En bref - pricing: Tarifs + pricing: Coûts + pricing_initial: Coûts de la formation initiale + pricing_continuing: Coûts de la formation continue + pricing_apprenticeship: Coûts de l'apprentissage published: Publiée ? registration: Modalités et délais d’accès registration_url: Lien d'inscription (URL) diff --git a/db/migrate/20240209135241_add_pricing_fields_to_education_programs.rb b/db/migrate/20240209135241_add_pricing_fields_to_education_programs.rb new file mode 100644 index 0000000000000000000000000000000000000000..b2f1305d3eba441826a9f4632bf5e388a5bdb853 --- /dev/null +++ b/db/migrate/20240209135241_add_pricing_fields_to_education_programs.rb @@ -0,0 +1,7 @@ +class AddPricingFieldsToEducationPrograms < ActiveRecord::Migration[7.1] + def change + add_column :education_programs, :pricing_continuing, :text + add_column :education_programs, :pricing_apprenticeship, :text + add_column :education_programs, :pricing_initial, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 83d57cc2c1fde144492e3b62d2cc827e19014185..e0fa208b2f552d6fbc1667d31dc644f13e2c07e8 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.1].define(version: 2024_02_08_131753) do +ActiveRecord::Schema[7.1].define(version: 2024_02_09_135241) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -680,6 +680,9 @@ ActiveRecord::Schema[7.1].define(version: 2024_02_08_131753) do t.boolean "apprenticeship" t.string "registration_url" t.text "summary" + t.text "pricing_continuing" + t.text "pricing_apprenticeship" + t.text "pricing_initial" t.index ["diploma_id"], name: "index_education_programs_on_diploma_id" t.index ["parent_id"], name: "index_education_programs_on_parent_id" t.index ["slug"], name: "index_education_programs_on_slug"