diff --git a/atlas/atlasRoutes.py b/atlas/atlasRoutes.py index 21b95163d..fd3ca7bbd 100644 --- a/atlas/atlasRoutes.py +++ b/atlas/atlasRoutes.py @@ -31,6 +31,7 @@ vmMedias, vmCorTaxonAttribut, vmTaxonsMostView, + vmCorTaxonOrganism ) @@ -232,6 +233,7 @@ def ficheEspece(cd_nom): taxon = vmTaxrefRepository.searchEspece(connection, cd_ref) altitudes = vmAltitudesRepository.getAltitudesChilds(connection, cd_ref) months = vmMoisRepository.getMonthlyObservationsChilds(connection, cd_ref) + data_source_values = vmCorTaxonOrganism.getTaxonOrganism(connection, cd_ref) synonyme = vmTaxrefRepository.getSynonymy(connection, cd_ref) communes = vmCommunesRepository.getCommunesObservationsChilds(connection, cd_ref) taxonomyHierarchy = vmTaxrefRepository.getAllTaxonomy(db_session, cd_ref) @@ -274,6 +276,7 @@ def ficheEspece(cd_nom): cd_ref=cd_ref, altitudes=altitudes, months=months, + data_source_values=data_source_values, synonyme=synonyme, communes=communes, taxonomyHierarchy=taxonomyHierarchy, diff --git a/atlas/configuration/config_schema.py b/atlas/configuration/config_schema.py index e1e292cd1..e6dc1f857 100644 --- a/atlas/configuration/config_schema.py +++ b/atlas/configuration/config_schema.py @@ -139,6 +139,7 @@ class Meta: AFFICHAGE_RECHERCHE_AVANCEE = fields.Boolean(load_default=False) AFFICHAGE_GRAPH_ALTITUDES = fields.Boolean(load_default=True) AFFICHAGE_GRAPH_PHENOLOGIE = fields.Boolean(load_default=True) + AFFICHAGE_GRAPH_PROVENANCE_DONNEE = fields.Boolean(load_default=True) RANG_STAT = fields.List( fields.Dict, diff --git a/atlas/messages.pot b/atlas/messages.pot index c36bb800d..26628d782 100644 --- a/atlas/messages.pot +++ b/atlas/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-09-27 10:32+0200\n" +"POT-Creation-Date: 2024-12-02 12:01+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,470 +17,503 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.1\n" -#: static/custom/templates/bandeaulogoshome.html:6 -#: static/custom/templates/bandeaulogoshome.html.sample:6 +#: atlas/static/custom/templates/bandeaulogoshome.html:6 +#: atlas/static/custom/templates/bandeaulogoshome.html.sample:6 msgid "home.partners" msgstr "" -#: static/custom/templates/footer.html:2 -#: static/custom/templates/footer.html.sample:2 templates/home/_main.html:3 +#: atlas/static/custom/templates/footer.html:2 +#: atlas/static/custom/templates/footer.html.sample:2 +#: atlas/templates/home/_main.html:3 msgid "home" msgstr "" -#: static/custom/templates/footer.html:5 static/custom/templates/footer.html:29 -#: static/custom/templates/footer.html.sample:5 -#: static/custom/templates/footer.html.sample:29 +#: atlas/static/custom/templates/footer.html:5 +#: atlas/static/custom/templates/footer.html:30 +#: atlas/static/custom/templates/footer.html.sample:5 +#: atlas/static/custom/templates/footer.html.sample:29 msgid "credits" msgstr "" -#: static/custom/templates/footer.html:7 static/custom/templates/footer.html:46 -#: static/custom/templates/footer.html.sample:7 -#: static/custom/templates/footer.html.sample:46 +#: atlas/static/custom/templates/footer.html:7 +#: atlas/static/custom/templates/footer.html:47 +#: atlas/static/custom/templates/footer.html.sample:7 +#: atlas/static/custom/templates/footer.html.sample:46 msgid "legal" msgstr "" -#: static/custom/templates/footer.html:11 -#: static/custom/templates/footer.html:64 -#: static/custom/templates/footer.html.sample:11 -#: static/custom/templates/footer.html.sample:64 +#: atlas/static/custom/templates/footer.html:11 +#: atlas/static/custom/templates/footer.html:65 +#: atlas/static/custom/templates/footer.html.sample:11 +#: atlas/static/custom/templates/footer.html.sample:64 msgid "personal_data" msgstr "" -#: static/custom/templates/footer.html:17 -#: static/custom/templates/footer.html.sample:17 +#: atlas/static/custom/templates/footer.html:12 +msgid "preferences_cookies" +msgstr "" + +#: atlas/static/custom/templates/footer.html:18 +#: atlas/static/custom/templates/footer.html.sample:17 msgid "atlas.fauna.flora" msgstr "" -#: static/custom/templates/footer.html:17 -#: static/custom/templates/footer.html.sample:17 -#: static/custom/templates/introduction.html:7 -#: static/custom/templates/introduction.html.sample:7 +#: atlas/static/custom/templates/footer.html:18 +#: atlas/static/custom/templates/footer.html.sample:17 +#: atlas/static/custom/templates/introduction.html:7 +#: atlas/static/custom/templates/introduction.html.sample:7 msgid "from1" msgstr "" -#: static/custom/templates/footer.html:19 -#: static/custom/templates/footer.html.sample:19 +#: atlas/static/custom/templates/footer.html:20 +#: atlas/static/custom/templates/footer.html.sample:19 msgid "powered.by" msgstr "" -#: static/custom/templates/footer.html:19 -#: static/custom/templates/footer.html.sample:19 +#: atlas/static/custom/templates/footer.html:20 +#: atlas/static/custom/templates/footer.html.sample:19 msgid "developed.by" msgstr "" -#: static/custom/templates/footer.html:20 -#: static/custom/templates/footer.html.sample:20 +#: atlas/static/custom/templates/footer.html:21 +#: atlas/static/custom/templates/footer.html.sample:20 msgid "ecrins.national.park" msgstr "" -#: static/custom/templates/introduction.html:6 -#: static/custom/templates/introduction.html.sample:6 +#: atlas/static/custom/templates/introduction.html:6 +#: atlas/static/custom/templates/introduction.html.sample:6 msgid "welcome.message" msgstr "" -#: static/custom/templates/introduction.html:7 -#: static/custom/templates/introduction.html.sample:7 +#: atlas/static/custom/templates/introduction.html:7 +#: atlas/static/custom/templates/introduction.html.sample:7 msgid "from2" msgstr "" -#: static/custom/templates/introduction.html:7 -#: static/custom/templates/introduction.html.sample:7 +#: atlas/static/custom/templates/introduction.html:7 +#: atlas/static/custom/templates/introduction.html.sample:7 msgid "from3" msgstr "" -#: static/custom/templates/introduction.html:7 -#: static/custom/templates/introduction.html.sample:7 +#: atlas/static/custom/templates/introduction.html:7 +#: atlas/static/custom/templates/introduction.html.sample:7 msgid "from4" msgstr "" -#: static/custom/templates/introduction.html:7 -#: static/custom/templates/introduction.html.sample:7 +#: atlas/static/custom/templates/introduction.html:7 +#: atlas/static/custom/templates/introduction.html.sample:7 msgid "from5" msgstr "" -#: static/custom/templates/introduction.html:11 -#: static/custom/templates/introduction.html.sample:11 +#: atlas/static/custom/templates/introduction.html:11 +#: atlas/static/custom/templates/introduction.html.sample:11 msgid "home.introduction.message" msgstr "" -#: static/custom/templates/navbar.html:34 -#: static/custom/templates/navbar.html.sample:34 -#: templates/home/globalStats.html:35 templates/photoGalery/_main.html:77 +#: atlas/static/custom/templates/navbar.html:34 +#: atlas/static/custom/templates/navbar.html.sample:34 +#: atlas/templates/home/globalStats.html:35 +#: atlas/templates/photoGalery/_main.html:77 msgid "search.species" msgstr "" -#: static/custom/templates/navbar.html:47 -#: static/custom/templates/navbar.html.sample:47 -#: templates/home/globalStats.html:55 +#: atlas/static/custom/templates/navbar.html:47 +#: atlas/static/custom/templates/navbar.html.sample:47 +#: atlas/templates/home/globalStats.html:55 msgid "search.city" msgstr "" -#: static/custom/templates/presentation.html:4 -#: static/custom/templates/presentation.html.sample:4 +#: atlas/static/custom/templates/presentation.html:4 +#: atlas/static/custom/templates/presentation.html.sample:4 msgid "atlas.presentation" msgstr "" -#: templates/areaSheet/_main.html:6 templates/areaSheet/_main.html:59 +#: atlas/templates/areaSheet/_main.html:6 +#: atlas/templates/areaSheet/_main.html:59 msgid "municipality.of" msgstr "" -#: templates/areaSheet/_main.html:70 +#: atlas/templates/areaSheet/_main.html:70 msgid "last.obs.municipality" msgstr "" -#: templates/areaSheet/_main.html:73 +#: atlas/templates/areaSheet/_main.html:73 msgid "last.obs.zone" msgstr "" -#: templates/areaSheet/surrounding_areas.html:10 +#: atlas/templates/areaSheet/surrounding_areas.html:10 msgid "associate.zone" msgstr "" -#: templates/areaSheet/surrounding_areas.html:23 +#: atlas/templates/areaSheet/surrounding_areas.html:23 msgid "check.area.sheet" msgstr "" -#: templates/core/advanced_search.html:4 -#: templates/core/advanced_search.html:382 templates/core/sideBar.html:30 +#: atlas/templates/core/advanced_search.html:4 +#: atlas/templates/core/advanced_search.html:382 +#: atlas/templates/core/sideBar.html:30 msgid "advanced_search" msgstr "" -#: templates/core/advanced_search.html:350 +#: atlas/templates/core/advanced_search.html:350 msgid "information" msgstr "" -#: templates/core/advanced_search.html:351 -#: templates/core/advanced_search.html:361 +#: atlas/templates/core/advanced_search.html:351 +#: atlas/templates/core/advanced_search.html:361 msgid "close" msgstr "" -#: templates/core/advanced_search.html:357 +#: atlas/templates/core/advanced_search.html:357 msgid "asearch.information" msgstr "" -#: templates/core/advanced_search.html:373 +#: atlas/templates/core/advanced_search.html:373 msgid "page.information" msgstr "" -#: templates/core/advanced_search.html:385 -#: templates/core/advanced_search.html:408 +#: atlas/templates/core/advanced_search.html:385 +#: atlas/templates/core/advanced_search.html:408 msgid "asearch.max" msgstr "" -#: templates/core/advanced_search.html:392 +#: atlas/templates/core/advanced_search.html:392 msgid "asearch.search.species" msgstr "" -#: templates/core/advanced_search.html:395 +#: atlas/templates/core/advanced_search.html:395 msgid "asearch.search.start" msgstr "" -#: templates/core/advanced_search.html:419 +#: atlas/templates/core/advanced_search.html:419 msgid "asearch.remove.selection" msgstr "" -#: templates/core/advanced_search.html:427 templates/core/listTaxons.html:87 -#: templates/home/lastObs.html:44 templates/home/mostViewNow.html:33 -#: templates/home/newSpecies.html:45 templates/home/taxoRank.html:61 -#: templates/organismSheet/topSpecies.html:67 +#: atlas/templates/core/advanced_search.html:427 +#: atlas/templates/core/listTaxons.html:87 atlas/templates/home/lastObs.html:44 +#: atlas/templates/home/mostViewNow.html:33 +#: atlas/templates/home/newSpecies.html:45 +#: atlas/templates/home/taxoRank.html:61 +#: atlas/templates/organismSheet/topSpecies.html:67 msgid "species.sheet" msgstr "" -#: templates/core/advanced_search.html:429 templates/core/listTaxons.html:86 -#: templates/core/tabTaxons.html:87 templates/organismSheet/topSpecies.html:66 -#: templates/speciesSheet/identityCard.html:180 +#: atlas/templates/core/advanced_search.html:429 +#: atlas/templates/core/listTaxons.html:86 +#: atlas/templates/core/tabTaxons.html:87 +#: atlas/templates/organismSheet/topSpecies.html:66 +#: atlas/templates/speciesSheet/identityCard.html:180 msgid "check.species.sheet" msgstr "" -#: templates/core/extended_areas_search.html:13 +#: atlas/templates/core/extended_areas_search.html:13 msgid "search.other.zones.type" msgstr "" -#: templates/core/listTaxons.html:14 +#: atlas/templates/core/listTaxons.html:14 msgid "filter.species" msgstr "" -#: templates/core/listTaxons.html:23 +#: atlas/templates/core/listTaxons.html:23 msgid "display.municipality.obs" msgstr "" -#: templates/core/listTaxons.html:49 templates/core/tabTaxons.html:62 -#: templates/organismSheet/topSpecies.html:36 -#: templates/speciesSheet/identityCard.html:64 -#: templates/speciesSheet/identityCard.html:158 +#: atlas/templates/core/listTaxons.html:49 +#: atlas/templates/core/tabTaxons.html:62 +#: atlas/templates/organismSheet/topSpecies.html:36 +#: atlas/templates/speciesSheet/identityCard.html:64 +#: atlas/templates/speciesSheet/identityCard.html:158 msgid "this.taxon.has.a.protected.status" msgstr "" -#: templates/core/listTaxons.html:80 templates/core/statHierarchy.html:7 -#: templates/organismSheet/topSpecies.html:61 -#: templates/speciesSheet/map.html:15 -#: templates/speciesSheet/otherInformations.html:144 +#: atlas/templates/core/listTaxons.html:80 +#: atlas/templates/core/statHierarchy.html:7 +#: atlas/templates/organismSheet/topSpecies.html:61 +#: atlas/templates/speciesSheet/map.html:15 +#: atlas/templates/speciesSheet/otherInformations.html:144 msgid "observation" msgstr "" -#: templates/core/listTaxons.html:81 templates/core/statHierarchy.html:7 -#: templates/core/tabTaxons.html:19 templates/home/globalStats.html:16 -#: templates/organismSheet/statsInfos.html:11 -#: templates/organismSheet/topSpecies.html:61 -#: templates/speciesSheet/identityCard.html:135 -#: templates/speciesSheet/map.html:15 -#: templates/speciesSheet/otherInformations.html:142 +#: atlas/templates/core/listTaxons.html:81 +#: atlas/templates/core/statHierarchy.html:7 +#: atlas/templates/core/tabTaxons.html:19 +#: atlas/templates/home/globalStats.html:16 +#: atlas/templates/organismSheet/statsInfos.html:11 +#: atlas/templates/organismSheet/topSpecies.html:61 +#: atlas/templates/speciesSheet/identityCard.html:135 +#: atlas/templates/speciesSheet/map.html:15 +#: atlas/templates/speciesSheet/otherInformations.html:142 msgid "observations" msgstr "" -#: templates/core/listTaxons.html:82 +#: atlas/templates/core/listTaxons.html:82 msgid "last.obs.in" msgstr "" -#: templates/core/loaderSpinner.html:3 +#: atlas/templates/core/loaderSpinner.html:3 msgid "loading" msgstr "" -#: templates/core/sideBar.html:3 +#: atlas/templates/core/sideBar.html:3 msgid "back.to.home" msgstr "" -#: templates/core/sideBar.html:35 templates/home/globalStats.html:68 -#: templates/photoGalery/_main.html:5 templates/photoGalery/_main.html:51 +#: atlas/templates/core/sideBar.html:35 +#: atlas/templates/home/globalStats.html:68 +#: atlas/templates/photoGalery/_main.html:5 +#: atlas/templates/photoGalery/_main.html:51 msgid "gallery.title" msgstr "" -#: templates/core/statHierarchy.html:12 templates/home/globalStats.html:28 -#: templates/home/taxoRank.html:32 templates/organismSheet/statsInfos.html:21 +#: atlas/templates/core/statHierarchy.html:12 +#: atlas/templates/home/globalStats.html:28 +#: atlas/templates/home/taxoRank.html:32 +#: atlas/templates/organismSheet/statsInfos.html:21 msgid "species" msgstr "" -#: templates/core/statHierarchy.html:17 templates/speciesSheet/map.html:25 -#: templates/speciesSheet/otherInformations.html:28 +#: atlas/templates/core/statHierarchy.html:17 +#: atlas/templates/speciesSheet/map.html:25 +#: atlas/templates/speciesSheet/otherInformations.html:28 msgid "observers" msgstr "" -#: templates/core/statHierarchy.html:17 templates/speciesSheet/map.html:25 -#: templates/speciesSheet/otherInformations.html:28 +#: atlas/templates/core/statHierarchy.html:17 +#: atlas/templates/speciesSheet/map.html:25 +#: atlas/templates/speciesSheet/otherInformations.html:28 msgid "observer" msgstr "" -#: templates/core/tabTaxons.html:7 +#: atlas/templates/core/tabTaxons.html:7 msgid "group" msgstr "" -#: templates/core/tabTaxons.html:8 templates/speciesSheet/identityCard.html:128 +#: atlas/templates/core/tabTaxons.html:8 +#: atlas/templates/speciesSheet/identityCard.html:128 msgid "scientific.name" msgstr "" -#: templates/core/tabTaxons.html:9 templates/speciesSheet/identityCard.html:127 +#: atlas/templates/core/tabTaxons.html:9 +#: atlas/templates/speciesSheet/identityCard.html:127 msgid "common.name" msgstr "" -#: templates/core/tabTaxons.html:16 +#: atlas/templates/core/tabTaxons.html:16 msgid "obs.number.s" msgstr "" -#: templates/core/tabTaxons.html:17 templates/speciesSheet/map.html:38 +#: atlas/templates/core/tabTaxons.html:17 +#: atlas/templates/speciesSheet/map.html:38 msgid "last.obs" msgstr "" -#: templates/core/tabTaxons.html:21 -#: templates/speciesSheet/identityCard.html:136 +#: atlas/templates/core/tabTaxons.html:21 +#: atlas/templates/speciesSheet/identityCard.html:136 msgid "sheet" msgstr "" -#: templates/core/tabTaxons.html:82 +#: atlas/templates/core/tabTaxons.html:82 msgid "display.city.infos" msgstr "" -#: templates/home/globalStats.html:4 +#: atlas/templates/home/globalStats.html:4 msgid "home.insomefigures" msgstr "" -#: templates/home/globalStats.html:18 +#: atlas/templates/home/globalStats.html:18 msgid "home.seelatestobs" msgstr "" -#: templates/home/globalStats.html:47 templates/speciesSheet/map.html:20 -#: templates/speciesSheet/otherInformations.html:10 -#: templates/speciesSheet/otherInformations.html:14 +#: atlas/templates/home/globalStats.html:47 +#: atlas/templates/speciesSheet/map.html:20 +#: atlas/templates/speciesSheet/otherInformations.html:10 +#: atlas/templates/speciesSheet/otherInformations.html:14 msgid "municipalities" msgstr "" -#: templates/home/globalStats.html:67 +#: atlas/templates/home/globalStats.html:67 msgid "photos" msgstr "" -#: templates/home/mostViewNow.html:5 +#: atlas/templates/home/mostViewNow.html:5 msgid "see.at.the.moment" msgstr "" -#: templates/home/mostViewNow.html:7 +#: atlas/templates/home/mostViewNow.html:7 msgid "species.most.obs.last.15.days" msgstr "" -#: templates/home/newSpecies.html:10 +#: atlas/templates/home/newSpecies.html:10 msgid "new.species.observed" msgstr "" -#: templates/home/taxoRank.html:8 +#: atlas/templates/home/taxoRank.html:8 msgid "species.to.discover" msgstr "" -#: templates/organismSheet/blocInfos.html:4 +#: atlas/templates/organismSheet/blocInfos.html:4 msgid "other.informations" msgstr "" -#: templates/organismSheet/groupChart.html:3 +#: atlas/templates/organismSheet/groupChart.html:3 msgid "part.graph" msgstr "" -#: templates/organismSheet/identityCard.html:20 +#: atlas/templates/organismSheet/identityCard.html:20 msgid "Adresse" msgstr "" -#: templates/organismSheet/identityCard.html:21 +#: atlas/templates/organismSheet/identityCard.html:21 msgid "Téléphone" msgstr "" -#: templates/organismSheet/identityCard.html:22 +#: atlas/templates/organismSheet/identityCard.html:22 msgid "Email" msgstr "" -#: templates/organismSheet/identityCard.html:23 +#: atlas/templates/organismSheet/identityCard.html:23 msgid "Site" msgstr "" -#: templates/organismSheet/mapObs.html:5 +#: atlas/templates/organismSheet/mapObs.html:5 msgid "map.observations" msgstr "" -#: templates/organismSheet/statsInfos.html:4 +#: atlas/templates/organismSheet/statsInfos.html:4 msgid "organism.stats" msgstr "" -#: templates/organismSheet/statsInfos.html:16 +#: atlas/templates/organismSheet/statsInfos.html:16 msgid "atlas.participation" msgstr "" -#: templates/organismSheet/topSpecies.html:5 +#: atlas/templates/organismSheet/topSpecies.html:5 msgid "top.species" msgstr "" -#: templates/organismSheet/topSpecies.html:62 +#: atlas/templates/organismSheet/topSpecies.html:62 msgid "from.organism.observations" msgstr "" -#: templates/photoGalery/_main.html:65 templates/photoGalery/_main.html:66 +#: atlas/templates/photoGalery/_main.html:65 +#: atlas/templates/photoGalery/_main.html:66 msgid "all.groups" msgstr "" -#: templates/photoGalery/_main.html:71 +#: atlas/templates/photoGalery/_main.html:71 msgid "order.photos" msgstr "" -#: templates/speciesSheet/audioVideo.html:7 +#: atlas/templates/speciesSheet/audioVideo.html:7 msgid "Video" msgstr "" -#: templates/speciesSheet/blocInfos.html:11 +#: atlas/templates/speciesSheet/blocInfos.html:11 msgid "species.infos" msgstr "" -#: templates/speciesSheet/blocInfos.html:14 -#: templates/speciesSheet/descriptionMedia.html:16 -#: templates/speciesSheet/otherInformations.html:69 +#: atlas/templates/speciesSheet/blocInfos.html:14 +#: atlas/templates/speciesSheet/descriptionMedia.html:16 +#: atlas/templates/speciesSheet/otherInformations.html:69 msgid "description" msgstr "" -#: templates/speciesSheet/blocInfos.html:17 +#: atlas/templates/speciesSheet/blocInfos.html:17 msgid "read.more" msgstr "" -#: templates/speciesSheet/blocInfos.html:19 +#: atlas/templates/speciesSheet/blocInfos.html:19 msgid "environment" msgstr "" -#: templates/speciesSheet/blocInfos.html:20 +#: atlas/templates/speciesSheet/blocInfos.html:20 msgid "repartition" msgstr "" -#: templates/speciesSheet/blocInfos.html:21 +#: atlas/templates/speciesSheet/blocInfos.html:21 msgid "synonyms" msgstr "" -#: templates/speciesSheet/blocInfos.html:27 -#: templates/speciesSheet/blocInfos.html:39 -#: templates/speciesSheet/blocInfos.html:46 +#: atlas/templates/speciesSheet/blocInfos.html:27 +#: atlas/templates/speciesSheet/blocInfos.html:39 +#: atlas/templates/speciesSheet/blocInfos.html:46 msgid "not.resigned.for.the.moment" msgstr "" -#: templates/speciesSheet/blocInfos.html:53 +#: atlas/templates/speciesSheet/blocInfos.html:53 msgid "no.synonym.for.this.taxon" msgstr "" -#: templates/speciesSheet/charts.html:4 +#: atlas/templates/speciesSheet/charts.html:4 msgid "alt.classes.obs" msgstr "" -#: templates/speciesSheet/charts.html:10 +#: atlas/templates/speciesSheet/charts.html:10 msgid "monthly.obs" msgstr "" -#: templates/speciesSheet/descriptionMedia.html:12 -#: templates/speciesSheet/otherInformations.html:42 +#: atlas/templates/speciesSheet/charts.html:16 +msgid "data.source" +msgstr "" + +#: atlas/templates/speciesSheet/descriptionMedia.html:12 +#: atlas/templates/speciesSheet/otherInformations.html:42 msgid "author" msgstr "" -#: templates/speciesSheet/identityCard.html:97 +#: atlas/templates/speciesSheet/identityCard.html:97 msgid "check.species.sheet.inpn" msgstr "" -#: templates/speciesSheet/identityCard.html:130 +#: atlas/templates/speciesSheet/identityCard.html:130 msgid "protection" msgstr "" -#: templates/speciesSheet/map.html:20 -#: templates/speciesSheet/otherInformations.html:10 -#: templates/speciesSheet/otherInformations.html:14 +#: atlas/templates/speciesSheet/map.html:20 +#: atlas/templates/speciesSheet/otherInformations.html:10 +#: atlas/templates/speciesSheet/otherInformations.html:14 msgid "municipality" msgstr "" -#: templates/speciesSheet/map.html:29 -#: templates/speciesSheet/otherInformations.html:21 +#: atlas/templates/speciesSheet/map.html:29 +#: atlas/templates/speciesSheet/otherInformations.html:21 msgid "organisms" msgstr "" -#: templates/speciesSheet/map.html:29 -#: templates/speciesSheet/otherInformations.html:21 +#: atlas/templates/speciesSheet/map.html:29 +#: atlas/templates/speciesSheet/otherInformations.html:21 msgid "organism" msgstr "" -#: templates/speciesSheet/map.html:34 +#: atlas/templates/speciesSheet/map.html:34 msgid "first.obs" msgstr "" -#: templates/speciesSheet/otherInformations.html:41 +#: atlas/templates/speciesSheet/otherInformations.html:41 msgid "title" msgstr "" -#: templates/speciesSheet/otherInformations.html:71 +#: atlas/templates/speciesSheet/otherInformations.html:71 msgid "date" msgstr "" -#: templates/speciesSheet/otherInformations.html:139 +#: atlas/templates/speciesSheet/otherInformations.html:139 msgid "organism.participation" msgstr "" -#: templates/speciesSheet/otherInformations.html:147 +#: atlas/templates/speciesSheet/otherInformations.html:147 msgid "organism.prospection" msgstr "" -#: templates/speciesSheet/otherInformations.html:153 +#: atlas/templates/speciesSheet/otherInformations.html:153 msgid "check.organism.sheet" msgstr "" -#: templates/speciesSheet/otherInformations.html:154 +#: atlas/templates/speciesSheet/otherInformations.html:154 msgid "organism.sheet" msgstr "" -#: templates/taxoRankSheet/_main.html:47 +#: atlas/templates/taxoRankSheet/_main.html:47 msgid "species.obs.for.tax" msgstr "" diff --git a/atlas/modeles/repositories/vmCorTaxonOrganism.py b/atlas/modeles/repositories/vmCorTaxonOrganism.py new file mode 100644 index 000000000..6c246d6a6 --- /dev/null +++ b/atlas/modeles/repositories/vmCorTaxonOrganism.py @@ -0,0 +1,20 @@ +# -*- coding:utf-8 -*- + +from sqlalchemy.sql import text + + +def getTaxonOrganism(connection, cd_ref): + sql = """ + select nom_organism, nb_observations + from atlas.vm_cor_taxon_organism + where cd_ref = :cdref + """ + result = connection.execute( + text(sql), + cdref=cd_ref + ) + + taxon_orga = {} + for elem in result: + taxon_orga.update({elem[0]: elem[1]}) + return taxon_orga diff --git a/atlas/static/chart.js b/atlas/static/chart.js index 57b546786..8ee296b16 100644 --- a/atlas/static/chart.js +++ b/atlas/static/chart.js @@ -1,6 +1,7 @@ // ChartJS Graphs const chartMainColor = getComputedStyle(document.documentElement).getPropertyValue('--main-color'); -const chartHoverMainColor = getComputedStyle(document.documentElement).getPropertyValue('--second-color'); +const chartSecondColor = getComputedStyle(document.documentElement).getPropertyValue('--second-color'); +const chartThirdColor = getComputedStyle(document.documentElement).getPropertyValue('--third-color'); const getChartDatas = function (data, key) { let values = []; @@ -20,7 +21,7 @@ genericChart = function (element, labels, values) { label: 'observations', data: values, backgroundColor: chartMainColor, - hoverBackgroundColor: chartHoverMainColor, + hoverBackgroundColor: chartSecondColor, borderWidth: 0 }] }, @@ -48,8 +49,86 @@ genericChart = function (element, labels, values) { }); }; +pieChartConfig = function (element, data) { + return new Chart(element, { + type: 'doughnut', + data: data, + options: { + responsive: true, + cutout: "30%", + maintainAspectRatio: false, + plugins: { + legend: { + position: 'top', + }, + title: { + display: false, + text: 'Graphique des provenances de données' + } + } + } + }) +} + +function getPieEndColor(index, isLastElem) { + // To change color if last element will have the same color to first element + if (isLastElem && index % 3 === 0) { + index++ + } + + if (index % 3 === 0) { + return chartMainColor + } else if (index % 3 === 1) { + return chartSecondColor + } + return chartThirdColor +} + +function formatPieData(data) { + let labels = [] + let data_count = [] + Object.keys(data).forEach(key => { + labels.push(key) + data_count.push(data[key]) + }) + + const element = document.getElementById("data-source"); + const context2d = element.getContext("2d"); + + return { + labels: labels, + datasets: [ + { + label: 'Dataset 1', + data: data_count, + backgroundColor: context => { + console.log(context.index) + if (context.element.x && context.element.y) { + const grad = context2d.createRadialGradient( + context.element.x, + context.element.y, + context.element.innerRadius, + context.element.x, + context.element.y, + context.element.outerRadius); + const isLastElem = context.index === data_count.length - 1 + + grad.addColorStop(0, chartMainColor); + grad.addColorStop(1, getPieEndColor(context.index, isLastElem)); + return grad + } + }, + hoverOffset: 25 + } + ] + } +} + var monthChartElement = document.getElementById('monthChart'); const monthChart = genericChart(monthChartElement, months_name, getChartDatas(months_value, 'value')); var altiChartElement = document.getElementById('altiChart'); const altiChart = genericChart(altiChartElement, getChartDatas(dataset, 'altitude'), getChartDatas(dataset, 'value')); + +const dataSourceChartElement = document.getElementById('data-source'); +pieChartConfig(dataSourceChartElement, formatPieData(data_source_values)); diff --git a/atlas/static/css/atlas.css b/atlas/static/css/atlas.css index 0513c98d0..515d12f89 100644 --- a/atlas/static/css/atlas.css +++ b/atlas/static/css/atlas.css @@ -1,6 +1,7 @@ :root { --main-color: #c3b528; --second-color: #5a7526; + --third-color: #2c410a; --map-maille-border-color: #ddd; --map-maille-lastobs-border-color: #c218d0; --map-territory-border-color: #333; diff --git a/atlas/templates/speciesSheet/_main.html b/atlas/templates/speciesSheet/_main.html index 08715e684..eec6b8caa 100644 --- a/atlas/templates/speciesSheet/_main.html +++ b/atlas/templates/speciesSheet/_main.html @@ -41,7 +41,9 @@ var months_name = {{ configuration.AVAILABLE_LANGUAGES[g.lang_code]['months'] | tojson }}; {% else %} var months_name = {{ configuration.AVAILABLE_LANGUAGES[configuration.DEFAULT_LANGUAGE]['months'] | tojson }}; - + {% endif %} + {% if configuration.AFFICHAGE_GRAPH_PROVENANCE_DONNEE %} + var data_source_values = {{ data_source_values | tojson}}; {% endif %} var observationsPoint = []; var observationsMaille = []; diff --git a/atlas/templates/speciesSheet/charts.html b/atlas/templates/speciesSheet/charts.html index f12648a20..30d519439 100644 --- a/atlas/templates/speciesSheet/charts.html +++ b/atlas/templates/speciesSheet/charts.html @@ -12,5 +12,11 @@

{{ _('monthly.obs') }}

{% endif %} + {% if configuration.AFFICHAGE_GRAPH_PROVENANCE_DONNEE %} +

{{ _('data.source') }}

+
+ +
+ {% endif %} {% endblock %} diff --git a/atlas/translations/en/LC_MESSAGES/messages.mo b/atlas/translations/en/LC_MESSAGES/messages.mo index 39dcdca50..936f5d462 100644 Binary files a/atlas/translations/en/LC_MESSAGES/messages.mo and b/atlas/translations/en/LC_MESSAGES/messages.mo differ diff --git a/atlas/translations/en/LC_MESSAGES/messages.po b/atlas/translations/en/LC_MESSAGES/messages.po index 8b6ec8e66..b7a12ad7a 100644 --- a/atlas/translations/en/LC_MESSAGES/messages.po +++ b/atlas/translations/en/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-09-27 10:32+0200\n" +"POT-Creation-Date: 2024-12-02 12:01+0100\n" "PO-Revision-Date: 2021-07-12 12:12+0200\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -436,6 +436,10 @@ msgstr "Observations by altitude class" msgid "monthly.obs" msgstr "Monthly observations" +#: atlas/templates/speciesSheet/charts.html:16 +msgid "data.source" +msgstr "Data provenance graph" + #: templates/speciesSheet/descriptionMedia.html:12 #: templates/speciesSheet/otherInformations.html:42 msgid "author" diff --git a/atlas/translations/fr/LC_MESSAGES/messages.mo b/atlas/translations/fr/LC_MESSAGES/messages.mo index 388a3706a..d1b4271a1 100644 Binary files a/atlas/translations/fr/LC_MESSAGES/messages.mo and b/atlas/translations/fr/LC_MESSAGES/messages.mo differ diff --git a/atlas/translations/fr/LC_MESSAGES/messages.po b/atlas/translations/fr/LC_MESSAGES/messages.po index 0c0ede54e..189a1220d 100644 --- a/atlas/translations/fr/LC_MESSAGES/messages.po +++ b/atlas/translations/fr/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-09-27 10:32+0200\n" +"POT-Creation-Date: 2024-12-02 12:01+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language: fr\n" @@ -438,6 +438,10 @@ msgstr "Observations par classes d'altitudes" msgid "monthly.obs" msgstr "Observations mensuelles" +#: templates/speciesSheet/charts.html:16 +msgid "data.source" +msgstr "Graphique de provenance des données" + #: templates/speciesSheet/descriptionMedia.html:12 #: templates/speciesSheet/otherInformations.html:42 msgid "author" diff --git a/atlas/translations/it/LC_MESSAGES/messages.mo b/atlas/translations/it/LC_MESSAGES/messages.mo index f23daef27..e28585f4b 100644 Binary files a/atlas/translations/it/LC_MESSAGES/messages.mo and b/atlas/translations/it/LC_MESSAGES/messages.mo differ diff --git a/atlas/translations/it/LC_MESSAGES/messages.po b/atlas/translations/it/LC_MESSAGES/messages.po index 9dcd3d1c7..73a9d72c9 100644 --- a/atlas/translations/it/LC_MESSAGES/messages.po +++ b/atlas/translations/it/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-09-27 10:32+0200\n" +"POT-Creation-Date: 2024-12-02 12:01+0100\n" "PO-Revision-Date: 2021-07-19 09:53+0200\n" "Last-Translator: FULL NAME \n" "Language: it\n" @@ -437,6 +437,10 @@ msgstr "Osservazioni per classi di altitudine" msgid "monthly.obs" msgstr "Osservazioni mensili" +#: atlas/templates/speciesSheet/charts.html:16 +msgid "data.source" +msgstr "Grafico della provenienza dei dati" + #: templates/speciesSheet/descriptionMedia.html:12 #: templates/speciesSheet/otherInformations.html:42 msgid "author" diff --git a/docs/changelog.rst b/docs/changelog.rst index ac203698d..76f42eb1f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -9,6 +9,7 @@ CHANGELOG - Ajout du lien "Données personelles" dans le pied de page (#527 @juggler31) - Suppression du support des installations sans TaxHub +- Ajout d'un graphique de provenance des données (#538) 🐛 **Corrections**