Commits

boralyl committed a18c9c5

Added some templates for the maintenance item detail. Also fixed some urls.

  • Participants
  • Parent commits f0fcaaa

Comments (0)

Files changed (3)

templates/base.html

 			<span class="icon-bar"></span>
 			<span class="icon-bar"></span>
 		</a>
-		<a class="brand" href="#">Vehicle Maintenance</a>
+		<a class="brand" href="/">Vehicle Maintenance</a>
 		<div class="nav-collapse">
 			<ul class="nav">
 			<li class="active"><a href="/">Home</a></li>
-			<li><a href="">Outstanding</a></li>
+			<li><a href="{% url outstanding-maintenance-items %}">Outstanding</a></li>
 			<li><a href="">History</a></li>
 			</ul>
 		</div><!--/.nav-collapse -->
 	<div class="container">
 	{% block content %}{% endblock %}
 	</div>
+	<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
 	<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
 {% block deferred_js %}{% endblock %}	
 </body>

templates/vehiclemaintenance/maintenanceitem_detail.html

+{% extends "base.html" %}
+
+{% block content %}
+<div class="pull-right">
+	<p><a href="" title="Check {{ object.name }}" class="btn-primary btn-large">Enter Check Now!</a></p>
+</div>
+<h1>{{ object.name }}</h1>
+<ul class="nav nav-tabs" id="tabbar" data-tabs="tabs">
+	<li class="active"><a href="#details" data-toggle="tab">Details</a></li>
+	<li><a href="#history" data-toggle="tab">History</a></li>
+</ul>
+<div id="tab-content" class="tab-content">
+	<div id="details" class="tab-pane active">
+		{{ object.procedure|linebreaks|safe }}
+
+		{% if object.help_videos.all %}
+			<ul class="thumbnails">
+			{% for video in object.help_videos.all %}
+				<li>
+					<div class="thumbnail">
+						{{ video.embed_code|safe }}
+						<div class="caption">
+							<h5>{{ video.title }}</h5>
+						</div>
+					</div>
+				</li>
+			{% endfor %}
+			</ul>
+		{% endif %}
+	</div>
+	<div id="history" class="tab-pane">
+		{% with object.maintenanceitemcheck_set.all as checks %}
+		{% if checks %}
+			<table class="table table-condensed table-striped table-bordered">
+				<thead>
+					<tr>
+						<th>Date</th>
+						<th>Passed?</th>
+						<th>Notes</th>
+					</tr>
+				</thead>
+				<tbody>
+					{% for check in checks %}
+						<tr>
+							<td>{{ check.date }}</td>
+							<td>{{ check.is_passable }}</td>
+							<td>{{ check.notes|linebreaks|safe }}</td>
+						</tr>
+					{% endfor %}
+				</tbody>
+			</table>
+		{% else %}
+			<p><strong>No checks</strong> have been performed for this maintenance item!  <em>Better correct that!</em></p>
+		{% endif %}
+		{% endwith %}
+	</div>
+</div>
+{% endblock %}
+
+{% block deferred_js %}
+<script type="text/javascript">
+$(document).ready(function() {
+	$("#tabbar").tabs());
+});
+</script>
+{% endblock %}

templates/vehiclemaintenance/outstanding_items_list.html

 	<tbody>
 		{% for item in maintenance_items %}
 		<tr>
-			<td><a href="" title="{{ item.name }}">{{ item.name }}</a></td>
+			<td><a href="{% url 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>