diff --git a/app/controllers/admin/communication/websites/agenda/events_controller.rb b/app/controllers/admin/communication/websites/agenda/events_controller.rb index 5dc31008965837b3efc41432c40bdcfd547914cc..f17c1a8e507c2b13bc092b7280b2a61f9cf50fda 100644 --- a/app/controllers/admin/communication/websites/agenda/events_controller.rb +++ b/app/controllers/admin/communication/websites/agenda/events_controller.rb @@ -78,7 +78,8 @@ class Admin::Communication::Websites::Agenda::EventsController < Admin::Communic params.require(:communication_website_agenda_event) .permit( :title, :meta_description, :summary, :published, :slug, - :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit + :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, + :from_day, :from_hour, :to_day, :to_hour ) .merge( university_id: current_university.id, 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 6484195ff5e459f3f7bb584c81610e5efbd74077..d4240f6e685c6f9782ec165c22967f92092eb31d 100644 --- a/app/views/admin/communication/websites/agenda/events/_form.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_form.html.erb @@ -9,6 +9,14 @@ <%= render 'admin/application/summary/form', f: f, about: event %> <% end %> <div class="row pure__row--small"> + <div class="col-md-6"> + <%= f.input :from_day, html5: true %> + <%= f.input :from_hour, html5: true %> + </div> + <div class="col-md-6"> + <%= f.input :to_day, html5: true %> + <%= f.input :to_hour, html5: true %> + </div> <div class="col-md-6"> <%= render 'admin/application/meta_description/form', f: f, about: event %> </div> diff --git a/app/views/admin/communication/websites/agenda/events/_list.html.erb b/app/views/admin/communication/websites/agenda/events/_list.html.erb index f847a592a765141320d13544d506dd9481675170..a3624d30e9786cc728a9fdb218d8c6f952f09daa 100644 --- a/app/views/admin/communication/websites/agenda/events/_list.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_list.html.erb @@ -6,7 +6,8 @@ <thead> <tr> <th class="ps-0" style="min-width: 250px"><%= Communication::Website::Agenda::Event.human_attribute_name('title') %></th> - <th><%= Communication::Website::Post.human_attribute_name('featured_image') %></th> + <th><%= Communication::Website::Agenda::Event.human_attribute_name('dates') %></th> + <th><%= Communication::Website::Agenda::Event.human_attribute_name('featured_image') %></th> </tr> </thead> <tbody> @@ -16,6 +17,9 @@ <%= link_to event, admin_communication_website_agenda_event_path(website_id: event.website.id, id: event.id), class: "#{'draft' unless event.published?}" %> + </td> + <td> + </td> <td><%= image_tag event.featured_image.representation(resize: '200x'), width: 100 if event.featured_image.attached? && event.featured_image.representable? %></td> 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 5c323dc3d394e41147a2f7817eaaa166dc6f00a9..b7e6a24ea87cf0ba4581008f94db1774da98374d 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,13 @@ <div class="col-lg-7"> <%= osuny_panel Communication::Website::Agenda::Event.human_attribute_name(:title), small: true do %> <p class="lead"><%= @event.title %></p> + <p> + <%= l @event.from_day %> + <%= l @event.from_hour, format: "%H:%M" if @event.from_hour %> + <br> + → <%= l @event.to_day %> + <%= l @event.to_hour, format: "%H:%M" if @event.to_hour %> + </p> <% end %> </div> <div class="offset-lg-1 col-lg-4"> @@ -16,9 +23,9 @@ <hr class="mb-5"> <div class="row"> <div class="col-lg-4"> - <% # TODO i18n après Violenn %> <div class="mb-4"> <%= osuny_label t('metadata') %><br> + <% # TODO i18n après Violenn %> <%= @event.published ? 'Publié' : 'Brouillon' %> <%= render 'admin/application/i18n/inline', about: @event %> </div> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index d552cee70ac92356a75d21a1094a409d0db3e3a9..9515f05fa5708ad7f4956a697d5e4da46b33c3e9 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -150,7 +150,13 @@ en: repository: Repository url: URL communication/website/agenda/event: + dates: Dates + featured_image: Featured image + from_day: From day + from_hour: From hour title: Title + to_day: To day + to_hour: To hour communication/website/category: children: Children categories featured_image: Featured image diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 558c9132f3bd0ce910b874d0443c147765472b16..6050bb39c99b7e1f62e2f008583effb166b5a8ee 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -150,7 +150,13 @@ fr: repository: Référentiel url: URL communication/website/agenda/event: + dates: Dates + featured_image: Image à la une + from_day: Jour de début + from_hour: Heure de début title: Titre + to_day: Jour de fin + to_hour: Heure de fin communication/website/category: children: Catégories enfants featured_image: Image à la une