From 16659fcb2b5052dc65d190dba600372ec9fa151b Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Thu, 31 Oct 2024 10:58:41 +0100 Subject: [PATCH] =?UTF-8?q?Rangement=20des=20donn=C3=A9es=20statiques=20(#?= =?UTF-8?q?2344)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rangement * raw date * meta -> core * clean * clean * clean * forced_title * clean * fix * fix --------- Co-authored-by: Sébastien Gaya --- app/models/research/publication.rb | 4 ++ .../administration/locations/static.html.erb | 4 +- .../admin/application/static/_core.html.erb | 69 +++++++++++++++++++ .../application/static/_design.json.jbuilder | 13 ---- .../application/static/_permalink.html.erb | 29 -------- .../static/_permalink.json.jbuilder | 10 --- .../agenda/categories/static.html.erb | 4 +- .../websites/agenda/events/static.html.erb | 16 +---- .../agenda/events/static/_dates.html.erb | 63 +++++++++-------- .../websites/pages/static.html.erb | 4 +- .../websites/pages/static.json.jbuilder | 30 -------- .../portfolio/categories/static.html.erb | 4 +- .../portfolio/projects/static.html.erb | 6 +- .../websites/posts/categories/static.html.erb | 5 +- .../websites/posts/static.html.erb | 7 +- .../communication/websites/static.html.erb | 3 - .../admin/education/diplomas/static.html.erb | 4 +- .../programs/categories/static.html.erb | 4 +- .../admin/education/programs/static.html.erb | 4 +- .../admin/education/teachers/static.html.erb | 5 +- .../research/journals/papers/static.html.erb | 4 +- .../research/journals/volumes/static.html.erb | 7 +- .../research/publications/static.html.erb | 5 +- .../research/researchers/static.html.erb | 14 ++-- .../organizations/categories/static.html.erb | 9 ++- .../university/organizations/static.html.erb | 6 +- .../people/administrators/static.html.erb | 8 +-- .../university/people/authors/static.html.erb | 8 +-- .../people/categories/static.html.erb | 9 ++- .../admin/university/people/static.html.erb | 6 +- 30 files changed, 151 insertions(+), 213 deletions(-) create mode 100644 app/views/admin/application/static/_core.html.erb delete mode 100644 app/views/admin/application/static/_design.json.jbuilder delete mode 100644 app/views/admin/application/static/_permalink.html.erb delete mode 100644 app/views/admin/application/static/_permalink.json.jbuilder delete mode 100644 app/views/admin/communication/websites/pages/static.json.jbuilder diff --git a/app/models/research/publication.rb b/app/models/research/publication.rb index 7bf4acffa..92bc1aadd 100644 --- a/app/models/research/publication.rb +++ b/app/models/research/publication.rb @@ -63,6 +63,10 @@ class Research::Publication < ApplicationRecord ", term: "%#{sanitize_sql_like(term)}%") } + def published_at + publication_date + end + def editable? source == 'osuny' end diff --git a/app/views/admin/administration/locations/static.html.erb b/app/views/admin/administration/locations/static.html.erb index 32bf0dce5..808a9758e 100644 --- a/app/views/admin/administration/locations/static.html.erb +++ b/app/views/admin/administration/locations/static.html.erb @@ -2,9 +2,7 @@ location = @l10n.about language = @l10n.language %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: location, diff --git a/app/views/admin/application/static/_core.html.erb b/app/views/admin/application/static/_core.html.erb new file mode 100644 index 000000000..d83613b00 --- /dev/null +++ b/app/views/admin/application/static/_core.html.erb @@ -0,0 +1,69 @@ +<% +# Partial arguments +forced_title ||= nil +forced_slug ||= nil +skip_date ||= false +# Preparing variables +title = forced_title || about.to_s +show_subtitle = about.respond_to?(:subtitle) +show_date = about.respond_to?(:published_at) && !skip_date +show_published_at = about.respond_to?(:published_at) +if about.respond_to?(:slug) && about.slug.present? + slug = forced_slug || about.slug +end +if @website + previous_permalinks = about.previous_permalinks_in_website(@website) + hugo = about.hugo(@website) if about.respond_to?(:hugo) +end +%> +<% +############# +# Title and subtitle +############# +%> +title: >- + <%= prepare_text_for_static title %> +<% if show_subtitle %> +subtitle: >- + <%= prepare_text_for_static about.subtitle %> +<% end %> +<% +############# +# Permalinks +############# +%> +<% if @website %> +url: "<%= about.current_permalink_in_website(@website)&.path %>" +<% if slug %> +slug: "<%= slug %>" +<% end %> +<% if previous_permalinks.any? %> +aliases: +<% previous_permalinks.each do |permalink| %> + - <%= permalink.path %> +<% end %> +<% end %> +<% end %> +<% +############# +# Dates & meta +############# +%> +<% if show_date %> +date: <%= about.published_at&.iso8601 %> +<% end %> +lastmod: <%= about.updated_at&.iso8601 %> +meta: +<% if hugo %> + hugo: + permalink: "<%= hugo.permalink %>" + file: "<%= hugo.file %>" + path: "<%= hugo.path %>" + slug: "<%= hugo.slug %>" +<% end %> + dates: + created_at: <%= about.created_at&.iso8601 %> + updated_at: <%= about.updated_at&.iso8601 %> +<% if show_published_at %> + published_at: <%= about.published_at&.iso8601 %> +<% end %> \ No newline at end of file diff --git a/app/views/admin/application/static/_design.json.jbuilder b/app/views/admin/application/static/_design.json.jbuilder deleted file mode 100644 index ec51e1538..000000000 --- a/app/views/admin/application/static/_design.json.jbuilder +++ /dev/null @@ -1,13 +0,0 @@ -full_width = local_assigns.has_key?(:full_width) ? local_assigns[:full_width] - : @about.full_width -toc_offcanvas = local_assigns.has_key?(:toc_offcanvas) ? local_assigns[:toc_offcanvas] - : @about.full_width -toc_present = local_assigns.has_key?(:toc_present) ? local_assigns[:toc_present] - : @about.show_toc? -json.design do - json.full_width full_width - json.toc do - json.present toc_present - json.offcanvas toc_offcanvas - end -end diff --git a/app/views/admin/application/static/_permalink.html.erb b/app/views/admin/application/static/_permalink.html.erb deleted file mode 100644 index 55170d5ba..000000000 --- a/app/views/admin/application/static/_permalink.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<% if @website %> -url: "<%= about.current_permalink_in_website(@website)&.path %>" -<% -if about.respond_to?(:slug) && about.slug.present? - forced_slug ||= nil - slug = forced_slug || about.slug -%> -slug: "<%= slug %>" -<% end %> -<% -previous_permalinks = about.previous_permalinks_in_website(@website) -if previous_permalinks.any? -%> -aliases: -<% previous_permalinks.each do |permalink| %> - - <%= permalink.path %> -<% end %> -<% end %> -<% -if about.respond_to?(:hugo) - hugo = about.hugo(@website) -%> -hugo: - permalink: "<%= hugo.permalink %>" - file: "<%= hugo.file %>" - path: "<%= hugo.path %>" - slug: "<%= hugo.slug %>" -<% end %> -<% end %> \ No newline at end of file diff --git a/app/views/admin/application/static/_permalink.json.jbuilder b/app/views/admin/application/static/_permalink.json.jbuilder deleted file mode 100644 index bae4fabb2..000000000 --- a/app/views/admin/application/static/_permalink.json.jbuilder +++ /dev/null @@ -1,10 +0,0 @@ -json.url @about.current_permalink_in_website(@website)&.path - -if @about.respond_to?(:slug) && @about.slug.present? - forced_slug ||= nil - json.slug (forced_slug || @about.slug) -end - -previous_permalinks = @about.previous_permalinks_in_website(@website) -json.aliases previous_permalinks.collect(&:path) if previous_permalinks.any? - \ No newline at end of file diff --git a/app/views/admin/communication/websites/agenda/categories/static.html.erb b/app/views/admin/communication/websites/agenda/categories/static.html.erb index e49d08f5e..9ff6570fa 100644 --- a/app/views/admin/communication/websites/agenda/categories/static.html.erb +++ b/app/views/admin/communication/websites/agenda/categories/static.html.erb @@ -1,9 +1,7 @@ <% category = @l10n.about %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: category, 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 d69a0a120..e1526f7cf 100644 --- a/app/views/admin/communication/websites/agenda/events/static.html.erb +++ b/app/views/admin/communication/websites/agenda/events/static.html.erb @@ -2,21 +2,7 @@ event = @l10n.about language = @l10n.language %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -subtitle: >- - <%= prepare_text_for_static @l10n.subtitle %> -<% -# https://github.com/osunyorg/admin/issues/1880 -if event.archive? %> -date: "<%= event.from_day&.iso8601 %>" -<% elsif event.current? %> -weight: -1 -date: "<%= event.from_day&.iso8601 %>" -<% else %> -weight: <%= event.distance_in_days %> -<% end %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n, skip_date: true %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: event, diff --git a/app/views/admin/communication/websites/agenda/events/static/_dates.html.erb b/app/views/admin/communication/websites/agenda/events/static/_dates.html.erb index ee1a005f7..36e7807f9 100644 --- a/app/views/admin/communication/websites/agenda/events/static/_dates.html.erb +++ b/app/views/admin/communication/websites/agenda/events/static/_dates.html.erb @@ -1,33 +1,40 @@ <% -depth ||= 0 -indentation = ' ' * depth -%> -<%= indentation %>dates: -<%= indentation %> status: "<%= event.status %>" -<%= indentation %> archive: <%= event.archive? %> -<%= indentation %> computed: -<%= indentation %> short: >- -<%= indentation %> <%= date_range_i18n(event.from_day, event.to_day, format: :short, locale: locale) %> -<%= indentation %> long: >- -<%= indentation %> <%= date_range_i18n(event.from_day, event.to_day, format: :long, locale: locale) %> -<%= indentation %> two_lines: -<%= indentation %> short: >- -<%= indentation %> <%= date_range_i18n(event.from_day, event.to_day, format: :short, layout: :two_lines, locale: locale) %> -<%= indentation %> long: >- -<%= indentation %> <%= date_range_i18n(event.from_day, event.to_day, format: :long, layout: :two_lines, locale: locale) %> -<%= indentation %> from: -<%= indentation %> day: <%= event.from_day %> +# Dates override default dates in core, so it comes after +# https://github.com/osunyorg/admin/issues/1880 +if event.archive? %> +date: "<%= event.from_day&.iso8601 %>" +<% elsif event.current? %> +weight: -1 +date: "<%= event.from_day&.iso8601 %>" +<% else %> +weight: <%= event.distance_in_days %> +<% end %> +dates: + status: "<%= event.status %>" + archive: <%= event.archive? %> + computed: + short: >- + <%= date_range_i18n(event.from_day, event.to_day, format: :short, locale: locale) %> + long: >- + <%= date_range_i18n(event.from_day, event.to_day, format: :long, locale: locale) %> + two_lines: + short: >- + <%= date_range_i18n(event.from_day, event.to_day, format: :short, layout: :two_lines, locale: locale) %> + long: >- + <%= date_range_i18n(event.from_day, event.to_day, format: :long, layout: :two_lines, locale: locale) %> + from: + day: <%= event.from_day %> <% if event.from_hour %> -<%= indentation %> hour: <%= event.from_hour.strftime "%H:%M" %> + hour: <%= event.from_hour.strftime "%H:%M" %> <% end %> -<%= indentation %> to: -<%= indentation %> day: <%= event.to_day || event.from_day %> + to: + day: <%= event.to_day || event.from_day %> <% if event.to_hour %> -<%= indentation %> hour: <%= event.to_hour.strftime "%H:%M" %> + hour: <%= event.to_hour.strftime "%H:%M" %> <% end %> -<%= indentation %> add_to_calendar: -<%= indentation %> google: "<%= l10n.cal_google_url.html_safe %>" -<%= indentation %> yahoo: "<%= l10n.cal_yahoo_url.html_safe %>" -<%= indentation %> office: "<%= l10n.cal_office_url.html_safe %>" -<%= indentation %> outlook: "<%= l10n.cal_outlook_url.html_safe %>" -<%= indentation %> ical: "<%= l10n.cal_ical_url.html_safe %>" + add_to_calendar: + google: "<%= l10n.cal_google_url.html_safe %>" + yahoo: "<%= l10n.cal_yahoo_url.html_safe %>" + office: "<%= l10n.cal_office_url.html_safe %>" + outlook: "<%= l10n.cal_outlook_url.html_safe %>" + ical: "<%= l10n.cal_ical_url.html_safe %>" diff --git a/app/views/admin/communication/websites/pages/static.html.erb b/app/views/admin/communication/websites/pages/static.html.erb index e4676624c..bf1878900 100644 --- a/app/views/admin/communication/websites/pages/static.html.erb +++ b/app/views/admin/communication/websites/pages/static.html.erb @@ -2,11 +2,9 @@ page = @l10n.about language = @l10n.language %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> breadcrumb_title: >- <%= prepare_text_for_static @l10n.best_breadcrumb_title %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: page, diff --git a/app/views/admin/communication/websites/pages/static.json.jbuilder b/app/views/admin/communication/websites/pages/static.json.jbuilder deleted file mode 100644 index b873bd5c5..000000000 --- a/app/views/admin/communication/websites/pages/static.json.jbuilder +++ /dev/null @@ -1,30 +0,0 @@ -json.extract! @about, - :title, - :breadcrumb_title, - :position -json.partial! 'admin/application/static/permalink' -json.partial! 'admin/application/static/design' -json.layout @about.static_layout if @about.static_layout -json.has do - json.administrators @website.has_administrators? - json.authors @website.has_authors? - json.researchers @website.has_researchers? - json.teachers @website.has_teachers? -end if @about.is_a?(Communication::Website::Page::Person) -json.partial! 'admin/application/i18n/static' -json.bodyclass @about.best_bodyclass -json.partial! 'admin/application/featured_image/static' -json.children @about.children - .published - .ordered - .select { |child| child.is_listed_among_children? } - .collect(&:path) -json.partial! 'admin/application/meta_description/static' -json.partial! 'admin/application/summary/static' -json.header_text @about.header_text -json.header_cta do - json.display @about.header_cta - json.label @about.header_cta_label - json.target @about.header_cta_url -end -json.partial! 'admin/communication/contents/static', about: @about diff --git a/app/views/admin/communication/websites/portfolio/categories/static.html.erb b/app/views/admin/communication/websites/portfolio/categories/static.html.erb index e49d08f5e..9ff6570fa 100644 --- a/app/views/admin/communication/websites/portfolio/categories/static.html.erb +++ b/app/views/admin/communication/websites/portfolio/categories/static.html.erb @@ -1,9 +1,7 @@ <% category = @l10n.about %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: category, diff --git a/app/views/admin/communication/websites/portfolio/projects/static.html.erb b/app/views/admin/communication/websites/portfolio/projects/static.html.erb index dfe436e90..e0d2468aa 100644 --- a/app/views/admin/communication/websites/portfolio/projects/static.html.erb +++ b/app/views/admin/communication/websites/portfolio/projects/static.html.erb @@ -2,11 +2,7 @@ project = @l10n.about %> --- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -subtitle: >- - <%= prepare_text_for_static @l10n.subtitle %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', full_width: true, diff --git a/app/views/admin/communication/websites/posts/categories/static.html.erb b/app/views/admin/communication/websites/posts/categories/static.html.erb index d4e6a5cbc..1a04e0066 100644 --- a/app/views/admin/communication/websites/posts/categories/static.html.erb +++ b/app/views/admin/communication/websites/posts/categories/static.html.erb @@ -1,10 +1,7 @@ <% category = @l10n.about %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', - about: @l10n, +<%= render 'admin/application/static/core', about: @l10n, forced_slug: @l10n.slug_with_ancestors_slugs(separator: '-') %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', diff --git a/app/views/admin/communication/websites/posts/static.html.erb b/app/views/admin/communication/websites/posts/static.html.erb index 389002c25..0500b72f5 100644 --- a/app/views/admin/communication/websites/posts/static.html.erb +++ b/app/views/admin/communication/websites/posts/static.html.erb @@ -2,12 +2,7 @@ post = @l10n.about language = @l10n.language %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -subtitle: >- - <%= prepare_text_for_static @l10n.subtitle %> -date: "<%= @l10n.published_at&.iso8601 %>" -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: post, diff --git a/app/views/admin/communication/websites/static.html.erb b/app/views/admin/communication/websites/static.html.erb index c851a9b71..5cabf7e62 100644 --- a/app/views/admin/communication/websites/static.html.erb +++ b/app/views/admin/communication/websites/static.html.erb @@ -1,6 +1,3 @@ -<%# TODO: Title should be removed safely as website title is now in languages config file. %> -title: >- - <%= prepare_text_for_static @website.original_localization.to_s %> default: <% if @website.default_image.attached? %> image: diff --git a/app/views/admin/education/diplomas/static.html.erb b/app/views/admin/education/diplomas/static.html.erb index 4a09c1986..95ba72b95 100644 --- a/app/views/admin/education/diplomas/static.html.erb +++ b/app/views/admin/education/diplomas/static.html.erb @@ -7,9 +7,7 @@ language = @l10n.language .published_now_in(language) .ordered if @website.present? %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: diploma, diff --git a/app/views/admin/education/programs/categories/static.html.erb b/app/views/admin/education/programs/categories/static.html.erb index 1cb3b573d..857b5e607 100644 --- a/app/views/admin/education/programs/categories/static.html.erb +++ b/app/views/admin/education/programs/categories/static.html.erb @@ -1,9 +1,7 @@ <% category = @l10n.about %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: category, diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 43adf448e..325c2c175 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -8,9 +8,7 @@ administrator_involvements = program.involvements_through_roles .includes(:person) .ordered_by_name(language) %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: program, diff --git a/app/views/admin/education/teachers/static.html.erb b/app/views/admin/education/teachers/static.html.erb index b9ae54460..9d1630200 100644 --- a/app/views/admin/education/teachers/static.html.erb +++ b/app/views/admin/education/teachers/static.html.erb @@ -3,13 +3,12 @@ person = @l10n.about person_l10n = @l10n.person_l10n language = @l10n.language +title = t('university.person.facets.teacher.programs_of', name: @l10n.to_s, locale: @l10n.language.iso_code) %> --- -title: >- - <%= t('university.person.facets.teacher.programs_of', name: @l10n.to_s, locale: @l10n.language.iso_code) %> +<%= render 'admin/application/static/core', about: @l10n, forced_title: title %> <%= render 'admin/application/static/breadcrumbs', about: person_l10n, add_link_on_last: true -%> - title: "<%= t('university.person.facets.teacher.programs', locale: @l10n.language.iso_code) %>" -<%= render 'admin/application/static/permalink', about: @l10n %> <%= render 'admin/application/static/design', about: person, l10n: @l10n, diff --git a/app/views/admin/research/journals/papers/static.html.erb b/app/views/admin/research/journals/papers/static.html.erb index 14682348a..ee80853d1 100644 --- a/app/views/admin/research/journals/papers/static.html.erb +++ b/app/views/admin/research/journals/papers/static.html.erb @@ -2,9 +2,7 @@ paper = @l10n.about language = @l10n.language %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: paper, diff --git a/app/views/admin/research/journals/volumes/static.html.erb b/app/views/admin/research/journals/volumes/static.html.erb index bca918507..05e9e1dae 100644 --- a/app/views/admin/research/journals/volumes/static.html.erb +++ b/app/views/admin/research/journals/volumes/static.html.erb @@ -1,10 +1,9 @@ <% volume = @l10n.about language = @l10n.language +issn = volume.journal.best_localization_for(language).issn %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: volume, @@ -13,7 +12,7 @@ title: >- toc_offcanvas: false, toc_present: false %> number: <%= volume.number %> -issn: "<%= volume.journal.best_localization_for(language).issn %>" +issn: "<%= issn %>" keywords: >- <%= @l10n.keywords %> date: "<%= @l10n.published_at.iso8601 %>" diff --git a/app/views/admin/research/publications/static.html.erb b/app/views/admin/research/publications/static.html.erb index 2bf9e6833..818183dc6 100644 --- a/app/views/admin/research/publications/static.html.erb +++ b/app/views/admin/research/publications/static.html.erb @@ -1,8 +1,5 @@ --- -title: >- - <%= prepare_text_for_static @about.to_s %> -date: "<%= @about.publication_date&.iso8601 %>" -<%= render 'admin/application/static/permalink', about: @about %> +<%= render 'admin/application/static/core', about: @about %> <%= render 'admin/application/static/breadcrumbs', about: @about %> <%= render 'admin/application/static/design', about: @about, diff --git a/app/views/admin/research/researchers/static.html.erb b/app/views/admin/research/researchers/static.html.erb index ea84757ef..8b685fb0f 100644 --- a/app/views/admin/research/researchers/static.html.erb +++ b/app/views/admin/research/researchers/static.html.erb @@ -2,17 +2,13 @@ # @l10n is a localization facet University::Person::Localization::Researcher person = @l10n.about person_l10n = @l10n.person_l10n +title = t('university.person.facets.researcher.publications_of', name: @l10n.to_s, locale: @l10n.language.iso_code) +breadcrumb_title = t('university.person.facets.researcher.publications', locale: @l10n.language.iso_code) %>--- -title: >- - <%= t('university.person.facets.researcher.publications_of', name: @l10n.to_s, locale: @l10n.language.iso_code) %> +<%= render 'admin/application/static/core', about: @l10n, forced_title: title %> <%= render 'admin/application/static/breadcrumbs', about: person_l10n, add_link_on_last: true -%> - - title: "<%= t('university.person.facets.researcher.publications', locale: @l10n.language.iso_code) %>" -<%= render 'admin/application/static/permalink', about: @l10n %> -<%= render 'admin/application/static/design', - about: person, - l10n: @l10n, - full_width: true, - toc_offcanvas: true %> + - title: "<%= breadcrumb_title %>" +<%= render 'admin/application/static/design', about: person, l10n: @l10n, full_width: true, toc_offcanvas: true %> person: >- <%= person_l10n.to_s %> first_name: >- diff --git a/app/views/admin/university/organizations/categories/static.html.erb b/app/views/admin/university/organizations/categories/static.html.erb index 0b9ba7f43..825dc01ee 100644 --- a/app/views/admin/university/organizations/categories/static.html.erb +++ b/app/views/admin/university/organizations/categories/static.html.erb @@ -1,13 +1,12 @@ <% # this version has to incremented every time you change something in the file, to invalidate the cache -version = 1 +version = 3 # Pas dans le controller parce que ça se fait dans les background jobs, à partir du @about category = @l10n.about cache [@about, category, @l10n, @website.id, version] do -%>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +%> +--- +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: category, diff --git a/app/views/admin/university/organizations/static.html.erb b/app/views/admin/university/organizations/static.html.erb index 776f80ff4..62d9cf5ef 100644 --- a/app/views/admin/university/organizations/static.html.erb +++ b/app/views/admin/university/organizations/static.html.erb @@ -1,14 +1,12 @@ <% # this version has to incremented every time you change something in the file, to invalidate the cache -version = 3 +version = 4 # Pas dans le controller parce que ça se fait dans les background jobs, à partir du @about organization = @l10n.about cache_key = [organization, @l10n, @website.id, version] cache cache_key do %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: organization, diff --git a/app/views/admin/university/people/administrators/static.html.erb b/app/views/admin/university/people/administrators/static.html.erb index 8638c7a3d..28678693b 100644 --- a/app/views/admin/university/people/administrators/static.html.erb +++ b/app/views/admin/university/people/administrators/static.html.erb @@ -2,13 +2,13 @@ # @l10n is a localization facet University::Person::Localization::Administrator person = @l10n.about person_l10n = @l10n.person_l10n +title = t('university.person.facets.administrator.responsabilities_of', name: @l10n.to_s, locale: @l10n.language.iso_code +breadcrumb_title = t('university.person.facets.administrator.responsabilities', locale: @l10n.language.iso_code) %> --- -title: >- - <%= t('university.person.facets.administrator.responsabilities_of', name: @l10n.to_s, locale: @l10n.language.iso_code) %> +<%= render 'admin/application/static/core', about: @l10n, forced_title: title %> <%= render 'admin/application/static/breadcrumbs', about: person_l10n, add_link_on_last: true -%> - - title: "<%= t('university.person.facets.administrator.responsabilities', locale: @l10n.language.iso_code) %>" -<%= render 'admin/application/static/permalink', about: @l10n %> + - title: "<%= breadcrumb_title %>" <%= render 'admin/application/static/design', about: person, l10n: @l10n, diff --git a/app/views/admin/university/people/authors/static.html.erb b/app/views/admin/university/people/authors/static.html.erb index 2d3c465a4..b17d74433 100644 --- a/app/views/admin/university/people/authors/static.html.erb +++ b/app/views/admin/university/people/authors/static.html.erb @@ -2,13 +2,13 @@ # @l10n is a localization facet University::Person::Localization::Author person = @l10n.about person_l10n = @l10n.person_l10n +title = t('university.person.facets.author.posts_of', name: @l10n.to_s, locale: @l10n.language.iso_code) +breadcrumb_title = t('university.person.facets.author.posts', locale: @l10n.language.iso_code) %> --- -title: >- - <%= t('university.person.facets.author.posts_of', name: @l10n.to_s, locale: @l10n.language.iso_code) %> +<%= render 'admin/application/static/core', about: @l10n, forced_title: title %> <%= render 'admin/application/static/breadcrumbs', about: person_l10n, add_link_on_last: true -%> - - title: "<%= t('university.person.facets.author.posts', locale: @l10n.language.iso_code) %>" -<%= render 'admin/application/static/permalink', about: @l10n %> + - title: "<%= breadcrumb_title %>" <%= render 'admin/application/static/design', about: person, l10n: @l10n, diff --git a/app/views/admin/university/people/categories/static.html.erb b/app/views/admin/university/people/categories/static.html.erb index 22d6b0951..825dc01ee 100644 --- a/app/views/admin/university/people/categories/static.html.erb +++ b/app/views/admin/university/people/categories/static.html.erb @@ -1,13 +1,12 @@ <% # this version has to incremented every time you change something in the file, to invalidate the cache -version = 2 +version = 3 # Pas dans le controller parce que ça se fait dans les background jobs, à partir du @about category = @l10n.about cache [@about, category, @l10n, @website.id, version] do -%>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> -<%= render 'admin/application/static/permalink', about: @l10n %> +%> +--- +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: category, diff --git a/app/views/admin/university/people/static.html.erb b/app/views/admin/university/people/static.html.erb index 4e119025c..c2922d9db 100644 --- a/app/views/admin/university/people/static.html.erb +++ b/app/views/admin/university/people/static.html.erb @@ -1,16 +1,14 @@ <% # this version has to be incremented every time you change something in the file, to invalidate the cache -version = 5 +version = 6 person = @l10n.about language = @l10n.language cache_key = [person, @l10n, @website.id, version] cache cache_key do %>--- -title: >- - <%= prepare_text_for_static @l10n.to_s %> linkTitle: >- <%= @l10n.to_s_alphabetical %> -<%= render 'admin/application/static/permalink', about: @l10n %> +<%= render 'admin/application/static/core', about: @l10n %> <%= render 'admin/application/static/breadcrumbs', about: @l10n %> <%= render 'admin/application/static/design', about: person,