Skip to content
Snippets Groups Projects
Commit f6a6ce4f authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Improved UI look and feel in visit details. Now it is just comfortale to see and interact with.

parent 3db70061
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
{% endblock styles %}
{% block page_title %}'subjects'{% endblock page_title %}
{% block page_header %}Subject's visits{% endblock page_header %}
{% block page_header %}List of visits{% endblock page_header %}
{% block page_description %}{% endblock page_description %}
{% block title %}{{ block.super }} - List of subject's visits {% endblock %}
......@@ -26,105 +26,89 @@
<a href="{% url 'web.views.visits' %}" class="btn btn-block btn-default" onclick="history.back()">Back</a>
</div>
<div class="box-header with-border">
<h3 class="box-title">List of visits</h3>
</div>
<div class="box-body">
<form class="form-horizontal">
{% for element in display %}
<div class="box-header with-border">
<h3 class="box-title">Visit {{ forloop.counter }}</h3>
</br>
</div>
{% for field in element.0 %}
<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|add_class:'form-control' }}
</div>
{% if field.errors %}
<span class="help-block">
{{ field.errors }}
</span>
{% endif %}
</div>
{% 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 %}<button type="button" class="btn btn-block btn-danger">YES</button>
{% else %}<button type="button" class="btn btn-block btn-success">NO</button>
{% endif %}
</div>
</div>
<div class="col-md-6 form-group">
<h3>Visit's assignments</h3>
</div>
{% if element.1 %}
<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 element.1 %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ app.appointment_type }}</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 %}{{ app.worker_assigned.first_name }} {{app.worker_assigned.last_name}}
{% else %} {{ app.flying_team }}
<div class="box box-widget widget-user-2">
<div class="widget-user-header bg-default">
<h3 class="widget-user-username">Visit {{ forloop.counter }}</h3>
<h5 class="widget-user-desc">
{% if visFinished %}(Finished)
{% else %}(Not finished)
{% endif %}
</h5>
</div>
<div class="box-footer">
{% for field in element.0 %}
<div class="col-md-6 form-group {% if field.errors %}has-error{% endif %}">
<label class="col-sm-4 control-label">{{ field.label }}</label>
<div class="col-sm-8">
{{ field|add_class:'form-control' }}
</div>
{% if field.errors %}<span class="help-block">{{ field.errors }}</span>{% endif %}
</div>
{% endfor %}
</div>
</div>
<div class="box box-widget widget-user-2">
<div class="widget-user-header bg-default">
<h3 class="widget-user-username">Visit's assignments</h3>
<!--<h5 class="widget-user-desc">
</h5>-->
</div>
<div class="box-footer">
{% if element.1 %}
<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 element.1 %}
<tr>
<td>{{ forloop.counter }}</td>
<td>{{ app.appointment_type }}</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 %}{{ app.worker_assigned.first_name }} {{app.worker_assigned.last_name}}
{% else %} {{ app.flying_team }}
{% endif %}
</td>
<td>
<a href="{% url 'web.views.assignment_edit' app.id %}" type="button" class="btn btn-block btn-default">Edit</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
No appointments found.
{% endif %}
</td>
<td>
<a href="{% url 'web.views.assignment_edit' app.id %}" type="button" class="btn btn-block btn-default">Edit</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No appointments found.</p>
{% endif %}
</div>
</div>
{% endfor %}
</form>
</div><!-- /.box-body -->
{% endfor %}
</div>
{% endblock %}
{% endblock maincontent %}
{% block scripts %}
......
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