diff --git a/RIGS/templates/rigboard.html b/RIGS/templates/rigboard.html index f9ee0f45..c903118c 100644 --- a/RIGS/templates/rigboard.html +++ b/RIGS/templates/rigboard.html @@ -1,4 +1,5 @@ {% extends 'base_rigs.html' %} +{% load button from filters %} {% block title %}Rigboard{% endblock %} @@ -9,12 +10,11 @@
Key: ReadyAction RequiredNeeds MICCancelledNon-Rig
- + {% if perms.RIGS.add_event %}
- {% if perms.RIGS.add_event %} - New - {% endif %} + {% button 'new' 'event_create' None %}
+ {% endif %} {% include 'event_table.html' %} diff --git a/RIGS/templatetags/filters.py b/RIGS/templatetags/filters.py index 7f6b58ad..21aab910 100644 --- a/RIGS/templatetags/filters.py +++ b/RIGS/templatetags/filters.py @@ -206,6 +206,10 @@ def button(type, url=None, pk=None, clazz=None, icon=None, text=None): clazz = "btn-primary" icon = "fa-eye" text = "View" + elif type == 'new': + clazz = "btn-primary" + icon = "fa-plus" + text = "New" elif type == 'submit': return {'submit': True, 'class': 'btn-primary', 'icon': 'fa-save', 'text': 'Save'} return {'target': url, 'id': pk, 'class': clazz, 'icon': icon, 'text': text} diff --git a/templates/button.html b/templates/button.html index 046c41ca..3ff7ff43 100644 --- a/templates/button.html +++ b/templates/button.html @@ -1,5 +1,7 @@ {% if submit %} - + +{% elif id %} + {{ text }} {% else %} - {{ text }} + {{ text }} {% endif %}