diff options
| author | Kyle Blanker <kyle@stridet.com> | 2017-09-12 15:44:13 -0400 |
|---|---|---|
| committer | Kyle Blanker <kyle@stridet.com> | 2017-09-12 15:44:13 -0400 |
| commit | 207be6ecd78719808836b49af4878c60b61e7d0a (patch) | |
| tree | e3244806e07ee95931d89493e53416ebb7f9b827 /app/dispatch/templates | |
| parent | 0e1a08683b888606fb9566113cbaff41c6b65d39 (diff) | |
| download | dispatch-tracker-207be6ecd78719808836b49af4878c60b61e7d0a.tar.gz dispatch-tracker-207be6ecd78719808836b49af4878c60b61e7d0a.tar.xz | |
Started to work on load crud operations
Diffstat (limited to 'app/dispatch/templates')
| -rw-r--r-- | app/dispatch/templates/dispatch/base.html | 6 | ||||
| -rw-r--r-- | app/dispatch/templates/dispatch/loads/create.html | 15 | ||||
| -rw-r--r-- | app/dispatch/templates/dispatch/loads/detail.html | 10 | ||||
| -rw-r--r-- | app/dispatch/templates/dispatch/loads/edit.html | 15 | ||||
| -rw-r--r-- | app/dispatch/templates/dispatch/loads/list.html | 43 |
5 files changed, 89 insertions, 0 deletions
diff --git a/app/dispatch/templates/dispatch/base.html b/app/dispatch/templates/dispatch/base.html index d7a85a9..37c8830 100644 --- a/app/dispatch/templates/dispatch/base.html +++ b/app/dispatch/templates/dispatch/base.html @@ -29,6 +29,7 @@ <ul class="right hide-on-med-and-down"> {% if user.is_authenticated %} <li><a href="#">Drivers</a></li> + <li><a href="{% url 'load_list' %}">Loads</a></li> <li><a href="{% url 'company_list' %}">Companies</a></li> <li><a href="#">Contacts</a></li> <li><a href="{% url 'logout' %}">Logout</a></li> @@ -40,6 +41,7 @@ <ul id="nav-mobile" class="side-nav"> {% if user.is_authenticated %} <li><a href="#">Drivers</a></li> + <li><a href="{% url 'load_list' %}">Loads</a></li> <li><a href="#">Companies</a></li> <li><a href="#">Contacts</a></li> <li><a href="{% url 'logout' %}">Logout</a></li> @@ -81,5 +83,9 @@ <!--Import jQuery before materialize.js--> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="{% static 'materialize/js/materialize.min.js' %}"></script> + + <script> + $('select').material_select(); + </script> </body> </html> diff --git a/app/dispatch/templates/dispatch/loads/create.html b/app/dispatch/templates/dispatch/loads/create.html new file mode 100644 index 0000000..ae40722 --- /dev/null +++ b/app/dispatch/templates/dispatch/loads/create.html @@ -0,0 +1,15 @@ +{% extends 'dispatch/base.html' %} + + +{% block content %} +<div class="row"> + <div class="col s12 m6"> + <h1>New Load</h1> + </div> +</div> + +<form action="" method="post">{% csrf_token %} + {{ form.as_p }} + <input type="submit" class="btn green" value="Save" /> +</form> +{% endblock %} diff --git a/app/dispatch/templates/dispatch/loads/detail.html b/app/dispatch/templates/dispatch/loads/detail.html new file mode 100644 index 0000000..e939fdb --- /dev/null +++ b/app/dispatch/templates/dispatch/loads/detail.html @@ -0,0 +1,10 @@ +{% extends 'dispatch/base.html' %} + + +{% block content %} +<div class="row"> + <div class="col s12 m6"> + <h1>{{ object.name }} details</h1> + </div> +</div> +{% endblock %} diff --git a/app/dispatch/templates/dispatch/loads/edit.html b/app/dispatch/templates/dispatch/loads/edit.html new file mode 100644 index 0000000..fe8460d --- /dev/null +++ b/app/dispatch/templates/dispatch/loads/edit.html @@ -0,0 +1,15 @@ +{% extends 'dispatch/base.html' %} + + +{% block content %} +<div class="row"> + <div class="col s12 m6"> + <h1>{{object.name}}</h1> + </div> +</div> + +<form action="" method="post">{% csrf_token %} + {{ form.as_p }} + <input type="submit" class="btn blue" value="Update" /> +</form> +{% endblock %} diff --git a/app/dispatch/templates/dispatch/loads/list.html b/app/dispatch/templates/dispatch/loads/list.html new file mode 100644 index 0000000..8129907 --- /dev/null +++ b/app/dispatch/templates/dispatch/loads/list.html @@ -0,0 +1,43 @@ +{% extends 'dispatch/base.html' %} + + +{% block content %} +<div class="row"> + <div class="col s12 m6"> + <h1>Loads</h1> + </div> + <div class="col s12 m6 right-align"> + <a href="{% url 'load_new' %}" class="btn green">Add Load</a> + </div> +</div> +<table class="striped"> + <thead> + <tr> + {% if user.is_superuser %} + <td>Driver</td> + {% endif %} + <th>Date</th> + <th>Company</th> + <th>Amount</th> + </tr> + </thead> + <tbody> + {% for load in object_list %} + <tr> + {% if user.is_superuser %} + <td>{{ load.user.first_name }} {{ load.user.last_name }}</td> + {% endif %} + <td>{{ load.date }}</td> + <td>{{ load.company.name }}</td> + <td>{{ load.amount }}</td> + <td class="right-align"> + <a href="{% url 'load_edit' load.id %}" class="btn orange">Edit</a> + <a href="{% url 'load_detail' load.id %}" class="btn blue">View</a> + </td> + </tr> + {% empty %} + <tr><td colspan="4">No loads yet.</td></tr> + {% endfor %} + </tbody> +</table> +{% endblock %} |
