From 746d094d814490465697da96116df58ee3e6fcf3 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 23 Dec 2018 15:51:38 -0800 Subject: [PATCH] Remove duplicated markup between list/grid album cards. --- .../etiquette_flask/templates/album_card.html | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/frontends/etiquette_flask/templates/album_card.html b/frontends/etiquette_flask/templates/album_card.html index 5b65b48..8a88184 100644 --- a/frontends/etiquette_flask/templates/album_card.html +++ b/frontends/etiquette_flask/templates/album_card.html @@ -1,4 +1,5 @@ {% macro create_root_album_card(view="grid") %} +{% set view = (view if view in ("list", "grid") else "grid") %} {% set viewparam = "?view=list" if view == "list" else "" %} {% if view == "list" %}
@@ -18,33 +19,11 @@ {% endmacro %} {% macro create_album_card(album, view="grid", unlink_parent=none) %} +{% set view = (view if view in ("list", "grid") else "grid") %} {% set viewparam = "?view=list" if view == "list" else "" %} - {% if view == "list" %} -
- - - -
- {% else %} -
+
+ {% if view == "grid" %} - - - - -
{% if unlink_parent is not none %}
-
{% endif %} + + + +
{% endmacro %}