diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-24 04:07:33 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-24 04:07:33 +0200 |
| commit | d171b7d9673bce6abf537d6dc6db3ac7a9062754 (patch) | |
| tree | e6b2d9f2e9e05da3d3f69845f4e5e2d495402fa7 | |
| parent | 2972386dd9dcd513256c2984d1c99f4b1e240a33 (diff) | |
Reduce visual clutter: remove time from article partials
| -rw-r--r-- | app/helpers/content_helper.rb | 6 | ||||
| -rw-r--r-- | app/views/custom/page_templates/public/update.html.erb | 2 | ||||
| -rw-r--r-- | config/locales/de.yml | 1 | ||||
| -rw-r--r-- | 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 | |||
| 59 | 59 | ||
| 60 | # Returns the published_at attribute of a page if it is not nil, otherwise | 60 | # Returns the published_at attribute of a page if it is not nil, otherwise |
| 61 | # it returns the auto-filled value of the created_at attribute | 61 | # it returns the auto-filled value of the created_at attribute |
| 62 | def date_for_page page | 62 | def date_and_time_for_page page |
| 63 | I18n.l(page.published_at, :format => :ccc) rescue I18n.l(page.created_at, :format => :ccc) | 63 | I18n.l(page.published_at, :format => :ccc) rescue I18n.l(page.created_at, :format => :ccc) |
| 64 | end | 64 | end |
| 65 | 65 | ||
| 66 | def date_for_page page | ||
| 67 | I18n.l(page.published_at, :format => :ccc_date) rescue I18n.l(page.created_at, :format => :ccc_date) | ||
| 68 | end | ||
| 69 | |||
| 66 | def author_for_page page | 70 | def author_for_page page |
| 67 | page.user ? page.user.login : "Unknown author" | 71 | page.user ? page.user.login : "Unknown author" |
| 68 | end | 72 | 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 @@ | |||
| 1 | <div class="article" lang="<%= @page.effective_lang %>"> | 1 | <div class="article" lang="<%= @page.effective_lang %>"> |
| 2 | <h2 class="headline"><%= @page.title %></h2> | 2 | <h2 class="headline"><%= @page.title %></h2> |
| 3 | <div class="author_and_date"><%= date_for_page @page %>, <%= @page.user.try(:login) %></div> | 3 | <div class="author_and_date"><%= date_and_time_for_page @page %>, <%= @page.user.try(:login) %></div> |
| 4 | <div class="abstract"><p><%= sanitize( @page.abstract )%></p></div> | 4 | <div class="abstract"><p><%= sanitize( @page.abstract )%></p></div> |
| 5 | <div id="headline_image"><%= headline_image %></div> | 5 | <div id="headline_image"><%= headline_image %></div> |
| 6 | <div class="body"><%= aggregate?(@page.body) %></div> | 6 | <div class="body"><%= aggregate?(@page.body) %></div> |
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: | |||
| 40 | default: "%A, %e. %B %Y, %H:%M Uhr" | 40 | default: "%A, %e. %B %Y, %H:%M Uhr" |
| 41 | short: "%e. %B, %H:%M Uhr" | 41 | short: "%e. %B, %H:%M Uhr" |
| 42 | ccc: "%e. %B %Y, %H:%M Uhr" | 42 | ccc: "%e. %B %Y, %H:%M Uhr" |
| 43 | ccc_date: "%e. %B %Y" | ||
| 43 | long: "%A, %e. %B %Y, %H:%M Uhr" | 44 | long: "%A, %e. %B %Y, %H:%M Uhr" |
| 44 | time: "%H:%M" | 45 | time: "%H:%M" |
| 45 | 46 | ||
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: | |||
| 25 | time: | 25 | time: |
| 26 | formats: | 26 | formats: |
| 27 | ccc: "%d %B, %Y %H:%M" | 27 | ccc: "%d %B, %Y %H:%M" |
| 28 | ccc_date: "%d %B, %Y" | ||
| 28 | 29 | ||
| 29 | will_paginate: | 30 | will_paginate: |
| 30 | previous_label: "← Previous" | 31 | previous_label: "← Previous" |
