Skip to content

Commit

Permalink
feat(partner): améliorations post déploiement (#763)
Browse files Browse the repository at this point in the history
## Description

🎸 modification de la route en `/partenaires/`
🎸 modification ordre de tri par date de mise à jour descendante
🎸 formatage de icones des partnaires dans la `ListView`

## Type de changement

🎨 changement d'UI
🚧 technique
  • Loading branch information
vincentporte authored Sep 4, 2024
1 parent 60bb2ee commit 09a865f
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 21 deletions.
2 changes: 1 addition & 1 deletion config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
path("", include(forum_moderation_urls)),
path("calendar/", include(event_urls)),
path("surveys/", include(surveys_urls)),
path("partners/", include(partner_urls)),
path("partenaires/", include(partner_urls)),
path("statistiques/", include(stats_urls)),
# machina legacy
path("", include(conversation_urlpatterns_factory.urlpatterns)),
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum/tests/__snapshots__/tests_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
# name: TestDocumentationForumContent.test_documentation_forum_with_partner[documentation_forum_with_partner]
'''
[<div class="col-12 col-sm-auto mt-3" id="partner_area">
<a href="/partners/best-partner-ever-[PK of Partner]/">
<a href="/partenaires/best-partner-ever-[PK of Partner]/">
<div class="d-flex gap-3 align-items-center mb-2">

<img alt="Best Partner Ever" class="img-fluid" loading="lazy" src="[img src]" width="100"/>
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/pages/tests/__snapshots__/test_homepage.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ul>
<ul>
<li>
<a href="/partners/">Nos partenaires</a>
<a href="/partenaires/">Nos partenaires</a>
</li>
<li>
<a href="/surveys/dsp/create/">Diagnostic Parcours IAE</a>
Expand Down
16 changes: 16 additions & 0 deletions lacommunaute/partner/migrations/0002_alter_partner_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.0.8 on 2024-09-04 14:01

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("partner", "0001_initial"),
]

operations = [
migrations.AlterModelOptions(
name="partner",
options={"ordering": ["-updated"], "verbose_name": "Partner", "verbose_name_plural": "Partners"},
),
]
2 changes: 1 addition & 1 deletion lacommunaute/partner/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Partner(DatedModel):
class Meta:
verbose_name = _("Partner")
verbose_name_plural = _("Partners")
ordering = ["-created"]
ordering = ["-updated"]

def __str__(self):
return f"{self.name}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partners/">Nos partenaires</a>
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partenaires/">Nos partenaires</a>
</li>
</ol>
</nav>
Expand Down Expand Up @@ -72,7 +72,7 @@
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partners/">Nos partenaires</a>
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partenaires/">Nos partenaires</a>
</li>
</ol>
</nav>
Expand Down Expand Up @@ -134,7 +134,7 @@
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partners/">Nos partenaires</a>
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partenaires/">Nos partenaires</a>
</li>
</ol>
</nav>
Expand Down Expand Up @@ -194,7 +194,7 @@
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partners/">Nos partenaires</a>
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner-list" href="/partenaires/">Nos partenaires</a>
</li>
</ol>
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
<div class="col mb-3 mb-md-5">
<div class="card c-card has-one-link-inside h-100">

<img alt="Best Partner Ever" class="card-img-top" loading="lazy" src="[img src]"/>
<div class="card-header card-header--partners">
<img alt="Best Partner Ever" class="img-fluid" loading="lazy" src="[img src]"/>
</div>

<div class="card-body pb-0">
<p class="h3 lh-base">Best Partner Ever</p>
<div class="card-text">short description for SEO</div>
</div>
<div class="card-footer text-end">
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner" href="/partners/best-partner-ever-[PK of Partner]/">
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="partner" href="/partenaires/best-partner-ever-[PK of Partner]/">
<i aria-hidden="true" class="ri-arrow-right-line ri-lg"></i>
</a>
</div>
Expand All @@ -41,20 +43,20 @@


<li class="page-item active">
<a class="page-link" href="/partners/?page=1">1</a>
<a class="page-link" href="/partenaires/?page=1">1</a>
</li>





<li class="page-item">
<a class="page-link" href="/partners/?page=2">2</a>
<a class="page-link" href="/partenaires/?page=2">2</a>
</li>


<li class="page-item">
<a aria-label="Suivant" class="page-link" href="/partners/?page=2"><i class="ri-arrow-right-s-line"></i></a>
<a aria-label="Suivant" class="page-link" href="/partenaires/?page=2"><i class="ri-arrow-right-s-line"></i></a>
</li>
</ul>
'''
Expand Down
9 changes: 8 additions & 1 deletion lacommunaute/partner/tests/tests_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ def test_logo_url(db):

def test_get_absolute_url(db):
partner = PartnerFactory()
assert partner.get_absolute_url() == f"/partners/{partner.slug}-{partner.pk}/"
assert partner.get_absolute_url() == f"/partenaires/{partner.slug}-{partner.pk}/"


def test_ordering(db):
partners = PartnerFactory.create_batch(2)
assert list(Partner.objects.all()) == partners[::-1]
partners[0].save()
assert list(Partner.objects.all()) == partners
16 changes: 10 additions & 6 deletions lacommunaute/static/stylesheets/itou_communaute.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
border-radius: 50%;
overflow: hidden;

> img {
>img {
width: 100%;
height: auto;
object-fit: cover;
Expand Down Expand Up @@ -110,7 +110,7 @@ span.highlighted {
.input-group-rounded-pill {
border-radius: 50rem !important;

> input {
>input {
border-top-left-radius: 50rem !important;
border-bottom-left-radius: 50rem !important;
}
Expand Down Expand Up @@ -162,13 +162,13 @@ span.highlighted {
}
}

> div {
>div {
padding: 16px 8px;
margin: 0;
margin-bottom: 8px;
min-height: 140px;

> span {
>span {
display: block;
}

Expand All @@ -188,7 +188,7 @@ span.highlighted {
}

.definition {
> div {
>div {
padding: 16px 8px 0 16px;
margin-bottom: 8px;

Expand All @@ -209,7 +209,7 @@ span.highlighted {
padding-top: 40%;
}

> iframe {
>iframe {
position: absolute;
top: 0;
left: 0;
Expand All @@ -222,3 +222,7 @@ span.highlighted {
.rating .ri-star-fill {
color: rgb(254, 208, 0);
}

.card-header--partners {
max-height: 100px;
}
4 changes: 3 additions & 1 deletion lacommunaute/templates/partner/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ <h1 class="s-title-01__title h1">{% trans "Partners" %}</h1>
<div class="col mb-3 mb-md-5">
<div class="card c-card has-one-link-inside h-100">
{% if partner.logo %}
<img src="{{ partner.logo.url }}" alt="{{ partner.name }}" class="card-img-top" loading="lazy" />
<div class="card-header card-header--partners">
<img src="{{ partner.logo.url }}" alt="{{ partner.name }}" loading="lazy" class="img-fluid">
</div>
{% endif %}
<div class="card-body pb-0">
<p class="h3 lh-base">{{ partner.name }}</p>
Expand Down

0 comments on commit 09a865f

Please sign in to comment.