Skip to content

Commit

Permalink
Compactage des informations annexes de l'espece
Browse files Browse the repository at this point in the history
  • Loading branch information
bruhnild committed Jan 21, 2025
1 parent 17c196a commit e09592d
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 165 deletions.
21 changes: 17 additions & 4 deletions atlas/static/css/ficheEspece.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
color: var(--main-color);
}

#identityCard {
}
#identityCard {}

#taxonIdentity {
padding-top: 10px;
Expand Down Expand Up @@ -98,7 +97,7 @@ p.imgDescription.main {
margin-top: 15px;
}

.nav > li > a {
.nav>li>a {
padding: 10px 7px;
}

Expand Down Expand Up @@ -267,7 +266,8 @@ text {

.carousel {
width: 100%;
margin: 0 auto; /* center your carousel if other than 100% */
margin: 0 auto;
/* center your carousel if other than 100% */
}

#fixed .slider-size {
Expand All @@ -284,3 +284,16 @@ text {
.carousel-indicators {
bottom: 0px;
}

#organisms>ul {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

#organisms>ul .media-body {
gap: 0.5rem;
}

#organisms>ul h3 {
font-size: 1.5rem;
}
324 changes: 163 additions & 161 deletions atlas/templates/speciesSheet/otherInformations.html
Original file line number Diff line number Diff line change
@@ -1,168 +1,170 @@
{% block otherInformations %}
<div class="card mt-4" id="otherInformationsPanel">
<div class="row" id="otherInformations">
<ul class="nav nav-tabs">
{% if articles | length != 0 %}
<li class="nav-item"><a data-toggle="tab" class="nav-link active"
href="#articles"><b>{{ articles|length }}</b> {{ 'articles' if articles|length > 1 else 'article' }}
</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#communes">
<b>{{ communes|length }}</b> {{ _('municipalities')|lower if communes|length > 1 else _('municipality')|lower }}</a>
</li>
{% else %}
<li class="nav-item"><a data-toggle="tab" class="nav-link active" href="#communes">
<b>{{ communes|length }}</b> {{ _('municipalities')|lower if communes|length > 1 else _('municipality')|lower }}</a>
</li>
<div class="card mt-4" id="otherInformationsPanel">
<div class="row" id="otherInformations">
<ul class="nav nav-tabs">
{% if articles | length != 0 %}
<li class="nav-item"><a data-toggle="tab" class="nav-link active" href="#articles"><b>{{ articles|length }}</b>
{{ 'articles' if articles|length > 1 else 'article' }}
</a></li>
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#communes">
<b>{{ communes|length }}</b>
{{ _('municipalities')|lower if communes|length > 1 else _('municipality')|lower }}</a>
</li>
{% else %}
<li class="nav-item"><a data-toggle="tab" class="nav-link active" href="#communes">
<b>{{ communes|length }}</b>
{{ _('municipalities')|lower if communes|length > 1 else _('municipality')|lower }}</a>
</li>
{% endif %}

{% if configuration.ORGANISM_MODULE %}
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#organisms">
<b>{{ organisms|length }} </b> {{ _('organisms')|lower if organisms|length > 1 else _('organism')|lower }}
</a>
</li>
{% endif %}

{% if configuration.DISPLAY_OBSERVERS %}
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#observateurs">
<b>{{ observers|length }} </b> {{ _('observers')|lower if observers|length > 1 else _('observer')|lower }}
</a></li>
{% endif %}
</ul>


<div class="tab-content" style="width:100%;">
<!-- municipality tab-->
{% if articles | length != 0 %}
<div id="articles" class="tab-pane fade show active">
<table class="table table-striped">
<thead>
<th></th>
<th> {{ _('title') }}</th>
<th> {{ _('author')}}</th>
</thead>
<tbody>

{% for i in range (articles | length) %}
<tr class="accordion-toggle" data-toggle="collapse" data-target=".moreInfo{{ i }}">
<td> {% if articles[i].id_type == 3 %}
<span class="fas fa-link"> </span>
{% else %} <span class="fas fa-paperclip"> </span>
{% endif %}

{% if configuration.ORGANISM_MODULE %}
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#organisms">
<b>{{ organisms|length }} </b> {{ _('organisms')|lower if organisms|length > 1 else _('organism')|lower }}
</a>
</li>
{% endif %}

{% if configuration.DISPLAY_OBSERVERS %}
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#observateurs">
<b>{{ observers|length }} </b> {{ _('observers')|lower if observers|length > 1 else _('observer')|lower }}
</a></li>
{% endif %}
</ul>


<div class="tab-content" style="width:100%;">
<!-- municipality tab-->
{% if articles | length != 0 %}
<div id="articles" class="tab-pane fade show active">
<table class="table table-striped">
<thead>
<th></th>
<th> {{ _('title') }}</th>
<th> {{ _('author')}}</th>
</thead>
<tbody>

{% for i in range (articles | length) %}
<tr class="accordion-toggle" data-toggle="collapse" data-target=".moreInfo{{ i }}">
<td> {% if articles[i].id_type == 3 %}
<span class="fas fa-link"> </span>
{% else %} <span class="fas fa-paperclip"> </span>
{% endif %}
</td>

<td>
<a href="{{ articles[i].path }}" target="_blank"> {{ articles[i].title }} </a>
</td>

<td>
{{ articles[i].author }}
</td>
<td>
<i class="btn-more"> <span class="fas fa-chevron-down "> </span></i>
</td>

</tr>
<tr>
<td colspan="4" class="hiddenRow" style="padding:0px;">
<div class="collapse moreInfo{{ i }}">
<strong> {{ _('description') }} : </strong>
<br> {{ articles[i].description | safe }} <br>
<strong> {{ _('date') }} : </strong> {{ articles[i].date }}
</div>
</td>
</tr>

{% endfor %}

</tbody>
</table>
</div>
{% endif %}
{% if articles | length != 0 %}
<div id="communes" class="tab-pane fade">
{% else %}
<div id="communes" class="tab-pane fade show active">
{% endif %}
<p>
{% for com in communes %}
<a href="{{ url_for('main.ficheCommune', insee = com.insee) }}">{{ com.commune_maj }}</a>
{% if not loop.last %}
-
{% endif %}
{% endfor %}
</p>
</td>

<td>
<a href="{{ articles[i].path }}" target="_blank"> {{ articles[i].title }} </a>
</td>

<td>
{{ articles[i].author }}
</td>
<td>
<i class="btn-more"> <span class="fas fa-chevron-down "> </span></i>
</td>

</tr>
<tr>
<td colspan="4" class="hiddenRow" style="padding:0px;">
<div class="collapse moreInfo{{ i }}">
<strong> {{ _('description') }} : </strong>
<br> {{ articles[i].description | safe }} <br>
<strong> {{ _('date') }} : </strong> {{ articles[i].date }}
</div>
</td>
</tr>

{% endfor %}

</tbody>
</table>
</div>
{% endif %}
{% if articles | length != 0 %}
<div id="communes" class="tab-pane fade">
{% else %}
<div id="communes" class="tab-pane fade show active">
{% endif %}
<p>
{% for com in communes %}
<a href="{{ url_for('main.ficheCommune', insee = com.insee) }}">{{ com.commune_maj }}</a>
{% if not loop.last %}
-
{% endif %}
{% endfor %}
</p>
</div>

<!--- oberservers tab-->
{% if configuration.DISPLAY_OBSERVERS %}
<div id="observateurs" class="tab-pane fade">
{% for o in observers %}
{{ o }}
{% if not loop.last %}
-
{% endif %}
{% endfor %}
</div>
{% endif %}
<!--- oberservers tab-->
{% if configuration.DISPLAY_OBSERVERS %}
<div id="observateurs" class="tab-pane fade">
{% for o in observers %}
{{ o }}
{% if not loop.last %}
-
{% endif %}
{% endfor %}
</div>
{% endif %}

{% if configuration.ORGANISM_MODULE %}
<!-- organism tab -->
<div id="organisms" class="tab-pane fade flex-grow-1">
<ul class="list-group w-100">
{% for o in organisms %}
<li id="organismListItem" class="media border-bottom p-2" id_organism="{{ o['nom_organism'] }}">
<div class="pictoImgList mr-2" data-toggle="tooltip" data-original-title="{{ taxon.group2_inpn }}"
data-placement="right">
<span class="float-right"></span>
<div class="pictoImgList mr-2" data-toggle="tooltip" data-original-title="{{ taxon.group2_inpn }}"
data-placement="right">
{% if o['url_logo']!= None %}
{% if not o['url_organism'] in (None, '') %}
<a href="{{ o['url_organism'] }}" target="_blank">
<img class="mx-auto d-block" src="{{ o['url_logo'] }}" style='width:100px'>
</a>
{% else %}
<img class="mx-auto d-block" src="{{ o['url_logo'] }}" style='width:100px'>
{% endif %}
{% endif %}
</div>
</div>

<div class="media-body d-flex align-items-center justify-content-between flex-wrap">
<div>
<h5 class="mt-0 mb-1 ">
<span id="name"><b>{{ o['nom_organism'] }}</b></span>
</h5>

<strong>{{ _('organism.participation') }}
{{ o['nb_observation']}}
{% if o['nb_observation'] > 1 %}
{{ _('observations') }}
{% else %}
{{ _('observation') }}
{% endif %}
</strong>
<br>{{ _('organism.prospection') }} :
<strong>{{ "%.2f"|format(o['nb_observation']/taxon.taxonSearch.nb_obs*100) }} %</strong>

{% if configuration.ORGANISM_MODULE %}
<!-- organism tab -->
<div id="organisms" class="tab-pane fade flex-grow-1">
<ul class="list-group w-100">
{% for o in organisms %}
<li id="organismListItem" class="media border-bottom p-2"
id_organism="{{ o['nom_organism'] }}">
<div class="pictoImgList mr-2" data-toggle="tooltip" data-original-title="{{ taxon.group2_inpn }}"
data-placement="right">
<span class="float-right"></span>
<div class="pictoImgList mr-2" data-toggle="tooltip" data-original-title="{{ taxon.group2_inpn }}"
data-placement="right">
{% if o['url_logo']!= None %}
{% if not o['url_organism'] in (None, '') %}
<a href="{{ o['url_organism'] }}" target="_blank">
<img class="mx-auto d-block" src="{{ o['url_logo'] }}" style='width:100px'>
</a>
{% else %}
<img class="mx-auto d-block" src="{{ o['url_logo'] }}" style='width:100px'>
{% endif %}
{% endif %}
</div>
</div>

<div class="media-body">
<span class="float-right"></span>
<h5 class="mt-0 mb-1 ">
<span id="name"><b>{{ o['nom_organism'] }}</b></span>
</h5>

<strong>{{ _('organism.participation') }}
{{ o['nb_observation']}}
{% if o['nb_observation'] > 1 %}
{{ _('observations') }}
{% else %}
{{ _('observation') }}
{% endif %}
</strong>
<br>{{ _('organism.prospection') }} : <strong>{{ "%.2f"|format(o['nb_observation']/taxon.taxonSearch.nb_obs*100) }} %</strong>
<br>
<br>
<span class="float-right">
<h3><a class="badge badge-primary" href="{{ url_for('main.ficheOrganism', id_organism=o['id_organism']) }}"
data-toggle="tooltip" style="color: white;"
title="{{ _('check.organism.sheet') }}" data-placement="left">
<i class="fas fa-list fa-fw"></i> {{ _('organism.sheet') }}</i>
</a></h3>
</span>

</div>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
<span>
<h3><a class="badge badge-primary"
href="{{ url_for('main.ficheOrganism', id_organism=o['id_organism']) }}" data-toggle="tooltip"
style="color: white;" title="{{ _('check.organism.sheet') }}" data-placement="left">
<i class="fas fa-list fa-fw"></i> {{ _('organism.sheet') }}</i>
</a></h3>
</span>

</div>
{% endfor %}
</ul>
</div>
{% endif %}

</div>
</div>

</div>
</div>
{% endblock %}
</div>
</div>
{% endblock %}

0 comments on commit e09592d

Please sign in to comment.