updated modal code
This commit is contained in:
parent
716cb2d347
commit
d2e56b99b8
20
billard/templates/billard/accountmodal.html
Normal file
20
billard/templates/billard/accountmodal.html
Normal file
@ -0,0 +1,20 @@
|
||||
{% if accounts %}
|
||||
<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 %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
{% endif %}
|
@ -19,6 +19,8 @@
|
||||
<div id="desk_data">
|
||||
{% include 'billard/index_ajax.html' %}
|
||||
</div>
|
||||
<div id="modal-wrapper">
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js %}
|
||||
<script type="text/javascript">
|
||||
@ -29,7 +31,9 @@ $(document).ready(function() {
|
||||
|
||||
function refresh_page() {
|
||||
$('#desk_data').load('#');
|
||||
$('#accountsmodal').modal();
|
||||
$('#accountsmodal').modal('hide');
|
||||
$('#modal-wrapper').load('{% url 'accountmodal' %}');
|
||||
$('#accountsmodal').modal('show');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -7,24 +7,4 @@
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12 alert alert-danger">Keine Tische angelegt!</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if accounts %}
|
||||
<div id="accountsmodal" class="modal fade" 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 %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
{% endif %}
|
@ -9,5 +9,6 @@ urlpatterns = [
|
||||
url(r'^$', views.index, name='carom_index'),
|
||||
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'process_locationdata', views.process_locationdata, name='process_locationdata'),
|
||||
url(r'accountmodal$', views.accountmodalview, name='accountmodal')
|
||||
]
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user