aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Blanker <kyle@stridet.com>2017-09-14 12:27:06 -0400
committerKyle Blanker <kyle@stridet.com>2017-09-14 12:27:06 -0400
commit20e556de47ab918917634a221f338f1d8a84cf92 (patch)
tree81eeebff54833d3d984dcd37c7bc0013d353bc2d
parentf81d43092039295f36a2590b855d3413966be84a (diff)
downloaddispatch-tracker-20e556de47ab918917634a221f338f1d8a84cf92.tar.gz
dispatch-tracker-20e556de47ab918917634a221f338f1d8a84cf92.tar.xz
Added titles to pages, fixed issue with company loading the loads templates
-rw-r--r--app/dispatch/templates/dispatch/base.html6
-rw-r--r--app/dispatch/templates/dispatch/companies/detail.html1
-rw-r--r--app/dispatch/templates/dispatch/companies/edit.html1
-rw-r--r--app/dispatch/templates/dispatch/companies/list.html1
-rw-r--r--app/dispatch/templates/dispatch/drivers/detail.html1
-rw-r--r--app/dispatch/templates/dispatch/drivers/edit.html1
-rw-r--r--app/dispatch/templates/dispatch/drivers/list.html1
-rw-r--r--app/dispatch/templates/dispatch/loads/create.html1
-rw-r--r--app/dispatch/templates/dispatch/loads/detail.html3
-rw-r--r--app/dispatch/templates/dispatch/loads/edit.html1
-rw-r--r--app/dispatch/templates/dispatch/loads/list.html2
-rw-r--r--app/dispatch/views.py6
12 files changed, 18 insertions, 7 deletions
diff --git a/app/dispatch/templates/dispatch/base.html b/app/dispatch/templates/dispatch/base.html
index de28d7a..693208f 100644
--- a/app/dispatch/templates/dispatch/base.html
+++ b/app/dispatch/templates/dispatch/base.html
@@ -3,7 +3,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
- <title></title>
+ <title>{% block title %}{% endblock %}</title>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
@@ -35,8 +35,8 @@
<div class="nav-wrapper container"><a id="logo-container" href="{% url 'home' %}" class="brand-logo">Dispatch Tracker</a>
<ul class="right hide-on-med-and-down">
{% if user.is_authenticated %}
- <li><a href="{% url 'driver_list' %}">Drivers</a></li>
<li><a href="{% url 'load_list' %}">Loads</a></li>
+ <li><a href="{% url 'driver_list' %}">Drivers</a></li>
<li><a href="{% url 'company_list' %}">Companies</a></li>
<li><a href="#">Contacts</a></li>
<li><a href="{% url 'logout' %}">Logout</a></li>
@@ -47,8 +47,8 @@
<ul id="nav-mobile" class="side-nav">
{% if user.is_authenticated %}
- <li><a href="#">Drivers</a></li>
<li><a href="{% url 'load_list' %}">Loads</a></li>
+ <li><a href="#">Drivers</a></li>
<li><a href="#">Companies</a></li>
<li><a href="#">Contacts</a></li>
<li><a href="{% url 'logout' %}">Logout</a></li>
diff --git a/app/dispatch/templates/dispatch/companies/detail.html b/app/dispatch/templates/dispatch/companies/detail.html
index 053f62b..b889055 100644
--- a/app/dispatch/templates/dispatch/companies/detail.html
+++ b/app/dispatch/templates/dispatch/companies/detail.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Details - {{object.name}}{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/companies/edit.html b/app/dispatch/templates/dispatch/companies/edit.html
index fe8460d..154ac1d 100644
--- a/app/dispatch/templates/dispatch/companies/edit.html
+++ b/app/dispatch/templates/dispatch/companies/edit.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Edit - {{object.name}}{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/companies/list.html b/app/dispatch/templates/dispatch/companies/list.html
index 9399276..2654587 100644
--- a/app/dispatch/templates/dispatch/companies/list.html
+++ b/app/dispatch/templates/dispatch/companies/list.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Companies{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/drivers/detail.html b/app/dispatch/templates/dispatch/drivers/detail.html
index 598d01e..69c1f3a 100644
--- a/app/dispatch/templates/dispatch/drivers/detail.html
+++ b/app/dispatch/templates/dispatch/drivers/detail.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Details - {{ object.first_name }} {{ object.last_name }}{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/drivers/edit.html b/app/dispatch/templates/dispatch/drivers/edit.html
index fe8460d..ef27923 100644
--- a/app/dispatch/templates/dispatch/drivers/edit.html
+++ b/app/dispatch/templates/dispatch/drivers/edit.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Edit - {{ object.first_name }} {{ object.last_name }}{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/drivers/list.html b/app/dispatch/templates/dispatch/drivers/list.html
index efc6141..ccfb50d 100644
--- a/app/dispatch/templates/dispatch/drivers/list.html
+++ b/app/dispatch/templates/dispatch/drivers/list.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Drivers{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/loads/create.html b/app/dispatch/templates/dispatch/loads/create.html
index ae40722..8d84df3 100644
--- a/app/dispatch/templates/dispatch/loads/create.html
+++ b/app/dispatch/templates/dispatch/loads/create.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Create new load{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/loads/detail.html b/app/dispatch/templates/dispatch/loads/detail.html
index e939fdb..3460ccc 100644
--- a/app/dispatch/templates/dispatch/loads/detail.html
+++ b/app/dispatch/templates/dispatch/loads/detail.html
@@ -1,10 +1,11 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Details - {{ object.load_number }}{% endblock %}
{% block content %}
<div class="row">
<div class="col s12 m6">
- <h1>{{ object.name }} details</h1>
+ <h1>Load details {{object.load_number}}</h1>
</div>
</div>
{% endblock %}
diff --git a/app/dispatch/templates/dispatch/loads/edit.html b/app/dispatch/templates/dispatch/loads/edit.html
index fe8460d..37b4bb8 100644
--- a/app/dispatch/templates/dispatch/loads/edit.html
+++ b/app/dispatch/templates/dispatch/loads/edit.html
@@ -1,5 +1,6 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Edit - {{ object.load_number }}{% endblock %}
{% block content %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/loads/list.html b/app/dispatch/templates/dispatch/loads/list.html
index d4caf71..6141e75 100644
--- a/app/dispatch/templates/dispatch/loads/list.html
+++ b/app/dispatch/templates/dispatch/loads/list.html
@@ -1,5 +1,7 @@
{% extends 'dispatch/base.html' %}
+{% block title %}Loads{% endblock %}
+
{% block content %}
diff --git a/app/dispatch/views.py b/app/dispatch/views.py
index b5f3e0d..790428c 100644
--- a/app/dispatch/views.py
+++ b/app/dispatch/views.py
@@ -18,7 +18,7 @@ from django.utils import formats
from dateutil import rrule
def home(request):
- return render(request,"dispatch/index.html")
+ return redirect(reverse('load_list'))
def get_week_dates(date=None):
if date == None:
@@ -119,13 +119,13 @@ class CompanyDetail(LoadDateSort):
model = Company
class CompanyUpdate(UpdateView):
- template_name = "dispatch/loads/edit.html"
+ template_name = "dispatch/companies/edit.html"
model = Company
success_url = reverse_lazy('company_list')
fields = ['name', 'address', 'phone_number','email_address']
class CompanyDelete(DeleteView):
- template_name = "dispatch/loads/delete.html"
+ template_name = "dispatch/companies/delete.html"
model = Company
success_url = reverse_lazy('company_list')