Mercurial > libervia-templates
changeset 326:f3c8a6af4ee2
bulma (events/overview): show event date and remaining time
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 01 May 2021 18:45:33 +0200 |
parents | 8c779fb46384 |
children | 6895500a42d6 |
files | sat_templates/templates/bulma/event/overview.html |
diffstat | 1 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/sat_templates/templates/bulma/event/overview.html Sat May 01 18:44:47 2021 +0200 +++ b/sat_templates/templates/bulma/event/overview.html Sat May 01 18:45:33 2021 +0200 @@ -13,7 +13,7 @@ {{ icon_defs('calendar') }} <section class="section"> - <div class="message is-info"> + <div class="message is-warning"> <div class="message-body"> {% trans %}There is not events discovery yet, this will come in the future.{% endtrans %} </div> @@ -34,7 +34,25 @@ </div> </div> - {{block.interests_grid(events, 'calendar')}} + {% call(part, interest) block.interests_grid(events, 'calendar') %} + {% if part == "header-title" %} + <a href="{{interest.url}}"> + <span class="tag is-medium is-rounded {{ 'is-light' if interest.date is in_the_past else 'is-info' }}"> + {{interest.date|date_fmt("full", date_only=true)}} + </span> + </a> + {% elif part == "content" %} + <a href="{{interest.url}}"> + <div><em>{{ interest.name|default(_("unnamed")) }}</em></div> + </a> + <a href="{{interest.url}}"> + <div class="has-text-weight-semibold {{ 'has-text-grey' if interest.date is in_the_past else 'has-text-black' }}"> + {{interest.date|date_fmt("relative")}} + </div> + </a> + {% endif %} + + {% endcall %} {% endif %} </section>