Make card layout / lists consistent #192

Merged
tobru merged 2 commits from 178-card-layout into main 2025-09-11 14:29:16 +00:00
3 changed files with 85 additions and 39 deletions
Showing only changes of commit 8aa42db71f - Show all commits

View file

@ -46,22 +46,20 @@
{% endif %}
</div>
</div>
<div class="row">
<div class="row match-height card-grid">
{% for offering in service.offerings.all %}
<div class="col-6 col-lg-3 col-md-4">
<div class="card">
<div class="card-header d-flex align-items-center">
<div class="card-header card-header-with-logo">
{% if offering.provider.logo %}
<img src="{{ offering.provider.logo.url }}"
alt="{{ offering.provider.name }}"
class="me-3"
style="max-width: 48px;
max-height: 48px">
alt="{{ offering.provider.name }}">
{% endif %}
<div class="d-flex flex-column">
<h4 class="mb-0">{{ offering.provider.name }}</h4>
<div class="card-header-content">
<h4>{{ offering.provider.name }}</h4>
</div>
</div>
<div class="card-content">
<div class="card-body">
{% if offering.description %}
<p class="card-text">{{ offering.description|urlize }}</p>
@ -69,6 +67,7 @@
<p class="card-text">{{ offering.provider.description|urlize }}</p>
{% endif %}
</div>
</div>
<div class="card-footer d-flex justify-content-between">
<span></span>
<a href="offering/{{ offering.pk }}/" class="btn btn-light-primary">{% translate "Create Instance" %}</a>

View file

@ -16,20 +16,17 @@
</div>
</div>
</div>
<div class="row match-height service-cards-container mb-5">
<div class="row match-height card-grid service-cards-container mb-5">
{% for service in services %}
<div class="col-12 col-md-6 col-lg-3">
<div class="card">
<div class="card-header d-flex align-items-center">
<div class="card-header card-header-with-logo">
{% if service.logo %}
<img src="{{ service.logo.url }}"
alt="{{ service.name }}"
class="me-3"
style="max-width: 48px;
max-height: 48px">
alt="{{ service.name }}">
{% endif %}
<div class="d-flex flex-column">
<h4 class="mb-0">{{ service.name }}</h4>
<div class="card-header-content">
<h4>{{ service.name }}</h4>
<small class="text-muted">{{ service.category }}</small>
</div>
</div>

View file

@ -175,7 +175,57 @@ a.btn-keycloak {
padding-right: 28px;
}
/* Service cards equal height styling */
/* Card layout utilities - reusable for any card grid */
.card-grid {
display: flex;
flex-wrap: wrap;
}
.card-grid > * {
display: flex;
align-items: stretch;
}
.card-grid .card {
width: 100%;
display: flex;
flex-direction: column;
}
.card-grid .card-content {
flex-grow: 1;
}
.card-grid .card-body {
flex-grow: 1;
}
/* Card header with logo styling */
.card-header-with-logo {
display: flex;
align-items: center;
}
.card-header-with-logo img {
max-width: 48px;
max-height: 48px;
margin-right: 1rem;
}
.card-header-with-logo .card-header-content {
display: flex;
flex-direction: column;
}
.card-header-with-logo .card-header-content h4 {
margin-bottom: 0;
}
.card-header-with-logo .card-header-content .text-muted {
font-size: 0.875rem;
}
/* Backwards compatibility - keep existing service-cards-container class */
.service-cards-container > * {
display: flex;
align-items: stretch;