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