From f6a6ce4f42a3151936c7caaba08ec8ebf7ab29d2 Mon Sep 17 00:00:00 2001 From: Jacek Lebioda <jacek.lebioda.001@student.uni.lu> Date: Fri, 3 Feb 2017 14:24:12 +0100 Subject: [PATCH] Improved UI look and feel in visit details. Now it is just comfortale to see and interact with. --- .../web/templates/subjects/visitdetails.html | 158 ++++++++---------- 1 file changed, 71 insertions(+), 87 deletions(-) diff --git a/smash/web/templates/subjects/visitdetails.html b/smash/web/templates/subjects/visitdetails.html index 55812732..af1f0ec7 100644 --- a/smash/web/templates/subjects/visitdetails.html +++ b/smash/web/templates/subjects/visitdetails.html @@ -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 %} -- GitLab