Commit c46efa41 authored by Brian Guadalupe's avatar Brian Guadalupe

Hide login and sigup forms when user is authenticated

parent 379d0bf9
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
{% block content %} {% block content %}
<div class="boxified main login_form"> <div class="boxified main login_form">
{% if user.is_authenticated %}
<h2>Login</h2> <p>You are already logged in as {{user.username}}. You need to log out before logging in as a different user.</p>
<p><a href="/logout">Log out</a> or <a href="/">return to home page</a>.</p>
{% else %}
<form method="post"> <h2>Login</h2>
<form method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<button type="submit" class="buttoned">Login</button> <button type="submit" class="buttoned">Login</button>
</form> </form>
</div> </div>
{% endif %}
{% endblock %} {% endblock %}
...@@ -2,15 +2,20 @@ ...@@ -2,15 +2,20 @@
{% block content %} {% block content %}
<div class='boxified main signup_form'> <div class='boxified main signup_form'>
<h2>Create your account</h2> {% if user.is_authenticated %}
<p> <p>You are already logged in as {{user.username}}.</p>
Sign up now to start building your music collection with us. <br/> Already have an account? Login <p><a href="/logout">Log out</a> or <a href="/">return to home page</a>.</p>
</p> {% else %}
<form method="post"> <h2>Create your account</h2>
<p>
Sign up now to start building your music collection with us. <br/> Already have an account? <a href="/login">Log in</a>
</p>
<form method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<button type="submit" class="buttoned">Sign up</button> <button type="submit" class="buttoned">Sign up</button>
</form> </form>
</div> {% endif %}
</div>
{% endblock %} {% 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