Skip to content
Snippets Groups Projects
Commit 13e3552f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when editing appoijntment info about subject is visible (and link to

edit subject is available)
parent 87d4ad84
No related branches found
No related tags found
1 merge request!5Appointments dev
......@@ -58,7 +58,7 @@
Status:
</label>
<div class="btn-group-vertical col-sm-8">
<label class="btn btn-primary">{{ status }}</label>
<label class="btn btn-primary">{{ appointment.status }}</label>
<a href="{% url 'web.views.appointment_mark' id 'finished' %}" class="btn btn-warning btn-block">Mark as finished</a>
<a href="{% url 'web.views.appointment_mark' id 'cancelled' %}" class="btn btn-warning btn-block">Mark as cancelled</a>
<a href="{% url 'web.views.appointment_mark' id 'no_show' %}" class="btn btn-warning btn-block">Mark as no show</a>
......@@ -74,6 +74,38 @@
<a href="{% url 'web.views.appointments' %}" class="btn btn-block btn-default" onclick="history.back()">Cancel</a>
</div>
</div><!-- /.box-footer -->
<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 -->
<div class="box-footer">
<a href="{% url 'web.views.subject_edit' appointment.visit.subject.id %}" type="button" class="btn btn-block btn-default">Edit subject</a>
<a href="{% url 'web.views.subjects' %}" class="btn btn-block btn-default" onclick="history.back()">Back</a>
</div><!-- /.box-footer -->
</form>
</form>
</div>
{% endblock %}
......
......@@ -554,7 +554,15 @@ def appointment_edit(request, id):
return redirect(appointments)
else:
form = AppointmentEditForm(instance=the_appointment)
return wrap_response(request, 'appointments/edit.html', {'form': form, 'id':id, 'status': the_appointment.status})
subject_form = SubjectDetailForm(instance=the_appointment.visit.subject)
return wrap_response(request, 'appointments/edit.html', {
'form': form,
'subject_form': subject_form,
'id':id,
'appointment': the_appointment
})
def appointment_edit_datetime(request, id):
......
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