From 8387e9ba2bae56f3d38f80f6dd0e68ab16fb8d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Fri, 24 Dec 2021 12:25:39 +0100 Subject: [PATCH] merge --- Gemfile.lock | 2 +- app/views/admin/education/programs/show.html.erb | 2 +- docs/websites/export.md | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b8b6435b1..1a59976af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -463,4 +463,4 @@ RUBY VERSION ruby 2.7.5p203 BUNDLED WITH - 2.2.33 + 2.3.2 diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index c52a813cb..b3f71ddfd 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -55,7 +55,7 @@ best_prop_source = @program.public_send("best_#{prop}_source") %> <% next if best_prop_value.blank? # No value at all%> - <h3 class="h5<%= ' mt-4' if index > 0 %>"> + <h3 class="h5 mt-4"> <%= Education::Program.human_attribute_name(prop) %> <% if best_prop_source %> <span class="small text-muted"> diff --git a/docs/websites/export.md b/docs/websites/export.md index 32f1173a4..a7bb28a66 100644 --- a/docs/websites/export.md +++ b/docs/websites/export.md @@ -1,3 +1,13 @@ # Export -Comment exporter les attachments, qu'ils soient liés à un objet active storage, ou dans un champ action text ? \ No newline at end of file +Tout objet qui doit être exporté sur un ou plusieurs websites doit : + - avoir une méthode `website` ou `websites` + - inclure le concern `WithGithubFiles` + +S'il possède des médias (`featured_image` et/ou images dans des rich texts), il doit inclure le concern `Communication::Website::WithMedia` + +Le concern `WithGithubFiles` ajoute un manifest à l'objet qui permet de définir les fichiers exportés côté GitHub pour celui-ci. + +Quand l'objet est sauvegardé, on se base sur le(s) websites et ce manifest pour créer et publier des objets `Communication::Website::GithubFile`. Ces derniers permettent de garder la trace du chemin actuel d'un fichier distant dans le cas où celui-ci viendrait à être déplacé (changement de slug, etc.). + +Ces fichiers servent également dans le cas où on souhaite republier manuellement une partie d'un site (exemple : tous les posts), la méthode `Communication::Website#publish_posts!` peut tout grouper en un batch. -- GitLab