1
0
Fork 0

Merge pull request #149 from satnogs/ui-fixes

Ui fixes
merge-requests/152/head
Nikos Roussos 2015-08-13 21:22:19 +03:00
commit 6974c55258
36 changed files with 341 additions and 386 deletions

View File

@ -1,5 +1,3 @@
from django.conf import settings
from django.contrib.sites.models import Site
from rest_framework import serializers
from network.base.models import Data

View File

@ -74,6 +74,12 @@ class Station(models.Model):
else:
return format_html('<span style="color:red">Offline</span>')
@property
def success_rate(self):
observations = self.data_set.all().count()
success = self.data_set.exclude(payload='').count()
return int(100 * (float(success) / float(observations)))
def __unicode__(self):
return "%d - %s" % (self.pk, self.name)

View File

@ -20,3 +20,11 @@ def frq(value):
formatted = format(float(to_format) / 1000000, '.3f')
formatted = formatted + ' Mhz'
return formatted
@register.filter
def percentagerest(value):
try:
return 100 - value
except (TypeError, ValueError):
return 0

View File

@ -1,6 +1,7 @@
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from network.base.views import StationAllView
urlpatterns = patterns(
'network.base.views',
@ -20,4 +21,6 @@ urlpatterns = patterns(
url(r'^stations/$', 'stations_list', name='stations_list'),
url(r'^stations/(?P<id>[0-9]+)/$', 'station_view', name='station_view'),
url(r'^stations/edit/$', 'station_edit', name='station_edit'),
url(r'^stations_all/$', StationAllView.as_view({'get': 'list'}), name='stations_all'),
)

View File

@ -12,12 +12,25 @@ from django.http import JsonResponse, HttpResponseNotFound, HttpResponseServerEr
from django.contrib.auth.decorators import login_required
from django.core.management import call_command
from rest_framework import serializers, viewsets
from network.base.models import (Station, Transmitter, Observation,
Data, Satellite, Antenna)
from network.base.forms import StationForm
from network.base.decorators import admin_required
class StationSerializer(serializers.ModelSerializer):
class Meta:
model = Station
fields = ('name', 'lat', 'lng')
class StationAllView(viewsets.ReadOnlyModelViewSet):
queryset = Station.objects.all()
serializer_class = StationSerializer
def index(request):
"""View to render index page."""
observations = Observation.objects.all()
@ -126,7 +139,8 @@ def observation_new(request):
def prediction_windows(request, sat_id, start_date, end_date):
try:
sat = Satellite.objects.filter(transmitters__alive=True).distinct().get(norad_cat_id=sat_id)
sat = Satellite.objects.filter(transmitters__alive=True). \
distinct().get(norad_cat_id=sat_id)
except:
data = {
'error': 'You should select a Satellite first.'

View File

@ -59,8 +59,6 @@ body {
font-family:'ClearSans';
}
a:hover {
text-decoration: none;
}
@ -102,6 +100,15 @@ a:hover {
text-align: center;
}
.form-group {
margin-left: 0px;
margin-right: 0px;
}
.bottom-details {
margin-top: 10px;
}
.img-avatar {
border: 2px solid white;
border-radius: 50px;
@ -111,6 +118,14 @@ a:hover {
margin-right: 5px;
}
.form-avatar {
margin-bottom: 10px;
}
.progress {
margin-bottom: 0px;
}
footer {
margin-bottom: 10px;
}

View File

@ -3,6 +3,7 @@ $(document).ready(function() {
var mapboxid = $('div#map').data('mapboxid');
var mapboxtoken = $('div#map').data('mapboxtoken');
var stations = $('div#map').data('stations');
L.mapbox.accessToken = mapboxtoken;
L.mapbox.config.FORCE_HTTPS = true;
@ -10,14 +11,9 @@ $(document).ready(function() {
zoomControl: false
}).setView([40, 0], 3);
var LocLayer = L.mapbox.featureLayer().addTo(map);
$('#successful a.toggle').click(function (e) {
e.preventDefault();
$(this).tab('show');
})
$.ajax({
url: '/api/stations/?format=json'
url: stations
}).done(function(data) {
data.forEach(function(m) {
L.mapbox.featureLayer({

View File

@ -3,60 +3,60 @@
{% load url from future %}
{% load crispy_forms_tags %}
{% block head_title %} - Account{% endblock %}
{% block head_title %} - Email{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-md-5">
<h2>E-mail Addresses</h2>
{% if user.emailaddress_set.all %}
<p>The following e-mail addresses are associated with your account:</p>
<div class="row">
<div class="col-md-5">
<h2>Email</h2>
{% if user.emailaddress_set.all %}
<p>The following email addresses are associated with your account:</p>
<form action="{% url 'account_email' %}" class="email_list" method="post">{% csrf_token %}
<fieldset class="blockLabels">
<form action="{% url 'account_email' %}" class="email_list" method="post">{% csrf_token %}
<fieldset class="blockLabels">
{% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder">
<label for="email_radio_{{ forloop.counter }}" class="{% if emailaddress.primary %}primary_email{% endif %}">
{% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder">
<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 }}
{% if emailaddress.verified %}
<span class="verified">Verified</span>
{% else %}
<span class="unverified">Unverified</span>
{% endif %}
{% if emailaddress.primary %}<span class="primary">Primary</span>{% endif %}
</label>
</div>
{% endfor %}
<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>
{{ emailaddress.email }}
{% if emailaddress.verified %}
<span class="glyphicon glyphicon-ok" aria-hidden="true" title="Verified"></span>
{% else %}
<span class="glyphicon glyphicon-remove" aria-hidden="true" title="Unverified"></span>
{% endif %}
{% if emailaddress.primary %}
<span class="glyphicon glyphicon-star" aria-hidden="true" title="Primary"></span>
{% endif %}
</label>
</div>
{% endfor %}
</fieldset>
</form>
<div class="buttonHolder">
<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 %}
<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>
</fieldset>
</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>
{% endblock %}
@ -64,7 +64,7 @@
{% block extra_body %}
<script type="text/javascript">
(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');
if (actions.length) {
actions[0].addEventListener("click", function(e) {

View File

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

View File

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

View File

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

View File

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

View File

@ -4,16 +4,14 @@
{% block head_title %} - Change Password{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-md-5">
<h2>Change Password</h2>
<div class="row">
<div class="col-md-5">
<h2>Change Password</h2>
<form method="POST" action="./" class="password_change">{% csrf_token %}
{{ form|crispy }}
<button class="btn" type="submit" name="action">Change Password</button>
</form>
</div>
<form method="POST" action="./" class="password_change">{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit" name="action">Change Password</button>
</form>
</div>
</div>
{% 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 content %}
<div class="container">
<div class="row">
<div class="col-md-5">
<h2>Password Reset</h2>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<div class="row">
<div class="col-md-5">
<h2>Password Reset</h2>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% 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|crispy }}
<button class="btn" type="submit">Reset My Password</button>
</form>
<p>Please contact us if you have any trouble resetting your password.</p>
</div>
<form method="POST" action="./" class="password_reset">{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-primary" type="submit">Reset</button>
</form>
</div>
</div>
{% endblock %}

View File

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

View File

@ -6,25 +6,26 @@
{% block head_title %} - Change Password{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2>{% if token_fail %}Bad Token{% else %}Change Password{% endif %}</h2>
<div class="row">
<div class="col-xs-5">
<h2>{% if token_fail %}Bad Token{% else %}Change Password{% endif %}</h2>
{% if token_fail %}
{% 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>
{% if token_fail %}
{% 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>
{% else %}
{% if form %}
<form method="POST" action="./">{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary" name="action">Save</button>
</form>
{% else %}
{% if form %}
<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 %}
<p>Your password is now changed.</p>
{% endif %}
</div>
{% endif %}
</div>
</div>
{% endblock %}

View File

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

View File

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

View File

@ -6,15 +6,19 @@
{% block title %} - Sign Up{% endblock title %}
{% 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|crispy }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button class="btn" type="submit">Sign Up &raquo;</button>
</form>
<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">{% csrf_token %}
{{ form|crispy }}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<button class="btn btn-primary" type="submit">Sign Up</button>
</form>
</div>
</div>
{% endblock content %}

View File

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

View File

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

View File

@ -5,22 +5,27 @@
{% block head_title %} - Verify Your E-mail Address{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-md-5">
<h2>Verify Your E-mail Address</h2>
{% url 'account_email' as email_url %}
<div class="row">
<div class="col-md-5">
<h2>Verify Your E-mail Address</h2>
{% 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
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
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>
We have sent an e-mail to you for
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>
</div>
<p>
<strong>Note:</strong> you can still
<a href="{{ email_url }}">change your e-mail address</a>.
</p>
</div>
</div>
{% endblock %}

View File

@ -1,22 +1 @@
{% 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 %}
{% extends "avatar/change.html" %}

View File

@ -3,26 +3,30 @@
{% load url from future %}
{% block content %}
<div class="container">
<h2>Avatar</h2>
<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>
{% else %}
<form method="POST" action="{% url 'avatar_change' %}">
<ul>
{{ primary_avatar_form.as_ul }}
</ul>
<p>{% csrf_token %}<input type="submit" value="Choose new Default" /></p>
</form>
{% 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>
<div class="col-md-1">
{% avatar user %}
</div>
<div class="col-md-9">
{% if not avatars %}
<p>You haven't uploaded an avatar yet. Showing what found at Gravatar.</p>
{% endif %}
<form class="form-avatar" enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}">
{% csrf_token %}
{{ upload_avatar_form.as_p }}
<input type="submit" class="btn btn-sm btn-primary" value="Upload New Image">
</form>
{% if avatars %}
<form class="form-avatar" method="POST" action="{% url 'avatar_delete' %}">
{% csrf_token %}
{% 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>
{% endif %}
</div>
</div>
</div>
{% 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>
<head>
<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">
<link rel="stylesheet" href="{% static 'css/lib/bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'css/lib/bootstrap-theme.min.css' %}">

View File

@ -10,7 +10,7 @@
{% endblock css %}
{% block prenav-content %}
<div id="map" data-mapboxid="{{ mapbox_id }}" data-mapboxtoken="{{ mapbox_token }}"></div>
<div id="map" data-mapboxid="{{ mapbox_id }}" data-mapboxtoken="{{ mapbox_token }}" data-stations="{% url 'base:stations_all' %}"></div>
{% endblock prenav-content %}
{% block content %}
@ -72,21 +72,19 @@
{% endfor %}
</span>
</div>
<!--
<div class="gs-front-line">
<span class="label label-info">Success Rate</span>
<span class="gs-front-data">
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 88%">
<span class="sr-only">88% Complete (success)</span>
<div class="progress" title="{{ featured_station.success_rate }}%">
<div class="progress-bar progress-bar-success" style="width: {{ featured_station.success_rate }}%">
<span class="sr-only">{{ featured_station.success_rate }}% Complete (success)</span>
</div>
<div class="progress-bar progress-bar-danger" style="width: 12%">
<span class="sr-only">12% Complete (danger)</span>
<div class="progress-bar progress-bar-danger" style="width: {{ featured_station.success_rate|percentagerest }}%">
<span class="sr-only">{{ featured_station.success_rate|percentagerest }}% Complete (danger)</span>
</div>
</div>
</span>
</div>
-->
</div>
</div>
</div>
@ -95,14 +93,14 @@
<div class="{% if featured_station %}col-md-8{% else %}col-md-12{% endif %}">
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a href="#successful" class="toggle" role="tab" data-toggle="tab">Latest Observations</a>
<a href="#latest" class="toggle" role="tab" data-toggle="tab">Latest Observations</a>
</li>
<li>
<a href="#scheduled" class="toggle" role="tab" data-toggle="tab">Scheduled Observations</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="successful">
<div class="tab-pane active" id="latest">
<table class="table table-hover">
<thead>
<th>ID</th>
@ -118,10 +116,10 @@
<td>
<a href="{% url 'base:observation_view' id=observation.id %}">
<span class="label
{% if not observation.data_set.all %}
label-danger
{% else %}
{% if observation.has_data %}
label-success
{% else %}
label-danger
{% endif %}">
{{ observation.id }}
</span>

View File

@ -73,6 +73,19 @@
{{ station.created|timesince }} ago
</span>
</div>
<div class="gs-front-line">
<span class="label label-default">Success Rate</span>
<span class="gs-front-data">
<div class="progress" title="{{ station.success_rate }}%">
<div class="progress-bar progress-bar-success" style="width: {{ station.success_rate }}%">
<span class="sr-only">{{ station.success_rate }}% Complete (success)</span>
</div>
<div class="progress-bar progress-bar-danger" style="width: {{ station.success_rate|percentagerest }}%">
<span class="sr-only">{{ station.success_rate|percentagerest }}% Complete (danger)</span>
</div>
</div>
</span>
</div>
<div class="gs-front-line">
{% if station.online %}
<span class="label label-success">Online</span>
@ -81,7 +94,11 @@
{% endif %}
<span class="gs-front-data"
title="{{ station.last_seen|date:"c" }}">
Last seen {{ station.last_seen|timesince }} ago
{% if station.last_seen %}
Last seen {{ station.last_seen|timesince }} ago
{% else %}
Never seen
{% endif %}
</span>
</div>
</div>

View File

@ -11,8 +11,8 @@
<h2>{% avatar user 50 %} {{ user.displayname }}
{% if user == request.user %}
<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 'account_email' %}">E-Mail</a>
<a class="btn btn-primary" href="{% url 'users:update_user' %}">Settings</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-info" data-toggle="modal" data-target="#APIModal" href="#">API Key</a>
</div>
@ -22,7 +22,7 @@
</div>
<div class="row">
<div class="col-sm-12">
<div class="col-md-12">
<h3>Ground Stations</h3>
</div>
</div>
@ -96,7 +96,7 @@
{% endif %}
<div class="row">
<div class="col-sm-12">
<div class="col-md-12">
<h3>Observations</h3>
</div>
</div>
@ -118,10 +118,10 @@
<td>
<a href="{% url 'base:observation_view' id=observation.id %}">
<span class="label
{% if not observation.data_set.all %}
label-danger
{% else %}
{% if observation.has_data %}
label-success
{% else %}
label-danger
{% endif %}">
{{ observation.id }}
</span>

View File

@ -1,22 +1,23 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% load avatar_tags %}
{% block title %} - User: {{ user.username }}{% endblock %}
{% block title %} - Settings{% endblock %}
{% block content %}
<h2>{% block header %}User: {{ user.username }}{% endblock %}</h2>
<div class="row">
<div class="col-lg-12">
<h1>{% block header %}User: {{ user.username }}{% endblock %}</h1>
<form class="form-horizontal"
method="post"
<div class="col-md-5">
<form method="post"
action="{% url 'users:update_user' %}">{% csrf_token %}
{{ form|crispy }}
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-default">Update</button>
</div>
{{ form|crispy }}
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-sm btn-primary">Update</button>
</div>
</form>
</div>
</form>
</div>
</div>
{% 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(
'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'^update/$', view=views.UserUpdateView.as_view(), name='update_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
class UserDetailView(LoginRequiredMixin, DetailView):
model = User
slug_field = "username"
slug_url_kwarg = "username"
class UserRedirectView(LoginRequiredMixin, RedirectView):
permanent = False
@ -43,12 +37,6 @@ class UserUpdateView(LoginRequiredMixin, UpdateView):
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):
"""View for user page."""
user = User.objects.get(username=username)

View File

@ -17,7 +17,7 @@ Pillow==2.8.1
# Users
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
# Astronomy