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 class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{% for acc in accounts %}
|
||||
<p>{{ acc.desk }} - {{ acc.time_from }} bis {{ acc.time_to }} - {{ prize }}</p>
|
||||
{% endfor %}
|
||||
<p>{{ account.desk }} - {{ account.time_from }} bis {{ account.time_to }} - {{ account.prize }}</p>
|
||||
</div>
|
||||
<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><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
|
@ -10,5 +10,6 @@ urlpatterns = [
|
||||
url(r'^(?P<pk>[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'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
|
||||
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 = {
|
||||
'accounts': accounts
|
||||
'account': account
|
||||
}
|
||||
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
|
||||
def index(request):
|
||||
if request.method == 'GET':
|
||||
@ -61,13 +68,11 @@ def index(request):
|
||||
loc = min_loc
|
||||
locations = Location.objects.filter(users__id=request.user.id).order_by('code')
|
||||
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 = {
|
||||
'range': range(1, 9),
|
||||
'locations': locations,
|
||||
'clients': clients,
|
||||
'location_id': int(loc),
|
||||
'accounts': accounts,
|
||||
}
|
||||
return render(request, template, context=context)
|
||||
if request.method == 'POST':
|
||||
|
Loading…
Reference in New Issue
Block a user