From e101f4c2d8627275dfee91b5240368bb636facf6 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 23 Oct 2021 18:48:27 -0700 Subject: [PATCH] Add author to bookmark card. --- frontends/etiquette_flask/templates/cards.html | 11 ++++++++++- frontends/etiquette_flask/templates/user.html | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/templates/cards.html b/frontends/etiquette_flask/templates/cards.html index 801b932..a60e4ef 100644 --- a/frontends/etiquette_flask/templates/cards.html +++ b/frontends/etiquette_flask/templates/cards.html @@ -65,7 +65,7 @@ draggable=true {# BOOKMARK ###################################################################} -{% macro create_bookmark_card(bookmark, add_delete_button=False) %} +{% macro create_bookmark_card(bookmark, add_delete_button=False, add_author=True) %}
{{bookmark.display_name}} @@ -83,6 +83,15 @@ draggable=true {% endif %}
+ + {% if add_author %} + {% set author = bookmark.author %} + {% if author is not none %} +

+ Author: {{author.display_name}} +

+ {% endif %} + {% endif %} {% endmacro %} diff --git a/frontends/etiquette_flask/templates/user.html b/frontends/etiquette_flask/templates/user.html index 252c58f..dbad86b 100644 --- a/frontends/etiquette_flask/templates/user.html +++ b/frontends/etiquette_flask/templates/user.html @@ -73,7 +73,7 @@ h2, h3

Bookmarks by {{user.display_name}}

{% for bookmark in bookmarks %} - {{cards.create_bookmark_card(bookmark)}} + {{cards.create_bookmark_card(bookmark, add_author=False)}} {% endfor %}
{% endif %}