From 73122f81dd5a249174c3725b5577e736b6f66799 Mon Sep 17 00:00:00 2001 From: Leon Date: Wed, 20 Nov 2024 23:12:34 +0200 Subject: [PATCH] Solution --- db.sqlite3 | Bin 0 -> 176128 bytes taxi/views.py | 16 ++++++++---- taxi_service/settings.py | 3 +++ taxi_service/urls.py | 1 + templates/includes/sidebar.html | 34 ++++++++++++++++++++++--- templates/registration/logged_out.html | 6 +++++ templates/registration/login.html | 14 ++++++++++ templates/taxi/car_detail.html | 6 ++--- templates/taxi/driver_list.html | 6 +++-- templates/taxi/index.html | 1 + 10 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 db.sqlite3 create mode 100644 templates/registration/logged_out.html create mode 100644 templates/registration/login.html diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..3d903f147395cbac24f7141311d4df9abbe1958f GIT binary patch literal 176128 zcmeI53ve9Cd6;*0XLt62-3IaC9uJ4(U_pr713~N?SYBQ3mcWw4;YGYig2~m^?Ct;< za3A142!L{;S{|cwB&Qso70GtwQbkUrq~u5?TdpKh*RaF$}?wUq^>B8ywaQeLWvVNN#BBgV3MLJMYd8ts{ zk}{QQNiMY|^v|p&6YEKFJ#l3rDf-&-ec}b5lJ$v7p(1a~C2?taU0m8&SP*Zl&MhWZ zH^uqnrkL1RU!Ge6O^eB;^^2mfAmwGBcwZ`IcBImUP&Ddql!M$%v0A8<4!a2WA4*RM z-ei({l+>$`Eh+cqQmR^pU{5aPm2z1r7Rt=pE_r<&D%M5xvFfPlqHNO2HsEPgQCv-4 zO|B-FW|C_fP*qmjjbEIl`Kt{0+|u0oTw-BiQ%g+F0wBGHsgCH4`lV`R$AIKy`|v-E zdj)SW$UPcvW4v7|R`;67swt2s; zf>tQ9c*^LKK|{p;^6f#vJ37jJaK9C~K}zTf`LXEkN#*i>u>>w!?~B3EbW>l(IRqQQgV7lLeYr6GtJnFw6)c4C{zOuesKI~&!RO>?Ly1RfJm>tc8H^P zDH*v?mQ#glK20I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ia$JuOAI;_+6Ik!Ck-&F-K -
  • Home page
  • -
  • Manufacturers
  • -
  • Cars
  • -
  • Drivers
  • + {% if user.is_authenticate %} +
  • + + User: {{ user.username }} + +
  • +
  • +
    + {% csrf_token %} + +
    +
  • + {% else %} +
  • + Login +
  • + {% endif %} +
    +
  • + Home page +
  • +
  • + Manufacturers +
  • +
  • + Cars +
  • +
  • + Drivers +
  • diff --git a/templates/registration/logged_out.html b/templates/registration/logged_out.html new file mode 100644 index 00000000..484ddbe0 --- /dev/null +++ b/templates/registration/logged_out.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} + +{% block content %} +

    Logged Out

    + Click here to log in again. +{% endblock %} \ No newline at end of file diff --git a/templates/registration/login.html b/templates/registration/login.html new file mode 100644 index 00000000..d285d919 --- /dev/null +++ b/templates/registration/login.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block content %} +

    Login

    + {% if form.errors %} +

    Invalid credentials

    + {% endif %} +
    + {% csrf_token %} + {{ form.as_p }} + + +
    +{% endblock %} \ No newline at end of file diff --git a/templates/taxi/car_detail.html b/templates/taxi/car_detail.html index db6da00a..8a74442b 100644 --- a/templates/taxi/car_detail.html +++ b/templates/taxi/car_detail.html @@ -5,8 +5,8 @@

    Drivers


      - {% for driver in car.drivers.all %} -
    • {{ driver.first_name }} {{ driver.last_name }}
    • - {% endfor %} + {% for driver in car.drivers.all %} +
    • {{ driver.first_name }} {{ driver.last_name }}
    • + {% endfor %}
    {% endblock %} diff --git a/templates/taxi/driver_list.html b/templates/taxi/driver_list.html index c6c3e823..f8132873 100644 --- a/templates/taxi/driver_list.html +++ b/templates/taxi/driver_list.html @@ -4,9 +4,11 @@

    Driver list

    {% if driver_list %}
      - {% for driver in driver_list%} + {% for driver in driver_list %}
    • - {{ driver.username }} + {{ driver.username }} + {% if user == driver %} (Me) {% endif %} + ({{ driver.first_name }} {{ driver.last_name }})
    • {% endfor %} diff --git a/templates/taxi/index.html b/templates/taxi/index.html index 13c59aa8..96764eae 100644 --- a/templates/taxi/index.html +++ b/templates/taxi/index.html @@ -10,4 +10,5 @@

      Dynamic content

    • Drivers: {{ num_drivers }}
    • Manufacturers: {{ num_manufacturers }}
    +

    You have visited this page {{ num_visits }} time {{ num_visits|pluralize }}.

    {% endblock %}