Skip to content

Commit

Permalink
Use newer cab and the proper auth URL patterns.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Sep 15, 2014
1 parent 326b68f commit 1e37184
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions djangosnippets/templates/base.html
Expand Up @@ -12,11 +12,11 @@
<body class="{% block bodyclass %}{% endblock %}">
<div id="accountbar"><div class="inner">
<p>
{% url 'auth_logout' as logout_url %}
{% if user.is_authenticated %}
Logged in as <a href="{% url 'cab_author_snippets' username=user.username %}">{{ user.username }}</a> (<a href="{% url 'logout' %}">Log out</a>)
Logged in as <a href="{% url 'cab_author_snippets' username=user.username %}">{{ user.username }}</a> (<a href="{{ logout_url }}">Log out</a>)
{% else %}
{% url 'logout' as logout_url %}
<a href="{% url 'login' %}?next={% if request.path == logout_url %}/{% else %}{{ request.path }}{% endif %}">Log in</a> or <a href="{% url 'registration_register' %}">register</a>
<a href="{% url 'auth_login' %}?next={% if request.path == logout_url %}/{% else %}{{ request.path }}{% endif %}">Log in</a> or <a href="{% url 'registration_register' %}">register</a>
{% endif %}
</p>
</div></div>
Expand Down
4 changes: 2 additions & 2 deletions djangosnippets/templates/comments/form.html
Expand Up @@ -4,7 +4,7 @@

{{ form.non_field_errors }}

<p>{% trans "Username:" %} <strong>{{ user.username }}</strong> (<a href="{% url 'logout' %}">{% trans "Log out" %}</a>)</p>
<p>{% trans "Username:" %} <strong>{{ user.username }}</strong> (<a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a>)</p>
<dl>

<div class="bee-like-this">
Expand Down Expand Up @@ -39,7 +39,7 @@
</div>
</form>
{% else %}
<form action="{% url 'login' %}" method="post" class="inline">{% csrf_token %}
<form action="{% url 'auth_login' %}" method="post" class="inline">{% csrf_token %}
<div class="field">
<label for="id_username">{% trans "Username:" %}</label>
<div class="controls"><input type="text" name="username" id="id_username" /></div>
Expand Down
Expand Up @@ -9,5 +9,5 @@
Welcome to django snippets! Now you can start sharing snippets, bookmark
your favorites, and comment on other users' snippets.
</p>
<p><a href="{% url 'login' %}">Log in &raquo;</a></p>
<p><a href="{% url 'auth_login' %}">Log in &raquo;</a></p>
{% endblock %}
2 changes: 1 addition & 1 deletion djangosnippets/templates/registration/logged_out.html
Expand Up @@ -5,7 +5,7 @@
{% block content_header %}Logged out{% endblock %}

{% block content %}
<p>You're logged out. <a href="{% url 'login' %}">Log in again</a></p>
<p>You're logged out. <a href="{% url 'auth_login' %}">Log in again</a></p>
{% endblock %}

{% block sidebar %}{% endblock %}
2 changes: 1 addition & 1 deletion djangosnippets/templates/registration/login.html
Expand Up @@ -5,7 +5,7 @@
{% block content_header %}Log in / Sign up{% endblock %}

{% block content %}
<form action="{% url 'login' %}" method="post" class="login_form inline column medium-6">{% csrf_token %}
<form action="{% url 'auth_login' %}" method="post" class="login_form inline column medium-6">{% csrf_token %}
{{ form.non_field_errors }}
{% if next %}<p class="alert-box warning">The page you're trying to access is only available to readers with free {{ site_name }} accounts. Just sign up and we'll send you on your way.</p>{% endif %}
<p class="help">Already have an account? Welcome back! Please use your username and password to sign in.</p>
Expand Down
Expand Up @@ -6,5 +6,5 @@

{% block content %}
<p>Your password has been reset. You can reset it as often as you forget it.</p>
<p><a href="{{ login_url }}">Log in &raquo;</a></p>
<p><a href="{% url 'auth_login' %}">Log in &raquo;</a></p>
{% endblock %}
2 changes: 1 addition & 1 deletion requirements-common.txt
@@ -1,4 +1,4 @@
django-cab==0.3.3
django-cab==0.3.4
django-generic-aggregation==0.3.2
django-haystack==2.1.0
django-pagination==1.0.7
Expand Down

0 comments on commit 1e37184

Please sign in to comment.