[News Archive] Add archive notice to old press releases - #3505
Conversation
…ntry/show.html if the age is older than a year, the text depends on how old
joshlarson
left a comment
There was a problem hiding this comment.
There are three layout changes that I think this needs.
First off, there are some differences between the icon in the Figma versus this branch. I suspect that most of them don't really matter, but the Figma shows the icon top-aligned, as opposed to this branch, which shows the icon centered, and I do think that the top-aligned icon looks better. Also, the spacing doesn't look exactly the same, and while I'm not sure this needs to be pixel-perfect, I will say that subjectively, the current icon-text-distance makes the whole thing look a bit cramped.
I suspect this will require a change to the <.cta /> component. I don't remember where else that's used, but I bet that any other places it's used will also be enhanced with a top-aligned rather than centered icon.
Second, (also visible in ☝️ screenshots) the Figma shows the banner above the "Posted on" date, while this branch has it below.
Second off, on wider screens, the archive note has a different width than the content below it, which gives it kind of a disjointed feel. Would it be possible to either shrink the notice or widen the content?
… top of the alert. Adjusted the width of the alert to better fit the text at various breakpoints.
joshlarson
left a comment
There was a problem hiding this comment.
Thanks for addressing the banner width, content ordering, and icon alignment comments!
I left a comment about the icon alignment stuff - the current implementation on this branch borks things for other consumers of the <.cta /> component, and we need to fix that before merging this.
Co-authored-by: Josh Larson <jlarson@mbta.com>
Co-authored-by: Josh Larson <jlarson@mbta.com>
…ws (#3519) * Translations delivered for PR#3505 on es-LA locale * Translations delivered for PR#3505 on ht-HT locale * Translations delivered for PR#3505 on zh-TW locale * Translations delivered for PR#3505 on pt-BR locale * Translations delivered for PR#3505 on fr-FR locale * Translations delivered for PR#3505 on zh-CN locale * Translations delivered for PR#3505 on vi-VN locale --------- Co-authored-by: smartling-github-connector[bot] <165276057+smartling-github-connector[bot]@users.noreply.github.com>


Scope
Asana Ticket: 🗞️ 🕸️ Add archive notice to old press releases
Implementation
Added age calculation to news_controller, then used that age to determine if a cta should be shown in news_entry/show.html and what message to show.
Added a little bit of style to match the figma.
Screenshots
How to test
Old entries start at around page 15
Two years is at around page 30
This is our oldest news entry at page 231
Confirm the messages show, and that the year difference calculation is correct.