Initial commit

This commit is contained in:
John Mullins
2023-08-18 18:10:53 +10:00
commit 0c3ba727bf
25 changed files with 1214 additions and 0 deletions
@@ -0,0 +1,7 @@
{% extends 'admin/change_form.html' %}
{% load i18n admin_urls %}
{% block object-tools-items %}
<li><a href="clone/" class="addlink">{{ clone_verbose_name }}</a></li>
{{ block.super }}
{% endblock %}
@@ -0,0 +1,46 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls static admin_modify %}
{% block extrahead %}{{ block.super }}
<script src="{% url 'admin:jsi18n' %}"></script>
{{ media }}
{% endblock %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static "admin/css/forms.css" %}">{% endblock %}
{% block coltype %}colM{% endblock %}
{% block bodyclass %}{{ block.super }} app-{{ app_label }} model-{{ verbose_name }} change-form{% endblock %}
{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
<a href="{% url 'admin:app_list' app_label='coord' %}">{{ verbose_name }}</a>
&rsaquo; {% if has_view_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% blocktranslate with name=verbose_name %}Add {{ name }}{% endblocktranslate %}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}
{% block content %}<div id="content-main">
{% block after_field_sets %}{% endblock %}
{% block inline_field_sets %}
{% endblock %}
{% block after_related_objects %}{% endblock %}
{% block submit_buttons_bottom %}{% endblock %}
{% block admin_change_form_document_ready %}
{% endblock %}
</div>
{% endblock %}
@@ -0,0 +1,17 @@
{% load i18n admin_urls %}
<div class="submit-row">
{% block submit-row %}
{% if show_save %}<input type="submit" value="{% translate 'Save' %}" class="default" name="_save">{% endif %}
{% if show_save_as_new %}<input type="submit" value="{% translate 'Save as new' %}" name="_saveasnew">{% endif %}
{% if show_save_and_add_another %}<input type="submit" value="{% translate 'Save and add another' %}" name="_addanother">{% endif %}
{% if show_save_and_continue %}<input type="submit" value="{% if can_change %}{% translate 'Save and continue editing' %}{% else %}{% translate 'Save and view' %}{% endif %}" name="_continue">{% endif %}
{% if show_close %}
{% url opts|admin_urlname:'changelist' as changelist_url %}
<a href="{% add_preserved_filters changelist_url %}" class="closelink">{% translate 'Close' %}</a>
{% endif %}
{% if show_delete_link and original %}
{% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
<a href="{% add_preserved_filters delete_url %}" class="deletelink">{% translate "Delete" %}</a>
{% endif %}
{% endblock %}
</div>
+12
View File
@@ -0,0 +1,12 @@
<h1>Company List</h1>
<table>
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>{{ item.contact_name }}</td>
<td>{{ item.contact_number }}</td>
<td>{{ item.contact_email }}</td>
<td>{{ item.address }}</td>
</tr>
{% endfor %}
</table>
@@ -0,0 +1,13 @@
<h1>Bus Numbers</h1>
<table>
<tr>
<th>Route Name</th>
<th>Number of Students</th>
</tr>
{% for bus in buses %}
<tr>
<td>{{ bus.route_name }}</td>
<td>{{ bus.num_travellers }}</td>
</tr>
{% endfor %}
</table>
@@ -0,0 +1,80 @@
<style>
table.stopHeader th {
text-align: left;
min-width: 150px;
width: 100%;
}
table.traveller th {
text-align: left;
border-bottom: 2px solid #000;
}
table.traveller td {
table-layout: fixed;
border-bottom: 2px solid #000;
border-right-style: dashed;
width: 100%;
min-width: 30px;
}
hr {
border: 2px solid;
}
</style>
{% for route in routes %}
<h1>{{ route.route_name }}</h1>
{% for stop in route.stops %}
<hr>
<table class="stopHeader">
<tr>
<th>Stop Number #{{ stop.stop_num }}</th>
<th>Pickup Time</th>
<th>Drop-off Time</th>
</tr>
<tr>
<td>{{ stop.name }}</td>
<td>{{ stop.am }}</td>
<td>{{ stop.pm }}</td>
</tr>
</table>
<table class="traveller">
<tr>
<th>Student</th>
<th>Fare</th>
<th>Mon AM</th>
<th>Mon PM</th>
<th>Tue AM</th>
<th>Tue PM</th>
<th>Wed AM</th>
<th>Wed PM</th>
<th>Thu AM</th>
<th>Thu PM</th>
<th>Fri AM</th>
<th>Fri PM</th>
</tr>
{% for traveller in stop.travellers %}
<tr>
<td>{{ traveller.display }}</td>
<td><b>{{ traveller.isFared }}</b></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
{% endfor %}
</table>
<br>
{% endfor %}
<p style="page-break-after: always">
{% endfor %}
@@ -0,0 +1,33 @@
{% for route in routes %}
<h1>{{ route.route_name }}</h1>
{% for stop in route.stops %}
<tr>
<th>Stop Number</th>
<th>Address</th>
<th>Pickup Time</th>
<th>Drop-off Time</th>
</tr>
<tr>
<th>{{ stop.stop_num }}</th>
<th>{{ stop.name }}</th>
<th>{{ stop.am }}</th>
<th>{{ stop.pm }}</th>
</tr>
{% for traveller in stop.travellers %}
<tr>
<th>Student</th>
<th>Mon AM</th>
<th>Mon PM</th>
<th>Tue AM</th>
<th>Tue PM</th>
</tr>
<tr>
<th>{{ traveller.traveller }}</th>
<th>{{ traveller.mon_am }}</th>
<th>{{ traveller.mon_pm }}</th>
<th>{{ traveller.tue_am }}</th>
<th>{{ traveller.tue_pm }}</th>
</tr>
{% endfor %}
{% endfor %}
{% endfor %}
@@ -0,0 +1,50 @@
<style>
table.stopHeader th {
text-align: left;
}
table.traveller th {
text-align: left;
border-bottom: 2px solid #000;
}
table.traveller td {
table-layout: fixed;
border-bottom: 2px solid #000;
border-right-style: dashed;
}
hr {
border: 2px solid;
}
</style>
{% for route in routes %}
<h1>{{ route.bus }}</h1>
<hr>
<table class="traveller">
<tr>
<th>Student</th>
<th>Parent A</th>
<th>Parent B</th>
<th>Emergency Contact A</th>
<th>Emergency Contact B</th>
<th>Driver notes</th>
</tr>
{% for traveller in route.travellers %}
<tr>
<td>{{ traveller.traveller }} ({{ traveller.traveller.school.shortName }})</td>
<td>{{ traveller.parent_a }}</td>
<td>{{ traveller.parent_b }}</td>
<td>{{ traveller.contact_a }}</td>
<td>{{ traveller.contact_b }}</td>
<td>{{ traveller.note }}</td>
</tr>
{% endfor %}
</table>
<br>
<p style="page-break-after: always">
{% endfor %}