From e1d96b9b767aefe647bd01617dc128ab99d11006 Mon Sep 17 00:00:00 2001 From: Robert Einsle Date: Sat, 10 Feb 2018 13:44:14 +0100 Subject: [PATCH] update to bootstrap 4 --- billard/migrations/0024_auto_20180210_1105.py | 35 + billard/models.py | 8 +- billard/static/billard/css/billard.css | 21 - billard/templates/billard/accounting.html | 8 +- billard/templates/billard/base.html | 69 - billard/templates/billard/index.html | 2 +- .../templates/billard/location_detail.html | 9 +- .../billard/location_detail_ajax.html | 4 +- billard/templates/billard/location_index.html | 6 +- .../billard/locationdata_detail.html | 2 +- .../templates/billard/locationdata_list.html | 2 +- .../billard/locationdata_list_ajax.html | 2 +- billard/templates/registration/login.html | 16 - billard/templatetags/display_client.py | 4 +- billard/templatetags/form_tags.py | 19 + billard/views.py | 1 + caromserver/settings.py | 18 +- caromserver/urls.py | 4 +- static/css/billard.css | 25 + .../billard => static}/css/bootstrap-grid.css | 0 .../css/bootstrap-grid.css.map | 0 .../css/bootstrap-grid.min.css | 0 .../css/bootstrap-grid.min.css.map | 0 .../css/bootstrap-reboot.css | 0 .../css/bootstrap-reboot.css.map | 0 .../css/bootstrap-reboot.min.css | 0 .../css/bootstrap-reboot.min.css.map | 0 .../billard => static}/css/bootstrap.css | 0 .../billard => static}/css/bootstrap.css.map | 0 .../billard => static}/css/bootstrap.min.css | 0 .../css/bootstrap.min.css.map | 0 static/css/login.css | 16 + static/img/shattered.png | Bin 0 -> 137733 bytes .../billard => static}/js/bootstrap.bundle.js | 0 .../js/bootstrap.bundle.js.map | 0 .../js/bootstrap.bundle.min.js | 0 .../js/bootstrap.bundle.min.js.map | 0 .../static/billard => static}/js/bootstrap.js | 0 .../billard => static}/js/bootstrap.js.map | 0 .../billard => static}/js/bootstrap.min.js | 0 .../js/bootstrap.min.js.map | 0 .../static/billard => static}/js/carom.js | 0 .../billard => static}/js/html5shiv.min.js | 0 .../billard => static}/js/jquery-3.3.1.js | 0 .../billard => static}/js/jquery-3.3.1.min.js | 0 .../js/jquery-3.3.1.min.map | 0 {billard/static/billard => static}/js/npm.js | 0 static/js/popper.js | 2445 +++++++++++++++++ static/js/popper.min.js | 5 + .../billard => static}/js/respond.min.js | 0 templates/_base.html | 85 + templates/_base_accounts.html | 17 + templates/includes/form.html | 26 + templates/registration/login.html | 21 + 54 files changed, 2739 insertions(+), 131 deletions(-) create mode 100644 billard/migrations/0024_auto_20180210_1105.py delete mode 100644 billard/static/billard/css/billard.css delete mode 100644 billard/templates/billard/base.html delete mode 100644 billard/templates/registration/login.html create mode 100644 billard/templatetags/form_tags.py create mode 100644 static/css/billard.css rename {billard/static/billard => static}/css/bootstrap-grid.css (100%) rename {billard/static/billard => static}/css/bootstrap-grid.css.map (100%) rename {billard/static/billard => static}/css/bootstrap-grid.min.css (100%) rename {billard/static/billard => static}/css/bootstrap-grid.min.css.map (100%) rename {billard/static/billard => static}/css/bootstrap-reboot.css (100%) rename {billard/static/billard => static}/css/bootstrap-reboot.css.map (100%) rename {billard/static/billard => static}/css/bootstrap-reboot.min.css (100%) rename {billard/static/billard => static}/css/bootstrap-reboot.min.css.map (100%) rename {billard/static/billard => static}/css/bootstrap.css (100%) rename {billard/static/billard => static}/css/bootstrap.css.map (100%) rename {billard/static/billard => static}/css/bootstrap.min.css (100%) rename {billard/static/billard => static}/css/bootstrap.min.css.map (100%) create mode 100644 static/css/login.css create mode 100644 static/img/shattered.png rename {billard/static/billard => static}/js/bootstrap.bundle.js (100%) rename {billard/static/billard => static}/js/bootstrap.bundle.js.map (100%) rename {billard/static/billard => static}/js/bootstrap.bundle.min.js (100%) rename {billard/static/billard => static}/js/bootstrap.bundle.min.js.map (100%) rename {billard/static/billard => static}/js/bootstrap.js (100%) rename {billard/static/billard => static}/js/bootstrap.js.map (100%) rename {billard/static/billard => static}/js/bootstrap.min.js (100%) rename {billard/static/billard => static}/js/bootstrap.min.js.map (100%) rename {billard/static/billard => static}/js/carom.js (100%) rename {billard/static/billard => static}/js/html5shiv.min.js (100%) rename {billard/static/billard => static}/js/jquery-3.3.1.js (100%) rename {billard/static/billard => static}/js/jquery-3.3.1.min.js (100%) rename {billard/static/billard => static}/js/jquery-3.3.1.min.map (100%) rename {billard/static/billard => static}/js/npm.js (100%) create mode 100644 static/js/popper.js create mode 100644 static/js/popper.min.js rename {billard/static/billard => static}/js/respond.min.js (100%) create mode 100644 templates/_base.html create mode 100644 templates/_base_accounts.html create mode 100644 templates/includes/form.html create mode 100644 templates/registration/login.html diff --git a/billard/migrations/0024_auto_20180210_1105.py b/billard/migrations/0024_auto_20180210_1105.py new file mode 100644 index 0000000..aaef85d --- /dev/null +++ b/billard/migrations/0024_auto_20180210_1105.py @@ -0,0 +1,35 @@ +# Generated by Django 2.0.2 on 2018-02-10 11:05 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('billard', '0023_accounting_account_tst'), + ] + + operations = [ + migrations.AlterField( + model_name='accounting', + name='desk', + field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='billard.Desk', verbose_name='Tisch'), + ), + migrations.AlterField( + model_name='client', + name='location', + field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='clients', to='billard.Location', verbose_name='Standort'), + ), + migrations.AlterField( + model_name='client', + name='report_user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='reporting_clients', to=settings.AUTH_USER_MODEL, verbose_name='Reporting Benutzer'), + ), + migrations.AlterField( + model_name='desk', + name='client', + field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='desks', to='billard.Client', verbose_name='Client'), + ), + ] diff --git a/billard/models.py b/billard/models.py index 055d03a..05a6e5e 100644 --- a/billard/models.py +++ b/billard/models.py @@ -48,8 +48,8 @@ class Location(models.Model): class Client(models.Model): uuid = models.UUIDField(unique=True, default=uuid.uuid4, verbose_name="Identifier") - location = models.ForeignKey(Location, related_name="clients", verbose_name="Standort") - report_user = models.ForeignKey(User, blank=True, null=True, verbose_name="Reporting Benutzer", related_name='reporting_clients') + location = models.ForeignKey(Location, related_name="clients", verbose_name="Standort", on_delete=models.DO_NOTHING) + report_user = models.ForeignKey(User, blank=True, null=True, verbose_name="Reporting Benutzer", related_name='reporting_clients', on_delete=models.DO_NOTHING) def __str__(self): return '{}, {}'.format(self.location.name, self.uuid) @@ -60,7 +60,7 @@ class Client(models.Model): class Desk(models.Model): - client = models.ForeignKey(Client, verbose_name='Client', related_name='desks') + client = models.ForeignKey(Client, verbose_name='Client', related_name='desks', on_delete=models.DO_NOTHING) desk_no = models.IntegerField(verbose_name='Tischnummer') name = models.CharField(max_length=32, blank=True, null=True, verbose_name='Tischbezeichnung') enabled = models.BooleanField(verbose_name='Tisch aktiv') @@ -77,7 +77,7 @@ class Desk(models.Model): class Accounting(models.Model): - desk = models.ForeignKey(Desk, verbose_name="Tisch") + desk = models.ForeignKey(Desk, verbose_name="Tisch", on_delete=models.DO_NOTHING) time_from = models.DateTimeField(verbose_name="Beginn") time_to = models.DateTimeField(blank=True, null=True, verbose_name="Ende") prize = models.DecimalField(max_digits=6, decimal_places=2, blank=True, null=True, verbose_name="Preis") diff --git a/billard/static/billard/css/billard.css b/billard/static/billard/css/billard.css deleted file mode 100644 index cab8e60..0000000 --- a/billard/static/billard/css/billard.css +++ /dev/null @@ -1,21 +0,0 @@ -body > .container { - padding: 60px 15px 0; -} - -.container .text-muted { - margin: 20px 0; -} - -.footer { - position: absolute; - bottom: 0; - width: 100%; - /* Set the fixed height of the footer here */ - height: 60px; - background-color: #f5f5f5; -} - -.footer > .container { - padding-right: 15px; - padding-left: 15px; -} diff --git a/billard/templates/billard/accounting.html b/billard/templates/billard/accounting.html index 207b502..ff8e3c7 100644 --- a/billard/templates/billard/accounting.html +++ b/billard/templates/billard/accounting.html @@ -1,8 +1,14 @@ -{% extends 'billard/base.html' %} +{% extends '_base.html' %} {% load display_client %} {% block title %}Abrechnung{% endblock %} +{% block breadcrumb %} + + + +{% endblock %} + {% block content %} diff --git a/billard/templates/billard/base.html b/billard/templates/billard/base.html deleted file mode 100644 index 21bc02b..0000000 --- a/billard/templates/billard/base.html +++ /dev/null @@ -1,69 +0,0 @@ -{% load static %} - - - - - - - carom - {% block title %}TITLE SETZEN{% endblock %} - - - -{% block header %} -{% endblock %} - - - - - - - - - -
-{% block content %} -{% endblock %} -
- - - -{% block js %} -{% endblock %} - - diff --git a/billard/templates/billard/index.html b/billard/templates/billard/index.html index 2ca45f8..03f02e3 100644 --- a/billard/templates/billard/index.html +++ b/billard/templates/billard/index.html @@ -1,4 +1,4 @@ -{% extends 'billard/base.html' %} +{% extends '_base.html' %} {% load display_client %} {% block title %}Location Data{% endblock %} diff --git a/billard/templates/billard/location_detail.html b/billard/templates/billard/location_detail.html index 1fe1f89..a655886 100644 --- a/billard/templates/billard/location_detail.html +++ b/billard/templates/billard/location_detail.html @@ -1,9 +1,14 @@ -{% extends 'billard/base.html' %} +{% extends '_base.html' %} {% block title %}Standort{% endblock %} +{% block breadcrumb %} + + +{% endblock %} + {% block content %} -
+
{% include 'billard/location_detail_ajax.html' %}