diff --git a/RIGS/templates/event_detail_buttons.html b/RIGS/templates/event_detail_buttons.html index 27e3a301..5ba44e50 100644 --- a/RIGS/templates/event_detail_buttons.html +++ b/RIGS/templates/event_detail_buttons.html @@ -1,15 +1,10 @@ +{% load button from filters %}
- + {% button 'event_update' event.pk 'edit' %} {% if event.is_rig %} - + {% button 'event_print' event.pk 'print' %} {% endif %} - + {% button 'event_duplicate' event.pk 'duplicate' %} {% if event.is_rig %} {% if event.internal %} {}".format(namespace, attr, str(attr))) else: return "None" + + +@register.inclusion_tag('button.html') +def button(url, pk, type, clazz=None, icon=None, text=None): + if type == 'edit': + clazz = "btn-warning" + icon = "fa-edit" + text = "Edit" + elif type == 'print': + clazz = "btn-primary" + icon = "fa-print" + text = "Print" + elif type == 'duplicate': + clazz = "btn-info" + icon = "fa-copy" + text = "Duplicate" + return {'target': url, 'id': pk, 'class': clazz, 'icon': icon, 'text': text} diff --git a/assets/templates/partials/asset_list_table.html b/assets/templates/partials/asset_list_table.html index de8f713d..ca057a38 100644 --- a/assets/templates/partials/asset_list_table.html +++ b/assets/templates/partials/asset_list_table.html @@ -12,10 +12,10 @@ {% for item in object_list %} - {{ item.asset_id }} - {{ item.description }} - {{ item.category }} - {{ item.status }} + {{ item.asset_id }} + {{ item.description }} + {{ item.category }} + {{ item.status }} {% if audit %} Audit diff --git a/templates/button.html b/templates/button.html new file mode 100644 index 00000000..ab15ac11 --- /dev/null +++ b/templates/button.html @@ -0,0 +1 @@ +