-
Notifications
You must be signed in to change notification settings - Fork 840
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
Showing
8 changed files
with
97 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
body { | ||
margin-top: 20px; | ||
background: cadetblue; | ||
} | ||
|
||
.sidebar-nav { | ||
padding: 0; | ||
list-style: none; | ||
} |
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 @@ | ||
from django.urls import path | ||
|
||
from taxi.views import index | ||
|
||
|
||
app_name = "taxi" | ||
urlpatterns = [ | ||
path("", index, name="index"), | ||
] |
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,3 +1,16 @@ | ||
from django.http import HttpRequest, HttpResponse | ||
from django.shortcuts import render | ||
from .models import Driver, Manufacturer, Car | ||
|
||
# Create your views here. | ||
|
||
def index(request: HttpRequest) -> HttpResponse: | ||
num_drivers = Driver.objects.count() | ||
num_manufacturers = Manufacturer.objects.count() | ||
num_cars = Car.objects.count() | ||
context = { | ||
"num_drivers": num_drivers, | ||
"num_manufacturers": num_manufacturers, | ||
"num_cars": num_cars, | ||
} | ||
|
||
return render(request, "taxi/index.html", context=context) |
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,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
{% block title %} | ||
<title>Taxi Service</title> | ||
{% endblock %} | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous"> | ||
{% load static %} | ||
<link rel="stylesheet" href="{% static 'css/styles.css' %}"> | ||
</head> | ||
<body> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-sm-3"> | ||
{% block sidebar %} | ||
{% include "includes/sidebar.html" %} | ||
{% endblock %} | ||
</div> | ||
<div class="col-sm-9"> | ||
{% block content %} | ||
{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
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,14 @@ | ||
<ul class="sidebar-nav"> | ||
<li> | ||
<a href="{% url "taxi:index" %}" style="color: #f5dd5d">Home page</a> | ||
</li> | ||
<li> | ||
<a href="#" style="color: #f5dd5d">Manufacturers</a> | ||
</li> | ||
<li> | ||
<a href="#" style="color: #f5dd5d">Cars</a> | ||
</li> | ||
<li> | ||
<a href="#" style="color: #f5dd5d">Drivers</a> | ||
</li> | ||
</ul> |
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,12 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
<h1>Taxi HomePage</h1> | ||
<p>Welcome To Our Teleport-Taxi</p> | ||
<h1>Our Service is:</h1> | ||
<ul> | ||
<li>Drivers: {{ num_drivers }}</li> | ||
<li>Manufacturers: {{ num_manufacturers }}</li> | ||
<li>Cars: {{ num_cars }}</li> | ||
</ul> | ||
{% endblock %} |