Skip to content

Commit

Permalink
feat: display contact infos in the footer
Browse files Browse the repository at this point in the history
This adds a new settings: UMAP_HOST_INFOS

Also, renames UMAP_FEEDBACK_LINK in UMAP_HELP_URL.

cf #2004
  • Loading branch information
yohanboniface committed Aug 29, 2024
1 parent 70ebffd commit a72691e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 13 deletions.
15 changes: 14 additions & 1 deletion docs/config/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Possible values:
Set to True if you want to display a message saying that your instance is not
ready for production use (no backup, etc.)

#### UMAP_FEEDBACK_LINK
#### UMAP_HELP_URL

Link to show on the header under the "Feedback and help" label.

Expand All @@ -211,6 +211,19 @@ Which feed to display on the home page. Three valid values:
- `"highlighted"`, which shows the maps that have been starred by a staff member
- `None`, which does not show any map on the home page

#### UMAP_HOST_INFOS

Informations about the entity hosting this uMap instance.

```
UMAP_HOST_INFOS = {
"name": "OpenStreetMap France",
"url": "https://openstreetmap.fr",
"contact": "[email protected]"
}
```


#### UMAP_IMPORTERS

Activate preset importers to connect uMap with external sources.
Expand Down
3 changes: 2 additions & 1 deletion umap/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

def settings(request):
return {
"UMAP_FEEDBACK_LINK": djsettings.UMAP_FEEDBACK_LINK,
"UMAP_HELP_URL": djsettings.UMAP_HELP_URL,
"SITE_NAME": djsettings.SITE_NAME,
"SITE_URL": djsettings.SITE_URL,
"ENABLE_ACCOUNT_LOGIN": djsettings.ENABLE_ACCOUNT_LOGIN,
"UMAP_READONLY": djsettings.UMAP_READONLY,
"UMAP_DEMO_SITE": djsettings.UMAP_DEMO_SITE,
"UMAP_HOST_INFOS": djsettings.UMAP_HOST_INFOS,
}


Expand Down
2 changes: 2 additions & 0 deletions umap/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
globals()["TEMPLATES"][0]["DIRS"] = [value]
elif key == "UMAP_CUSTOM_STATICS":
globals()["STATICFILES_DIRS"].insert(0, value)
elif key == "UMAP_FEEDBACK_LINK":
globals()["UMAP_HELP_URL"] = value
else:
globals()[key] = value
3 changes: 2 additions & 1 deletion umap/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,15 @@
UMAP_MAPS_PER_SEARCH = 25
UMAP_MAPS_PER_PAGE_OWNER = 10
UMAP_SEARCH_CONFIGURATION = "simple"
UMAP_FEEDBACK_LINK = "https://wiki.openstreetmap.org/wiki/UMap#Feedback_and_help"
UMAP_HELP_URL = "https://wiki.openstreetmap.org/wiki/UMap#Feedback_and_help"
USER_MAPS_URL = "user_maps"
DATABASES = {"default": env.db(default="postgis://localhost:5432/umap")}
UMAP_DEFAULT_SHARE_STATUS = None
UMAP_DEFAULT_EDIT_STATUS = None
UMAP_DEFAULT_FEATURES_HAVE_OWNERS = False
UMAP_HOME_FEED = "latest"
UMAP_IMPORTERS = {}
UMAP_HOST_INFOS = {}

UMAP_READONLY = env("UMAP_READONLY", default=False)
UMAP_GZIP = True
Expand Down
17 changes: 10 additions & 7 deletions umap/static/umap/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ header {
}

footer {
height: 140px;
min-height: 140px;
margin-top: 40px;
background-color: #2E3641;
text-align: center;
line-height: 140px;
color: #fff;
background-color: var(--color-darkBlue);
color: var(--color-light);
display: flex;
align-items: center;
justify-content: space-evenly;
flex-wrap: wrap;
}
footer a {
color: #fff;
color: var(--color-light);
text-decoration: underline;
}
footer a.branding {
Expand All @@ -20,8 +22,9 @@ footer a.branding {
background-repeat: no-repeat;
background-size: 60px auto;
font-size: 30px;
height: 60px;
line-height: 60px;
font-weight: bold;
height: 140px;
padding-inline-start: 70px;
display: inline-block;
}
Expand Down
7 changes: 5 additions & 2 deletions umap/templates/umap/content_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

<footer>
<a href="https://wiki.openstreetmap.org/wiki/UMap" class="branding">uMap</a>
an OpenStreetMap project
(version <a href="https://umap-project.readthedocs.io/en/master/changelog/">{{ UMAP_VERSION }}</a>)
<span>{% trans "An OpenStreetMap project" %}
({% trans "version" %} <a href="https://umap-project.readthedocs.io/en/master/changelog/">{{ UMAP_VERSION }}</a>)</span>
{% if UMAP_HOST_INFOS.url and UMAP_HOST_INFOS.name %}<span>{% trans "Hosted by" %} <a href="{{ UMAP_HOST_INFOS.url }}">{{ UMAP_HOST_INFOS.name }}</a></span>{% endif %}
{% if UMAP_HOST_INFOS.email %}<a href="mailto:{{ UMAP_HOST_INFOS.email }}">{% trans "Contact" %}</a>{% endif %}
{% if UMAP_HELP_URL %}<a href="{{ UMAP_HELP_URL }}">{% trans "Help" %}</a>{% endif %}
{% get_language_info_list for LANGUAGES as languages %}
<form action="{% url "set_language" %}" method="post" class="i18n_switch">
{% csrf_token %}
Expand Down
2 changes: 1 addition & 1 deletion umap/templates/umap/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<a href="{% url "about" %}">{% trans "About" %}</a>
</li>
<li>
<a href="{{ UMAP_FEEDBACK_LINK }}">{% trans "Help" %}</a>
<a href="{{ UMAP_HELP_URL }}">{% trans "Help" %}</a>
</li>
{% if user.is_authenticated %}
{% if user.has_usable_password %}
Expand Down

0 comments on commit a72691e

Please sign in to comment.