Update the views for Login, Logout, Register, and Profile

This commit is contained in:
AndyGrant committed 2020-02-22 19:25:45 -05:00
1 parent 8adb23d974
commit 610899a521
5 files changed
+99 -80

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@
<li class="header">ADMIN</li>
{% if user.is_authenticated %}
<li><a href="/logout/">Logout</a></li>
<li><a href="/viewProfile/">Profile</a></li>
<li><a href="/profile/">Profile</a></li>
{% else %}
<li><a href="/login">Login </a></li>
<li><a href="/register">Register</a></li>
+33
View File
@@ -0,0 +1,33 @@
{% extends "OpenBench/base.html" %}
{% block content %}
<form method="POST" action="/profile/">
{% csrf_token %}
<!-- Profile information. Everything may be changed but the Username -->
<label>Username</label><input readonly value="{{profile.user.username}}"><br>
<label>Email</label><input value="{{profile.user.email}}" name="email"><br>
<label>Source Repo</label><input value="{{profile.repo}}" name="repo"><br>
<label>New Password</label><input type="password" name="password1"><br>
<label>New Password</label><input type="password" name="password2"><br>
<!-- User's have a default engine. Select the default, otherwise show an empty line -->
<label>Engine</label> <select id="engine" name="engine">
{% for engine in config.engines %}
{% if profile.engine == engine %}
<option selected value="{{engine}}">{{engine}}</option>
{% else %}
<option value="{{engine}}">{{engine}}</option>
{% endif %}
{% endfor %}
{% if not profile.engine %}
<option selected value=""></option>
{% endif %}
</select><br>
<input type="submit" value="Update Profile">
</form>
{% endblock %}
-33
View File
@@ -1,33 +0,0 @@
{% extends "OpenBench/base.html" %}
{% block content %}
<form method="POST" action="/editProfile/">
{% csrf_token %}
<!-- User definition. Everything may be changed but the Username -->
<label>Username </label> <input readonly value="{{profile.user.username}}" name="username"><br>
<label>Email </label> <input value="{{profile.user.email}}" name="email"><br>
<label>Source Repo </label> <input value="{{profile.repo}}" name="repo"><br>
<label>New Password</label> <input type="password" name="password1"><br>
<label>New Password</label> <input type="password" name="password2"><br>
<!-- User's have a default engine. Select the default, otherwise show an empty line -->
<label>Engine</label> <select id="enginename" name="enginename" onchange="configure(testMode)">
{% for engine in config.engines %}
{% if profile.engine == engine %}
<option selected value="{{engine}}">{{engine}}</option>
{% else %}
<option value="{{engine}}">{{engine}}</option>
{% endif %}
{% endfor %}
{% if not profile.engine %}
<option selected value=""></option>
{% endif %}
</select><br>
<input type="submit" name="submit" value="Update Profile">
</form>
{% endblock %}