diff --git a/app/controllers/admin/communication/websites/agenda/events_controller.rb b/app/controllers/admin/communication/websites/agenda/events_controller.rb index a78ff1a9104db908706f2a990e533add4627c9d0..a5816f196c8097450b2fe61dfb9879e489300961 100644 --- a/app/controllers/admin/communication/websites/agenda/events_controller.rb +++ b/app/controllers/admin/communication/websites/agenda/events_controller.rb @@ -78,7 +78,7 @@ class Admin::Communication::Websites::Agenda::EventsController < Admin::Communic def event_params params.require(:communication_website_agenda_event) .permit( - :title, :meta_description, :summary, :published, :slug, + :title, :subtitle, :meta_description, :summary, :published, :slug, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :from_day, :from_hour, :to_day, :to_hour ) diff --git a/app/models/communication/website/agenda/event.rb b/app/models/communication/website/agenda/event.rb index 67c710dae7813e905b2a1ad8fc390a12db7f832c..506d611c905196e74b734ede2606788e39c3c509 100644 --- a/app/models/communication/website/agenda/event.rb +++ b/app/models/communication/website/agenda/event.rb @@ -10,6 +10,7 @@ # meta_description :text # published :boolean default(FALSE) # slug :string indexed +# subtitle :string # summary :text # title :string # to_day :date diff --git a/app/views/admin/communication/websites/agenda/events/_form.html.erb b/app/views/admin/communication/websites/agenda/events/_form.html.erb index 576ba9c86683bd85324da3d3050d4f6146daa576..9499024d1a4407fb6289144d7242314c447c75e7 100644 --- a/app/views/admin/communication/websites/agenda/events/_form.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_form.html.erb @@ -6,6 +6,7 @@ <div class="col-md-8"> <%= osuny_panel t('content') do %> <%= f.input :title %> + <%= f.input :subtitle %> <%= render 'admin/application/summary/form', f: f, about: event %> <% end %> <%= osuny_panel Communication::Website::Agenda::Event.human_attribute_name('dates') do %> diff --git a/app/views/admin/communication/websites/agenda/events/show.html.erb b/app/views/admin/communication/websites/agenda/events/show.html.erb index 3bd2fded9ad281eaf2eb25d37abff5c6a187a704..52f8cfedabc812fd259a70286bdbf93121f5104f 100644 --- a/app/views/admin/communication/websites/agenda/events/show.html.erb +++ b/app/views/admin/communication/websites/agenda/events/show.html.erb @@ -5,6 +5,9 @@ <div class="col-lg-7"> <%= osuny_panel Communication::Website::Agenda::Event.human_attribute_name(:title), small: true do %> <p class="lead"><%= @event.title %></p> + <% if @event.subtitle.present? %> + <p class="mt-n3 text-muted"><%= @event.subtitle %></p> + <% end %> <p><%= render 'admin/communication/websites/agenda/events/dates', event: @event %></p> <% end %> </div> diff --git a/db/migrate/20231031104523_add_subtitle_to_communication_website_agenda_events.rb b/db/migrate/20231031104523_add_subtitle_to_communication_website_agenda_events.rb new file mode 100644 index 0000000000000000000000000000000000000000..4e9e639bbf4a16b17c26b8edfe452f48ee215e1c --- /dev/null +++ b/db/migrate/20231031104523_add_subtitle_to_communication_website_agenda_events.rb @@ -0,0 +1,5 @@ +class AddSubtitleToCommunicationWebsiteAgendaEvents < ActiveRecord::Migration[7.1] + def change + add_column :communication_website_agenda_events, :subtitle, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 659e0ae397ed6501c52e9dedbd3b6089c4283ee7..f51e0365581eea2345c6f635e6339d5fcdcb66e2 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: 2023_10_18_182341) do +ActiveRecord::Schema[7.1].define(version: 2023_10_31_104523) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -252,6 +252,7 @@ ActiveRecord::Schema[7.1].define(version: 2023_10_18_182341) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "slug" + t.string "subtitle" t.index ["communication_website_id"], name: "index_agenda_events_on_communication_website_id" t.index ["language_id"], name: "index_communication_website_agenda_events_on_language_id" t.index ["original_id"], name: "index_communication_website_agenda_events_on_original_id" @@ -260,6 +261,13 @@ ActiveRecord::Schema[7.1].define(version: 2023_10_18_182341) do t.index ["university_id"], name: "index_communication_website_agenda_events_on_university_id" end + create_table "communication_website_agenda_events_categories", id: false, force: :cascade do |t| + t.uuid "communication_website_agenda_event_id", null: false + t.uuid "communication_website_category_id", null: false + t.index ["communication_website_agenda_event_id", "communication_website_category_id"], name: "event_category" + t.index ["communication_website_category_id", "communication_website_agenda_event_id"], name: "category_event" + end + create_table "communication_website_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false diff --git a/test/fixtures/communication/website/agenda/events.yml b/test/fixtures/communication/website/agenda/events.yml index d813866e4310fdf8fb4111156fec4ac39d13e2dd..01f5d18dabd095b22d80aed382f3a2d3f5b8f2e9 100644 --- a/test/fixtures/communication/website/agenda/events.yml +++ b/test/fixtures/communication/website/agenda/events.yml @@ -10,6 +10,7 @@ # meta_description :text # published :boolean default(FALSE) # slug :string indexed +# subtitle :string # summary :text # title :string # to_day :date diff --git a/test/models/communication/website/agenda/event_test.rb b/test/models/communication/website/agenda/event_test.rb index c8ca3e1728d3bf17d0a6d5da0da8af473cde6245..17615a6e93fcf16c245551f9b7dee7689238f76e 100644 --- a/test/models/communication/website/agenda/event_test.rb +++ b/test/models/communication/website/agenda/event_test.rb @@ -10,6 +10,7 @@ # meta_description :text # published :boolean default(FALSE) # slug :string indexed +# subtitle :string # summary :text # title :string # to_day :date