Merge pull request #23 from pierotofy/master

Dashboard text additions, timezone handling in node processing view
pull/26/head
Piero Toffanin 2016-09-30 13:38:03 -04:00 zatwierdzone przez GitHub
commit da48c63cda
8 zmienionych plików z 79 dodań i 12 usunięć

Wyświetl plik

@ -19,6 +19,8 @@
color: white; color: white;
text-decoration: none; text-decoration: none;
background-color: #2c3e50; } background-color: #2c3e50; }
#navbar-top ul#side-menu li {
word-break: break-word; }
#navbar-top .navbar-top-links li a.dropdown-toggle { #navbar-top .navbar-top-links li a.dropdown-toggle {
height: 50px; } height: 50px; }
#navbar-top .user-profile { #navbar-top .user-profile {
@ -32,6 +34,8 @@ ul#side-menu.nav a {
.content { .content {
clear: both; } clear: both; }
.content h1, .content h2, .content h3, .content h4, .content h5 {
padding-top: 4px; }
.top-buffer { .top-buffer {
margin-top: 15px; } margin-top: 15px; }
@ -45,4 +49,7 @@ ul#side-menu.nav a {
table.table-first-col-bold td:first-child { table.table-first-col-bold td:first-child {
font-weight: bold; } font-weight: bold; }
button span.glyphicon {
margin-right: 4px; }
/*# sourceMappingURL=main.css.map */ /*# sourceMappingURL=main.css.map */

Wyświetl plik

@ -1,6 +1,6 @@
{ {
"version": 3, "version": 3,
"mappings": "AAAA,WAAW;EACP,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,IAAI;EAChB,gBAAgB,EAAE,OAAO;EAEzB,yBAAa;IACT,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,GAAG;EAEhB,wBAAY;IACR,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,GAAG;EAGpB,8BAAkB;IACd,KAAK,EAAE,KAAK;IACZ,eAAe,EAAE,IAAI;EAIrB,+CAAiB;IACb,KAAK,EAAE,KAAK;EAGhB,qHAAyB;IACrB,gBAAgB,EAAE,OAAO;EAM7B,kEAAgB;IACZ,KAAK,EAAE,KAAK;IACZ,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,OAAO;EAIjC,kDAAsC;IAClC,MAAM,EAAE,IAAI;EA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AY,EAAE,GAAG",
"sources": ["main.scss"], "sources": ["main.scss"],
"names": [], "names": [],
"file": "main.css" "file": "main.css"

Wyświetl plik

@ -34,6 +34,10 @@
text-decoration: none; text-decoration: none;
background-color: #2c3e50; background-color: #2c3e50;
} }
li{
word-break: break-word;
}
} }
.navbar-top-links li a.dropdown-toggle{ .navbar-top-links li a.dropdown-toggle{
@ -58,6 +62,9 @@ ul#side-menu.nav{
.content{ .content{
clear: both; clear: both;
h1,h2,h3,h4,h5{
padding-top: 4px;
}
} }
.top-buffer { .top-buffer {
@ -77,3 +84,7 @@ table.table-first-col-bold{
font-weight: bold; font-weight: bold;
} }
} }
button i.glyphicon{
margin-right: 4px;
}

Wyświetl plik

@ -1,5 +1,41 @@
{% extends "app/logged_in_base.html" %} {% extends "app/logged_in_base.html" %}
{% load i18n %}
{% block content %} {% block content %}
<div class="test">Hello dashboard</div> {% if show_welcome %}
<h3>{% trans 'Welcome!' %}</h3>
{% else %}
<h3>{% trans 'Dashboard' %}</h3>
{% endif %}
{% if no_processingnodes %}
{% trans 'Add a Processing Node' as add_processing_node %}
{% with nodeodm_link='<a href="https://github.com/pierotofy/node-OpenDroneMap" target="_blank">node-OpenDroneMap</a>' api_link='<a href="https://github.com/pierotofy/node-OpenDroneMap/blob/master/docs/index.adoc" target="_blank">API</a>' %}
<p>
{% blocktrans %}
To get started, "{{ add_processing_node }}". A processing node is a computer running an instance of {{ nodeodm_link }} or some other software that implements this {{ api_link }}.
{% endblocktrans %}
</p>
{% endwith %}
<button class="btn btn-primary" onclick="location.href='{% url "admin:nodeodm_processingnode_add" %}';"><i class="fa fa-plus-circle"></i> {{ add_processing_node }}</button>
{% else %}
{% if no_projects %}
{% trans 'Upload Images' as upload_images %}
<p>
{% blocktrans %} To create a new project, press the "{{ upload_images }}" button. {% endblocktrans %}
</p>
<button class="btn btn-primary"><i class="glyphicon glyphicon-upload"></i> {{ upload_images }}</button>
{% endif %}
<p>
<ul>
<li>{% trans 'Need at least 5 images' %}</li>
<li>{% trans 'Images must overlap by 60% or more' %}</li>
</ul>
</p>
{% endif %}
<!-- <h4>Projects</h4> -->
{% endblock %} {% endblock %}

Wyświetl plik

@ -208,11 +208,11 @@
</a> </a>
<ul class="dropdown-menu dropdown-user"> <ul class="dropdown-menu dropdown-user">
<li class="user-profile"> <li class="user-profile">
Hello, {{ user.username }}<br/> {% trans 'Hello' %}, {{ user.username }}<br/>
<span class="email">{{ user.email }}</span> <span class="email">{{ user.email }}</span>
</li> </li>
<li class="divider"></li> <li class="divider"></li>
<li><a href="/logout/"><i class="fa fa-sign-out fa-fw"></i> Logout</a> <li><a href="/logout/"><i class="fa fa-sign-out fa-fw"></i> {% trans 'Logout' %}</a>
</li> </li>
</ul> </ul>
<!-- /.dropdown-user --> <!-- /.dropdown-user -->
@ -235,7 +235,7 @@
</div> </div>
</li>--> </li>-->
<li> <li>
<a href="/dashboard/"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a> <a href="/dashboard/"><i class="fa fa-dashboard fa-fw"></i> {% trans 'Dashboard' %}</a>
</li> </li>
<!--<li> <!--<li>
<a href="#"><i class="fa fa-plane fa-fw"></i> Mission Planner</a> <a href="#"><i class="fa fa-plane fa-fw"></i> Mission Planner</a>
@ -252,18 +252,18 @@
</li> </li>
{% endfor %} {% endfor %}
<li> <li>
<a href="/admin/nodeodm/processingnode/add/"><span class="fa fa-plus-circle"></span> Add New</a> <a href="{% url 'admin:nodeodm_processingnode_add' %}"><span class="fa fa-plus-circle"></span> Add New</a>
</li> </li>
</ul> </ul>
<!-- /.nav-second-level --> <!-- /.nav-second-level -->
</li> </li>
{% if user.is_superuser %} {% if user.is_superuser %}
<li> <li>
<a href="/admin/"><i class="fa fa-gears fa-fw"></i> Admin Panel</a> <a href="/admin/"><i class="fa fa-gears fa-fw"></i> {% trans 'Administration' %}</a>
</li> </li>
{% endif %} {% endif %}
<li> <li>
<a href="#"><i class="fa fa-life-saver fa-fw"></i> Documentation</a> <a href="#"><i class="fa fa-life-saver fa-fw"></i> {% trans 'Documentation' %}</a>
</li> </li>
</ul> </ul>
</div> </div>

Wyświetl plik

@ -1,5 +1,5 @@
{% extends "app/logged_in_base.html" %} {% extends "app/logged_in_base.html" %}
{% load i18n %} {% load i18n tz %}
{% block content %} {% block content %}
<h3>Processing Node</h3> <h3>Processing Node</h3>
@ -22,13 +22,19 @@
</tr> </tr>
<tr> <tr>
<td>{% trans "Last Refreshed" %}</td> <td>{% trans "Last Refreshed" %}</td>
<td>{{ processing_node.last_refreshed }}</td> <!-- TODO: timezone? --> <td>{{ processing_node.last_refreshed|timesince }} {% trans 'ago' %} ({{ processing_node.last_refreshed|localtime }})</td> <!-- TODO: timezone? -->
</tr> </tr>
<tr> <tr>
<td>{% trans "Options (JSON)" %}</td> <td>{% trans "Options (JSON)" %}</td>
<td><div id="processing_node_json"></div></td> <td><div id="processing_node_json"></div></td>
</tr> </tr>
</table> </table>
{% if user.is_superuser %}
<div class="text-center">
<button class="btn btn-default" onclick="location.href='{% url "admin:nodeodm_processingnode_change" processing_node.id %}';"><i class="glyphicon glyphicon-pencil"></i> {% trans "Edit" %}</button>
<button class="btn btn-danger" onclick="location.href='{% url "admin:nodeodm_processingnode_delete" processing_node.id %}';"><i class="glyphicon glyphicon-trash"></i> {% trans "Delete" %}</button>
</div>
{% endif %}
<script> <script>
$(function(){ $(function(){
// TODO: we'll need a prettier console library to display stuff like // TODO: we'll need a prettier console library to display stuff like

Wyświetl plik

@ -1,6 +1,7 @@
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse from django.http import HttpResponse
from nodeodm.models import ProcessingNode from nodeodm.models import ProcessingNode
from .models import Project
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
@ -10,7 +11,13 @@ def index(request):
@login_required @login_required
def dashboard(request): def dashboard(request):
return render(request, 'app/dashboard.html', {'title': 'Dashboard'}) no_projects = Project.objects.count() == 0
no_processingnodes = ProcessingNode.objects.count() == 0 and no_projects
return render(request, 'app/dashboard.html', {'title': 'Dashboard',
'no_projects': no_projects,
'no_processingnodes': no_processingnodes,
'show_welcome': no_projects and no_processingnodes})
@login_required @login_required
def processing_node(request, processing_node_id): def processing_node(request, processing_node_id):

Wyświetl plik

@ -115,7 +115,7 @@ AUTH_PASSWORD_VALIDATORS = [
# https://docs.djangoproject.com/en/1.10/topics/i18n/ # https://docs.djangoproject.com/en/1.10/topics/i18n/
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC' TIME_ZONE = None # Use local server time
USE_I18N = True USE_I18N = True
USE_L10N = True USE_L10N = True
USE_TZ = True USE_TZ = True