mirror of https://github.com/snachodog/mybuddy.git
194 lines
10 KiB
HTML
194 lines
10 KiB
HTML
{% extends 'babybuddy/base.html' %}
|
|
{% load timers %}
|
|
|
|
{% block nav %}
|
|
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
|
|
<a class="navbar-brand" href="/"><span class="text-info">Baby</span> Buddy</a>
|
|
|
|
<div class="d-lg-none d-md-none ml-auto p-0 mr-2">
|
|
<a class="text-success mr-2" href="{% url 'timer-add-quick' %}"><i class="icon icon-2x icon-timer" aria-hidden="true"></i></a>
|
|
<div class="dropdown show d-inline">
|
|
<a class="text-success"
|
|
href="#"
|
|
role="button"
|
|
id="nav-quick-add-link"
|
|
data-toggle="dropdown"
|
|
aria-haspopup="true"
|
|
aria-expanded="false"><i class="icon icon-2x icon-add" aria-hidden="true"></i>
|
|
</a>
|
|
|
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="nav-quick-add-link">
|
|
{% if perms.core.add_diaperchange %}
|
|
<a class="dropdown-item p-2" href="{% url 'diaperchange-add' %}">
|
|
<i class="icon icon-diaperchange" aria-hidden="true"></i> Diaper Change
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_feeding %}
|
|
<a class="dropdown-item p-2" href="{% url 'feeding-add' %}">
|
|
<i class="icon icon-feeding" aria-hidden="true"></i> Feeding
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_note %}
|
|
<a class="dropdown-item p-2" href="{% url 'note-add' %}">
|
|
<i class="icon icon-note" aria-hidden="true"></i> Note
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_sleep %}
|
|
<a class="dropdown-item p-2" href="{% url 'sleep-add' %}">
|
|
<i class="icon icon-sleep" aria-hidden="true"></i> Sleep
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_tummytime %}
|
|
<a class="dropdown-item p-2" href="{% url 'tummytime-add' %}">
|
|
<i class="icon icon-tummytime" aria-hidden="true"></i> Tummy Time
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_weight %}
|
|
<a class="dropdown-item p-2" href="{% url 'weight-add' %}">
|
|
<i class="icon icon-weight" aria-hidden="true"></i> Weight
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse"
|
|
data-target="#navbar-app" aria-controls="navbar-app"
|
|
aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
|
|
<div class="collapse navbar-collapse" id="navbar-app">
|
|
<ul class="navbar-nav mr-auto">
|
|
<li class="nav-item{% if request.path == '/' %} active{% endif %}">
|
|
<a class="nav-link" href="{% url 'dashboard' %}">
|
|
<i class="icon icon-dashboard" aria-hidden="true"></i> Dashboard
|
|
</a>
|
|
</li>
|
|
|
|
<li class="nav-item dropdown">
|
|
<a id="nav-children-menu-link"
|
|
class="nav-link dropdown-toggle"
|
|
href="#"
|
|
data-toggle="dropdown"
|
|
aria-haspopup="true"
|
|
aria-expanded="false"><i class="icon icon-child" aria-hidden="true"></i> Children</a>
|
|
<div class="dropdown-menu" aria-labelledby="nav-children-menu-link">
|
|
|
|
{% if perms.core.view_child %}
|
|
<a class="dropdown-item{% if request.path == '/children/' %} active{% endif %}" href="{% url 'child-list' %}">
|
|
<i class="icon icon-child" aria-hidden="true"></i> Children
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_child %}
|
|
<a class="dropdown-item pl-5{% if request.path == '/children/add/' %} active{% endif %}"
|
|
href="{% url 'child-add' %}"><i class="icon icon-add" aria-hidden="true"></i> Child</a>
|
|
{% endif %}
|
|
|
|
{% if perms.core.view_note %}
|
|
<a class="dropdown-item{% if request.path == '/notes/' %} active{% endif %}" href="{% url 'note-list' %}">
|
|
<i class="icon icon-note" aria-hidden="true"></i> Notes
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_note %}
|
|
<a class="dropdown-item pl-5{% if request.path == '/notes/add/' %} active{% endif %}"
|
|
href="{% url 'note-add' %}"><i class="icon icon-add" aria-hidden="true"></i> Note</a>
|
|
{% endif %}
|
|
|
|
{% if perms.core.view_weight %}
|
|
<a class="dropdown-item{% if request.path == '/weight/' %} active{% endif %}" href="{% url 'weight-list' %}">
|
|
<i class="icon icon-weight" aria-hidden="true"></i> Weight
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.core.add_weight %}
|
|
<a class="dropdown-item pl-5{% if request.path == '/weight/add/' %} active{% endif %}"
|
|
href="{% url 'weight-add' %}"><i class="icon icon-add" aria-hidden="true"></i> Weight entry</a>
|
|
{% endif %}
|
|
|
|
</div>
|
|
</li>
|
|
|
|
<li class="nav-item dropdown">
|
|
<a id="nav-activity-menu-link"
|
|
class="nav-link dropdown-toggle"
|
|
href="#"
|
|
data-toggle="dropdown"
|
|
aria-haspopup="true"
|
|
aria-expanded="false"><i class="icon icon-activities" aria-hidden="true"></i> Activities</a>
|
|
<div class="dropdown-menu" aria-labelledby="nav-activity-menu-link">
|
|
|
|
{% if perms.core.view_diaperchange %}
|
|
<a class="dropdown-item{% if request.path == '/changes/' %} active{% endif %}"
|
|
href="{% url 'diaperchange-list' %}"><i class="icon icon-diaperchange" aria-hidden="true"></i> Changes</a>
|
|
{% endif %}
|
|
{% if perms.core.add_diaperchange %}
|
|
<a class="dropdown-item pl-5{% if request.path == '/changes/add/' %} active{% endif %}"
|
|
href="{% url 'diaperchange-add' %}"><i class="icon icon-add" aria-hidden="true"></i> Change</a>
|
|
{% endif %}
|
|
|
|
{% if perms.core.view_feeding %}
|
|
<a class="dropdown-item{% if request.path == '/feedings/' %} active{% endif %}"
|
|
href="{% url 'feeding-list' %}"><i class="icon icon-feeding" aria-hidden="true"></i> Feedings</a>
|
|
{% endif %}
|
|
{% if perms.core.add_diaperchange %}
|
|
<a class="dropdown-item pl-5{% if request.path == '/feedings/add/' %} active{% endif %}"
|
|
href="{% url 'feeding-add' %}"><i class="icon icon-add" aria-hidden="true"></i> Feeding</a>
|
|
{% endif %}
|
|
|
|
{% if perms.core.view_sleep %}
|
|
<a class="dropdown-item{% if request.path == '/sleep/' %} active{% endif %}"
|
|
href="{% url 'sleep-list' %}"><i class="icon icon-sleep" aria-hidden="true"></i> Sleep</a>
|
|
{% endif %}
|
|
{% if perms.core.add_sleep %}
|
|
<a class="dropdown-item pl-5{% if request.path == '/sleep/add/' %} active{% endif %}"
|
|
href="{% url 'sleep-add' %}"><i class="icon icon-add" aria-hidden="true"></i> Sleep entry</a>
|
|
{% endif %}
|
|
|
|
{% if perms.core.view_tummytime %}
|
|
<a class="dropdown-item{% if request.path == '/tummy-time/' %} active{% endif %}"
|
|
href="{% url 'tummytime-list' %}"><i class="icon icon-tummytime" aria-hidden="true"></i> Tummy Time</a>
|
|
{% endif %}
|
|
{% if perms.core.add_tummytime %}
|
|
<a class="dropdown-item pl-5{% if request.path == '/tummy-time/add/' %} active{% endif %}"
|
|
href="{% url 'tummytime-add' %}"><i class="icon icon-add" aria-hidden="true"></i> Tummy Time entry</a>
|
|
{% endif %}
|
|
|
|
</div>
|
|
</li>
|
|
|
|
{% if perms.core.view_timer %}
|
|
{% timer_nav %}
|
|
{% endif %}
|
|
</ul>
|
|
|
|
{% if request.user %}
|
|
<ul class="navbar-nav ml-auto">
|
|
<li class="nav-item dropdown">
|
|
<a id="nav-user-menu-link"
|
|
class="nav-link dropdown-toggle"
|
|
href="#"
|
|
data-toggle="dropdown"
|
|
aria-haspopup="true"
|
|
aria-expanded="false"><i class="icon icon-user" aria-hidden="true"></i> {{ request.user }}
|
|
</a>
|
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="nav-user-menu-link">
|
|
<a href="{% url 'api:api-root' %}"
|
|
class="dropdown-item"
|
|
target="_blank">API Browser</a>
|
|
|
|
{% if request.user.is_staff %}
|
|
<a href="{% url 'admin:index' %}"
|
|
class="dropdown-item"
|
|
target="_blank">Admin</a>
|
|
{% endif %}
|
|
|
|
<a href="{% url 'logout' %}"
|
|
class="dropdown-item">Logout</a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
</nav>
|
|
{% endblock %} |