1
0
Fork 0
forked from OpenNeo/impress

Bold the Terms of Use link when it's been changed recently

This commit is contained in:
Emi Matchu 2024-02-29 11:22:12 -08:00
parent 0316544e32
commit 9156fa7162
4 changed files with 19 additions and 2 deletions

View file

@ -123,6 +123,9 @@ ul.buttons
margin: 0 .5em
#locale-form
float: right
.terms
&[data-updated-recently]
font-weight: bold
=flash
margin-bottom: 1em

View file

@ -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)

View file

@ -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')}:

View file

@ -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