Skip to content
Snippets Groups Projects
Commit 452bf792 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

show website

parent 5ebf5fe0
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,8 @@ class Admin::Communication::WebsitesController < Admin::Communication::Websites:
@pages = @all_pages.recent
@all_posts = @website.posts.accessible_by(current_ability).for_language(current_website_language)
@posts = @all_posts.recent
@all_events = @website.events.accessible_by(current_ability).for_language(current_website_language)
@events = @all_events.recent
breadcrumb
end
......
......@@ -57,6 +57,7 @@ class Communication::Website::Agenda::Event < ApplicationRecord
optional: true
scope :ordered, -> { order(from_day: :desc) }
scope :recent, -> { order(from_day: :desc).limit(5) }
validates_presence_of :from_day
......
......@@ -15,6 +15,7 @@
<%= render 'admin/communication/websites/sidebar' do %>
<%= render 'admin/communication/websites/show/posts' if can?(:read, Communication::Website::Post) && @website.feature_posts %>
<%= render 'admin/communication/websites/show/events' if can?(:read, Communication::Website::Agenda::Event) && @website.feature_agenda %>
<%= render 'admin/communication/websites/show/pages' if can?(:read, Communication::Website::Page) %>
<%= image_tag @website.deployment_status_badge, alt: '' if @website.deployment_status_badge.present? %>
<% end %>
......
<%
action = ''
action += link_to t('create'),
new_admin_communication_website_agenda_event_path(website_id: @website),
class: button_classes if can?(:create, Communication::Website::Agenda::Event)
subtitle = ''
if @all_events.any?
subtitle = link_to t('communication.website.see_all', number: @all_events.size),
admin_communication_website_agenda_events_path(website_id: @website)
end
%>
<%= osuny_panel t('communication.website.last_events'),
subtitle: subtitle,
action: action do %>
<%= render 'admin/communication/websites/agenda/events/list',
events: @events %>
<% end %>
......@@ -776,6 +776,7 @@ en:
refresh: Refresh import
show: Show import
pending: Import in progress
last_events: Last events
last_pages: Last pages
last_posts: Last posts
menus:
......
......@@ -773,6 +773,7 @@ fr:
refresh: Relancer l'import
show: Voir l'import
pending: Import en cours
last_events: Derniers événements
last_pages: Dernières pages
last_posts: Dernières actualités
menus:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment