1
0
Fork 0

Multiple grid/spacing UI fixes on account/avatar templates

merge-requests/149/head
Nikos Roussos 2015-08-13 21:21:24 +03:00
parent 9e0e53cbb8
commit 9d1604d609
28 changed files with 270 additions and 357 deletions

View File

@ -100,6 +100,15 @@ a:hover {
text-align: center; text-align: center;
} }
.form-group {
margin-left: 0px;
margin-right: 0px;
}
.bottom-details {
margin-top: 10px;
}
.img-avatar { .img-avatar {
border: 2px solid white; border: 2px solid white;
border-radius: 50px; border-radius: 50px;
@ -109,6 +118,10 @@ a:hover {
margin-right: 5px; margin-right: 5px;
} }
.form-avatar {
margin-bottom: 10px;
}
.progress { .progress {
margin-bottom: 0px; margin-bottom: 0px;
} }

View File

@ -3,60 +3,60 @@
{% load url from future %} {% load url from future %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block head_title %} - Account{% endblock %} {% block head_title %} - Email{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Email</h2>
<h2>E-mail Addresses</h2> {% if user.emailaddress_set.all %}
{% if user.emailaddress_set.all %} <p>The following email addresses are associated with your account:</p>
<p>The following e-mail addresses are associated with your account:</p>
<form action="{% url 'account_email' %}" class="email_list" method="post">{% csrf_token %} <form action="{% url 'account_email' %}" class="email_list" method="post">{% csrf_token %}
<fieldset class="blockLabels"> <fieldset class="blockLabels">
{% for emailaddress in user.emailaddress_set.all %} {% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="email_radio_{{ forloop.counter }}" class="{% if emailaddress.primary %}primary_email{% endif %}"> <label for="email_radio_{{ forloop.counter }}" class="{% if emailaddress.primary %}primary_email{% endif %}">
<input id="email_radio_{{ forloop.counter }}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{% endif %} value="{{ emailaddress.email }}"/> <input id="email_radio_{{ forloop.counter }}" type="radio" name="email" {% if emailaddress.primary %}checked="checked"{% endif %} value="{{ emailaddress.email }}"/>
{{ emailaddress.email }} {{ emailaddress.email }}
{% if emailaddress.verified %} {% if emailaddress.verified %}
<span class="verified">Verified</span> <span class="glyphicon glyphicon-ok" aria-hidden="true" title="Verified"></span>
{% else %} {% else %}
<span class="unverified">Unverified</span> <span class="glyphicon glyphicon-remove" aria-hidden="true" title="Unverified"></span>
{% endif %} {% endif %}
{% if emailaddress.primary %}<span class="primary">Primary</span>{% endif %} {% if emailaddress.primary %}
</label> <span class="glyphicon glyphicon-star" aria-hidden="true" title="Primary"></span>
</div> {% endif %}
{% endfor %} </label>
<div class="buttonHolder">
<button class="secondaryAction" type="submit" name="action_primary" >Make Primary</button>
<button class="secondaryAction" type="submit" name="action_send" >{Re-send Verification</button>
<button class="primaryAction" type="submit" name="action_remove" >Remove</button>
</div> </div>
{% endfor %}
</fieldset> <div class="buttonHolder">
</form> <button class="btn btn-sm btn-primary" type="submit" name="action_primary">Make Primary</button>
<button class="btn btn-sm btn-default" type="submit" name="action_send">Re-send Verification</button>
<button class="btn btn-sm btn-danger" type="submit" name="action_remove">Remove</button>
</div>
{% else %} </fieldset>
<p>
<strong>Warning:</strong> You currently do not have any e-mail address set up.
You should really add an e-mail address so you can receive notifications,
reset your password, etc.
</p>
{% endif %}
<h2>Add E-mail Address</h2>
<form method="post" action="." class="add_email">{% csrf_token %}
{{ form|crispy }}
<button class="btn" name="action_add" type="submit">Add E-mail</button>
</form> </form>
</div>
{% else %}
<p>
<strong>Warning:</strong> You currently do not have any email address set up.
You should really add an email address so you can receive notifications,
reset your password, etc.
</p>
{% endif %}
<h2>Add Email Address</h2>
<form method="post" action="." class="add_email">{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-sm btn-primary" name="action_add" type="submit">Add Email</button>
</form>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
@ -64,7 +64,7 @@
{% block extra_body %} {% block extra_body %}
<script type="text/javascript"> <script type="text/javascript">
(function() { (function() {
var message = "Do you really want to remove the selected e-mail address?"; var message = "Do you really want to remove the selected email address?";
var actions = document.getElementsByName('action_remove'); var actions = document.getElementsByName('action_remove');
if (actions.length) { if (actions.length) {
actions[0].addEventListener("click", function(e) { actions[0].addEventListener("click", function(e) {

View File

@ -6,28 +6,27 @@
{% block head_title %} - Confirm E-mail Address{% endblock %} {% block head_title %} - Confirm E-mail Address{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-xs-5">
<div class="col-xs-12"> <h2>Confirm E-mail Address</h2>
<h2>Confirm E-mail Address</h2>
{% if confirmation %} {% if confirmation %}
{% user_display confirmation.email_address.user as user_display %} {% user_display confirmation.email_address.user as user_display %}
<p> <p>
Please confirm that <a href="mailto:{{ email }}">{{ email }}</a> Please confirm that <a href="mailto:{{ email }}">{{ email }}</a>
is an e-mail address for user {{ user_display }}. is an e-mail address for user {{ user_display }}.
</p> </p>
<form method="post" action="{% url 'account_confirm_email' confirmation.key %}">{% csrf_token %} <form method="post" action="{% url 'account_confirm_email' confirmation.key %}">
<button class="submit" type="submit">Confirm</button> {% csrf_token %}
</form> <button class="btn btn-primary" type="submit">Confirm</button>
{% else %} </form>
{% url 'account_email' as email_url %} {% else %}
<p> {% url 'account_email' as email_url %}
This e-mail confirmation link expired or is invalid. <p>
Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>. This e-mail confirmation link expired or is invalid.
</p> Please <a href="{{ email_url }}">issue a new e-mail confirmation request</a>.
{% endif %} </p>
</div> {% endif %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -5,16 +5,14 @@
{% block head_title %} - Confirm E-mail Address{% endblock %} {% block head_title %} - Confirm E-mail Address{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-xs-5">
<div class="col-xs-12"> <h2>Confirm E-mail Address</h2>
<h2>Confirm E-mail Address</h2> {% user_display email_address.user as user_display %}
{% user_display email_address.user as user_display %} <p>
<p> You have confirmed that <a href="mailto:{{ email }}">{{ email }}</a>
You have confirmed that <a href="mailto:{{ email }}">{{ email }}</a> is an e-mail address for user {{ user_display }}.
is an e-mail address for user {{ user_display }}. </p>
</p>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -7,36 +7,37 @@
{% block head_title %} - Sign In{% endblock %} {% block head_title %} - Sign In{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Log In</h2>
<h2>Sign In</h2> {% if socialaccount.providers %}
{% if socialaccount.providers %} <p>
<p> Please sign in with one
Please sign in with one of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a> for a {{ site_name }} account and sign in below:
for a {{ site_name }} account and sign in below: </p>
</p>
<div class="socialaccount_ballot"> <div class="socialaccount_ballot">
<ul class="socialaccount_providers"> <ul class="socialaccount_providers">
{% include "socialaccount/snippets/provider_list.html" with process="login" %} {% include "socialaccount/snippets/provider_list.html" with process="login" %}
</ul> </ul>
<div class="login-or">or</div> <div class="login-or">or</div>
</div> </div>
{% include "socialaccount/snippets/login_extra.html" %} {% include "socialaccount/snippets/login_extra.html" %}
{% endif %}
<form class="login" method="POST" action="{% url 'account_login' %}">{% csrf_token %}
{{ form|crispy }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %} {% endif %}
<button class="btn btn-primary" type="submit">Sign In</button>
<form class="login" method="POST" action="{% url 'account_login' %}">{% csrf_token %} <div class="bottom-details">
{{ form|crispy }} <a href="{% url 'account_reset_password' %}">Forgot Password?</a> |
{% if redirect_field_value %} <a href="{% url 'account_signup' %}">Sign Up</a>
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> </div>
{% endif %} </form>
<a class="button secondaryAction" href="{% url 'account_reset_password' %}">Forgot Password?</a>
<button class="btn btn-primary" type="submit">Sign In</button>
</form>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -5,18 +5,16 @@
{% block head_title %} - Sign Out{% endblock %} {% block head_title %} - Sign Out{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Sign Out</h2>
<h2>Sign Out</h2> <p>Are you sure you want to sign out?</p>
<p>Are you sure you want to sign out?</p> <form method="post" action="{% url 'account_logout' %}">{% csrf_token %}
<form method="post" action="{% url 'account_logout' %}">{% csrf_token %} {% if redirect_field_value %}
{% if redirect_field_value %} <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/>
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}"/> {% endif %}
{% endif %} <button class="btn btn-danger" type="submit">Sign Out</button>
<button class="btn btn-danger" type="submit">Sign Out</button> </form>
</form>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -4,16 +4,14 @@
{% block head_title %} - Change Password{% endblock %} {% block head_title %} - Change Password{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Change Password</h2>
<h2>Change Password</h2>
<form method="POST" action="./" class="password_change">{% csrf_token %} <form method="POST" action="./" class="password_change">{% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
<button class="btn" type="submit" name="action">Change Password</button> <button class="btn btn-primary" type="submit" name="action">Change Password</button>
</form> </form>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,11 +0,0 @@
{% extends "account/base.html" %}
{% block head_title %} - Delete Password{% endblock %}
{% block content %}
<h2>Delete Password</h2>
<p>You may delete your password since you are currently logged in using OpenID.</p>
<form method="post" action="./">{% csrf_token %}
<button class="btn" type="submit">delete my password</button>
</form>
{% endblock %}

View File

@ -1,8 +0,0 @@
{% extends "account/base.html" %}
{% block head_title %} - Password Deleted{% endblock %}
{% block content %}
<h2>Password Deleted</h2>
<p>Your password has been deleted.</p>
{% endblock %}

View File

@ -6,22 +6,22 @@
{% block head_title %} - Password Reset{% endblock %} {% block head_title %} - Password Reset{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Password Reset</h2>
<h2>Password Reset</h2> {% if user.is_authenticated %}
{% if user.is_authenticated %} {% include "account/snippets/already_logged_in.html" %}
{% include "account/snippets/already_logged_in.html" %} {% endif %}
{% endif %}
<p>Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it."</p> <p>
Forgotten your password? Enter your e-mail address below,
and we'll send you an e-mail allowing you to reset it.
</p>
<form method="POST" action="./" class="password_reset">{% csrf_token %} <form method="POST" action="./" class="password_reset">{% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
<button class="btn" type="submit">Reset My Password</button> <button class="btn btn-primary" type="submit">Reset</button>
</form> </form>
<p>Please contact us if you have any trouble resetting your password.</p>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -5,15 +5,16 @@
{% block head_title %} - Password Reset{% endblock %} {% block head_title %} - Password Reset{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-xs-12">
<div class="col-xs-12"> <h2>Password Reset</h2>
<h2>Password Reset</h2> {% if user.is_authenticated %}
{% if user.is_authenticated %} {% include "account/snippets/already_logged_in.html" %}
{% include "account/snippets/already_logged_in.html" %} {% endif %}
{% endif %} <p>
<p>We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.</p> We have sent you an e-mail. Please contact us if you do not receive
</div> it within a few minutes.
</p>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -6,25 +6,26 @@
{% block head_title %} - Change Password{% endblock %} {% block head_title %} - Change Password{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-xs-5">
<div class="col-xs-12"> <h2>{% if token_fail %}Bad Token{% else %}Change Password{% endif %}</h2>
<h2>{% if token_fail %}Bad Token{% else %}Change Password{% endif %}</h2>
{% if token_fail %} {% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %} {% url 'account_reset_password' as passwd_reset_url %}
<p>The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.</p> <p>
The password reset link was invalid, possibly because it has already been used.
Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.
</p>
{% else %}
{% if form %}
<form method="POST" action="./">{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary" name="action">Save</button>
</form>
{% else %} {% else %}
{% if form %} <p>Your password is now changed.</p>
<form method="POST" action="./">{% csrf_token %}
{{ form|crispy }}
<button type="submit" name="action">change password</button>
</form>
{% else %}
<p>Your password is now changed.</p>
{% endif %}
{% endif %} {% endif %}
</div> {% endif %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -4,12 +4,10 @@
{% block head_title %} - Change Password{% endblock %} {% block head_title %} - Change Password{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Change Password</h2>
<h2>Change Password</h2> <p>Your password is now changed.</p>
<p>Your password is now changed.'</p>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -6,15 +6,13 @@
{% block head_title %} - Set Password{% endblock %} {% block head_title %} - Set Password{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Set Password</h2>
<h2>Set Password</h2> <form method="POST" action="./" class="password_set">{% csrf_token %}
<form method="POST" action="./" class="password_set">{% csrf_token %} {{ form|crispy }}
{{ form|crispy }} <input type="submit" name="action" value="Set Password"/>
<input type="submit" name="action" value="Set Password"/> </form>
</form>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -6,15 +6,19 @@
{% block title %} - Sign Up{% endblock title %} {% block title %} - Sign Up{% endblock title %}
{% block content %} {% block content %}
<h1>Sign Up</h1> <div class="row">
<div class="col-md-5">
<h1>Sign Up</h1>
<p>Already have an account? Then please <a href="{{ login_url }}">sign in</a>.</p> <p>Already have an account? Then please <a href="{{ login_url }}">log in</a>.</p>
<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">{% csrf_token %} <form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">{% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
{% if redirect_field_value %} {% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %} {% endif %}
<button class="btn" type="submit">Sign Up &raquo;</button> <button class="btn btn-primary" type="submit">Sign Up</button>
</form> </form>
</div>
</div>
{% endblock content %} {% endblock content %}

View File

@ -5,16 +5,14 @@
{% block head_title %} - Invitation only Sign Ups{% endblock %} {% block head_title %} - Invitation only Sign Ups{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Invitation only Sign Ups</h2>
<h2>Invitation only Sign Ups</h2> <p>SatNOGS Network is currently on Alpha state.</p>
<p>SatNOGS Network is currently on Alpha state.</p> <p>
<p> You can though request an account on our
You can though request an account on our <a href="https://community.satnogs.org/" target="_blank">Community forum</a>.
<a href="https://community.satnogs.org/" target="_blank">Community forum</a>. </p>
</p>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -4,16 +4,14 @@
{% block head_title %} - Verify Your E-mail Address{% endblock %} {% block head_title %} - Verify Your E-mail Address{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Verify Your E-mail Address</h2>
<h2>Verify Your E-mail Address</h2> <p>
<p> We have sent an e-mail to <a href="mailto:{{ email }}">{{ email }}</a>
We have sent an e-mail to <a href="mailto:{{ email }}">{{ email }}</a> for verification. Follow the link provided to finalize the signup process.
for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.
Please contact us if you do not receive it within a few minutes. </p>
</p>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -5,22 +5,27 @@
{% block head_title %} - Verify Your E-mail Address{% endblock %} {% block head_title %} - Verify Your E-mail Address{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="row">
<div class="row"> <div class="col-md-5">
<div class="col-md-5"> <h2>Verify Your E-mail Address</h2>
<h2>Verify Your E-mail Address</h2> {% url 'account_email' as email_url %}
{% url 'account_email' as email_url %}
<p>This part of the site requires us to verify that <p>
This part of the site requires us to verify that
you are who you claim to be. For this purpose, we require that you you are who you claim to be. For this purpose, we require that you
verify ownership of your e-mail address.</p> verify ownership of your e-mail address.
</p>
<p>We have sent an e-mail to you for <p>
verification. Please click on the link inside this e-mail. Please We have sent an e-mail to you for
contact us if you do not receive it within a few minutes.</p> verification. Please click on the link inside this e-mail.
Please contact us if you do not receive it within a few minutes.
</p>
<p><strong>Note:</strong> you can still <a href="{{ email_url }}">change your e-mail address</a>.</p> <p>
</div> <strong>Note:</strong> you can still
<a href="{{ email_url }}">change your e-mail address</a>.
</p>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,22 +1 @@
{% extends "avatar/change.html" %}
{% extends "avatar/base.html" %}
{% load avatar_tags %}
{% load url from future %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2>Your current avatar:</h2>
{% avatar user %}
{% if not avatars %}
<p>You haven't uploaded an avatar yet. Please upload one now.</p>
{% endif %}
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}">
{{ upload_avatar_form.as_p }}
<p>{% csrf_token %}<input type="submit" value="Upload New Image" /></p>
</form>
</div>
</div>
</div>
{% endblock %}

View File

@ -3,26 +3,30 @@
{% load url from future %} {% load url from future %}
{% block content %} {% block content %}
<div class="container"> <h2>Avatar</h2>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-md-1">
<h2>Your current avatar:</h2> {% avatar user %}
{% avatar user %} </div>
{% if not avatars %} <div class="col-md-9">
<p>You haven't uploaded an avatar yet. Please upload one now.</p> {% if not avatars %}
{% else %} <p>You haven't uploaded an avatar yet. Showing what found at Gravatar.</p>
<form method="POST" action="{% url 'avatar_change' %}"> {% endif %}
<ul> <form class="form-avatar" enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}">
{{ primary_avatar_form.as_ul }} {% csrf_token %}
</ul> {{ upload_avatar_form.as_p }}
<p>{% csrf_token %}<input type="submit" value="Choose new Default" /></p> <input type="submit" class="btn btn-sm btn-primary" value="Upload New Image">
</form> </form>
{% endif %} {% if avatars %}
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}"> <form class="form-avatar" method="POST" action="{% url 'avatar_delete' %}">
{{ upload_avatar_form.as_p }} {% csrf_token %}
<p>{% csrf_token %}<input type="submit" value="Upload New Image" /></p> {% for avatar in avatars %}
<input name="choices" value="{{ avatar.id }}" type="hidden">
{% endfor %}
<input type="submit" class="btn btn-sm btn-danger" value="Delete Current Avatar">
</form> </form>
{% endif %}
</div> </div>
</div> </div>
</div>
{% endblock %} {% endblock %}

View File

@ -1,23 +0,0 @@
{% extends "avatar/base.html" %}
{% load url from future %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2>Please select the avatars that you would like to delete.</h2>
{% if not avatars %}
{% url 'avatar_change' as avatar_change_url %}
<p>You have no avatars to delete. Please <a href="{{ avatar_change_url }}">upload one</a> now.</p>
{% else %}
<form method="POST" action="{% url 'avatar_delete' %}">
<ul>
{{ delete_avatar_form.as_ul }}
</ul>
<p>{% csrf_token %}<input type="submit" value="Delete These" /></p>
</form>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -6,7 +6,7 @@
<html lang="en" ng-app> <html lang="en" ng-app>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>SatNOGS - Network{% block title %}{% endblock title %}</title> <title>SatNOGS Network{% block title %}{% endblock title %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static 'css/lib/bootstrap.min.css' %}"> <link rel="stylesheet" href="{% static 'css/lib/bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'css/lib/bootstrap-theme.min.css' %}"> <link rel="stylesheet" href="{% static 'css/lib/bootstrap-theme.min.css' %}">

View File

@ -11,8 +11,8 @@
<h2>{% avatar user 50 %} {{ user.displayname }} <h2>{% avatar user 50 %} {{ user.displayname }}
{% if user == request.user %} {% if user == request.user %}
<div class="pull-right edit-profile-buttons"> <div class="pull-right edit-profile-buttons">
<a class="btn btn-primary" href="{% url 'users:update_user' %}">My Info</a> <a class="btn btn-primary" href="{% url 'users:update_user' %}">Settings</a>
<a class="btn btn-primary" href="{% url 'account_email' %}">E-Mail</a> <a class="btn btn-primary" href="{% url 'account_email' %}">Email</a>
<a class="btn btn-primary" href="{% url 'avatar_change' %}">Avatar</a> <a class="btn btn-primary" href="{% url 'avatar_change' %}">Avatar</a>
<a class="btn btn-info" data-toggle="modal" data-target="#APIModal" href="#">API Key</a> <a class="btn btn-info" data-toggle="modal" data-target="#APIModal" href="#">API Key</a>
</div> </div>
@ -22,7 +22,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-md-12">
<h3>Ground Stations</h3> <h3>Ground Stations</h3>
</div> </div>
</div> </div>
@ -96,7 +96,7 @@
{% endif %} {% endif %}
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-md-12">
<h3>Observations</h3> <h3>Observations</h3>
</div> </div>
</div> </div>

View File

@ -1,22 +1,23 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% load avatar_tags %}
{% block title %} - User: {{ user.username }}{% endblock %} {% block title %} - Settings{% endblock %}
{% block content %} {% block content %}
<h2>{% block header %}User: {{ user.username }}{% endblock %}</h2>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-md-5">
<h1>{% block header %}User: {{ user.username }}{% endblock %}</h1> <form method="post"
<form class="form-horizontal"
method="post"
action="{% url 'users:update_user' %}">{% csrf_token %} action="{% url 'users:update_user' %}">{% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
<button type="submit" class="btn btn-default">Update</button> <button type="submit" class="btn btn-sm btn-primary">Update</button>
</div>
</div> </div>
</form> </div>
</form>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,26 +0,0 @@
{% extends "base.html" %}
{% load static %}
{% load avatar_tags %}
{% block title %} - Members{% endblock %}
{% block content %}
<div class="row">
<div class="col-xs-12">
<h2>Users</h2>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="list-group">
{% for user in user_list %}
<a href="{% url 'users:view_user' username=user.username %}" class="list-group-item">
<h4 class="list-group-item-heading">{% avatar user 35 %} {{ user.username }}</h4>
<p class="list-group-item-text">{{ maker.tagline }}</p>
</a>
{% endfor %}
</div>
</div>
</div>
{% endblock content %}

View File

@ -5,7 +5,6 @@ from network.users import views
urlpatterns = patterns( urlpatterns = patterns(
'network.users.views', 'network.users.views',
url(r'^$', view=views.UserListView.as_view(), name='list_user'),
url(r'^redirect/$', view=views.UserRedirectView.as_view(), name='redirect_user'), url(r'^redirect/$', view=views.UserRedirectView.as_view(), name='redirect_user'),
url(r'^update/$', view=views.UserUpdateView.as_view(), name='update_user'), url(r'^update/$', view=views.UserUpdateView.as_view(), name='update_user'),
url(r'^(?P<username>[\w.@+-]+)/$', 'view_user', name='view_user'), url(r'^(?P<username>[\w.@+-]+)/$', 'view_user', name='view_user'),

View File

@ -15,12 +15,6 @@ from network.base.forms import StationForm
from network.base.models import Station, Observation, Antenna from network.base.models import Station, Observation, Antenna
class UserDetailView(LoginRequiredMixin, DetailView):
model = User
slug_field = "username"
slug_url_kwarg = "username"
class UserRedirectView(LoginRequiredMixin, RedirectView): class UserRedirectView(LoginRequiredMixin, RedirectView):
permanent = False permanent = False
@ -43,12 +37,6 @@ class UserUpdateView(LoginRequiredMixin, UpdateView):
return User.objects.get(username=self.request.user.username) return User.objects.get(username=self.request.user.username)
class UserListView(LoginRequiredMixin, ListView):
model = User
slug_field = "username"
slug_url_kwarg = "username"
def view_user(request, username): def view_user(request, username):
"""View for user page.""" """View for user page."""
user = User.objects.get(username=username) user = User.objects.get(username=username)

View File

@ -17,7 +17,7 @@ Pillow==2.8.1
# Users # Users
django-allauth==0.20.0 django-allauth==0.20.0
-e git+https://github.com/comzeradd/django-avatar.git@gravatar_https#egg=avatar django-avatar==2.1.1
django-crispy-forms==1.4.0 django-crispy-forms==1.4.0
# Astronomy # Astronomy