diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index 9ad8b4439f2c42afef03bae5cae9aca798c8efab..fa9ffcd3bd2594f0ee911d97d1290f4b407b65bc 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -85,6 +85,12 @@ class Communication::Website::Page < ApplicationRecord [self] + descendents + active_storage_blobs end + def url + return unless published + return if website.url.blank? + "#{website.url}#{path}" + end + def to_s "#{title}" end diff --git a/app/models/communication/website/post.rb b/app/models/communication/website/post.rb index 21ab6e532c964bcbdce31606436b1f8a32fd2b11..2a927140f09afef3bb2cb802753a2cc240b27077 100644 --- a/app/models/communication/website/post.rb +++ b/app/models/communication/website/post.rb @@ -82,6 +82,12 @@ class Communication::Website::Post < ApplicationRecord [self] + explicit_active_storage_blobs end + def url + return unless published + return if website.url.blank? + "#{website.url}#{path}" + end + def to_s "#{title}" end diff --git a/app/views/admin/communication/website/pages/show.html.erb b/app/views/admin/communication/website/pages/show.html.erb index 0300058af7631c41a01df2c8b9ededd734c4e38e..8fcde48610cb6eba98541245a846ca31db5db08a 100644 --- a/app/views/admin/communication/website/pages/show.html.erb +++ b/app/views/admin/communication/website/pages/show.html.erb @@ -18,6 +18,14 @@ <div class="col-md-4"> <div class="card flex-fill w-100"> <div class="card-header"> + <div class="float-end"> + <% if @page.url %> + <%= link_to t('open'), + @page.url, + target: :_blank, + class: 'btn btn-light' %> + <% end %> + </div> <h2 class="card-title mb-0 h5"><%= t('metadata') %></h2> </div> <div class="card-body"> diff --git a/app/views/admin/communication/website/posts/show.html.erb b/app/views/admin/communication/website/posts/show.html.erb index cfa349ba6ff4fe7afc01a4ea69f84a9c005b9ddf..78d2f5240953b8015399ca9c9b7a8a93a9356d4a 100644 --- a/app/views/admin/communication/website/posts/show.html.erb +++ b/app/views/admin/communication/website/posts/show.html.erb @@ -17,6 +17,14 @@ <div class="col-md-4"> <div class="card flex-fill w-100"> <div class="card-header"> + <div class="float-end"> + <% if @post.url %> + <%= link_to t('open'), + @post.url, + target: :_blank, + class: 'btn btn-light' %> + <% end %> + </div> <h2 class="card-title mb-0 h5"><%= t('metadata') %></h2> </div> <div class="card-body"> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index f7cc60ce5ecbb1db71d531df167323d194ea92e4..15be4d2ddd4ab988701a9086f6a7f9ef7c38a424 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -51,7 +51,7 @@ en: template: Kind of block communication/website/category: children: Children categories - description: Description + description: Description (SEO) name: Name parent: Parent category slug: Slug diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index c840b2974eaf11163d9d4ce5c9b75aad371fe3fe..36085fabdaba761e8bf9d4a9c94621df09389a7f 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -54,7 +54,7 @@ fr: template: Type de bloc communication/website/category: children: Catégories enfants - description: Description + description: Description (SEO) name: Nom parent: Catégorie parente slug: Slug diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index d1f9e138e7da5ef067b20029853faf105abfe065..f024abf80045e244a92d7adce704957908a82e8b 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -16,7 +16,7 @@ en: capacity: Capacity contacts: Contacts continuing: Formation continue - description: Description + description: Description (SEO) duration: Durée ects: Crédits ECTS evaluation: Modalités d’évaluation diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index e8db3e7b72200e3886875ceebdf19ea174e0c440..dd5179c79c453fc4591df9403e103e109f324eb4 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -16,7 +16,7 @@ fr: capacity: Capacité contacts: Contacts continuing: Formation continue - description: Description + description: Description (SEO) duration: Durée ects: Crédits ECTS evaluation: Modalités d’évaluation diff --git a/config/locales/en.yml b/config/locales/en.yml index 1e7b63f4418bbc67887891c1617458e50b6ac293..cf1d5cfe72700d554a81b287f62dab7d23a549f7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -118,6 +118,7 @@ en: server_admin: Admin server sign_out: Log out metadata: Metadata + open: Open please_confirm: Are you sure? please_confirm_with_children: "WARNING: deleting this element will also remove every child. Are you sure?" preview: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5cedc06f52edc633887e4768bc711b36735e349e..ffe93797d39251912f3bf7d13eb1506989644dd7 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -118,6 +118,7 @@ fr: server_admin: Admin serveur sign_out: Déconnexion metadata: Informations + open: Ouvrir please_confirm: Est-ce que vous confirmez ? please_confirm_with_children: "ATTENTION : effacer cet élément supprimera aussi tous ses enfants. Est-ce que vous confirmez ?" preview: diff --git a/config/locales/research/en.yml b/config/locales/research/en.yml index fc5ed6bf8286d36582e1f0577026fc9e3a6e06a4..a2d811b11f3ca1470daab3cca02affcbf410c9a6 100644 --- a/config/locales/research/en.yml +++ b/config/locales/research/en.yml @@ -39,7 +39,7 @@ en: research/journal/volume: featured_image: Cover featured_image_alt: Alt text - description: Description + description: Description (SEO) keywords: Keywords number: Number published: Published? @@ -52,7 +52,7 @@ en: name: Name zipcode: Zipcode research/laboratory/axis: - description: Description + description: Description (SEO) name: Name short_name: Short name text: Text diff --git a/config/locales/research/fr.yml b/config/locales/research/fr.yml index f7d6dc7d431bf76b0531e0b6828a9c4a5fdb1f50..74eaf696e5c6be4f63858e7b63557c9a1e03b913 100644 --- a/config/locales/research/fr.yml +++ b/config/locales/research/fr.yml @@ -39,7 +39,7 @@ fr: research/journal/volume: featured_image: Couverture featured_image_alt: Texte alternatif - description: Description + description: Description (SEO) keywords: Mots clés number: Numéro published: Publié ? @@ -52,7 +52,7 @@ fr: name: Nom zipcode: Code postal research/laboratory/axis: - description: Description + description: Description (SEO) name: Nom short_name: Nom court text: Texte diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 1a3509ab429ae7748067d8cd34bc0b91233e72f4..a61d7c28445f599bd055c48ecb1e19b8865633ef 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -18,7 +18,7 @@ en: abilities: Abilities biography: Biography communication_website_posts: Posts - description: Description + description: Description (SEO) education_programs: Programs email: Email first_name: First name @@ -39,7 +39,7 @@ en: person: Person target_id: '' university/role: - description: Description + description: Description (SEO) people: People models: university: diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index 8159e8df848dc0b4e30beab6dfce116a90566a11..b10a6d36c9a7224e0673bdaa9b107cbeff5a9f12 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -18,7 +18,7 @@ fr: abilities: Responsabilités biography: Biographie communication_website_posts: Actualités - description: Description + description: Description (SEO) education_programs: Formations email: Email first_name: Prénom @@ -39,7 +39,7 @@ fr: person: Personne target_id: '' university/role: - description: Description + description: Description (SEO) people: Personnes models: university: