Skip to content
Snippets Groups Projects
Commit 79a92a74 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files
parents 1505f3f4 a6ae9f0e
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,6 @@ class WorkerAddForm(ModelForm): ...@@ -28,7 +28,6 @@ class WorkerAddForm(ModelForm):
class Meta: class Meta:
model = Worker model = Worker
exclude = ['appointments'] exclude = ['appointments']
#fields = '__all__'
class WorkerDetailForm(ModelForm): class WorkerDetailForm(ModelForm):
......
...@@ -23,11 +23,56 @@ ...@@ -23,11 +23,56 @@
{% block maincontent %} {% block maincontent %}
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-5">
<h3>Planning</h3> <h3>Visits</h3>
{% if visit_list %}
<table id="visit_table" class="table table-bordered table-striped">
<thead>
<tr>
<th>Subject name</th>
<th>Full information</th>
<th>Visit begins</th>
<th>Visit ends</th>
<th>Visit type</th>
<th>Finished?</th>
</tr>
</thead>
<tbody>
{% for visit in visit_list %}
<tr>
<td>{{ visit.subject.firstName }} {{ visit.subject.lastName }}</td>
<td>
<button type="button" class="btn btn-block btn-default btn-xs">See full information</button>
</td>
<td>
{{ visit.visitBegin }}
</td>
<td>
{{ visit.visitEnd }}
</td>
<td>
{{ visit.get_visitType_display }}
</td>
<td>
{% if visit.visitFinished %}<button type="button" class="btn btn-block btn-danger">YES</button>
{% else %}<button type="button" class="btn btn-block btn-success">NO</button>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No visits to display.</p>
{% endif %}
<hr />
None
</div> </div>
</div> </div>
{% endblock maincontent %} {% endblock maincontent %}
...@@ -39,4 +84,16 @@ ...@@ -39,4 +84,16 @@
<script src="{% static 'AdminLTE/plugins/moment.js/moment.min.js' %}"></script> <script src="{% static 'AdminLTE/plugins/moment.js/moment.min.js' %}"></script>
<script src="{% static 'AdminLTE/plugins/fullcalendar/fullcalendar.min.js' %}"></script> <script src="{% static 'AdminLTE/plugins/fullcalendar/fullcalendar.min.js' %}"></script>
<script>
$(function () {
$('#planning_table, #approaching_table').DataTable({
"paging": true,
"lengthChange": false,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false
});
</script>
{% endblock scripts %} {% endblock scripts %}
...@@ -52,12 +52,14 @@ def logout(request): ...@@ -52,12 +52,14 @@ def logout(request):
return redirect('/login?error=' + message) return redirect('/login?error=' + message)
def assignments(request):
return wrap_response(request, 'assignments/index.html', {})
def visits(request): def visits(request):
return wrap_response(request, 'visits/index.html', {}) visit_list = Visit.objects.order_by('-visitBegin')
context = {
'visit_list': visit_list
}
return wrap_response(request, 'visits/index.html', context)
def subjects(request): def subjects(request):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment