Allow to hide donation pages to MapOSMatic project

nimn-master
Étienne Loks 2016-11-12 17:53:02 +00:00
rodzic 06c9c39d6f
commit 162a864d45
6 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -105,6 +105,7 @@ def all(request):
'BRAND_NAME': www.settings.BRAND_NAME,
'CONTACT_EMAIL': www.settings.CONTACT_EMAIL,
'EXTRA_FOOTER': www.settings.EXTRA_FOOTER,
'MAPOSMATIC_DONATION': www.settings.MAPOSMATIC_DONATION,
'BBOX_MAXIMUM_LENGTH_IN_METERS': www.settings.BBOX_MAXIMUM_LENGTH_IN_METERS,
'searchform': forms.MapSearchForm(request.GET),

Wyświetl plik

@ -73,11 +73,15 @@ def about(request):
def donate(request):
"""The donate page."""
if not www.settings.MAPOSMATIC_DONATION:
return HttpResponseRedirect(reverse('main'))
return render_to_response('maposmatic/donate.html',
context_instance=RequestContext(request))
def donate_thanks(request):
"""The thanks for donation page."""
if not www.settings.MAPOSMATIC_DONATION:
return HttpResponseRedirect(reverse('main'))
return render_to_response('maposmatic/donate-thanks.html',
context_instance=RequestContext(request))

Wyświetl plik

@ -323,6 +323,9 @@ CONTACT_EMAIL = ""
# If you want to provide extra information in the footer put it in EXTRA_FOOTER
EXTRA_FOOTER = ""
# Show a link to donate to the MapOSMatic team
MAPOSMATIC_DONATION = False
try:
from settings_local import *
except ImportError:

Wyświetl plik

@ -116,6 +116,9 @@ https://docs.djangoproject.com/en/1.8/ref/settings/
# DAEMON_ERRORS_EMAIL_REPLY_TO = 'noreply@domain.com'
# DAEMON_ERRORS_JOB_URL = 'http://domain.com/jobs/%d'
# # Show a link to donate to the MapOSMatic team
# MAPOSMATIC_DONATION = False
# # Displayed on the top menu
# BRAND_NAME = "MapOSMatic"
# # Front page feed

Wyświetl plik

@ -70,7 +70,7 @@
<li class="{% block menu-new %}{% endblock %}"><a href="{% url "new" %}"><i class="icon-white icon-edit"></i> {% trans "Create map" %}</a></li>
<li class="{% block menu-maps %}{% endblock %}"><a href="{% url "maps" %}"><i class="icon-white icon-list"></i> {% trans "Maps" %}</a></li>
<li class="{% block menu-about %}{% endblock %}"><a href="{% url "about" %}"><i class="icon-white icon-comment"></i> {% trans "About" %}</a></li>
<li class="{% block menu-donate %}{% endblock %}"><a href="{% url "donate" %}"><i class="icon-white icon-gift"></i> {% trans "Donate" %}</a></li>
{% if MAPOSMATIC_DONATION %}<li class="{% block menu-donate %}{% endblock %}"><a href="{% url "donate" %}"><i class="icon-white icon-gift"></i> {% trans "Donate" %}</a></li>{% endif %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">

Wyświetl plik

@ -118,6 +118,7 @@
</ul>
</div>
{% if MAPOSMATIC_DONATION %}
<div class="span4">
<h2>{% trans "Donate" %}</h2>
@ -133,5 +134,6 @@
<img alt="" border="0" src="https://www.paypalobjects.com/{{paypal_lang_code}}/i/scr/pixel.gif" width="1" height="1"/>
</form>
</div>
{% endif %}
</div>
{% endblock %}