Skip to content

Commit

Permalink
Merge branch 'master' into demenagement
Browse files Browse the repository at this point in the history
  • Loading branch information
GwilhermPoullennec authored Nov 4, 2023
2 parents 389cfe9 + 5bb23d6 commit c050156
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions orgues/management/commands/build_meilisearch_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def handle(self, *args, **options):
'longitude',
'construction',
'modified_date',
'etat',
])

index.update_ranking_rules([
Expand Down
1 change: 1 addition & 0 deletions orgues/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Meta:


class Orgue(models.Model):

CHOIX_REGION = (
('Auvergne-Rhône-Alpes', 'Auvergne-Rhône-Alpes'),
('Bourgogne-Franche-Comté', 'Bourgogne-Franche-Comté'),
Expand Down
5 changes: 4 additions & 1 deletion orgues/templates/orgues/base_edition.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@


<h2 class="mb-0">
{{ orgue.edifice|capfirst }} <br>
{{ orgue.edifice|capfirst }}
{% if orgue.etat == "disparu" %}
(Orgue disparu)
{% endif %} <br>
</h2>
<h4 class="text-muted">
{{ orgue.commune }}{% if orgue.ancienne_commune %} ({{ orgue.ancienne_commune }}){% endif %}, {{ orgue.departement }}
Expand Down
1 change: 1 addition & 0 deletions orgues/templates/orgues/carte_popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ <h4 class="mb-1">{{ edifice }}</h4>
{% if orgue.designation %}{{ orgue.designation }} {% else %} Orgue {% endif %}
{% if orgue.emplacement %}, {{ orgue.emplacement }} {% endif %}
{% if orgue.resume_composition %}, {{ orgue.resume_composition }} {% endif %}
{% if orgue.etat == "disparu" %}, Orgue disparu {% endif %}
</div>
<div><b>Localisation: </b>{{ orgue.edifice }}, {{ orgue.commune }}, {{ orgue.departement }} ({{ orgue.region }})</div>
<div><b>Facteurs:</b> {% for evenement in orgue.evenements.all %}{% for facteur in evenement.facteurs.all %}{{ facteur.nom }}, {% endfor %}{% endfor %}</div>
Expand Down
5 changes: 4 additions & 1 deletion orgues/templates/orgues/orgue_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
<div class="row justify-content-center text-md-left">
<div class="col-lg-9 my-4 text-center text-md-left">
<h2 class="mb-0">
{{ orgue.edifice|capfirst }} <br>
{{ orgue.edifice|capfirst }}
{% if orgue.etat == "disparu" %}
(Orgue disparu)
{% endif %} <br>
</h2>

{% spaceless %}
Expand Down
1 change: 1 addition & 0 deletions orgues/templates/orgues/orgue_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ <h4 class="card-title mb-0">
<span v-if="!orgue.designation">Orgue</span>
<span v-if="orgue.emplacement">, ((orgue.emplacement))</span>
<span v-if="orgue.resume_composition">, ((orgue.resume_composition))</span>
<span v-if="orgue.etat === 'Disparu'">, Orgue disparu</span>
</p>
{% endspaceless %}
<div class="line-clamp-3">
Expand Down
3 changes: 2 additions & 1 deletion orgues/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ def calc(self, df, type):
return dict((k, self.normalize(v)) for k, v in res.items())

def normalize(self, data):
total = data['count'] or 0
total = data['count'] - data['disparu'] or 0
return {
'total': total,
'mh': data['mh'] or 0,
Expand All @@ -1487,4 +1487,5 @@ def normalize(self, data):
'degrade': round(100 * ((data['degrade'] or 0) + (data['restauration'] or 0)) / total, 0),
'inconnu': round(
100 * (total - (data['altere'] or 0) - (data['bon'] or 0) - (data['tres_bon'] or 0) - (data['degrade'] or 0) - (data['restauration'] or 0)) / total, 0),
'disparu' : data['disparu'],
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Django==3.1.14
django-appconf==1.0.4
django-imagekit==4.0.2
pilkit==2.0
Pillow==9.3.0
Pillow==10.0.1
pytz==2019.3
six==1.13.0
sqlparse==0.4.4
Expand Down
6 changes: 5 additions & 1 deletion templates/accueil.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,16 @@ <h2 class="mb-0">Carte</h2>
<h3 id="selected-region">((selected))</h3>
<p class="text-bold" id="nb-etat-total">
<span class="puce-etat bg-primary">((data.total))</span>
<span>Nombre d'orgues recensés</span>
<span>Nombre d'orgues existants recensés</span>
</p>
<!-- Puce contenant le nombre d'orgues inscrits ou classés -->
<p id="nbInsCla">
<span class="puce-etat " style="background-color:#C31A38;">((data.mh))</span>
<span>Orgues inscrits ou classés</span>
</p>
<p id="nbInsCla">
<span class="puce-etat " style="background-color:#eba510;">((data.disparu))</span>
<span>Nombre d'orgues disparus</span>
</p>
<!-- Puce contenant le taux d'avancement moyen -->
<br>
Expand Down

0 comments on commit c050156

Please sign in to comment.