Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Bondzik-S committed Nov 20, 2024
1 parent 98718d6 commit 938c924
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions templates/registration/login.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% extends "base.html" %}

{% block content %}
<h1>Login</h1>
{% if form.errors %}
<p style="color: red;">Invalid credentials</p>
{% endif %}
<form action="{% url 'login' %}" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit">
<input type="hidden" name="next" value="{{ next }}">
</form>
<h1>Login</h1>
{% if form.errors %}
<p style="color: red;">Invalid credentials</p>
{% endif %}
<form action="{% url 'login' %}" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit">
<input type="hidden" name="next" value="{{ next }}">
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/taxi/driver_detail.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base.html" %}

{% block content %}
<p><strong>
<p><strong>
{{ driver.first_name }} {{ driver.last_name }}.</strong>
License number: {{ driver.license_number }}
</p>
Expand Down
10 changes: 5 additions & 5 deletions templates/taxi/driver_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
<h1>Driver list</h1>
{% if driver_list %}
<ul>
{% for driver in driver_list%}
{% if driver.id == user.id %}
{% for driver in driver_list %}
{% if driver.id == user.id %}
<li>
<a href="{% url "taxi:driver-detail" pk=driver.id %}">{{ driver.username }}</a>
<a href="{% url 'taxi:driver-detail' pk=driver.id %}">{{ driver.username }}</a>
({{ driver.first_name }} {{ driver.last_name }}) (Me)
</li>
{% else %}
<li>
<a href="{% url "taxi:driver-detail" pk=driver.id %}">{{ driver.username }}</a>
<a href="{% url 'taxi:driver-detail' pk=driver.id %}">{{ driver.username }}</a>
({{ driver.first_name }} {{ driver.last_name }})
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% else %}
Expand Down
4 changes: 2 additions & 2 deletions templates/taxi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ <h2>Dynamic content</h2>
<li><strong>Drivers:</strong> {{ num_drivers }}</li>
<li><strong>Manufacturers:</strong> {{ num_manufacturers }}</li>
</ul>
<p>You have visited this page {{ num_visits }} time{{ num_visits|pluralize }}.</p>

<p>You have visited this page {{ num_visits }} time{{ num_visits|pluralize }}.</p>
{% endblock %}

0 comments on commit 938c924

Please sign in to comment.