Skip to content

Commit e0eeb42

Browse files
authored
Merge pull request internetarchive#11056 from krishnaGauss/11037/fix/global-list-render
Fixed the bug to handle global and community lists
2 parents 2db8c82 + 489a715 commit e0eeb42

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

openlibrary/templates/lists/list_follow.html

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,41 @@
2323
$ img_url = '/images/icons/avatar_book-sm.png'
2424
<img src="$img_url" loading="lazy" width="80"/>
2525
</a>
26-
<div class="list-follow-card__bottom">
27-
<div class="list-follow-card__user">
28-
<a href="$owner.key">
29-
<img src="$(owner.key)/avatar" />
30-
</a>
31-
<div class="list-follow-card__username">
32-
<a class="list-follow-card__username-link" href="$owner.key">
33-
$if not own_list:
34-
$ owner_username = owner.key.split('/')[-1]
35-
$('@' + owner_username)
36-
$else:
37-
$_('You')
26+
27+
<!-- Bottom section: owner info or community label -->
28+
$if owner:
29+
<div class="list-follow-card__bottom">
30+
<div class="list-follow-card__user">
31+
<a href="$owner.key">
32+
<img src="$(owner.key)/avatar" />
3833
</a>
34+
<div class="list-follow-card__username">
35+
<a class="list-follow-card__username-link" href="$owner.key">
36+
$if not own_list:
37+
$ owner_username = owner.key.split('/')[-1]
38+
$('@' + owner_username)
39+
$else:
40+
$_('You')
41+
</a>
42+
</div>
43+
</div>
44+
<div class="list-follow-card__follow-button">
45+
$if not own_list:
46+
$ owner_username = owner.key.split('/')[-1]
47+
$ owner_account = get_user_object(owner_username)
48+
$ is_subscribed = ctx.user and ctx.user.is_subscribed_user(owner_username)
49+
$ settings = owner_account.get_users_settings()
50+
$ is_public = settings and settings.get('public_readlog', 'no') == "yes"
51+
$if is_public:
52+
$:render_follow_button(owner_username, is_subscribed)
3953
</div>
4054
</div>
41-
<div class="list-follow-card__follow-button">
42-
$if not own_list:
43-
$ owner_username = owner.key.split('/')[-1]
44-
$ owner_account = get_user_object(owner_username)
45-
$ is_subscribed = ctx.user and ctx.user.is_subscribed_user(owner_username)
46-
$ settings = owner_account.get_users_settings()
47-
$ is_public = settings and settings.get('public_readlog', 'no') == "yes"
48-
$if is_public:
49-
$:render_follow_button(owner_username, is_subscribed)
55+
$else:
56+
<div class="list-follow-card__bottom">
57+
<div class="list-follow-card__community-label">
58+
<i>Community List</i>
59+
</div>
5060
</div>
51-
</div>
5261
</div>
5362

5463
$ count = 0

0 commit comments

Comments
 (0)