From d171b7d9673bce6abf537d6dc6db3ac7a9062754 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 24 Jul 2026 04:07:33 +0200 Subject: Reduce visual clutter: remove time from article partials --- app/helpers/content_helper.rb | 6 +++++- app/views/custom/page_templates/public/update.html.erb | 2 +- config/locales/de.yml | 1 + config/locales/en.yml | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index 6bb9c4e0..fd351ed2 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb @@ -59,10 +59,14 @@ module ContentHelper # Returns the published_at attribute of a page if it is not nil, otherwise # it returns the auto-filled value of the created_at attribute - def date_for_page page + def date_and_time_for_page page I18n.l(page.published_at, :format => :ccc) rescue I18n.l(page.created_at, :format => :ccc) end + def date_for_page page + I18n.l(page.published_at, :format => :ccc_date) rescue I18n.l(page.created_at, :format => :ccc_date) + end + def author_for_page page page.user ? page.user.login : "Unknown author" end diff --git a/app/views/custom/page_templates/public/update.html.erb b/app/views/custom/page_templates/public/update.html.erb index 0ff1bb24..f460f621 100644 --- a/app/views/custom/page_templates/public/update.html.erb +++ b/app/views/custom/page_templates/public/update.html.erb @@ -1,6 +1,6 @@

<%= @page.title %>

-
<%= date_for_page @page %>, <%= @page.user.try(:login) %>
+
<%= date_and_time_for_page @page %>, <%= @page.user.try(:login) %>

<%= sanitize( @page.abstract )%>

<%= headline_image %>
<%= aggregate?(@page.body) %>
diff --git a/config/locales/de.yml b/config/locales/de.yml index d5ba0706..7ffa0a59 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -40,6 +40,7 @@ de: default: "%A, %e. %B %Y, %H:%M Uhr" short: "%e. %B, %H:%M Uhr" ccc: "%e. %B %Y, %H:%M Uhr" + ccc_date: "%e. %B %Y" long: "%A, %e. %B %Y, %H:%M Uhr" time: "%H:%M" diff --git a/config/locales/en.yml b/config/locales/en.yml index 8b4e5db4..732d5cd1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -25,6 +25,7 @@ en: time: formats: ccc: "%d %B, %Y %H:%M" + ccc_date: "%d %B, %Y" will_paginate: previous_label: "← Previous" -- cgit v1.3