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

Merge branch '115-show-completed-appointment-types-on-visit-page' into 'master'

finsihed appointment types are highlighted in the visit detail view

Closes #115

See merge request !59
parents 03548a67 a440df17
No related branches found
No related tags found
1 merge request!59finsihed appointment types are highlighted in the visit detail view
Pipeline #
......@@ -26,4 +26,15 @@
.top-buffer {
margin-top: 20px;
}
.checkbox-circle {
width: 10px;
height: 10px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
float:left;
margin:5px;
display: inline;
}
\ No newline at end of file
<div class="col-md-6 form-group {% if field.errors %}has-error{% endif %} multi-checkboxes">
<label for="{# TODO #}" class="col-sm-4 control-label">{{ field.label }}</label>
<div class="col-sm-8">
<ul id="id_{{ field.name }}">
{% for pk, choice in field.field.widget.choices %}
<li>
<label for="id_{{ field.name }}_{{ forloop.counter0 }}">
<div class="checkbox-circle"
style="
{% for appointment in appointments %}{% for appointment_type in appointment.appointment_types.all %}{% if appointment_type.id == pk|slugify or appointment_type.id == pk %}{% if appointment.status == "FINISHED" %}
background: green;
{% elif appointment.status == "SCHEDULED" %}
background: orange;
{% endif %}{% endif %}{% endfor %}{% endfor %}
"></div>
<input {% if readonly %}disabled="disabled"{% endif %}
{% for option in field.value %}{% if option == pk|slugify or option == pk %}checked="checked"
{% endif %}{% endfor %} type="checkbox"
id="id_{{ field.name }}_{{ forloop.counter0 }}"
name="{{ field.name }}"
value="{{ pk }}"
/>{{ choice }}</label>
</li>
{% endfor %}
</ul>
</div>
</div>
......@@ -45,16 +45,20 @@
</div>
<div class="box-footer">
{% for field in element.0 %}
<div class="col-md-6 form-group {% if field.errors %}has-error{% endif %} {% if field|is_checkbox %}multi-checkboxes{% endif %}">
<label class="col-sm-4 control-label">{{ field.label }}</label>
{% 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 class="col-sm-4 control-label">{{ field.label }}</label>
<div class="col-sm-8">
{{ field|disable|add_class:'form-control' }}
</div>
<div class="col-sm-8">
{{ field|disable|add_class:'form-control' }}
</div>
{% if field.errors %}
<span class="help-block">{{ field.errors }}</span>{% endif %}
</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=element.1 readonly="true" %}
{% endif %}
{% endfor %}
</div>
</div>
......
......@@ -30,30 +30,32 @@
</div>
<div class="box-header with-border">
<h3 class="box-title">Details of visit
</h3>
<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 vform %}
<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-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>
<div class="col-sm-8">
{{ field|add_class:'form-control' }}
{# {% 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 %}
{% if field.errors %}
<span class="help-block">
{{ field.errors }}
</span>
{% endif %}
</div>
{% endfor %}
<div class="col-md-6 form-group">
......@@ -165,8 +167,8 @@
{% if field.errors %}
<span class="help-block">
{{ field.errors }}
</span>
{{ field.errors }}
</span>
{% endif %}
</div>
{% endfor %}
......
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