Skip to content

Commit

Permalink
Reuse same template. Improve display
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jun 26, 2024
1 parent 0429ef0 commit 7b43a14
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 34 deletions.
2 changes: 1 addition & 1 deletion lemarche/templates/dashboard/siae_edit_activities.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h3>Ajoutez vos secteurs d'activité et recevez des opportunités commerciales c
<div class="row mb-3 mb-lg-5">
{% for activity in siae.activities.all %}
<div class="col-12 col-lg-8">
{% include "dashboard/_siae_activity_card.html" with activity=activity %}
{% include "siaes/_siae_activity_card.html" with activity=activity %}
</div>
{% endfor %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3>{{ page_title }}</h3>
{% if activity %}
<div class="row mb-3 mb-lg-5">
<div class="col-12 col-lg-8">
{% include "dashboard/_siae_activity_card.html" with activity=activity hide_actions=True %}
{% include "siaes/_siae_activity_card.html" with activity=activity hide_actions=True %}
</div>
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,7 @@
<div class="bg-white d-block rounded-lg shadow-lg p-3 mb-3">
<div class="row">
<div class="col-12 col-lg-8">
<p class="h4 lh-sm">{{ activity.sector_group }}</p>

<ul>
{% siae_sectors_display activity display_max=6 output_format='li' %}
</ul>

<p class="mb-0">
<i class="ri-briefcase-4-line mr-1"></i>
<span class="sr-only">Type(s) de prestation :</span>
<span>{{ activity.presta_type_display }}</span>
</p>
<p class="mb-0">
<i class="ri-map-2-line"></i>
<span class="sr-only">Intervient sur : {{ siae.geo_range_pretty_title }}</span>
<span>{{ siae.geo_range_pretty_display }}</span>
</p>
{% include "siaes/_siae_activity_content.html" with activity=activity with_collapse=with_collapse %}
</div>

{% if not hide_actions %}
Expand Down
38 changes: 24 additions & 14 deletions lemarche/templates/siaes/_siae_activity_content.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
{% load siae_sectors_display %}

<p class="h4 lh-sm">{{ activity.sector_group }}</p>
<p class="h4 lh-sm">
{% if with_collapse %}
<a href="#collapseSiaeActiviyContent{{ activity.id }}" class="text-decoration-none has-collapse-caret collapsed" data-toggle="collapse">
{{ activity.sector_group }}
</a>
{% else %}
{{ activity.sector_group }}
{% endif %}
</p>

<ul>
{% siae_sectors_display activity display_max=6 output_format='li' %}
</ul>
<div id="collapseSiaeActiviyContent{{ activity.id }}" class="{% if with_collapse %}pb-3 collapse{% endif %}">
<ul style="padding-left:1.5rem">
{% siae_sectors_display activity display_max=6 output_format='li' %}
</ul>

<p class="mb-0">
<i class="ri-briefcase-4-line mr-1"></i>
<span class="sr-only">Type(s) de prestation :</span>
<span>{{ activity.presta_type_display }}</span>
</p>
<p class="mb-0">
<i class="ri-map-2-line"></i>
<span class="sr-only">Intervient sur : {{ siae.geo_range_pretty_title }}</span>
<span>{{ siae.geo_range_pretty_display }}</span>
</p>
<p class="mb-0">
<i class="ri-briefcase-4-line mr-1"></i>
<span class="sr-only">Type(s) de prestation :</span>
<span>{{ activity.presta_type_display }}</span>
</p>
<p class="mb-0">
<i class="ri-map-2-line"></i>
<span class="sr-only">Intervient sur : {{ siae.geo_range_pretty_title }}</span>
<span>{{ siae.geo_range_pretty_display }}</span>
</p>
</div>
4 changes: 2 additions & 2 deletions lemarche/templates/siaes/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h3 class="h2 mb-1 mt-1">Présentation du prestataire</h3>
<h3 class="h2 mb-1 mt-1">Secteurs d'activité</h3>
{% if user.is_authenticated and user.is_admin %}
{% for activity in siae.activities.all %}
{% include "siaes/_siae_activity_content.html" with activity=activity %}
{% include "siaes/_siae_activity_content.html" with activity=activity with_collapse=True %}
{% endfor %}
{% else %}
{% if not siae.sector_count %}
Expand Down Expand Up @@ -129,7 +129,7 @@ <h3 class="h2 mb-1 mt-1">Références clients</h3>
</li>
{% endfor %}
</ul>
<div class="collapse" id="collapseMoreRefClients">
<div id="collapseMoreRefClients" class="collapse">
<ul class="list-unstyled row row-cols-3 align-items-center mb-0">
{% for image in siae.client_references.all|slice:"6:" %}
<li class="col">
Expand Down

0 comments on commit 7b43a14

Please sign in to comment.