Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudlevy committed Jan 13, 2025
1 parent 08ec1a2 commit aab640f
Show file tree
Hide file tree
Showing 22 changed files with 40 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Admin::Communication::Websites::Agenda::ApplicationController < Admin::Com

def breadcrumb
super
add_breadcrumb Communication::Website::Agenda.model_name.human(count: 2),
add_breadcrumb @website.feature_agenda_name(current_language),
admin_communication_website_agenda_events_path
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ def destroy

def breadcrumb
super
add_breadcrumb Communication::Website::Agenda::Event.model_name.human(count: 2),
admin_communication_website_agenda_events_path
breadcrumb_for @event
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Admin::Communication::Websites::Portfolio::ApplicationController < Admin::

def breadcrumb
super
add_breadcrumb Communication::Website::Portfolio.model_name.human(count: 2),
add_breadcrumb @website.feature_portfolio_name(current_language),
admin_communication_website_portfolio_projects_path
end
end
8 changes: 8 additions & 0 deletions app/models/communication/website/with_feature_agenda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@ module Communication::Website::WithFeatureAgenda
scope :with_feature_agenda, -> { where(feature_agenda: true) }
end

def feature_agenda_name(language)
begin
special_page(Communication::Website::Page::CommunicationAgenda).best_localization_for(language)
rescue
Communication::Website::Agenda::Event.model_name.human(count: 2)
end
end

end
7 changes: 7 additions & 0 deletions app/models/communication/website/with_feature_portfolio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ module Communication::Website::WithFeaturePortfolio
scope :with_feature_portfolio, -> { where(feature_portfolio: true) }
end

def feature_portfolio_name(language)
begin
special_page(Communication::Website::Page::CommunicationPortfolio).best_localization_for(language)
rescue
Communication::Website::Portfolio::Project.model_name.human(count: 2)
end
end
end
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<% content_for :title, Communication::Website::Agenda::Event.model_name.human(count: 2) %>
<% content_for :title, t('create') %>

<div class="d-flex justify-content-between mb-4">
<p>
<%= @events.total_count %>
<%= Communication::Website::Agenda::Event.model_name.human(count: @events.total_count).downcase %>
<%= t('admin.item', count: @events.total_count) %>
</p>
<%= render 'filters', current_path: admin_communication_website_agenda_events_path, website: @website %>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<% content_for :title, Communication::Website::Agenda::Event.model_name.human %>
<% content_for :title, t('create') %>
<%= render 'form', event: @event, l10n: @l10n %>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<% content_for :title, Communication::Website::Portfolio::Project.model_name.human(count: 2) %>
<% content_for :title, t('create') %>

<div class="d-flex justify-content-between mb-4">
<p>
<%= @projects.total_count %>
<%= Communication::Website::Portfolio::Project.model_name.human(count: @projects.total_count).downcase %>
<%= t('admin.item', count: @projects.total_count) %>
</p>
<%= render 'filters', current_path: admin_communication_website_portfolio_projects_path, website: @website %>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<% content_for :title, Communication::Website::Portfolio::Project.model_name.human %>

<% content_for :title, t('create') %>
<%= render 'form', project: @project, l10n: @l10n %>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="d-flex justify-content-between mb-4">
<p>
<%= @posts.total_count %>
<%= Communication::Website::Post.model_name.human(count: @posts.total_count).downcase %>
<%= t('admin.item', count: @posts.total_count) %>
</p>
<%= render 'filters', current_path: admin_communication_website_posts_path, website: @website %>
</div>
Expand Down
6 changes: 2 additions & 4 deletions app/views/admin/communication/websites/posts/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<% content_for :title, Communication::Website::Post.model_name.human %>
<%= render 'form',
post: @post,
l10n: @l10n %>
<% content_for :title, t('create') %>
<%= render 'form', post: @post, l10n: @l10n %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
title = t('communication.website.last_events')
title = @website.feature_agenda_name(current_language)
action = ''
action += link_to t('create'),
new_admin_communication_website_agenda_event_path(website_id: @website),
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/communication/websites/show/_pages.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<%
title = Communication::Website::Page.model_name.human(count: 2)
action = ''
action += link_to t('create'),
new_admin_communication_website_page_path(website_id: @website),
class: button_classes if can?(:create, Communication::Website::Page)
%>
<%= osuny_panel t('communication.website.last_pages'),
action: action do %>
<%= osuny_panel title, action: action do %>
<div class="row g-2 mb-3">
<% @pages.each do |page| %>
<div class="<%= 'col-lg-6 col-xxl-4' if large %>">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
title = t('communication.website.last_posts')
title = @website.feature_posts_name(current_language)
action = ''
action += link_to t('create'),
new_admin_communication_website_post_path(website_id: @website),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
title = t('communication.website.last_projects')
title = @website.feature_portfolio_name(current_language)
action = ''
action += link_to t('create'),
new_admin_communication_website_portfolio_project_path(website_id: @website),
Expand Down
4 changes: 0 additions & 4 deletions config/locales/communication/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,6 @@ en:
button: Go live
title: Go live
hosting: Hosting
last_events: Last events
last_pages: Last pages
last_posts: Last posts
last_projects: Last projects
menus:
automatic: This menu is created automatically. <br>This means that it reflects the site's tree structure. <br>As soon as you want to modify it, by creating an item, the automatism will stop.
default_title:
Expand Down
4 changes: 0 additions & 4 deletions config/locales/communication/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,6 @@ fr:
button: Mettre en production
title: Mise en production
hosting: Hébergement
last_events: Derniers événements
last_pages: Dernières pages
last_posts: Dernières actualités
last_projects: Derniers projets
menus:
automatic: Ce menu se constitue automatiquement. <br>Cela signifie qu'il reflète l'arborescence du site. <br>Dès que vous souhaiterez le modifier, en créant un élément, l'automatisme s'arrêtera.
default_title:
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ en:
in: in %{lang}
switch_to: switch to %{choices}
infos: Informations
items:
one: item
other: items
inheritance:
sentence_html: Value inherited from %{link}
sentence_without_link: Value inherited
Expand Down
4 changes: 2 additions & 2 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ fr:
sentence_without_link: Valeur héritée
status: Valeur héritée
item:
one: Élément
other: Éléments
one: élément
other: éléments
meta_description:
hint: Texte simple, dédié au à l'optimisation pour les moteurs de recherche (Search Engine Optimization, SEO).
label: Description pour les moteurs de recherche (meta)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

navigation.items do |primary|
primary.item :feature_nav_events,
Communication::Website::Agenda::Event.model_name.human(count: 2),
@website.feature_agenda_name(current_language),
admin_communication_website_agenda_events_path(website_id: @website.id)
primary.item :feature_nav_categories,
Communication::Website::Agenda::Category.model_name.human(count: 2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

navigation.items do |primary|
primary.item :feature_nav_projects,
Communication::Website::Portfolio::Project.model_name.human(count: 2),
@website.feature_portfolio_name(current_language),
admin_communication_website_portfolio_projects_path(website_id: @website.id)
primary.item :feature_nav_categories,
Communication::Website::Portfolio::Category.model_name.human(count: 2),
Expand Down
4 changes: 2 additions & 2 deletions config/navigation/admin/communication/website_navigation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
admin_communication_website_post_authors_path(website_id: @website.id).in?(request.path)
} if @website.feature_posts
primary.item :subnav_agenda,
Communication::Website::Agenda.model_name.human(count: 2),
@website.feature_agenda_name(current_language),
admin_communication_website_agenda_events_path(website_id: @website.id),
highlights_on: lambda {
admin_communication_website_agenda_root_path(website_id: @website.id).in?(request.path)
} if @website.feature_agenda
primary.item :subnav_portfolio,
Communication::Website::Portfolio.model_name.human(count: 2),
@website.feature_portfolio_name(current_language),
admin_communication_website_portfolio_projects_path(website_id: @website.id),
highlights_on: lambda {
admin_communication_website_portfolio_root_path(website_id: @website.id).in?(request.path)
Expand Down

0 comments on commit aab640f

Please sign in to comment.