Finish the move to Jinja2

This commit is contained in:
Skia 2016-02-02 11:00:08 +01:00
parent 239133e355
commit afc87888a6
19 changed files with 46 additions and 75 deletions

View File

@ -1,4 +0,0 @@
{% load renderer %}
{{ text|markdown }}

View File

@ -43,5 +43,10 @@
Site réalisé par des gens biens
{% endblock %}
</footer>
<!--
{% block tests %}
{{ tests }}
{% endblock %}
-->
</body>
</html>

View File

@ -1,20 +0,0 @@
{% extends "core/base.jinja" %}
{% block title %}
{% if profile %}
Edit {{ profile.get_display_name }}
{% endif %}
{% endblock %}
{% block content %}
{% if profile %}
<h3>Edit user</h3>
<p><a href="{% url 'core:user_profile' profile.id %}">Back to profile</a></p>
<p>You're editing the profile of <strong>{{ profile.get_display_name }}</strong></p>
<form action="{% url 'core:user_edit' profile.id %}" method="post">
{% csrf_token %}
{{ user_form }}
<p><input type="submit" value="Save!" /></p>
</form>
{% endif %}
{% endblock %}

View File

@ -4,7 +4,7 @@
<p><a href="{{ url('core:group_list') }}">Back to list</a></p>
<h2>Edit group</h2>
<form action="" method="post">
{{ csrf_input }}
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="Update" /></p>
</form>

View File

@ -8,7 +8,7 @@ Group list
<h3>Group list</h3>
<ul>
{% for g in group_list %}
<li><a href="{{ url('core:group_edit', kwargs={'group_id': g.id} }}">{{ g.name }}</a></li>
<li><a href="{{ url('core:group_edit', group_id=g.id) }}">{{ g.name }}</a></li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -1,14 +0,0 @@
{% extends "core/base.jinja" %}
{% block content %}
{% if form.errors %}
<p>Your passwords didn't match. Please try again.</p>
{% endif %}
<form method="post" action="{% url 'core:password_change' %}">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Change!" />
</form>
{% endblock %}

View File

@ -0,0 +1,10 @@
{% extends "core/base.jinja" %}
{% block content %}
<form method="post" action="{{ url('core:password_change') }}">
{% csrf_token %}
{{ form.as_p() }}
<input type="submit" value="Change!" />
</form>
{% endblock %}

View File

@ -1,13 +0,0 @@
{% extends "core/base.jinja" %}
{% block content %}
{% if form.errors %}
<p>Your passwords didn't match. Please try again.</p>
{% else %}
You successfully changed your password!
{% endif %}
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends "core/base.jinja" %}
{% block content %}
<p>You successfully changed your password!</p>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block content %}
<form method="post" action="">
{% csrf_token %}
{{ form.as_p }}
{{ form.as_p() }}
<input type="submit" value="Reset!" />
</form>
{% endblock %}

View File

@ -2,7 +2,7 @@
{% block content %}
<p>You successfully reset your password!</p>
<a href="{% url 'core:login' %}">Login</a>
<a href="{{ url('core:login') }}">Login</a>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block content %}
<form method="post" action="">
{% csrf_token %}
{{ form.as_p }}
{{ form.as_p() }}
<input type="submit" value="Reset" />
</form>
{% endblock %}

View File

@ -1,15 +0,0 @@
{% load i18n %}{% autoescape off %}
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'core:password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}

View File

@ -0,0 +1,15 @@
{% autoescape off %}
{% trans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endtrans %}
{% trans %}Please go to the following page and choose a new password:{% endtrans %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{{ url('core:password_reset_confirm', uidb64=uid, token=token) }}
{% endblock %}
{% trans %}Your username, in case you've forgotten: {% endtrans %} {{ user.get_username() }}
{% trans %}Thanks for using our site! {% endtrans %}
{% trans %}The {{ site_name }} team{% endtrans %}
{% endautoescape %}

View File

@ -6,13 +6,13 @@
<h1>{{ title }}</h1>
{% if user_registered %}
Welcome {{ user_registered.get_display_name }}!
Welcome {{ user_registered.get_display_name() }}!
You successfully registred and you will soon receive a confirmation mail.
Your username is {{ user_registered.username }}.
{% endif %}
<form action="{% url 'core:register' %}" method="post">
<form action="{{ url('core:register') }}" method="post">
{% csrf_token %}
{{ form }}
<p><input type="submit" value="Register!" /></p>

View File

@ -7,6 +7,7 @@
{{ form.as_p() }}
<p><input type="submit" value="Update" /></p>
</form>
<p><a href="{{ url('core:password_change') }}">Change my password</a></p>
{% endblock %}

View File

@ -10,11 +10,11 @@ class GroupListView(CanEditMixin, ListView):
Displays the group list
"""
model = Group
template_name = "core/group_list.html"
template_name = "core/group_list.jinja"
class GroupEditView(CanEditMixin, UpdateView):
model = Group
pk_url_kwarg = "group_id"
template_name = "core/group_edit.html"
template_name = "core/group_edit.jinja"
form_class = GroupEditForm