diff --git a/frontends/etiquette_flask/static/css/cards.css b/frontends/etiquette_flask/static/css/cards.css index 0a776cc..32e9b6d 100644 --- a/frontends/etiquette_flask/static/css/cards.css +++ b/frontends/etiquette_flask/static/css/cards.css @@ -77,6 +77,59 @@ /* ########################################################################## */ /* ########################################################################## */ +.bookmark_card +{ + position: relative; + display: inline-grid; + grid-template: + "title" auto + "url" auto + "toolbox" auto + /1fr; + + padding: 8px; + margin: 8px; + max-width: 500px; + + border-radius: 8px; + + background-color: var(--color_secondary); +} + +.bookmark_card:hover +{ + box-shadow: 2px 2px 5px 0px var(--color_dropshadow); +} + +.bookmark_card .bookmark_title +{ + grid-area: "title"; +} + +.bookmark_card .bookmark_url +{ + grid-area: "url"; +} + +.bookmark_card .bookmark_toolbox +{ + grid-area: "toolbox"; +} + +.bookmark_card input +{ + width: 100%; +} + +.bookmark_card .bookmark_url +{ + color: #aaa; +} + +/* ########################################################################## */ +/* ########################################################################## */ +/* ########################################################################## */ + .photo_card { background-color: var(--color_secondary); diff --git a/frontends/etiquette_flask/templates/bookmark_card.html b/frontends/etiquette_flask/templates/bookmark_card.html new file mode 100644 index 0000000..2396f5b --- /dev/null +++ b/frontends/etiquette_flask/templates/bookmark_card.html @@ -0,0 +1,20 @@ +{% macro create_bookmark_card(bookmark, add_delete_button=False) %} +
+ {{bookmark.display_name}} + + {{bookmark.url}} + +
+ {% if add_delete_button %} + + {% endif %} +
+
+{% endmacro %} diff --git a/frontends/etiquette_flask/templates/bookmarks.html b/frontends/etiquette_flask/templates/bookmarks.html index 6d5aa53..cf0a97a 100644 --- a/frontends/etiquette_flask/templates/bookmarks.html +++ b/frontends/etiquette_flask/templates/bookmarks.html @@ -1,12 +1,14 @@ + {% import "bookmark_card.html" as bookmark_card %} {% import "header.html" as header %} Bookmarks + {% if theme %}{% endif %} @@ -20,36 +22,6 @@ flex: 0 0 auto; flex-direction: column; } - -.bookmark_card, -.new_bookmark_card -{ - display: inline-flex; - flex: 0 0 auto; - flex-direction: column; - align-items: baseline; - - padding: 8px; - margin: 8px; - max-width: 500px; - - border-radius: 8px; - box-shadow: 2px 2px 5px 0px var(--color_dropshadow); - - background-color: var(--color_secondary); -} - -.bookmark_card input, -.new_bookmark_card input -{ - width: 100%; -} - -.bookmark_card .bookmark_url -{ - color: #aaa; -} - @@ -59,36 +31,15 @@

Bookmarks

{% for bookmark in bookmarks %} -
- - {{-bookmark.display_name-}} - - - - {{-bookmark.url-}} - - - -
+ {{bookmark_card.create_bookmark_card(bookmark, add_delete_button=True)}} {% endfor %} -
+
- +
+ +
@@ -156,6 +107,10 @@ function create_editors() const cards = document.getElementsByClassName("bookmark_card"); for (const card of cards) { + if (card.classList.contains("new_bookmark_card")) + { + continue; + } const ed_elements = [ { "id": "title",