mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-16 21:12:13 +00:00
Compare commits
2 Commits
032768d3b0
...
3f38ce77e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f38ce77e0 | ||
|
|
39a2401ec9 |
@@ -16,9 +16,16 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% 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 %}
|
||||
<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 %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -41,8 +41,13 @@ class RigboardIndex(generic.TemplateView):
|
||||
# get super context
|
||||
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
|
||||
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"
|
||||
return context
|
||||
|
||||
|
||||
Reference in New Issue
Block a user