From ce2417a319afd09d1ae27620ba7c2343634980fa Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 5 Sep 2023 20:29:40 +0200 Subject: [PATCH] wip --- .../websites/agenda/events/_dates.html.erb | 9 +++++++++ .../websites/agenda/events/_list.html.erb | 4 +--- .../websites/agenda/events/show.html.erb | 10 ++-------- .../websites/agenda/events/static.html.erb | 16 +--------------- 4 files changed, 13 insertions(+), 26 deletions(-) create mode 100644 app/views/admin/communication/websites/agenda/events/_dates.html.erb diff --git a/app/views/admin/communication/websites/agenda/events/_dates.html.erb b/app/views/admin/communication/websites/agenda/events/_dates.html.erb new file mode 100644 index 000000000..3b5167771 --- /dev/null +++ b/app/views/admin/communication/websites/agenda/events/_dates.html.erb @@ -0,0 +1,9 @@ +<i class="fas fa-play-circle"></i> +<%= l event.from_day %> +<%= l event.from_hour, format: "%H:%M" if event.from_hour %> +<% if event.to_day%> + <br> + <i class="fas fa-stop-circle"></i> + <%= l event.to_day %> + <%= l event.to_hour, format: "%H:%M" if event.to_hour %> +<% end %> \ No newline at end of file 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 a3624d30e..a58354711 100644 --- a/app/views/admin/communication/websites/agenda/events/_list.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_list.html.erb @@ -18,9 +18,7 @@ admin_communication_website_agenda_event_path(website_id: event.website.id, id: event.id), class: "#{'draft' unless event.published?}" %> </td> - <td> - - </td> + <td class="small"><%= render 'admin/communication/websites/agenda/events/dates', event: event %></td> <td><%= image_tag event.featured_image.representation(resize: '200x'), width: 100 if event.featured_image.attached? && event.featured_image.representable? %></td> </tr> 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 b7e6a24ea..3bd2fded9 100644 --- a/app/views/admin/communication/websites/agenda/events/show.html.erb +++ b/app/views/admin/communication/websites/agenda/events/show.html.erb @@ -5,13 +5,7 @@ <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> + <p><%= render 'admin/communication/websites/agenda/events/dates', event: @event %></p> <% end %> </div> <div class="offset-lg-1 col-lg-4"> @@ -41,7 +35,7 @@ <% content_for :action_bar_left do %> <%= destroy_link @event %> <%= duplicate_link @event %> - <%= static_link static_admin_communication_website_post_path(@event) %> + <%= static_link static_admin_communication_website_agenda_event_path(@event) %> <% end %> <% content_for :action_bar_right do %> diff --git a/app/views/admin/communication/websites/agenda/events/static.html.erb b/app/views/admin/communication/websites/agenda/events/static.html.erb index 8f4dc2b7e..a95e2cb5b 100644 --- a/app/views/admin/communication/websites/agenda/events/static.html.erb +++ b/app/views/admin/communication/websites/agenda/events/static.html.erb @@ -1,25 +1,11 @@ --- title: "<%= @about.title %>" -date: "<%= @about.published_at&.iso8601 %>" +date: "<%= @about.from_day&.iso8601 %>" <%= render 'admin/application/static/permalink' %> <%= render 'admin/application/static/design', full_width: false, toc_offcanvas: false %> -<% if @about.pinned %> -weight: 1 -<% end %> -<% if @about.author %> -authors: - - "<%= @about.translated_author.slug %>" -<% end %> -<% if @about.categories.any? %> -categories: - <% @about.categories.each do |category| %> - - "<%= category.slug_with_ancestors_slugs %>" - <% end %> -<% end %> <%= render 'admin/application/i18n/static' %> <%= render 'admin/application/featured_image/static' %> <%= render 'admin/application/meta_description/static' %> <%= render 'admin/application/summary/static' %> <%= render 'admin/communication/blocks/content/static', about: @about %> --- -<%= prepare_html_for_static @about.text, @about.university %> -- GitLab