Restore compact followed locations section

This commit is contained in:
2026-09-15 15:00:09 +02:00
parent d43a12acf3
commit 45c086b032
3 changed files with 12 additions and 4 deletions
+1
View File
@@ -199,6 +199,7 @@
"Noch keine Band gefolgt.": "No bands followed yet.", "Noch keine Band gefolgt.": "No bands followed yet.",
"Locations": "Venues", "Locations": "Venues",
"Noch keiner Location gefolgt.": "No venues followed yet.", "Noch keiner Location gefolgt.": "No venues followed yet.",
"Location nicht mehr folgen": "Unfollow venue",
"Kommende Treffer": "Upcoming matches", "Kommende Treffer": "Upcoming matches",
"und": "and", "und": "and",
"Location": "Venue", "Location": "Venue",
+7 -4
View File
@@ -1,10 +1,13 @@
<!DOCTYPE html><html lang="{{ language() }}"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{ _('Gefolgt · MetalCircle') }}</title><link rel="stylesheet" href="/static/css/style.css"><style> <!DOCTYPE html><html lang="{{ language() }}"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{ _('Gefolgt · MetalCircle') }}</title><link rel="stylesheet" href="/static/css/style.css"><style>
.follow-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}.follow-card{padding:18px;background:var(--surface);border:1px solid var(--border);border-radius:12px}.follow-list{display:flex;flex-wrap:wrap;gap:8px;padding:0;list-style:none}.follow-list li{display:flex;align-items:center;gap:6px;padding:7px 10px;background:#171212;border:1px solid var(--border);border-radius:999px}.follow-list form{margin:0}.follow-remove{padding:0;color:#fca5a5;background:none;border:0;cursor:pointer;font-size:1rem}.follow-events{display:grid;gap:10px}.follow-event{display:block;padding:14px;background:#0b0b0b;border:1px solid var(--border);border-radius:10px}.follow-event:hover{border-color:#ef4444}.follow-reason{color:var(--muted);font-size:.82rem} .follow-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.follow-card{min-width:0;padding:12px;background:var(--surface);border:1px solid var(--border);border-radius:12px}.follow-card h2{margin:0 0 8px;font-size:1rem}.follow-list{display:flex;flex-wrap:wrap;gap:6px;padding:0;margin:0;list-style:none}.follow-list li{display:flex;align-items:center;gap:5px;min-width:0;padding:5px 8px;background:#171212;border:1px solid var(--border);border-radius:999px;font-size:.88rem}.follow-list li>a,.follow-list li>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.follow-list form{flex:0 0 auto;margin:0}.follow-remove{padding:0;color:#fca5a5;background:none;border:0;cursor:pointer;font-size:1rem;line-height:1}.follow-events{display:grid;gap:10px}.follow-event{display:block;padding:14px;background:#0b0b0b;border:1px solid var(--border);border-radius:10px}.follow-event:hover{border-color:#ef4444}.follow-reason{color:var(--muted);font-size:.82rem}
@media(max-width:760px){.follow-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.follow-card{padding:9px}.follow-card h2{margin-bottom:6px;font-size:.94rem}.follow-list{gap:5px}.follow-list li{gap:4px;padding:4px 7px;font-size:.82rem}.follow-grid .follow-card:last-child{grid-column:1/-1}}
@media(max-width:360px){.follow-grid{grid-template-columns:1fr}.follow-grid .follow-card:last-child{grid-column:auto}}
</style><link rel="stylesheet" href="/static/css/language.css"> </style><link rel="stylesheet" href="/static/css/language.css">
</head><body><header><div class="header-inner"><a href="/" class="logo"><img class="brand-logo" src="/static/images/metalcircle-full.png" alt="MetalCircle"></a>{% include '_header_controls.html' %}</div> </head><body><header><div class="header-inner"><a href="/" class="logo"><img class="brand-logo" src="/static/images/metalcircle-full.png" alt="MetalCircle"></a>{% include '_header_controls.html' %}</div>
</header><main> </header><main>
<div class="page-title"><h1>{{ _('⭐ Gefolgt') }}</h1><p>{{ _('Bands, Locations, Personen und passende kommende Veranstaltungen.') }}</p></div> <div class="page-title"><h1>{{ _('⭐ Gefolgt') }}</h1><p>{{ _('Bands, Locations, Personen und passende kommende Veranstaltungen.') }}</p></div>
<div class="follow-grid"><section class="follow-card"><h2>Bands</h2><ul class="follow-list">{% for band in followed_bands %}<li>{{ band.name }}<form method="post" action="/following/bands/remove"><input type="hidden" name="band_key" value="{{ band.key }}"><button class="follow-remove" type="submit" title="{{ _('Nicht mehr folgen') }}" aria-label="{{ band.name }} {{ _('nicht mehr folgen') }}">×</button></form></li>{% else %}<li>{{ _('Noch keine Band gefolgt.') }}</li>{% endfor %}</ul></section> <div class="follow-grid"><section class="follow-card"><h2>Bands</h2><ul class="follow-list">{% for band in followed_bands %}<li><span>{{ band.name }}</span><form method="post" action="/following/bands/remove"><input type="hidden" name="band_key" value="{{ band.key }}"><button class="follow-remove" type="submit" title="{{ _('Nicht mehr folgen') }}" aria-label="{{ band.name }} {{ _('nicht mehr folgen') }}">×</button></form></li>{% else %}<li>{{ _('Noch keine Band gefolgt.') }}</li>{% endfor %}</ul></section>
<section class="follow-card"><h2>{{ _('Personen') }}</h2><ul class="follow-list">{% for person in followed_users %}<li><a href="/users/{{ person.username }}">{{ person.name }}</a><form method="post" action="/following/users/remove"><input type="hidden" name="followed_id" value="{{ person.id }}"><button class="follow-remove" type="submit" title="{{ _('Nutzer nicht mehr folgen') }}" aria-label="{{ person.name }} {{ _('Nutzer nicht mehr folgen') }}">×</button></form></li>{% else %}<li>{{ _('Du folgst noch keinen Nutzern.') }}</li>{% endfor %}</ul></section></div> <section class="follow-card"><h2>{{ _('Personen') }}</h2><ul class="follow-list">{% for person in followed_users %}<li><a href="/users/{{ person.username }}">{{ person.name }}</a><form method="post" action="/following/users/remove"><input type="hidden" name="followed_id" value="{{ person.id }}"><button class="follow-remove" type="submit" title="{{ _('Nutzer nicht mehr folgen') }}" aria-label="{{ person.name }} {{ _('Nutzer nicht mehr folgen') }}">×</button></form></li>{% else %}<li>{{ _('Du folgst noch keinen Nutzern.') }}</li>{% endfor %}</ul></section>
<section class="follow-card" style="margin-top:18px"><h2>{{ _('Kommende Treffer') }}</h2><div class="follow-events">{% for event in events %}<a class="follow-event" href="/concerts/{{ event.id }}"><strong>{{ event.artist }}</strong><br>{{ event.date }} · {{ event.time }}{% if event.venue %} · {{ event.venue }}{% endif %}{% if event.matched_band or event.matched_venue %}<div class="follow-reason">{% if event.matched_band %}Band{% endif %}{% if event.matched_band and event.matched_venue %} {{ _('und') }} {% endif %}{% if event.matched_venue %}{{ _('Location') }}{% endif %} {{ _('gefolgt') }}</div>{% endif %}{% if event.going_users %}<div class="follow-reason">{{ _('Gehen hin:') }} {% for person in event.going_users %}{{ person.name }}{% if not loop.last %}, {% endif %}{% endfor %}</div>{% endif %}</a>{% else %}<p>{{ _('Momentan gibt es keine kommenden Treffer.') }}</p>{% endfor %}</div></section> <section class="follow-card"><h2>{{ _('Locations') }}</h2><ul class="follow-list">{% for venue in followed_venues %}<li><span>{{ venue.name }}{% if venue.city %} · {{ venue.city }}{% endif %}</span><form method="post" action="/following/venues/remove"><input type="hidden" name="venue_id" value="{{ venue.id }}"><button class="follow-remove" type="submit" title="{{ _('Location nicht mehr folgen') }}" aria-label="{{ venue.name }} {{ _('Location nicht mehr folgen') }}">×</button></form></li>{% else %}<li>{{ _('Noch keiner Location gefolgt.') }}</li>{% endfor %}</ul></section>
<section class="follow-card" style="grid-column:1/-1"><h2>{{ _('Kommende Treffer') }}</h2><div class="follow-events">{% for event in events %}<a class="follow-event" href="/concerts/{{ event.id }}"><strong>{{ event.artist }}</strong><br>{{ event.date }} · {{ event.time }}{% if event.venue %} · {{ event.venue }}{% endif %}{% if event.matched_band or event.matched_venue %}<div class="follow-reason">{% if event.matched_band %}Band{% endif %}{% if event.matched_band and event.matched_venue %} {{ _('und') }} {% endif %}{% if event.matched_venue %}{{ _('Location') }}{% endif %} {{ _('gefolgt') }}</div>{% endif %}{% if event.going_users %}<div class="follow-reason">{{ _('Gehen hin:') }} {% for person in event.going_users %}{{ person.name }}{% if not loop.last %}, {% endif %}{% endfor %}</div>{% endif %}</a>{% else %}<p>{{ _('Momentan gibt es keine kommenden Treffer.') }}</p>{% endfor %}</div></section></div>
</main></body></html> </main></body></html>
+4
View File
@@ -96,6 +96,8 @@ class FeatureApiTests(unittest.TestCase):
def test_follow_user_and_show_their_attending_events(self): def test_follow_user_and_show_their_attending_events(self):
with main.get_db_connection() as db: with main.get_db_connection() as db:
db.execute("INSERT INTO venues(name, city) VALUES ('Followed Test Venue', 'Hagen')")
db.execute("INSERT INTO followed_venues(user_id, venue_id) VALUES (1, 1)")
db.execute("INSERT INTO concerts(artist,start_datetime,visibility,created_by,event_type) " db.execute("INSERT INTO concerts(artist,start_datetime,visibility,created_by,event_type) "
"VALUES ('Followed Friend Band',CURRENT_TIMESTAMP + INTERVAL '3 days','public',2,'concert')") "VALUES ('Followed Friend Band',CURRENT_TIMESTAMP + INTERVAL '3 days','public',2,'concert')")
db.execute("INSERT INTO concert_attendance(concert_id,user_id,status) VALUES (1,2,'attending')") db.execute("INSERT INTO concert_attendance(concert_id,user_id,status) VALUES (1,2,'attending')")
@@ -107,6 +109,8 @@ class FeatureApiTests(unittest.TestCase):
page = self.client.get('/following') page = self.client.get('/following')
self.assertEqual(page.status_code, 200) self.assertEqual(page.status_code, 200)
self.assertIn('tester_b', page.text) self.assertIn('tester_b', page.text)
self.assertIn('Followed Test Venue', page.text)
self.assertIn('/following/venues/remove', page.text)
self.assertIn('Followed Friend Band', page.text) self.assertIn('Followed Friend Band', page.text)
self.assertIn('Gehen hin:', page.text) self.assertIn('Gehen hin:', page.text)
self.client.get('/language/en', follow_redirects=False) self.client.get('/language/en', follow_redirects=False)