breadcrumbs

This commit is contained in:
Oliver 2021-10-27 20:17:37 +11:00
parent 219191eb6a
commit 9df9aaa18f
8 changed files with 43 additions and 47 deletions

View File

@ -1,16 +1,10 @@
{% load i18n %} {% load i18n %}
<div class='navigation'> <li><a href='#' id='toggle-part-tree'><strong><span class='fas fa-stream'></span></strong></a></li>
<nav aria-label="breadcrumb"> <li class="breadcrumb-item{% if category is None %} active" aria-current="page{% endif %}"><a href="/part/">{% trans "Parts" %}</a></li>
<ol class="breadcrumb">
<li><a href='#' id='toggle-part-tree'><strong><span class='fas fa-stream'></span></strong></a></li>
<li class="breadcrumb-item{% if category is None %} active" aria-current="page{% endif %}"><a href="/part/">{% trans "Parts" %}</a></li>
{% if category %} {% if category %}
{% for path_item in category.parentpath %} {% for path_item in category.parentpath %}
<li class="breadcrumb-item"><a href="{% url 'category-detail' path_item.id %}">{{ path_item.name }}</a></li> <li class="breadcrumb-item"><a href="{% url 'category-detail' path_item.id %}">{{ path_item.name }}</a></li>
{% endfor %} {% endfor %}
<li class="breadcrumb-item active" aria-current="page"><a href="{% url 'category-detail' category.id %}">{{ category.name }}</a></li> <li class="breadcrumb-item active" aria-current="page"><a href="{% url 'category-detail' category.id %}">{{ category.name }}</a></li>
{% endif %} {% endif %}
</ol>
</nav>
</div>

View File

@ -32,27 +32,25 @@
<h3>{% trans "Part Categories" %}</h3> <h3>{% trans "Part Categories" %}</h3>
<p>{% trans "All parts" %}</p> <p>{% trans "All parts" %}</p>
{% endif %} {% endif %}
<p> <div class='btn-group' role='group'>
<div class='btn-group action-buttons'> {% if roles.part_category.add %}
{% if roles.part_category.add %} <button class='btn btn-outline-secondary' id='cat-create' title='{% trans "Create new part category" %}'>
<button class='btn btn-default' id='cat-create' title='{% trans "Create new part category" %}'> <span class='fas fa-plus-circle icon-green'/>
<span class='fas fa-plus-circle icon-green'/> </button>
</button> {% endif %}
{% endif %} {% if category %}
{% if category %} {% if roles.part_category.change %}
{% if roles.part_category.change %} <button class='btn btn-outline-secondary' id='cat-edit' title='{% trans "Edit part category" %}'>
<button class='btn btn-default' id='cat-edit' title='{% trans "Edit part category" %}'> <span class='fas fa-edit icon-blue'/>
<span class='fas fa-edit icon-blue'/> </button>
</button> {% endif %}
{% endif %} {% if roles.part_category.delete %}
{% if roles.part_category.delete %} <button class='btn btn-outline-secondary' id='cat-delete' title='{% trans "Delete part category" %}'>
<button class='btn btn-default' id='cat-delete' title='{% trans "Delete part category" %}'> <span class='fas fa-trash-alt icon-red'/>
<span class='fas fa-trash-alt icon-red'/> </button>
</button> {% endif %}
{% endif %} {% endif %}
{% endif %} </div>
</div>
</p>
</div> </div>
<div class='col-sm-6'> <div class='col-sm-6'>
{% if category %} {% if category %}

View File

@ -17,14 +17,12 @@
<div id='part-tree'></div> <div id='part-tree'></div>
{% endblock %} {% endblock %}
{% block pre_content %} {% block breadcrumbs %}
{% if part %} {% if part %}
{% include "part/cat_link.html" with category=part.category %} {% include "part/cat_link.html" with category=part.category %}
{% else %} {% else %}
{% include 'part/cat_link.html' with category=category %} {% include 'part/cat_link.html' with category=category %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block js_ready %} {% block js_ready %}

View File

@ -12,7 +12,7 @@
<div id='stock-tree'></div> <div id='stock-tree'></div>
{% endblock %} {% endblock %}
{% block pre_content %} {% block breadcrumbs %}
{% include 'stock/loc_link.html' with location=item.location %} {% include 'stock/loc_link.html' with location=item.location %}
{% endblock %} {% endblock %}

View File

@ -1,16 +1,10 @@
{% load i18n %} {% load i18n %}
<div class="navigation"> <li><a href='#' title='Toggle Stock Tree' id='toggle-stock-tree'><strong><span class='fas fa-stream'></span></strong></a></li>
<nav aria-label="breadcrumb"> <li class="breadcrumb-item{% if location is None %} active" aria-current="page{% endif %}"><a href="/stock/">{% trans "Stock" %}</a></li>
<ol class="breadcrumb">
<li><a href='#' title='Toggle Stock Tree' id='toggle-stock-tree'><strong><span class='fas fa-stream'></span></strong></a></li>
<li class="breadcrumb-item{% if location is None %} active" aria-current="page{% endif %}"><a href="/stock/">{% trans "Stock" %}</a></li>
{% if location %} {% if location %}
{% for path_item in location.parentpath %} {% for path_item in location.parentpath %}
<li class='breadcrumb-item'><a href="{% url 'stock-location-detail' path_item.id %}">{{ path_item.name }}</a></li> <li class='breadcrumb-item'><a href="{% url 'stock-location-detail' path_item.id %}">{{ path_item.name }}</a></li>
{% endfor %} {% endfor %}
<li class='breadcrumb-item active' aria-current='page'><a href="{% url 'stock-location-detail' location.id %}">{{ location.name }}</a></li> <li class='breadcrumb-item active' aria-current='page'><a href="{% url 'stock-location-detail' location.id %}">{{ location.name }}</a></li>
{% endif %} {% endif %}
</ol>
</nav>
</div>

View File

@ -17,7 +17,7 @@
</div> </div>
{% endblock %} {% endblock %}
{% block pre_content %} {% block breadcrumbs %}
{% if item %} {% if item %}
{% include 'stock/loc_link.html' with location=item.location %} {% include 'stock/loc_link.html' with location=item.location %}
{% else %} {% else %}

View File

@ -68,8 +68,18 @@
{% include "navbar.html" %} {% include "navbar.html" %}
<div class='main body wrapper'> <div class='main body wrapper'>
<div class='inventree-body'> <div class='inventree-body'>
<div class='container-fluid'>
<nav aria-label='breadcrumb'>
<ol class='breadcrumb'>
{% block breadcrumbs %}
<li class='breadcrumb-item active'>Breadcrumbs Go Here!</li>
{% endblock %}
</ol>
</nav>
</div>
<div class='containter-fluid inventree-pre-content'> <div class='containter-fluid inventree-pre-content'>
{% block pre_content %} {% block pre_content %}

View File

@ -2024,6 +2024,8 @@ function constructHiddenInput(name, parameters) {
// Construct a "checkbox" input // Construct a "checkbox" input
function constructCheckboxInput(name, parameters) { function constructCheckboxInput(name, parameters) {
var todo = "refactor this with the new bootstrap slide-toggle thingy";
return constructInputOptions( return constructInputOptions(
name, name,
'form-check-input', 'form-check-input',