Move add button to header in list views

This commit is contained in:
Christopher C. Wells 2020-02-06 20:09:24 -08:00
parent 703782b21c
commit 6333b0b1ea
9 changed files with 71 additions and 64 deletions

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Children" %}</h1>
<h1>
{% trans "Children" %}
{% if perms.core.add_child %}
<a href="{% url 'core:child-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-child" aria-hidden="true"></i> {% trans "Add Child" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover child-list">
@ -64,11 +71,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_child %}
<a href="{% url 'core:child-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-child" aria-hidden="true"></i> {% trans "Add a Child" %}
</a>
{% endif %}
{% endblock %}

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Diaper Changes" %}</h1>
<h1>
{% trans "Diaper Changes" %}
{% if perms.core.add_diaperchange %}
<a href="{% url 'core:diaperchange-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-diaperchange" aria-hidden="true"></i> {% trans "Add Diaper Change" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">
@ -59,11 +66,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_diaperchange %}
<a href="{% url 'core:diaperchange-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-diaperchange" aria-hidden="true"></i> {% trans "Add a Change" %}
</a>
{% endif %}
{% endblock %}

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Feedings" %}</h1>
<h1>
{% trans "Feedings" %}
{% if perms.core.add_feeding %}
<a href="{% url 'core:feeding-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-feeding" aria-hidden="true"></i> {% trans "Add Feeding" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">
@ -64,11 +71,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_feeding %}
<a href="{% url 'core:feeding-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-feeding" aria-hidden="true"></i> {% trans "Add a Feeding" %}
</a>
{% endif %}
{% endblock %}

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Notes" %}</h1>
<h1>
{% trans "Notes" %}
{% if perms.core.add_note %}
<a href="{% url 'core:note-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-note" aria-hidden="true"></i> {% trans "Add Note" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">
@ -53,11 +60,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_note %}
<a href="{% url 'core:note-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-note" aria-hidden="true"></i> {% trans "Add a Note" %}
</a>
{% endif %}
{% endblock %}

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Sleep" %}</h1>
<h1>
{% trans "Sleep" %}
{% if perms.core.add_sleep %}
<a href="{% url 'core:sleep-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-sleep" aria-hidden="true"></i> {% trans "Add Sleep" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">
@ -57,11 +64,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_sleep %}
<a href="{% url 'core:sleep-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-sleep" aria-hidden="true"></i> {% trans "Add a Sleep Entry" %}
</a>
{% endif %}
{% endblock %}

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Temperature" %}</h1>
<h1>
{% trans "Temperature" %}
{% if perms.core.add_temperature %}
<a href="{% url 'core:temperature-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-temperature" aria-hidden="true"></i> {% trans "Add Temperature Reading" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">
@ -53,11 +60,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_temperature %}
<a href="{% url 'core:temperature-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-temperature" aria-hidden="true"></i> {% trans "Add a Temperature Reading" %}
</a>
{% endif %}
{% endblock %}

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Timers" %}</h1>
<h1>
{% trans "Timers" %}
{% if perms.core.add_timer %}
<a href="{% url 'core:timer-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-timer" aria-hidden="true"></i> {% trans "Start Timer" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">

View File

@ -8,7 +8,13 @@
{% endblock %}
{% block content %}
<h1>{% trans "Tummy Time" %}</h1>
<h1>
{% trans "Tummy Time" %}
{% if perms.core.add_tummytime %}
<a href="{% url 'core:tummytime-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-tummytime" aria-hidden="true"></i> {% trans "Add Tummy Time" %}</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">
@ -57,10 +63,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_tummytime %}
<a href="{% url 'core:tummytime-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-tummytime" aria-hidden="true"></i> {% trans "Add a Tummy Time Entry" %}</a>
{% endif %}
{% endblock %}

View File

@ -8,7 +8,14 @@
{% endblock %}
{% block content %}
<h1>{% trans "Weight" %}</h1>
<h1>
{% trans "Weight" %}
{% if perms.core.add_weight %}
<a href="{% url 'core:weight-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-weight" aria-hidden="true"></i> {% trans "Add Weight" %}
</a>
{% endif %}
</h1>
{% include 'babybuddy/filter.html' %}
<div class="table-responsive">
<table class="table table-striped table-hover">
@ -53,11 +60,4 @@
</table>
</div>
{% include 'babybuddy/paginator.html' %}
{% if perms.core.add_weight %}
<a href="{% url 'core:weight-add' %}" class="btn btn-sm btn-success">
<i class="icon icon-weight" aria-hidden="true"></i> {% trans "Add a Weight Entry" %}
</a>
{% endif %}
{% endblock %}