Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fiche structure : changer le label des salariés en insertion pour les ESAT/EA #903

Merged
merged 3 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lemarche/siaes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,12 @@ def ca_display(self):
return f"{ca_formatted}€"
return "non disponible"

@property
def etp_count_label_display(self):
if self.kind_is_esat_or_ea_or_eatt:
return "Travailleurs en situation de handicap"
return "Salariés en insertion"

@property
def etp_count_display(self):
if self.employees_insertion_count:
Expand Down Expand Up @@ -998,8 +1004,8 @@ def source_display(self):
return "l'ASP"

@property
def kind_is_esat_or_ea(self):
return self.kind in [siae_constants.KIND_ESAT, siae_constants.KIND_EA]
def kind_is_esat_or_ea_or_eatt(self):
return self.kind in [siae_constants.KIND_ESAT, siae_constants.KIND_EA, siae_constants.KIND_EATT]

@property
def completion_percent(self):
Expand Down
9 changes: 5 additions & 4 deletions lemarche/siaes/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ def test_is_missing_content_property(self):
siae_full_2.save() # to update stats
self.assertFalse(siae_full_2.is_missing_content)

def test_kind_is_esat_or_ea_property(self):
def test_kind_is_esat_or_ea_or_eatt_property(self):
siae_esat = SiaeFactory(kind=siae_constants.KIND_ESAT)
self.assertTrue(siae_esat.kind_is_esat_or_ea)
siae_ea = SiaeFactory(kind=siae_constants.KIND_EA)
self.assertTrue(siae_ea.kind_is_esat_or_ea)
siae_eatt = SiaeFactory(kind=siae_constants.KIND_EATT)
siae_ei = SiaeFactory(kind=siae_constants.KIND_EI)
self.assertFalse(siae_ei.kind_is_esat_or_ea)
for siae in [siae_esat, siae_ea, siae_eatt]:
self.assertTrue(siae.kind_is_esat_or_ea_or_eatt)
self.assertFalse(siae_ei.kind_is_esat_or_ea_or_eatt)


class SiaeModelSaveTest(TestCase):
Expand Down
4 changes: 2 additions & 2 deletions lemarche/templates/dashboard/siae_edit_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<div class="col-12 col-lg-8">
<div class="bg-white d-block rounded-lg shadow-lg p-3 p-lg-5">
<fieldset>
<legend class="h5">{% get_verbose_name siae 'employees_insertion_count' %}</legend>
<legend class="h5">Nombre de {{ siae.etp_count_label_display | lower }}</legend>
{% bootstrap_field form.employees_insertion_count show_label=False %}
</fieldset>
</div>
Expand All @@ -111,7 +111,7 @@
<strong>Conseil</strong>
</p>
<p class="mb-0">
Le nombre de salariés en insertion démontre à la fois votre capacité de production et l'impact social de votre structure.
Le nombre de {{ siae.etp_count_label_display | lower }} démontre à la fois votre capacité de production et l'impact social de votre structure.
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lemarche/templates/siaes/_detail_partner_cta.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="col">
<h4>Vous avez besoin d'être accompagné dans vos achats inclusifs par des partenaires reconnus ?</h2>

{% if siae.kind_is_esat_or_ea %}
{% if siae.kind_is_esat_or_ea_or_eatt %}
<a href="{% slugurl "faciltez-vous-les-achats-responsables" %}" target="_blank" id="track_siae_detail_partners_esat_ea" class="btn btn-sm btn-outline-primary btn-ico">
<span>Découvrez-les maintenant</span>
<i class="ri-arrow-right-up-line ri-lg"></i>
Expand Down
4 changes: 2 additions & 2 deletions lemarche/templates/siaes/_useful_infos_siae.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
<div class="row">
<div class="col-12">
<i class="ri-user-add-line"></i>
<strong>Salariés en insertion :</strong>
<strong>{{ siae.etp_count_label_display }} :</strong>
<span>{{ siae.etp_count_display|floatformat:0|default:"non disponible" }}</span>
</div>
</div>
</div>
</div>
</div>
5 changes: 3 additions & 2 deletions lemarche/templates/siaes/_useful_infos_siae_v2.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load array_choices_display %}

<div class="row">
<div class="col-12 col-md-6">
<ul class="list-unstyled">
Expand Down Expand Up @@ -30,7 +31,7 @@
</li>
<li class="mb-2">
<i class="ri-user-add-line"></i>
<strong>Salariés en insertion :</strong>
<strong>{{ siae.etp_count_label_display }} :</strong>
<span>{{ siae.etp_count_display|floatformat:0|default:"non disponible" }}</span>
</li>
<li class="mb-2">
Expand Down Expand Up @@ -84,4 +85,4 @@
</li>
</ul>
</div>
</div>
</div>