kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fixed timezone fixture problem, added default project from first dashboard access
rodzic
f290cfeb5a
commit
85633f54d3
|
@ -11,7 +11,7 @@
|
|||
email: test@mail.com
|
||||
is_staff: true
|
||||
is_active: true
|
||||
date_joined: 2016-09-11 22:26:52.582858+00:00
|
||||
date_joined: '2016-09-11T22:26:52.582858+00:00'
|
||||
groups: []
|
||||
user_permissions: []
|
||||
- model: auth.user
|
||||
|
@ -27,6 +27,6 @@
|
|||
email: test2@mail.com
|
||||
is_staff: true
|
||||
is_active: true
|
||||
date_joined: 2016-09-11 22:26:52.582858+00:00
|
||||
date_joined: '2016-09-11T22:26:52.582858+00:00'
|
||||
groups: []
|
||||
user_permissions: []
|
|
@ -2,7 +2,7 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
{% if show_welcome %}
|
||||
{% if no_processingnodes %}
|
||||
<h3>{% trans 'Welcome!' %}</h3>
|
||||
{% else %}
|
||||
<h3>{% trans 'Dashboard' %}</h3>
|
||||
|
@ -21,14 +21,11 @@
|
|||
|
||||
{% 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 %}
|
||||
|
||||
{% 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>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
|
|
|
@ -61,6 +61,9 @@ class TestApp(TestCase):
|
|||
# Login
|
||||
c.post('/login/', data=self.credentials, follow=True)
|
||||
|
||||
# We should have a project created from the dashboard
|
||||
self.assertTrue(Project.objects.count() >= 1)
|
||||
|
||||
# We can access a processingnode view that exists
|
||||
res = c.get('/processingnode/1/')
|
||||
self.assertTrue(res.status_code == 200)
|
||||
|
|
13
app/views.py
13
app/views.py
|
@ -4,6 +4,7 @@ from nodeodm.models import ProcessingNode
|
|||
from .models import Project
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
def index(request):
|
||||
return redirect('dashboard' if request.user.is_authenticated()
|
||||
|
@ -11,13 +12,15 @@ def index(request):
|
|||
|
||||
@login_required
|
||||
def dashboard(request):
|
||||
no_projects = Project.objects.count() == 0
|
||||
no_processingnodes = ProcessingNode.objects.count() == 0 and no_projects
|
||||
no_processingnodes = ProcessingNode.objects.count() == 0
|
||||
|
||||
# Create first project automatically
|
||||
if Project.objects.count() == 0:
|
||||
proj = Project(owner=request.user, name=_("First Project"))
|
||||
proj.save()
|
||||
|
||||
return render(request, 'app/dashboard.html', {'title': 'Dashboard',
|
||||
'no_projects': no_projects,
|
||||
'no_processingnodes': no_processingnodes,
|
||||
'show_welcome': no_projects and no_processingnodes})
|
||||
'no_processingnodes': no_processingnodes})
|
||||
|
||||
@login_required
|
||||
def processing_node(request, processing_node_id):
|
||||
|
|
Ładowanie…
Reference in New Issue