diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-10-11 11:48:22 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-10-11 11:48:22 -0500 |
commit | 9d2b0161b9e6f570e7b429127d6ebb83c125c1c6 (patch) | |
tree | a3e9d58d55e2b1e45ecafe4ba7e2658408517374 | |
parent | 0c875e1e96b77892bd3f9bd5a91959c57ab7b91c (diff) | |
download | mediagoblin-9d2b0161b9e6f570e7b429127d6ebb83c125c1c6.tar.lz mediagoblin-9d2b0161b9e6f570e7b429127d6ebb83c125c1c6.tar.xz mediagoblin-9d2b0161b9e6f570e7b429127d6ebb83c125c1c6.zip |
Make showing the Terms of Service a user option, and move it to the footer.
This commit sponsored by Gjalt-Jorn Peters. Thank you!
-rw-r--r-- | mediagoblin/config_spec.ini | 5 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/base.html | 5 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/bits/base_footer.html | 7 | ||||
-rw-r--r-- | mediagoblin/views.py | 5 |
4 files changed, 16 insertions, 6 deletions
diff --git a/mediagoblin/config_spec.ini b/mediagoblin/config_spec.ini index d738074d..971b6153 100644 --- a/mediagoblin/config_spec.ini +++ b/mediagoblin/config_spec.ini @@ -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() diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index 6394fa4f..c7ed6d8e 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -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= diff --git a/mediagoblin/templates/mediagoblin/bits/base_footer.html b/mediagoblin/templates/mediagoblin/bits/base_footer.html index 80cd41b0..84397be2 100644 --- a/mediagoblin/templates/mediagoblin/bits/base_footer.html +++ b/mediagoblin/templates/mediagoblin/bits/base_footer.html @@ -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 -%} diff --git a/mediagoblin/views.py b/mediagoblin/views.py index 1d7be813..4185c1b6 100644 --- a/mediagoblin/views.py +++ b/mediagoblin/views.py @@ -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', {}) |