-
Notifications
You must be signed in to change notification settings - Fork 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a33c2b2
commit 172c5f6
Showing
10 changed files
with
147 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<h3>Delete car</h3> | ||
<p>Are you sure you want to delete "{{ car.name }}"?</p> | ||
<form method="post"> | ||
{% csrf_token %} | ||
<input type="submit" value="Yes, delete" class="btn btn-primary"> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h2>Car Details: <a class="btn btn-primary" href={% url 'taxi:car-update' pk=car.id %}>Update</a> <a | ||
class="btn btn-danger" | ||
href={% url 'taxi:car-delete' pk=car.id %}>Delete</a></h2> | ||
<p>Manufacturer: ({{ car.manufacturer.name }}, {{ car.manufacturer.country }})</p> | ||
<h1>Drivers</h1> | ||
<h5>Drivers</h5> | ||
<hr> | ||
<ul> | ||
{% for driver in car.drivers.all %} | ||
<li>{{ driver.username }} ({{ driver.first_name }} {{ driver.last_name }})</li> | ||
{% endfor %} | ||
{% for driver in car.drivers.all %} | ||
<li>{{ driver.username }} ({{ driver.first_name }} {{ driver.last_name }})</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% extends "base.html" %} | ||
{% load crispy_forms_filters %} | ||
{% block content %} | ||
<h3>{{ object|yesno:"Update,Create" }} New Car</h3> | ||
<form method="post" novalidate> | ||
{% csrf_token %} | ||
{{ form|crispy }} | ||
<input class="btn btn-primary" type="submit" value="Submit"> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<h3>Delete Manufacturer</h3> | ||
<p>Are you sure you want to delete "{{ manufacturer.name }}"?</p> | ||
<form method="post"> | ||
{% csrf_token %} | ||
<input type="submit" value="Yes, delete" class="btn btn-primary"> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% extends "base.html" %} | ||
{% load crispy_forms_filters %} | ||
{% block content %} | ||
<h3>{{ object|yesno:"Update, Create" }} manufacturer</h3> | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{ form|crispy }} | ||
<input type="submit" value="Submit"> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,44 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h1>Manufacturer List | ||
</h1> | ||
<h1>Manufacturer List <a href={% url 'taxi:manufacturer-create' %}>+</a> | ||
</h1> | ||
|
||
{% if manufacturer_list %} | ||
<table class="table"> | ||
{% if manufacturer_list %} | ||
<table class="table"> | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>Country</th> | ||
<th>Update</th> | ||
<th>Delete</th> | ||
</tr> | ||
|
||
{% for manufacturer in manufacturer_list %} | ||
<tr> | ||
<th>ID</th> | ||
<th>Name</th> | ||
<th>Country</th> | ||
<td> | ||
{{ manufacturer.id }} | ||
</td> | ||
<td> | ||
{{ manufacturer.name }} | ||
</td> | ||
<td> | ||
{{ manufacturer.country }} | ||
</td> | ||
<td> | ||
<a class="btn btn-primary" | ||
href={% url 'taxi:manufacturer-update' pk=manufacturer.id %}>Update</a> | ||
</td> | ||
<td> | ||
<a | ||
class="btn btn-danger" | ||
href={% url 'taxi:manufacturer-delete' pk=manufacturer.id %}>Delete</a> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
|
||
{% for manufacturer in manufacturer_list %} | ||
<tr> | ||
<td> | ||
{{ manufacturer.id }} | ||
</td> | ||
<td> | ||
{{ manufacturer.name }} | ||
</td> | ||
<td> | ||
{{ manufacturer.country }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
|
||
{% else %} | ||
<p>There are no manufacturers in the service.</p> | ||
{% endif %} | ||
{% else %} | ||
<p>There are no manufacturers in the service.</p> | ||
{% endif %} | ||
{% endblock %} |