Widened page layout; improved mobile rendering

This commit is contained in:
Jeremy Stretch
2016-12-09 16:23:11 -05:00
parent bd40f72ad5
commit 298ac1ba7a
26 changed files with 205 additions and 247 deletions
+22
View File
@@ -0,0 +1,22 @@
{% extends '_base.html' %}
{% block content %}
<div class="row">
<div class="col-sm-12 col-md-8 col-md-offset-2">
<h1>{% block title %}{% endblock %}</h1>
</div>
</div>
<div class="row">
<div class="col-sm-3 col-md-2 col-md-offset-2">
<ul class="nav nav-pills nav-stacked">
<li{% ifequal active_tab "profile" %} class="active"{% endifequal %}><a href="{% url 'users:profile' %}">Profile</a></li>
<li{% ifequal active_tab "change_password" %} class="active"{% endifequal %}><a href="{% url 'users:change_password' %}">Change Password</a></li>
<li{% ifequal active_tab "userkey" %} class="active"{% endifequal %}><a href="{% url 'users:userkey' %}">User Key</a></li>
<li{% ifequal active_tab "recent_activity" %} class="active"{% endifequal %}><a href="{% url 'users:recent_activity' %}">Recent Activity</a></li>
</ul>
</div>
<div class="col-sm-9 col-md-6">
{% block usercontent %}{% endblock %}
</div>
</div>
{% endblock %}
+21 -37
View File
@@ -1,46 +1,30 @@
{% extends '_base.html' %}
{% extends 'users/_user.html' %}
{% load form_helpers %}
{% block title %}Change Password{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>Change Password</h1>
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-2">
{% include 'users/inc/profile_nav.html' with active_tab="change_password" %}
</div>
<div class="col-md-6">
<form action="." method="post" class="form form-horizontal">
{% csrf_token %}
{% if form.non_field_errors %}
<div class="panel panel-danger">
<div class="panel-heading"><strong>Errors</strong></div>
<div class="panel-body">
{{ form.non_field_errors }}
</div>
</div>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading"><strong>Password</strong></div>
{% block usercontent %}
<form action="." method="post" class="form form-horizontal">
{% csrf_token %}
{% if form.non_field_errors %}
<div class="panel panel-danger">
<div class="panel-heading"><strong>Errors</strong></div>
<div class="panel-body">
{% render_field form.old_password %}
{% render_field form.new_password1 %}
{% render_field form.new_password2 %}
{{ form.non_field_errors }}
</div>
</div>
<div class="row">
<div class="form-group">
<div class="col-md-12 text-center">
<button type="submit" name="_update" class="btn btn-primary">Update</button>
<a href="{% url 'users:profile' %}" class="btn btn-default">Cancel</a>
</div>
</div>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading"><strong>Password</strong></div>
<div class="panel-body">
{% render_field form.old_password %}
{% render_field form.new_password1 %}
{% render_field form.new_password2 %}
</div>
</form>
</div>
</div>
</div>
<div class="text-right">
<button type="submit" name="_update" class="btn btn-primary">Update</button>
<a href="{% url 'users:profile' %}" class="btn btn-default">Cancel</a>
</div>
</form>
{% endblock %}
@@ -1,6 +0,0 @@
<ul class="nav nav-pills nav-stacked">
<li{% ifequal active_tab "profile" %} class="active"{% endifequal %}><a href="{% url 'users:profile' %}">Profile</a></li>
<li{% ifequal active_tab "change_password" %} class="active"{% endifequal %}><a href="{% url 'users:change_password' %}">Change Password</a></li>
<li{% ifequal active_tab "userkey" %} class="active"{% endifequal %}><a href="{% url 'users:userkey' %}">User Key</a></li>
<li{% ifequal active_tab "recent_activity" %} class="active"{% endifequal %}><a href="{% url 'users:recent_activity' %}">Recent Activity</a></li>
</ul>
+14 -26
View File
@@ -1,31 +1,19 @@
{% extends '_base.html' %}
{% extends 'users/_user.html' %}
{% load helpers %}
{% block title %}User Profile{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>User Profile</h1>
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-2">
{% include 'users/inc/profile_nav.html' with active_tab="profile" %}
</div>
<div class="col-md-6">
<small class="text-muted">User login</small>
<h5>{{ request.user.username }}</h5>
<small class="text-muted">Full name</small>
<h5>{{ request.user.first_name }} {{ request.user.last_name }}</h5>
<small class="text-muted">Email</small>
<h5>{{ request.user.email }}</h5>
<small class="text-muted">Registered</small>
<h5>{{ request.user.date_joined }}</h5>
<small class="text-muted">Groups</small>
<h5>{{ request.user.groups.all|join:', ' }}</h5>
<small class="text-muted">Admin access</small>
<h5>{{ request.user.is_staff|yesno|capfirst }}</h5>
</div>
</div>
{% block usercontent %}
<small class="text-muted">User login</small>
<h5>{{ request.user.username }}</h5>
<small class="text-muted">Full name</small>
<h5>{{ request.user.first_name }} {{ request.user.last_name }}</h5>
<small class="text-muted">Email</small>
<h5>{{ request.user.email }}</h5>
<small class="text-muted">Registered</small>
<h5>{{ request.user.date_joined }}</h5>
<small class="text-muted">Groups</small>
<h5>{{ request.user.groups.all|join:', ' }}</h5>
<small class="text-muted">Admin access</small>
<h5>{{ request.user.is_staff|yesno|capfirst }}</h5>
{% endblock %}
+16 -29
View File
@@ -1,35 +1,22 @@
{% extends '_base.html' %}
{% load form_helpers %}
{% extends 'users/_user.html' %}
{% block title %}Recent Activity{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>Recent Activity</h1>
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-2">
{% include 'users/inc/profile_nav.html' with active_tab="recent_activity" %}
</div>
<div class="col-md-6">
<table class="table table-hover">
<thead>
{% block usercontent %}
<table class="table table-hover">
<thead>
<tr>
<th>Time</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for action in recent_activity %}
<tr>
<th>Time</th>
<th>Action</th>
<td>{{ action.time|date:'SHORT_DATETIME_FORMAT' }}</td>
<td>{{ action.icon }} {{ action.message|safe }}</td>
</tr>
</thead>
<tbody>
{% for action in recent_activity %}
<tr>
<td>{{ action.time|date:'SHORT_DATETIME_FORMAT' }}</td>
<td>{{ action.icon }} {{ action.message|safe }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endfor %}
</tbody>
</table>
{% endblock %}
+29 -42
View File
@@ -1,46 +1,33 @@
{% extends '_base.html' %}
{% load form_helpers %}
{% extends 'users/_user.html' %}
{% block title %}User Key{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>User Key</h1>
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-2">
{% include 'users/inc/profile_nav.html' with active_tab="userkey" %}
</div>
<div class="col-md-6">
{% if userkey %}
<h4>
Your user key is:
{% if userkey.is_active %}
<span class="label label-success">Active</span>
{% else %}
<span class="label label-danger">Inactive</span>
{% endif %}
</h4>
<p>Your public key is below.</p>
<pre>{{ userkey.public_key }}</pre>
<div class="pull-right">
<a href="{% url 'users:userkey_edit' %}" class="btn btn-warning">
<span class="fa fa-pencil" aria-hidden="true"></span>
Edit user key
</a>
</div>
{% include 'inc/created_updated.html' with obj=userkey %}
{% else %}
<p>You don't have a user key on file.</p>
<p>
<a href="{% url 'users:userkey_edit' %}" class="btn btn-primary">
<span class="fa fa-plus" aria-hidden="true"></span>
Create a User Key
</a>
</p>
{% endif %}
</div>
</div>
{% block usercontent %}
{% if userkey %}
<h4>
Your user key is:
{% if userkey.is_active %}
<span class="label label-success">Active</span>
{% else %}
<span class="label label-danger">Inactive</span>
{% endif %}
</h4>
<p>Your public key is below.</p>
<pre>{{ userkey.public_key }}</pre>
<div class="pull-right">
<a href="{% url 'users:userkey_edit' %}" class="btn btn-warning">
<span class="fa fa-pencil" aria-hidden="true"></span>
Edit user key
</a>
</div>
{% include 'inc/created_updated.html' with obj=userkey %}
{% else %}
<p>You don't have a user key on file.</p>
<p>
<a href="{% url 'users:userkey_edit' %}" class="btn btn-primary">
<span class="fa fa-plus" aria-hidden="true"></span>
Create a User Key
</a>
</p>
{% endif %}
{% endblock %}
+41 -54
View File
@@ -1,71 +1,58 @@
{% extends '_base.html' %}
{% extends 'users/_user.html' %}
{% load static from staticfiles %}
{% load form_helpers %}
{% block title %}User Key{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1>User Key</h1>
</div>
</div>
<div class="row">
<div class="col-md-2 col-md-offset-2">
{% include 'users/inc/profile_nav.html' with active_tab="userkey" %}
</div>
<div class="col-md-6">
{% if userkey.is_active %}
<div class="alert alert-danger" role="alert">
<strong>Warning:</strong> Changing your public key will require your user key to be re-activated by another
user. You will be unable to retrieve any secrets until your key has been reactivated.
</div>
{% endif %}
<form action="." method="post" class="form">
{% csrf_token %}
{% block usercontent %}
{% if userkey.is_active %}
<div class="alert alert-danger" role="alert">
<strong>Warning:</strong> Changing your public key will require your user key to be re-activated by another
user. You will be unable to retrieve any secrets until your key has been reactivated.
</div>
{% endif %}
<form action="." method="post" class="form">
{% csrf_token %}
<div class="form-group">
{% render_field form.public_key %}
</div>
<div class="row">
<div class="form-group">
{% render_field form.public_key %}
<div class="col-sm-6 col-md-6">
<button type="button" class="btn btn-info" id="generate_keypair">Generate a New Key Pair</button>
</div>
<div class="col-sm-6 col-md-6 text-right">
<button type="submit" name="_update" class="btn btn-primary">Save</button>
<a href="{% url 'users:userkey' %}" class="btn btn-default">Cancel</a>
</div>
</div>
<div class="row">
<div class="form-group">
<div class="col-md-6">
<button type="button" class="btn btn-info" id="generate_keypair">Generate a New Key Pair</button>
</div>
</form>
<div class="modal fade" id="new_keypair_modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="new_keypair_modal_title">
New RSA Key Pair
</h4>
</div>
<div class="modal-body">
<strong>New Public Key</strong>
<div class="form-group">
<textarea class="form-control" id="new_pubkey" style="height: 250px;"></textarea>
</div>
<div class="col-md-6 text-right">
<button type="submit" name="_update" class="btn btn-primary">Save</button>
<a href="{% url 'users:userkey' %}" class="btn btn-default">Cancel</a>
<strong>New Private Key</strong>
<div class="form-group">
<textarea class="form-control" id="new_privkey" style="height: 250px;"></textarea>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="modal fade" id="new_keypair_modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="new_keypair_modal_title">
New RSA Key Pair
</h4>
</div>
<div class="modal-body">
<strong>New Public Key</strong>
<div class="form-group">
<textarea class="form-control" id="new_pubkey" style="height: 250px;"></textarea>
<div class="modal-footer text-center">
<button type="button" class="btn btn-danger" id="use_new_pubkey" data-dismiss="modal">I have saved my new private key</button>
</div>
<strong>New Private Key</strong>
<div class="form-group">
<textarea class="form-control" id="new_privkey" style="height: 250px;"></textarea>
</div>
</div>
<div class="modal-footer text-center">
<button type="button" class="btn btn-danger" id="use_new_pubkey" data-dismiss="modal">I have saved my new private key</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascript %}