Make the twitter name in header configurable

See #291
This commit is contained in:
Roland Geider
2016-06-13 16:23:21 +02:00
parent ee8fafabd3
commit fd50fec2e4
7 changed files with 19 additions and 4 deletions

View File

@@ -9,6 +9,8 @@ Upgrade steps:
* Database upgrade: ``python manage.py migrate``
* Reset workout cache: ``python manage.py clear-cache --clear-workout-cache``
* New config option in settings.py: ``WGER_SETTINGS['TWITTER']``. Set this if
your instance has its own twitter account.
* Update static files (only production): ``python manage.py collectstatic``
New features:

View File

@@ -40,8 +40,10 @@
<!-- twitter cards -->
{% block twittercard %}
{% if twitter %}
<meta content="summary" name="twitter:card">
<meta content="@wger_de" name="twitter:site">
<meta content="@{{ twitter }}" name="twitter:site">
{% endif %}
{% endblock %}
<title>{% block title %}{% endblock %}</title>

View File

@@ -39,8 +39,10 @@
<!-- twitter cards -->
{% block twittercard %}
{% if twitter %}
<meta content="summary" name="twitter:card">
<meta content="@wger_de" name="twitter:site">
<meta content="@{{ twitter }}" name="twitter:site">
{% endif %}
{% endblock %}

View File

@@ -38,8 +38,10 @@
<!-- twitter cards -->
{% block twittercard %}
{% if twitter %}
<meta content="summary" name="twitter:card">
<meta content="@wger_de" name="twitter:site">
<meta content="@{{ twitter }}" name="twitter:site">
{% endif %}
{% endblock %}

View File

@@ -59,3 +59,6 @@ if DEBUG:
# Sender address used for sent emails
WGER_SETTINGS['EMAIL_FROM'] = 'wger Workout Manager <wger@example.com>'
# Your twitter handle, if you have one for this instance.
#WGER_SETTINGS['TWITTER'] = ''

View File

@@ -350,5 +350,6 @@ WGER_SETTINGS = {
'USE_RECAPTCHA': False,
'REMOVE_WHITESPACE': False,
'ALLOW_REGISTRATION': True,
'EMAIL_FROM': 'wger Workout Manager <wger@example.com>'
'EMAIL_FROM': 'wger Workout Manager <wger@example.com>',
'TWITTER': False
}

View File

@@ -35,6 +35,9 @@ def processor(request):
# Application version
'version': get_version(),
# Twitter handle for this instance
'twitter': settings.WGER_SETTINGS['TWITTER'],
# User language
'language': language,