Skip to content

Commit 5e7defc

Browse files
committed
Bug: Learn Page correct post card and community card display issues
1 parent 54759a9 commit 5e7defc

5 files changed

Lines changed: 103 additions & 12 deletions

File tree

core/views.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,8 @@ def get_v3_context_data(self, **kwargs):
541541
{
542542
"title": "A talk by Richard Thomson at the Utah C++ Programmers Group",
543543
"description": "Lorem Ispum Sum Delores",
544-
"url": "#",
545-
"date": "03/03/2025",
546-
"category": "Issues",
547-
"tag": "beast",
548-
"author": {
549-
"name": "Richard Thomson",
550-
"role": "Contributor",
551-
"show_badge": True,
552-
"avatar_url": "/static/img/v3/demo_page/Avatar.png",
553-
},
544+
"cta_url": "#",
545+
"cta_label": "Learn More",
554546
}
555547
],
556548
}

static/css/v3/community-card.css

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
Community Card
3+
Individual community card item styles used within card-group containers.
4+
*/
5+
6+
.community-card {
7+
display: flex;
8+
flex-direction: column;
9+
gap: var(--space-medium);
10+
padding: var(--space-card);
11+
font-family: var(--font-sans);
12+
color: var(--color-text-primary);
13+
transition:
14+
background-color 0.2s ease,
15+
border-color 0.2s ease;
16+
}
17+
18+
.community-card__title {
19+
margin: 0;
20+
padding: 0;
21+
font-family: var(--font-sans);
22+
font-size: var(--font-size-base);
23+
font-weight: var(--font-weight-medium);
24+
line-height: var(--line-height-default);
25+
letter-spacing: var(--letter-spacing-tight);
26+
color: var(--color-text-primary);
27+
}
28+
29+
.community-card__description {
30+
margin: 0;
31+
padding: 0;
32+
font-family: var(--font-sans);
33+
font-size: var(--font-size-xs);
34+
font-weight: var(--font-weight-regular);
35+
line-height: var(--line-height-default);
36+
letter-spacing: var(--letter-spacing-tight);
37+
color: var(--color-text-secondary);
38+
}
39+
40+
.community-card__link {
41+
color: var(--color-text-primary);
42+
font-family: var(--font-sans);
43+
font-size: var(--font-size-xs);
44+
font-weight: var(--font-weight-medium);
45+
line-height: var(--line-height-tight);
46+
letter-spacing: var(--letter-spacing-tight);
47+
text-decoration-line: underline;
48+
text-decoration-skip-ink: none;
49+
text-underline-position: from-font;
50+
}

static/css/v3/components.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@
5454
@import "./library-discovery-card.css";
5555
@import "./help-card.css";
5656
@import "./quick-start-card.css";
57+
@import "./community-card.css";
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{% extends "v3/includes/_card_group.html" %}
2+
{% comment %}
3+
Community Card — extends _card_group.html to render community connection items.
4+
5+
Variables (passed to _card_group.html):
6+
heading (string, optional) — section heading text
7+
heading_url (string, optional) — if set, heading becomes a link
8+
items (list, optional) — list of event objects with:
9+
- title (string, required) — event title
10+
- description (string, optional) — event description
11+
- date (string, required) — human-readable date (e.g. "29/10/25")
12+
- datetime (string, optional) — value for <time datetime="...">
13+
- card_url (string, optional) — if set, the card is wrapped in a link
14+
- card_aria_label (string, optional) — aria-label for the link; defaults to title
15+
variant (string, optional) — "list" or "card", defaults to "list"
16+
theme (string, optional) — only for variant "card": "default", "grey", "yellow", "green", "teal"
17+
layout (string, optional) — "vertical" or "horizontal", defaults to "vertical"
18+
primary_cta_label (string, optional) — primary CTA button label
19+
primary_cta_url (string, optional) — primary CTA button URL
20+
secondary_cta_label (string, optional) — secondary CTA button label
21+
secondary_cta_url (string, optional) — secondary CTA button URL
22+
23+
Usage:
24+
{% include "v3/includes/_event_card.html" with heading="Upcoming Events" items=events variant="card" theme="teal" primary_cta_label="View events" primary_cta_url="/events/" %}
25+
{% endcomment %}
26+
{% block card_list %}
27+
{% if items %}
28+
<ul class="card-group__list">
29+
{% for item in items %}
30+
<li class="card-group__item">
31+
<article class="community-card">
32+
<h3 class="community-card__title">{{ item.title }}</h3>
33+
{% if item.description %}
34+
<p class="community-card__description">{{ item.description }}</p>
35+
{% endif %}
36+
{% if item.cta_url and item.cta_label %}
37+
<a href="{{ item.cta_url }}"
38+
class="community-card__link"
39+
aria-label="{{ item.card_aria_label|default:item.cta_label }}">
40+
{{item.cta_label}}
41+
</a>
42+
{% endif %}
43+
</article>
44+
</li>
45+
{% endfor %}
46+
</ul>
47+
{% endif %}
48+
{% endblock %}

templates/v3/learn_page.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ <h1>Start anywhere. Learn everything. Build anything.</h1>
3030
<div class="card-masonry py-large">
3131
<div class="item-a">
3232
{% with data=post_cards_data %}
33-
{% include 'v3/includes/_post_cards_v3.html' with heading=data.heading posts=data.posts view_all_url=data.view_all_url view_all_label=data.view_all_label theme='teal' variant="content-card" %}
33+
{% include 'v3/includes/_post_card.html' with heading=data.heading items=data.posts primary_cta_url=data.view_all_url primary_cta_label=data.view_all_label theme='teal' variant="card" %}
3434
{% endwith %}
3535
</div>
3636
<div class="item-b">
3737
{% with data=boost_community_data %}
38-
{% include 'v3/includes/_post_cards_v3.html' with heading=data.heading posts=data.posts view_all_url=data.view_all_url view_all_label=data.view_all_label %}
38+
{% include 'v3/includes/_community_card.html' with heading=data.heading items=data.posts primary_cta_url=data.view_all_url primary_cta_label=data.view_all_label %}
3939
{% endwith %}
4040
</div>
4141
<div class="item-d">

0 commit comments

Comments
 (0)