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' %}