From bce92c219f6fd54b903a2059413d46f3300b5130 Mon Sep 17 00:00:00 2001 From: Drini Cami Date: Fri, 7 Jun 2024 17:42:11 +0200 Subject: [PATCH 1/6] Make list-showcase use BEM notation - DRY up HTML elements - Remove some unused CSS variables --- openlibrary/templates/lists/showcase.html | 48 ++++++++++----------- static/css/components/list-showcase.less | 51 ++++++++++------------- 2 files changed, 45 insertions(+), 54 deletions(-) diff --git a/openlibrary/templates/lists/showcase.html b/openlibrary/templates/lists/showcase.html index 189f06e8c49..b87caaff1fb 100644 --- a/openlibrary/templates/lists/showcase.html +++ b/openlibrary/templates/lists/showcase.html @@ -5,41 +5,37 @@ $ total_lists = lists[0:min(len(lists), 5)] $ all_lists_url = "/people/%s/lists" % username -$def showcase(list): +$def list_card(list): $ cached_info = list.get_patron_showcase() $ title = cached_info["title"] if len(cached_info["title"]) < 16 else cached_info["title"][0:16] + "..." $ count = cached_info["count"] $ list_url = list.get_url() $ cover_urls = [cover_url if cover_url else default_image_url for cover_url in cached_info["covers"]] -
- -
-
-

$title

- $if count == 1: -

$count book

- $else: -

$count books

-
-
- $ cover = 0 - $for img_url in cover_urls: - - $ cover +=1 -
-
-
-
-