mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-03-11 22:48:24 +00:00
Compare commits
2 Commits
032768d3b0
...
3f38ce77e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f38ce77e0 | ||
|
|
39a2401ec9 |
@@ -16,9 +16,16 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not request.GET.legacy %}
|
{% if not request.GET.legacy %}
|
||||||
<a href="?legacy=true" class="btn btn-secondary">View legacy rigboard</a>
|
|
||||||
|
{% if not request.GET.hide_cancelled %}
|
||||||
|
<a href="?hide_cancelled=true" class="btn btn-primary mr-3">Hide cancelled</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="." class="btn btn-secondary">Go to new rigboard</a>
|
<a href="." class="btn btn-primary mr-3">Show cancelled</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<a href="?legacy=true" class="btn btn-secondary">Legacy rigboard</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="." class="btn btn-secondary">New rigboard</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,13 @@ class RigboardIndex(generic.TemplateView):
|
|||||||
# get super context
|
# get super context
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
|
|
||||||
|
objects = models.Event.objects.current_events()
|
||||||
|
|
||||||
|
if self.request.GET.get('hide_cancelled', False):
|
||||||
|
objects = objects.exclude(status=models.Event.CANCELLED)
|
||||||
|
|
||||||
# call out method to get current events
|
# call out method to get current events
|
||||||
context['events'] = models.Event.objects.current_events().select_related('riskassessment', 'invoice').prefetch_related('checklists')
|
context['events'] = objects.select_related('riskassessment', 'invoice').prefetch_related('checklists')
|
||||||
context['page_title'] = "Rigboard"
|
context['page_title'] = "Rigboard"
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user