-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat speciesSheet: custom attributes for infos bloc
Close #412.
- Loading branch information
Showing
10 changed files
with
142 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,61 @@ | ||
{% block blocInfos %} | ||
{% if configuration.GLOSSAIRE %} | ||
<!-- Jquery Glossarizer --> | ||
<script src="{{url_for('static', filename='node_modules/glossarizer/tooltip/tooltip.js') }}"></script> | ||
<script src="{{url_for('static', filename='node_modules/glossarizer/jquery.glossarize.js') }}"></script> | ||
<link rel="stylesheet" href="{{url_for('static', filename='node_modules/glossarizer/tooltip/tooltip.css') }}"> | ||
{% endif %} | ||
{% if configuration.GLOSSAIRE %} | ||
<!-- Jquery Glossarizer --> | ||
<script src="{{url_for('static', filename='node_modules/glossarizer/tooltip/tooltip.js') }}"></script> | ||
<script src="{{url_for('static', filename='node_modules/glossarizer/jquery.glossarize.js') }}"></script> | ||
<link rel="stylesheet" href="{{url_for('static', filename='node_modules/glossarizer/tooltip/tooltip.css') }}" /> | ||
{% endif %} | ||
|
||
<div class="card mt-4" id="blocInfos"> | ||
<h4 class="title-bar center"> | ||
<strong>{{ _('species.infos') }}</strong> | ||
</h4> | ||
<ul class="nav nav-tabs"> | ||
<li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#description">{{ _('description') }}</a> | ||
</li> | ||
{% if taxonDescription.commentaire != None %} | ||
<li><a class="nav-link" data-toggle="tab" href="#commentaire">{{ _('read.more') }}</a></li> | ||
{% endif %} | ||
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#milieu">{{ _('environment') }}</a></li> | ||
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#chorologie">{{ _('repartition') }}</a></li> | ||
<li class="nav-item"><a class="nav-link" data-toggle="tab" href="#synonymes">{{ _('synonyms') }}</a></li> | ||
</ul> | ||
<div class="card mt-4" id="blocInfos"> | ||
<h4 class="title-bar center"> | ||
<strong>{{ _('species.infos') }}</strong> | ||
</h4> | ||
<ul class="nav nav-tabs"> | ||
{% for desc in taxonDescription %} | ||
<li class="nav-item"> | ||
<a | ||
class="nav-link {% if loop.index == 1 %}active{% endif %}" | ||
data-toggle="tab" | ||
href="#{{desc.code}}" | ||
> | ||
{{ _(desc.title) }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
<li class="nav-item"> | ||
<a class="nav-link" data-toggle="tab" href="#synonymes"> | ||
{{ _('synonyms') }} | ||
</a> | ||
</li> | ||
</ul> | ||
|
||
<div class="tab-content"> | ||
<div id="description" class="tab-pane fade show active"> | ||
{% if taxonDescription.description == None %} | ||
{{ _('not.resigned.for.the.moment') }} | ||
{% else %} | ||
{{ taxonDescription.description | safe }} | ||
{% endif %} | ||
</div> | ||
{% if taxonDescription.commentaire != None %} | ||
<div id="commentaire" class="tab-pane fade"> | ||
{{ taxonDescription.commentaire | safe }} | ||
</div> | ||
{% endif %} | ||
<div id="milieu" class="tab-pane fade"> | ||
{% if taxonDescription.milieu == None %} | ||
{{ _('not.resigned.for.the.moment') }} | ||
{% else %} | ||
{{ taxonDescription.milieu }} | ||
{% endif %} | ||
</div> | ||
<div id="chorologie" class="tab-pane fade"> | ||
{% if taxonDescription.chorologie == None %} | ||
{{ _('not.resigned.for.the.moment') }} | ||
{% else %} | ||
{{ taxonDescription.chorologie }} | ||
{% endif %} | ||
</div> | ||
<div id="synonymes" class="tab-pane fade"> | ||
{% if synonyme | length == 1 %} | ||
{{ _('no.synonym.for.this.taxon') }} | ||
{% else %} | ||
{% for syn in synonyme %} | ||
{% if not syn.lb_nom == taxon.taxonSearch.lb_nom %} | ||
{{ syn.nom_complet_html | safe }} | ||
{% endif %} | ||
{% if ( (not loop.last) and (not syn.lb_nom == taxon.taxonSearch.lb_nom) ) %} | ||
| | ||
{% endif %} | ||
<div class="tab-content"> | ||
{% for desc in taxonDescription %} | ||
<div | ||
id="{{desc.code}}" | ||
class="tab-pane fade show {% if loop.index == 1 %}active{% endif %}" | ||
> | ||
{% if desc.value == None %} | ||
{{ _('not.resigned.for.the.moment') }} | ||
{% else %} | ||
{{ desc.value | safe }} | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
<div id="synonymes" class="tab-pane fade"> | ||
{% if synonyme | length == 1 %} | ||
{{ _('no.synonym.for.this.taxon') }} | ||
{% else %} | ||
{% for syn in synonyme %} | ||
{% if not syn.lb_nom == taxon.taxonSearch.lb_nom %} | ||
{{ syn.nom_complet_html | safe }} | ||
{% endif %} | ||
{% if ( (not loop.last) and (not syn.lb_nom == taxon.taxonSearch.lb_nom) ) %} | ||
| | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
-- Attributs de chaque taxon (description, commentaire, milieu et chorologie) | ||
CREATE MATERIALIZED VIEW atlas.vm_cor_taxon_attribut AS | ||
SELECT id_attribut, | ||
valeur_attribut, | ||
cd_ref | ||
FROM taxonomie.cor_taxon_attribut | ||
WHERE id_attribut IN (100, 101, 102, 103); | ||
CREATE UNIQUE INDEX ON atlas.vm_cor_taxon_attribut (cd_ref,id_attribut); | ||
-- Attributs TaxHub de chaque taxon | ||
CREATE MATERIALIZED VIEW atlas.vm_taxon_attribute AS | ||
SELECT cta.cd_ref, | ||
ba.nom_attribut AS code, | ||
ba.label_attribut AS title, | ||
CASE | ||
WHEN ba.type_attribut = 'text' AND ba.type_widget = 'select' | ||
THEN REPLACE(cta.valeur_attribut, '&', '|') | ||
ELSE cta.valeur_attribut | ||
END AS "value" | ||
FROM taxonomie.cor_taxon_attribut AS cta | ||
JOIN taxonomie.bib_attributs AS ba | ||
ON cta.id_attribut = ba.id_attribut | ||
WHERE ba.nom_attribut IN ('atlas_description', 'atlas_commentaire', 'atlas_milieu', 'atlas_chorologie') | ||
AND cta.valeur_attribut IS NOT NULL | ||
AND cta.valeur_attribut != '' ; | ||
|
||
CREATE UNIQUE INDEX ON atlas.vm_taxon_attribute (cd_ref, code); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
BEGIN; | ||
|
||
DROP MATERIALIZED VIEW IF EXISTS atlas.vm_taxon_attribute ; | ||
|
||
DROP FOREIGN TABLE IF EXISTS taxonomie.bib_attributs ; | ||
|
||
DROP MATERIALIZED VIEW IF EXISTS atlas.vm_cor_taxon_attribut ; | ||
|
||
IMPORT FOREIGN SCHEMA taxonomie | ||
LIMIT TO (taxonomie.bib_attributs) | ||
FROM SERVER geonaturedbserver INTO taxonomie ; | ||
|
||
ALTER TABLE taxonomie.bib_attributs OWNER TO geonatatlas; | ||
GRANT ALL ON TABLE taxonomie.bib_attributs TO geonatatlas; | ||
|
||
CREATE MATERIALIZED VIEW atlas.vm_taxon_attribute AS | ||
SELECT cta.cd_ref, | ||
ba.nom_attribut AS code, | ||
ba.label_attribut AS title, | ||
CASE | ||
WHEN ba.type_attribut = 'text' AND ba.type_widget = 'select' | ||
THEN REPLACE(cta.valeur_attribut, '&', '|') | ||
ELSE cta.valeur_attribut | ||
END AS "value" | ||
FROM taxonomie.cor_taxon_attribut AS cta | ||
JOIN taxonomie.bib_attributs AS ba | ||
ON cta.id_attribut = ba.id_attribut | ||
WHERE ba.nom_attribut IN ('atlas_description', 'atlas_commentaire', 'atlas_milieu', 'atlas_chorologie') | ||
AND cta.valeur_attribut IS NOT NULL | ||
AND cta.valeur_attribut != '' ; | ||
|
||
CREATE UNIQUE INDEX ON atlas.vm_taxon_attribute (cd_ref, code); | ||
|
||
-- TODO: adapt taxonomie.bib_attributs owner if it's not default "geonatatlas" | ||
-- TOOD: adapt if necessary "ba.nom_attribut IN ('atlas_description', 'atlas_commentaire', 'atlas_milieu', 'atlas_chorologie')" | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters