Commit f1425cc9 authored by BERJON Matthieu's avatar BERJON Matthieu Committed by BAIRE Anthony

Adding the ToS view

I added a view to display the latest version of the ToS. This include a
specific url, its related view and template. I edited the footer as well
to add a link to the ToS.
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent 72b7c6bc
......@@ -76,6 +76,9 @@ urlpatterns = [
url(r'^profile/password$', views.UserPasswordUpdate.as_view(), name='user_password'),
url(r'^profile/need_validation$', views.UserNeedValidation.as_view(), name='user_need_validation'),
# Terms of service urls
url(r'^tos$', views.TosDetail.as_view(), name='tos_detail'),
# url(r'^runners/$', views.RunnerList.as_view(), name='runner_list'),
# url(r'^runners/_add$', views.RunnerCreate.as_view(), name='runner_create'),
# url(r'^runners/(?P<pk>\d+)/update$', views.RunnerUpdate.as_view(), name='runner_update'),
......
......@@ -82,6 +82,7 @@ from .models import (
Webapp,
WebappParameter,
WebappVersion,
Tos,
)
from .signals import job_post_save
from .templatetags.converters import status_icon
......@@ -1458,3 +1459,13 @@ def auth(request):
return HttpResponse(status=200)
return HttpResponse(status=403)
class TosDetail(DetailView):
template_name = 'tos_detail.html'
context_object_name = 'tos'
def get_object(self):
"""Returns the object according to its docker name or a 404 error"""
last_tos = Tos.objects.order_by('-version').first()
return last_tos
......@@ -22,8 +22,8 @@
<ul>
<li><a href="https://wiki.inria.fr/sed_ren/">/SED/</a></li>
<li><a href="{% url 'main:tos_detail' %}">Terms</a></li>
{% comment Will be reintegrated with the RGPD %}
<li><a href="#">Terms</a></li>
<li><a href="#">Privacy</a></li>
{% endcomment %}
</ul>
......
{% extends "base.html" %}
{% load converters %}
{% block title %}Terms of Service{% endblock %}
{% block breadcrumb %}
<li class="breadcrumb-item active" aria-current="page">Terms of Service</li>
{% endblock %}
{% block content %}
<div class="container">
<div class="allgo-page">
{{ tos.content | markdown | safe }}
{% if tos.url %}
<p>You can read the Terms of Service as a <a href="{{ tos.url }}">PDF file</a>.</p>
{% endif %}
</div>
</div>
{% endblock %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment