From 49024565d3ad28764981dd3d6d63a775693fd257 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Fri, 3 Feb 2023 15:19:22 +0100 Subject: [PATCH] better analysis --- app/views/admin/application/property/_text.html.erb | 3 ++- app/views/admin/education/programs/show.html.erb | 5 +---- config/locales/education/fr.yml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/admin/application/property/_text.html.erb b/app/views/admin/application/property/_text.html.erb index 42e023087..fa3899795 100644 --- a/app/views/admin/application/property/_text.html.erb +++ b/app/views/admin/application/property/_text.html.erb @@ -4,6 +4,7 @@ if object.respond_to? "best_#{property}" value = object.public_send("best_#{property}").to_s source = object.public_send("best_#{property}_source") end +text = Static.html_to_text value %> <h3 class="h5"> <%= object.class.human_attribute_name(property) %> @@ -15,7 +16,7 @@ end <% end %> </h3> <p> - <% if value.blank? %> + <% if text.blank? %> <i class="fa fa-exclamation-circle text-danger"></i> <%= t 'properties.text.missing' %> <% else %> diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index 8fd6930ba..76a157351 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -62,10 +62,7 @@ <%= render 'admin/education/programs/forms/part', part: :presentation, collapsed: true do %> <div class="row"> <div class="col-xxl-6"> - <h3 class="h5"> - <%= Education::Program.human_attribute_name('presentation') %> - </h3> - <p><%= @program.presentation %></p> + <%= render 'admin/application/property/text', object: @program, property: :presentation %> </div> <div class="col-xxl-6"> <%= render 'admin/application/property/text', object: @program, property: :objectives %> diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 77e0483a0..bc51c0384 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -101,7 +101,7 @@ fr: hint: Haut de page, résumé de la formation. presentation: label: Présentation - hint: Complétées par les blocs, afin de permettre une présentation libre et riche de la formation. + hint: Complétée par les blocs, afin de permettre un descriptif libre et riche de la formation. pedagogy: label: Pédagogie hint: Mode d'enseignement et d'évaluation, et présentation de l'équipe pédagogique. -- GitLab