Improve style and responsiveness of event entry in taskDetail

This commit is contained in:
Adam Goldsmith 2020-12-15 01:46:23 -05:00
parent 7b0ea4cb62
commit 09bc22f60b

View File

@ -1,5 +1,7 @@
{% extends "base.djhtml" %} {% extends "base.djhtml" %}
{% load widget_tweaks %}
{% block title %} {{ tool.name }} - {{ task.name }} | RecMaint {% endblock %} {% block title %} {{ tool.name }} - {{ task.name }} | RecMaint {% endblock %}
{% block content %} {% block content %}
@ -18,11 +20,32 @@
</div> </div>
{% endif %} {% endif %}
<form method="post"> {% if form.errors %}
<div class="alert alert-warning">
<h3> Error: </h3>
{{ form.errors }}
</div>
{% endif %}
<div class="d-md-none">
<h2> Log a Maintenance Event </h2>
<form class="form-group" method="post">
{% csrf_token %} {% csrf_token %}
{{ form }} <fieldset class="form-group">
<input type="submit" value="Submit"> {{ form.date.label_tag }}
{% render_field form.date type="date" class="form-control" %}
</fieldset>
<fieldset class="form-group">
{{ form.user.label_tag }}
{% render_field form.user class="form-control" %}
</fieldset>
<fieldset class="form-group">
{{ form.notes.label_tag }}
{% render_field form.notes class="form-control form-control-sm" rows="2" %}
</fieldset>
<input type="submit" class="btn btn-primary" value="Submit">
</form> </form>
</div>
<h2> Event Log </h2> <h2> Event Log </h2>
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
@ -34,6 +57,15 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="d-none d-md-table-row">
<form method="post">
{% csrf_token %}
<td> {% render_field form.date type="date" class="form-control" %} </td>
<td> {% render_field form.user class="form-control" style="width: initial;" %} </td>
<td> {% render_field form.notes class="form-control form-control-sm" rows="2" %} </td>
<td> <input type="submit" class="btn btn-primary" value="Submit"> </td>
</form>
</tr>
{% for event in events|dictsortreversed:"date" %} {% for event in events|dictsortreversed:"date" %}
<tr> <tr>
<td class="text-nowrap"> {{ event.date }} </td> <td class="text-nowrap"> {{ event.date }} </td>