Skip to content

Commit

Permalink
Merge pull request #152 from Georiviere/feat_add_watershed_portals
Browse files Browse the repository at this point in the history
✨ Add watershed types portals
  • Loading branch information
LePetitTim authored Aug 4, 2023
2 parents bdbb880 + 62bbaa4 commit 24c1a97
Show file tree
Hide file tree
Showing 15 changed files with 245 additions and 80 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ CHANGELOG
* Add linked objects on contributions
* Add portal SEO informations
* Add min zoom, max zoom extent portal
* Add public portals on watershed types allowing to publish them


1.1.0 (2023-13-06)
Expand Down
52 changes: 52 additions & 0 deletions docs/install/advanced_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,55 @@ Some settings come from Geotrek-admin or Mapentity, on which Georiviere is based
* `Map layers colors and style <https://geotrek.readthedocs.io/en/master/advanced-configuration.html#map-layers-colors-and-style>`_

See `Geotrek-admin documentation <https://geotrek.readthedocs.io/en/master/advanced-configuration.html>`_ for further information.


Override translations
---------------------

You can override default translation files available in each module

Don't edit these default files, use them to find which words you want to override.

Create the custom translations destination folder:

Create a ``django.po`` file in ``var/conf/extra_locale`` directory.
You can do one folder and one ``django.po`` file for each language
(example ``var/conf/extra_locale/fr/LC_MESSAGES/django.po`` for French translation overriding)

Override the translations that you want in these files.

Example of content for the French translation overriding:

::

# MY FRENCH CUSTOM TRANSLATION
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-15 15:32+0200\n"
"PO-Revision-Date: 2018-11-15 15:33+0100\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Project-Id-Verésion: PACKAGE VERSION\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Project-Id-Version: \n"
"X-Generator: Poedit 1.5.4\n"

msgid "City"
msgstr "Région"

msgid "District"
msgstr "Pays"

Apply changes (French translation in this example) :

::

sudo docker-compose run --rm web update.sh
39 changes: 32 additions & 7 deletions georiviere/contribution/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-25 12:41+0000\n"
"POT-Creation-Date: 2023-07-31 13:06+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -42,6 +42,9 @@ msgstr ""
msgid "Type"
msgstr ""

msgid "Linked object"
msgstr ""

msgid "Label"
msgstr ""

Expand Down Expand Up @@ -75,6 +78,12 @@ msgstr ""
msgid "Description of the contribution"
msgstr ""

msgid "Published"
msgstr ""

msgid "Make it visible on portal"
msgstr ""

msgid "Portal"
msgstr ""

Expand All @@ -96,7 +105,8 @@ msgstr ""
msgid "No category"
msgstr ""

msgid "Published"
#, python-brace-format
msgid "Feedback from {email}"
msgstr ""

msgid "Contribution potential damage type"
Expand Down Expand Up @@ -150,16 +160,16 @@ msgstr ""
msgid "Landing type"
msgstr ""

msgid "Excessive cutting length in meters"
msgid "Excessive cutting length (in meters)"
msgstr ""

msgid "Length bank erosion"
msgid "Length bank erosion (in meters)"
msgstr ""

msgid "Distance between the foot of the bank and the foot of the erosion."
msgstr ""

msgid "Bank height"
msgid "Bank height (in meters)"
msgstr ""

msgid ""
Expand Down Expand Up @@ -194,10 +204,10 @@ msgstr ""
msgid "Fish species"
msgstr ""

msgid "Home area"
msgid "Home area (in square meters)"
msgstr ""

msgid "Home area in meters"
msgid "Home area in square meters"
msgstr ""

msgid "Number heritage species"
Expand Down Expand Up @@ -310,3 +320,18 @@ msgstr ""

msgid "None"
msgstr ""

#, python-format
msgid "%(email)s has sent a contribution."
msgstr ""

#, python-format
msgid "Severity : %(severity)s"
msgstr ""

#, python-format
msgid ""
"\n"
"Lat : %(lat)s / Lon : %(lng)s\n"
"http://www.openstreetmap.org/?mlat=%(lat)s&mlon=%(lng)s\n"
msgstr ""
52 changes: 39 additions & 13 deletions georiviere/contribution/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-25 12:41+0000\n"
"POT-Creation-Date: 2023-07-31 13:06+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -42,6 +42,9 @@ msgstr "Catégorie"
msgid "Type"
msgstr "Type"

msgid "Linked object"
msgstr "Objet lié"

msgid "Label"
msgstr "Label"

Expand Down Expand Up @@ -75,6 +78,12 @@ msgstr "Description"
msgid "Description of the contribution"
msgstr "Description de la gravité"

msgid "Published"
msgstr "Publié"

msgid "Make it visible on portal"
msgstr "Rendre visible sur le portail"

msgid "Portal"
msgstr "Portail"

Expand All @@ -96,8 +105,9 @@ msgstr "Nom"
msgid "No category"
msgstr "Aucune catégorie"

msgid "Published"
msgstr "Publié"
#, python-brace-format
msgid "Feedback from {email}"
msgstr "Retour utilisateur depuis {email}"

msgid "Contribution potential damage type"
msgstr "Type de contibution dégats potentiels"
Expand Down Expand Up @@ -150,17 +160,17 @@ msgstr "Piétinement par le bétail (impactant)"
msgid "Landing type"
msgstr "Type d'atterrissement"

msgid "Excessive cutting length in meters"
msgstr "Longueur coupe abusive en mètres"
msgid "Excessive cutting length (in meters)"
msgstr "Longueur coupe abusive (en mètres)"

msgid "Length bank erosion"
msgstr "Longueur de l'érosion de la berge"
msgid "Length bank erosion (in meters)"
msgstr "Longueur de l'érosion de la berge (en mètres)"

msgid "Distance between the foot of the bank and the foot of the erosion."
msgstr "Distance entre le pied de berge et le pied de l'érosion"

msgid "Bank height"
msgstr "Hauteur de berge"
msgid "Bank height (in meters)"
msgstr "Hauteur de berge (en mètres)"

msgid ""
"Bank height (measured between the foot of the bank and the top of the bank) "
Expand Down Expand Up @@ -194,11 +204,11 @@ msgstr "Observations patrimoniale"
msgid "Fish species"
msgstr "Espèce piscicole"

msgid "Home area"
msgstr "Surface du foyer"
msgid "Home area (in square meters)"
msgstr "Surface du foyer (en mètres carrés)"

msgid "Home area in meters"
msgstr "Surface du foyer en mètres"
msgid "Home area in square meters"
msgstr "Surface du foyer en mètres carrés"

msgid "Number heritage species"
msgstr "Nombre d'individus patrimoniale"
Expand Down Expand Up @@ -310,3 +320,19 @@ msgstr "Connaissance"

msgid "None"
msgstr "Aucun"

#, python-format
msgid "%(email)s has sent a contribution."
msgstr "%(email)s has sent a contribution."

#, python-format
#| msgid "Severity types"
msgid "Severity : %(severity)s"
msgstr "Sévérité : %(severity)s"

#, python-format
msgid ""
"\n"
"Lat : %(lat)s / Lon : %(lng)s\n"
"http://www.openstreetmap.org/?mlat=%(lat)s&mlon=%(lng)s\n"
msgstr ""
33 changes: 33 additions & 0 deletions georiviere/contribution/migrations/0008_auto_20230731_1304.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 3.1.14 on 2023-07-31 13:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('contribution', '0007_auto_20230725_1541'),
]

operations = [
migrations.AlterField(
model_name='contributionfaunaflora',
name='home_area',
field=models.FloatField(blank=True, default=0.0, help_text='Home area in square meters', null=True, verbose_name='Home area (in square meters)'),
),
migrations.AlterField(
model_name='contributionpotentialdamage',
name='bank_height',
field=models.FloatField(blank=True, default=0.0, help_text='Bank height (measured between the foot of the bank and the top of the bank) in meters', null=True, verbose_name='Bank height (in meters)'),
),
migrations.AlterField(
model_name='contributionpotentialdamage',
name='excessive_cutting_length',
field=models.FloatField(blank=True, default=0.0, null=True, verbose_name='Excessive cutting length (in meters)'),
),
migrations.AlterField(
model_name='contributionpotentialdamage',
name='length_bank_erosion',
field=models.FloatField(blank=True, default=0.0, help_text='Distance between the foot of the bank and the foot of the erosion.', null=True, verbose_name='Length bank erosion (in meters)'),
),
]
10 changes: 5 additions & 5 deletions georiviere/contribution/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,14 @@ class TypeChoice(models.IntegerChoices):
landing_type = models.ForeignKey(LandingType, on_delete=models.PROTECT, null=True,
verbose_name=_("Landing type"))
excessive_cutting_length = models.FloatField(default=0.0, null=True, blank=True,
verbose_name=_("Excessive cutting length in meters"))
verbose_name=_("Excessive cutting length (in meters)"))
jam_type = models.ForeignKey(JamType, on_delete=models.PROTECT, null=True)
length_bank_erosion = models.FloatField(default=0.0, null=True, blank=True,
verbose_name=_("Length bank erosion"),
verbose_name=_("Length bank erosion (in meters)"),
help_text=_('Distance between the foot of the bank and the foot of '
'the erosion.'))
bank_height = models.FloatField(default=0.0, null=True, blank=True,
verbose_name=_("Bank height"),
verbose_name=_("Bank height (in meters)"),
help_text=_('Bank height (measured between the foot of the bank and the top '
'of the bank) in meters'))
disease_type = models.ForeignKey(DiseaseType, on_delete=models.PROTECT, null=True)
Expand Down Expand Up @@ -362,8 +362,8 @@ class TypeChoice(models.IntegerChoices):
verbose_name=_("Type"),
)
home_area = models.FloatField(default=0.0, null=True, blank=True,
verbose_name=_("Home area"),
help_text=_('Home area in meters'))
verbose_name=_("Home area (in square meters)"),
help_text=_('Home area in square meters'))
invasive_species = models.ForeignKey(InvasiveSpecies, on_delete=models.PROTECT, null=True)
number_heritage_species = models.IntegerField(default=0, null=True, blank=True,
verbose_name=_("Number heritage species"))
Expand Down
Loading

0 comments on commit 24c1a97

Please sign in to comment.