updated modal code
This commit is contained in:
parent
51a5d1659a
commit
e7a25888a7
@ -1,18 +1,15 @@
|
|||||||
{% if accounts %}
|
{% if account %}
|
||||||
<div id="accountsmodal" class="modal" tabindex="-1" role="dialog">
|
<div id="accountsmodal" class="modal" tabindex="-1" role="dialog">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
||||||
<h4 class="modal-title">Kischte Kischte Kischte</h4>
|
<h4 class="modal-title">Kischte Kischte Kischte</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
{% for acc in accounts %}
|
<p>{{ account.desk }} - {{ account.time_from }} bis {{ account.time_to }} - {{ account.prize }}</p>
|
||||||
<p>{{ acc.desk }} - {{ acc.time_from }} bis {{ acc.time_to }} - {{ prize }}</p>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-default" href="{% url 'accountmodalconfirm' account.pk %}">Schliessen</button>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
|
@ -10,5 +10,6 @@ urlpatterns = [
|
|||||||
url(r'^(?P<pk>[0-9]+)/$', views.LocationDataDetailView.as_view(), name='detail'),
|
url(r'^(?P<pk>[0-9]+)/$', views.LocationDataDetailView.as_view(), name='detail'),
|
||||||
url(r'api/v1/', include(router.urls)),
|
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')
|
url(r'accountmodal$', views.accountmodalview, name='accountmodal'),
|
||||||
|
url(r'accoutmodal/confirm/(?P<pk>[0-9]+)$', views.accountmodalconfirmview, name="accountmodalconfirm")
|
||||||
]
|
]
|
||||||
|
@ -32,12 +32,19 @@ class LocationDataDetailView(DetailView):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def accountmodalview(request):
|
def accountmodalview(request):
|
||||||
accounts = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid)
|
account = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid).first
|
||||||
context = {
|
context = {
|
||||||
'accounts': accounts
|
'account': account
|
||||||
}
|
}
|
||||||
return render(request, 'billard/accountmodal.html', context=context)
|
return render(request, 'billard/accountmodal.html', context=context)
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
def accountmodalconfirmview(request, pk):
|
||||||
|
account = Accounting.objects.get(pk=pk)
|
||||||
|
account.reporter_uuid = None
|
||||||
|
account.save()
|
||||||
|
redirect('carom_index')
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def index(request):
|
def index(request):
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
@ -61,13 +68,11 @@ def index(request):
|
|||||||
loc = min_loc
|
loc = min_loc
|
||||||
locations = Location.objects.filter(users__id=request.user.id).order_by('code')
|
locations = Location.objects.filter(users__id=request.user.id).order_by('code')
|
||||||
clients = Client.objects.filter(location_id=loc).order_by('id')
|
clients = Client.objects.filter(location_id=loc).order_by('id')
|
||||||
accounts = Accounting.objects.filter(reporter_uuid=Client.objects.get(report_user=request.user).uuid)
|
|
||||||
context = {
|
context = {
|
||||||
'range': range(1, 9),
|
'range': range(1, 9),
|
||||||
'locations': locations,
|
'locations': locations,
|
||||||
'clients': clients,
|
'clients': clients,
|
||||||
'location_id': int(loc),
|
'location_id': int(loc),
|
||||||
'accounts': accounts,
|
|
||||||
}
|
}
|
||||||
return render(request, template, context=context)
|
return render(request, template, context=context)
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
Loading…
Reference in New Issue
Block a user