Make showing the Terms of Service a user option, and move it to the footer.

This commit sponsored by Gjalt-Jorn Peters.  Thank you!
This commit is contained in:
Christopher Allan Webber 2013-10-11 11:48:22 -05:00
parent 0c875e1e96
commit 9d2b0161b9
4 changed files with 16 additions and 6 deletions

View File

@ -45,6 +45,11 @@ comments_ascending = boolean(default=True)
# Enable/disable reporting
allow_reporting = boolean(default=True)
# Enable/disable terms of service
# ... Note: you can override the terms of service template on a
# per-site basis...
show_tos = boolean(default=True)
# By default not set, but you might want something like:
# "%(here)s/user_dev/templates/"
local_templates = string()

View File

@ -94,11 +94,6 @@
"javascript:;"
{% endif %}
>{% trans %}log out{% endtrans %}</a>
<p class="fine_print">
<a href="{{ request.urlgen('terms_of_service') }}">
{%- trans %}Terms of Service{%- endtrans %}
</a>
</p>
{% endif %}
{%- elif auth %}
<a href=

View File

@ -24,5 +24,12 @@
{% trans source_link=app_config['source_link'] -%}
Released under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPL</a>. <a href="{{ source_link }}">Source code</a> available.
{%- endtrans %}
{% if app_config['show_tos'] %}
<p class="fine_print">
<a href="{{ request.urlgen('terms_of_service') }}">
{%- trans %}Terms of Service{%- endtrans %}
</a>
</p>
{% endif %}
</footer>
{%- endblock mediagoblin_footer -%}

View File

@ -17,7 +17,7 @@
from mediagoblin import mg_globals
from mediagoblin.db.models import MediaEntry
from mediagoblin.tools.pagination import Pagination
from mediagoblin.tools.response import render_to_response
from mediagoblin.tools.response import render_to_response, render_404
from mediagoblin.decorators import uses_pagination, user_not_banned
@ -46,5 +46,8 @@ def simple_template_render(request):
request, template_name, {})
def terms_of_service(request):
if mg_globals.app_config["show_tos"] is False:
return render_404(request)
return render_to_response(request,
'mediagoblin/terms_of_service.html', {})