-
Carlos Vega authoredCarlos Vega authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
details.html 9.44 KiB
{% extends "_base.html" %}
{% load static %}
{% load filters %}
{% block styles %}
{{ block.super }}
<!-- DataTables -->
<link rel="stylesheet" href="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.css' %}">
{% include "includes/datepicker.css.html" %}
{% endblock styles %}
{% block ui_active_tab %}'visits'{% endblock ui_active_tab %}
{% block page_header %}Details of the visit ({{ visit.visit_number }}) {% endblock page_header %}
{% block page_description %}{% endblock page_description %}
{% block title %}{{ block.super }} - Details of visit ({{ visit.visit_number }}) {% endblock %}
{% block breadcrumb %}
{% include "subjects/breadcrumb.html" %}
{% endblock breadcrumb %}
{% block maincontent %}
{% block content %}
<div class="box box-info">
<div class="box-header with-border">
<a href="{% url 'web.views.subject_visit_details' visit.subject.id %}" type="button"
class="btn btn-block btn-default">Subject's visits</a>
</div>
<div class="box-header with-border">
<h3 class="box-title">Details of visit </h3>
</div>
<form method="post" action="" class="form-horizontal">
{% csrf_token %}
<div class="box-body">
{% for field in visit_form %}
{% if not field|is_checkbox %}
<div class="col-md-6 form-group {% if field.errors %}has-error{% endif %} {% if field|is_checkbox %}multi-checkboxes{% endif %}">
<label for="{# TODO #}" class="col-sm-4 control-label">{{ field.label }}</label>
{# {% if not field|is_checkbox %}#}
<div class="col-sm-8">
{{ field|add_class:'form-control' }}
</div>
{% if field.errors %}
<span class="help-block">
{{ field.errors }}
</span>
{% endif %}
</div>
{% else %}
{% include 'includes/visit_appointment_types_field.html' with field=field appointments=loApp %}
{% endif %}
{% endfor %}
<div class="col-md-6 form-group">
<label class="col-sm-4 control-label">
Visit finished
</label>
<div class="col-sm-8">
{% if visFinished %}
<div class="btn btn-block">YES</div>
{% else %}
<div class="btn btn-block">
{% if canFinish %}
<a href="{% url 'web.views.visit_mark' vid 'finished' %}"
class="btn btn-warning btn-block">Mark as finished</a>
{% else %}
Waiting for appointments to finish.
{% endif %}
</div>
{% endif %}
</div>
</div>
</div><!-- /.box-body -->
<div class="box-footer">
<div class="col-sm-12">
<button type="submit" class="btn btn-block btn-success">Save and continue</button>
</div>
</div><!-- /.box-footer -->
</form>
<div class="box-header with-border">
<h3 class="box-title">Visit's appointments</h3>
</div>
<div>
<a href="{% url 'web.views.appointment_add' vid %}" class="btn btn-app">
<i class="fa fa-plus"></i>
Add new appointment
</a>
</div>
{% if loApp %}
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<th>No.</th>
<th>Type</th>
<th>Date</th>
<th>Time</th>
<th>Length [min]</th>
<th>Responsible</th>
<th>Plan/Modify</th>
</tr>
</thead>
<tbody>
{% for app in loApp %}
<tr>
<td>{{ forloop.counter }}</td>
<td style="background-color:{{ app.color }} !important">
<font COLOR="{{ app.font_color }}">
{% for type in app.appointment_types.all %}
{{ type.code }},
{% endfor %}
</font>
</td>
<td>{{ app.datetime_when | date:"d-M-Y" }}</td>
<td>{{ app.datetime_when | time:"H:i" }}</td>
<td>{{ app.length }}</td>
<td>
{% if app.flying_team is None %}{{ app.worker_assigned.first_name }}
{{ app.worker_assigned.last_name }}
{% else %} {{ app.flying_team }}
{% endif %}
</td>
<td>
{% ifequal app.status "SCHEDULED" %}
<a href="{% url 'web.views.appointment_edit' app.id %}?from_visit" type="button"
class="btn btn-block btn-default">Edit</a>
{% else %}
{{ app.status }}
{% endifequal %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No appointments found.</p>
{% endif %}
<div class="box-header with-border">
<h3 class="box-title">Subject's details</h3>
</div>
<form class="form-horizontal">
<div class="box-body">
{% for field in subject_form %}
<div class="col-md-6 form-group {% if field.errors %}has-error{% endif %}">
<label for="{# TODO #}" class="col-sm-4 control-label">
{{ field.label }}
</label>
<div class="col-sm-8">
{{ field|disable|add_class:'form-control' }}
</div>
{% if field.errors %}
<span class="help-block">
{{ field.errors }}
</span>
{% endif %}
</div>
{% endfor %}
</div><!-- /.box-body -->
</form>
<div class="box-header with-border">
<h3 class="box-title">Subject's study details</h3>
</div>
<form class="form-horizontal">
<div class="box-body">
{% for field in study_subject_form %}
<div class="col-md-6 form-group {% if field.errors %}has-error{% endif %}">
<label for="{# TODO #}" class="col-sm-4 control-label">
{{ field.label }}
</label>
<div class="col-sm-8">
{{ field|disable|add_class:'form-control' }}
</div>
{% if field.errors %}
<span class="help-block">
{{ field.errors }}
</span>
{% endif %}
</div>
{% endfor %}
</div><!-- /.box-body -->
</form>
<div class="box-footer">
<td><a href="{% url 'web.views.subject_edit' visit.subject.id %}" type="button"
class="btn btn-block btn-default">Edit subject</a></td>
</div><!-- /.box-footer -->
</div>
{% include 'includes/mail_templates_box.html' with instance_id=visit.id %}
{% endblock %}
{% endblock maincontent %}
{% block scripts %}
{{ block.super }}
<script src="{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"></script>
<script src="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"></script>
<script src="{% static 'js/visit.js' %}"></script>
<script>
var default_visit_duration_in_months = parseInt("{{default_visit_duration}}");
visit_dates_behaviour($("[name='datetime_begin']"), $("[name='datetime_end']"), default_visit_duration_in_months);
</script>
{% include "includes/datepicker.js.html" %}
{% endblock scripts %}