diff --git a/billard/templates/billard/accountmodal.html b/billard/templates/billard/accountmodal.html new file mode 100644 index 0000000..62b2ffd --- /dev/null +++ b/billard/templates/billard/accountmodal.html @@ -0,0 +1,20 @@ +{% if accounts %} + +{% endif %} \ No newline at end of file diff --git a/billard/templates/billard/index.html b/billard/templates/billard/index.html index aaa79f2..6746d72 100644 --- a/billard/templates/billard/index.html +++ b/billard/templates/billard/index.html @@ -19,6 +19,8 @@
{% include 'billard/index_ajax.html' %}
+ {% endblock %} {% block js %} {% endblock %} diff --git a/billard/templates/billard/index_ajax.html b/billard/templates/billard/index_ajax.html index 665bd2e..10d7261 100644 --- a/billard/templates/billard/index_ajax.html +++ b/billard/templates/billard/index_ajax.html @@ -7,24 +7,4 @@
Keine Tische angelegt!
-{% endif %} -{% if accounts %} - {% endif %} \ No newline at end of file diff --git a/billard/urls.py b/billard/urls.py index 5f2c954..c01b3ee 100644 --- a/billard/urls.py +++ b/billard/urls.py @@ -9,5 +9,6 @@ urlpatterns = [ url(r'^$', views.index, name='carom_index'), url(r'^(?P[0-9]+)/$', views.LocationDataDetailView.as_view(), name='detail'), url(r'api/v1/', include(router.urls)), - url(r'process_locationdata', views.process_locationdata, name='process_locationdata') + url(r'process_locationdata', views.process_locationdata, name='process_locationdata'), + url(r'accountmodal$', views.accountmodalview, name='accountmodal') ] diff --git a/billard/views.py b/billard/views.py index 52517e9..e17eb76 100644 --- a/billard/views.py +++ b/billard/views.py @@ -30,6 +30,13 @@ class LocationDataDetailView(DetailView): return ('billard/locationdata_detail_ajax.html',) return super().get_template_names() +@login_required +def accountmodalview(request): + accounts = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid) + context = { + 'accounts': accounts + } + return render(request, 'billard/accountmodal.html', context=context) @login_required def index(request):