Switch rigboard new button to primary

This commit is contained in:
2020-10-06 16:18:27 +01:00
parent 50ae3022cd
commit 2f8e09906b
3 changed files with 12 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
{% extends 'base_rigs.html' %}
{% load button from filters %}
{% block title %}Rigboard{% endblock %}
@@ -9,12 +10,11 @@
<div class="col-sm-12 col-md">
Key: <span class="table-success mr-1 px-2">Ready</span><span class="table-warning mr-1 px-2">Action Required</span><span class="table-danger mr-1 px-2">Needs MIC</span><span class="table-secondary mr-1 px-2">Cancelled</span><span class="table-info px-2">Non-Rig</span>
</div>
{% if perms.RIGS.add_event %}
<div class="col text-right">
{% if perms.RIGS.add_event %}
<a href="{% url 'event_create' %}" class="btn btn-success">New <i class="fas fa-plus"></i></a>
{% endif %}
{% button 'new' 'event_create' None %}
</div>
{% endif %}
</div>
{% include 'event_table.html' %}

View File

@@ -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}

View File

@@ -1,5 +1,7 @@
{% if submit %}
<button type="submit" class="btn {{ class }}" title="{{ text }}"><span class="fas {{ icon }}"></span> <span class="d-none d-sm-block">{{ text }}</span></button>
<button type="submit" class="btn {{ class }}" title="{{ text }}"><span class="fas {{ icon }}"></span> <span class="d-none d-sm-inline">{{ text }}</span></button>
{% elif id %}
<a href="{% url target id %}" class="btn {{ class }}"><span class="fas {{ icon }}"></span> <span class="d-none d-sm-inline">{{ text }}</span></a>
{% else %}
<a href="{% url target id %}" class="btn {{ class }}"><span class="fas {{ icon }}"></span> <span class="d-none d-sm-block">{{ text }}</span></a>
<a href="{% url target %}" class="btn {{ class }}"><span class="fas {{ icon }}"></span> <span class="d-none d-sm-inline">{{ text }}</span></a>
{% endif %}