Commits

boralyl committed 09b098a

Added templates for the dashboard and upcoming maintenance items lists.

  • Participants
  • Parent commits 74d5cfa

Comments (0)

Files changed (4)

templates/base.html

 		</a>
 		<a class="brand" href="/">Vehicle Maintenance</a>
 		{% if user.is_authenticated %}
-			{% url vm-index as home %}
+			{% url vm-dashboard as home %}
 			{% url vm-outstanding-items as outstanding %}
+			{% url vm-upcoming-items as upcoming %}
 			{% url vm-history as history %}
 			{% url vm-vehicles as vehicles %}
 			<div class="nav-collapse">
 				<ul class="nav">
 				<li class="{% nav_active request home 'active' %}"><a href="{{ home }}">Home</a></li>
 				<li class="{% nav_active request outstanding 'active' %}"><a href="{{ outstanding }}">Outstanding</a></li>
+				<li class="{% nav_active request upcoming 'active' %}"><a href="{{ upcoming }}">Upcoming</a></li>
 				<li class="{% nav_active request history 'active' %}"><a href="{{ history }}">History</a></li>
 				<li class="{% nav_active request vehicles 'active' %}"><a href="{{ vehicles }}">Vehicles</a></li>
 				</ul>

templates/vehiclemaintenance/dashboard.html

+{% extends 'base.html' %}
+
+{% block content %}
+<h1>Dashboard</h1>
+
+<h2>Outstanding</h2>
+{% if outstanding_items %}
+<table class="table table-condensed">
+	<thead>
+		<tr>
+			<th>Task</th>
+			<th>Details</th>
+			<th>Last Check</th>
+			<th>Due</th>
+		</tr>
+	</thead>
+	<tbody>
+		{% for item in outstanding_items %}
+		<tr>
+			<td><a href="{% url vm-maintenance-item-details item.id %}" title="{{ item.name }}">{{ item.name }}</a></td>
+			<td>{{ item.procedure }}</td>
+			<td>{{ item.maintenanceitemcheck_set.all.0.date|default:"NEVER!" }}</td>
+			<td></td>
+		</tr>
+		{% endfor %}
+	</tbody>
+</table>
+{% else %}
+<p>Congrats, you have no outstanding items!</p>
+{% endif %}
+
+<h2>Upcoming</h2>
+{% if upcoming_items %}
+<table class="table table-condensed">
+	<thead>
+		<tr>
+			<th>Task</th>
+			<th>Details</th>
+			<th>Last Check</th>
+			<th>Due</th>
+		</tr>
+	</thead>
+	<tbody>
+		{% for item in upcoming_items %}
+		<tr>
+			<td><a href="{% url vm-maintenance-item-details item.id %}" title="{{ item.name }}">{{ item.name }}</a></td>
+			<td>{{ item.procedure }}</td>
+			<td>{{ item.maintenanceitemcheck_set.all.0.date|default:"NEVER!" }}</td>
+			<td></td>
+		</tr>
+		{% endfor %}
+	</tbody>
+</table>
+{% else %}
+<p>Congrats, you have no outstanding items!</p>
+{% endif %}
+{% endblock %}

templates/vehiclemaintenance/outstanding_items_list.html

 	</tbody>
 </table>
 {% else %}
-<ssp>Congrats, you have no outstanding items!</p>
+<p>Congrats, you have no outstanding items!</p>
 {% endif %}
 {% endblock %}

templates/vehiclemaintenance/upcoming_list.html

+{% extends 'base.html' %}
+
+{% block content %}
+<h1>Upcoming</h1>
+
+{% if maintenance_items %}
+<table class="table table-condensed">
+	<thead>
+		<tr>
+			<th>Task</th>
+			<th>Details</th>
+			<th>Last Check</th>
+			<th>Due</th>
+		</tr>
+	</thead>
+	<tbody>
+		{% for item in maintenance_items %}
+		<tr>
+			<td><a href="{% url vm-maintenance-item-details item.id %}" title="{{ item.name }}">{{ item.name }}</a></td>
+			<td>{{ item.procedure }}</td>
+			<td>{{ item.maintenanceitemcheck_set.all.0.date|default:"NEVER!" }}</td>
+			<td></td>
+		</tr>
+		{% endfor %}
+	</tbody>
+</table>
+{% else %}
+<p>Congrats, you have no outstanding items!</p>
+{% endif %}
+{% endblock %}