Allow to override site name in pages title

This commit is contained in:
Yohan Boniface 2016-06-30 14:41:10 +02:00
parent 55abcfb545
commit da6cff729c
4 changed files with 10 additions and 6 deletions

View file

@ -1,12 +1,15 @@
from django.conf import settings from django.conf import settings as djsettings
from . import __version__ from . import __version__
def feedback_link(request):
def settings(request):
return { return {
'UMAP_FEEDBACK_LINK': settings.UMAP_FEEDBACK_LINK 'UMAP_FEEDBACK_LINK': djsettings.UMAP_FEEDBACK_LINK,
'SITE_NAME': djsettings.SITE_NAME
} }
def version(request): def version(request):
return { return {
'UMAP_VERSION': __version__ 'UMAP_VERSION': __version__

View file

@ -117,7 +117,7 @@ TEMPLATES = [
"django.core.context_processors.tz", "django.core.context_processors.tz",
'social.apps.django_app.context_processors.backends', 'social.apps.django_app.context_processors.backends',
'social.apps.django_app.context_processors.login_redirect', 'social.apps.django_app.context_processors.login_redirect',
'umap.context_processors.feedback_link', 'umap.context_processors.settings',
'umap.context_processors.version', 'umap.context_processors.version',
) )
} }
@ -154,6 +154,7 @@ LEAFLET_STORAGE_EXTRA_URLS = {
'ajax_proxy': '/ajax-proxy/?url={url}' 'ajax_proxy': '/ajax-proxy/?url={url}'
} }
SITE_URL = "http://umap.org" SITE_URL = "http://umap.org"
SITE_NAME = 'uMap'
UMAP_DEMO_SITE = False UMAP_DEMO_SITE = False
UMAP_EXCLUDE_DEFAULT_MAPS = False UMAP_EXCLUDE_DEFAULT_MAPS = False
UMAP_MAPS_PER_PAGE = 5 UMAP_MAPS_PER_PAGE = 5

View file

@ -2,7 +2,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>{% block head_title %}uMap{% endblock %}</title> <title>{% block head_title %}{{ SITE_NAME }}{% endblock %}</title>
<meta charset="utf-8"> <meta charset="utf-8">
{% compress css %} {% compress css %}
<!-- Included CSS Files (Compressed) --> <!-- Included CSS Files (Compressed) -->

View file

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load leaflet_storage_tags compress i18n %} {% load leaflet_storage_tags compress i18n %}
{% block head_title %}{{ map.name }} - uMap{% endblock %} {% block head_title %}{{ map.name }} - {{ SITE_NAME }}{% endblock %}
{% block body_class %}map_detail{% endblock %} {% block body_class %}map_detail{% endblock %}
{% block extra_head %} {% block extra_head %}