-
Notifications
You must be signed in to change notification settings - Fork 1.2k
done task #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
done task #1345
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| body { | ||
| margin: 10px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from django.urls import path | ||
|
|
||
| from taxi.views import index | ||
|
|
||
|
|
||
| urlpatterns = [ | ||
| path("", index, name="index"), | ||
| ] | ||
|
|
||
| app_name = "taxi" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,13 @@ | ||
| from django.shortcuts import render | ||
|
|
||
| # Create your views here. | ||
| from taxi.models import Driver, Manufacturer, Car | ||
|
|
||
|
|
||
| def index(request): | ||
| context = { | ||
| "num_drivers": Driver.objects.count(), | ||
| "num_manufacturers": Manufacturer.objects.count(), | ||
| "num_cars": Car.objects.count(), | ||
| } | ||
|
|
||
| return render(request, "taxi/index.html", context) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| {% load static %} | ||
| <!DOCTYPE HTML> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" | ||
| content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | ||
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" | ||
| integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous"> | ||
| {% block title %} | ||
| <title>Taxi Service</title> | ||
| {% endblock %} | ||
| <link rel="stylesheet" href="{% static "css/styles.css" %}"> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div> | ||
| {% block sidebar %} | ||
| {% include "includes/sidebar.html" %} | ||
| {% endblock %} | ||
| </div> | ||
|
|
||
| <div> | ||
| {% block content %} | ||
| {% endblock %} | ||
| </div> | ||
|
|
||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <ul> | ||
| <li><a href="#">Home page</a></li> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This violates checklist item #2: "Add a blank line between different groups of imports and ensure appropriate ordering of imports." Add a blank line between the third-party import ( |
||
| <li><a href="#">Manufacturers</a></li> | ||
| <li><a href="#">Cars</a></li> | ||
| <li><a href="#">Drivers</a></li> | ||
| </ul> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block content %} | ||
| <ul> | ||
| <li>Cars: {{ num_cars }}</li> | ||
| <li>Drivers: {{ num_drivers }}</li> | ||
| <li>Manufacturers: {{ num_manufacturers }}</li> | ||
| </ul> | ||
| {% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item #2: "Add a blank line between different groups of imports and ensure appropriate ordering of imports." Add a blank line between the third-party import (
from django.shortcuts import render) and the local import (from taxi.models import Driver, Manufacturer, Car).