diff --git a/app/assets/stylesheets/_layout.sass b/app/assets/stylesheets/_layout.sass index c26f7a4d..3b319d31 100644 --- a/app/assets/stylesheets/_layout.sass +++ b/app/assets/stylesheets/_layout.sass @@ -123,6 +123,9 @@ ul.buttons margin: 0 .5em #locale-form float: right + .terms + &[data-updated-recently] + font-weight: bold =flash margin-bottom: 1em diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 746c19ea..84f7dfe1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -200,6 +200,18 @@ module ApplicationHelper def md(text) RDiscount.new(text).to_html.html_safe end + + def terms_updated_at + Date.new(2024, 2, 29) + end + + def terms_updated_timestamp + terms_updated_at.strftime("%b %Y") + end + + def terms_updated_recently + terms_updated_at >= 2.months.ago + end def translate_markdown(key, options={}) md translate("#{key}_markdown", **options) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7a71cab7..96ab47e2 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -61,7 +61,9 @@ %ul %li= link_to t('.footer.source_code'), 'https://github.com/openneo/impress' - %li= link_to t('.footer.terms'), terms_path + %li.terms{"data-updated-recently": terms_updated_recently } + = link_to t('.footer.terms', date: terms_updated_timestamp), + terms_path %div #{t('.footer.contact')}: diff --git a/config/locales/en.yml b/config/locales/en.yml index e210df5a..1294e3e0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -33,7 +33,7 @@ en: footer: blog: Blog source_code: Source Code - terms: Terms of Use (updated Feb 2024) + terms: Terms of Use (updated %{date}) contact: Contact suggestions: Suggestions email: Questions, comments, bugs