mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 15:41:10 +00:00
Merge branch 'master' into stock-item-forms
This commit is contained in:
@@ -20,15 +20,37 @@
|
||||
{% include "admin_button.html" with url=url %}
|
||||
{% endif %}
|
||||
{% if category %}
|
||||
{% if roles.part_category.change %}
|
||||
<button class='btn btn-outline-secondary' id='cat-edit' title='{% trans "Edit part category" %}'>
|
||||
<span class='fas fa-edit'/>
|
||||
{% if starred_directly %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "You are subscribed to notifications for this category" %}'>
|
||||
<span id='category-star-icon' class='fas fa-bell icon-green'></span>
|
||||
</button>
|
||||
{% elif starred %}
|
||||
<button type='button' class='btn btn-outline-secondary' title='{% trans "You are subscribed to notifications for this category" %}' disabled='true'>
|
||||
<span class='fas fa-bell icon-green'></span>
|
||||
</button>
|
||||
{% else %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Subscribe to nofications for this category" %}'>
|
||||
<span id='category-star-icon' class='fa fa-bell-slash'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if roles.part_category.delete %}
|
||||
<button class='btn btn-outline-secondary' id='cat-delete' title='{% trans "Delete part category" %}'>
|
||||
<span class='fas fa-trash-alt icon-red'/>
|
||||
</button>
|
||||
{% if roles.part_category.change or roles.part_category.delete %}
|
||||
<div class='btn-group' role='group'>
|
||||
<button id='category-options' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown' title='{% trans "Category Actions" %}'>
|
||||
<span class='fas fa-tools'></span> <span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu'>
|
||||
{% if roles.part_category.change %}
|
||||
<li><a class='dropdown-item' href='#' id='cat-edit' title='{% trans "Edit category" %}'>
|
||||
<span class='fas fa-edit icon-green'></span> {% trans "Edit Category" %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if roles.part_category.delete %}
|
||||
<li><a class='dropdown-item' href='#' id='cat-delete' title='{% trans "Delete category" %}'>
|
||||
<span class='fas fa-trash-alt icon-red'></span> {% trans "Delete Category" %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if roles.part_category.add %}
|
||||
@@ -198,6 +220,14 @@
|
||||
data: {{ parameters|safe }},
|
||||
}
|
||||
);
|
||||
|
||||
$("#toggle-starred").click(function() {
|
||||
toggleStar({
|
||||
url: '{% url "api-part-category-detail" category.pk %}',
|
||||
button: '#category-star-icon'
|
||||
});
|
||||
});
|
||||
|
||||
{% endif %}
|
||||
|
||||
enableSidebar('category');
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<td><span class='fas fa-sitemap'></span></td>
|
||||
<td>{% trans "Category" %}</td>
|
||||
<td>
|
||||
<a href='{% url "category-detail" part.category.pk %}'>{{ part.category }}</a>
|
||||
<a href='{% url "category-detail" part.category.pk %}'>{{ part.category.name }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
@@ -62,7 +62,7 @@
|
||||
{% endif %}
|
||||
{% if part.minimum_stock %}
|
||||
<tr>
|
||||
<td><span class='fas fa-less-than-equal'></span></td>
|
||||
<td><span class='fas fa-flag'></span></td>
|
||||
<td>{% trans "Minimum stock level" %}</td>
|
||||
<td>{{ part.minimum_stock }}</td>
|
||||
</tr>
|
||||
|
@@ -23,9 +23,19 @@
|
||||
{% include "admin_button.html" with url=url %}
|
||||
{% endif %}
|
||||
|
||||
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Star this part" %}'>
|
||||
<span id='part-star-icon' class='fas fa-star {% if starred %}icon-yellow{% endif %}'/>
|
||||
{% if starred_directly %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "You are subscribed to nofications for this part" %}'>
|
||||
<span id='part-star-icon' class='fas fa-bell icon-green'/>
|
||||
</button>
|
||||
{% elif starred %}
|
||||
<button type='button' class='btn btn-outline-secondary' title='{% trans "You are subscribed to notifications for this part" %}' disabled='true'>
|
||||
<span class='fas fa-bell icon-green'></span>
|
||||
</button>
|
||||
{% else %}
|
||||
<button type='button' class='btn btn-outline-secondary' id='toggle-starred' title='{% trans "Subscribe to nofications for this part" %}'>
|
||||
<span id='part-star-icon' class='fa fa-bell-slash'/>
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if barcodes %}
|
||||
<!-- Barcode actions menu -->
|
||||
@@ -137,8 +147,6 @@
|
||||
</div>
|
||||
</h4>
|
||||
|
||||
|
||||
|
||||
<!-- Part info messages -->
|
||||
<div class='info-messages'>
|
||||
{% if part.variant_of %}
|
||||
@@ -164,6 +172,13 @@
|
||||
<td>{% trans "In Stock" %}</td>
|
||||
<td>{% include "part/stock_count.html" %}</td>
|
||||
</tr>
|
||||
{% if part.minimum_stock %}
|
||||
<tr>
|
||||
<td><span class='fas fa-flag'></span></td>
|
||||
<td>{% trans "Minimum Stock" %}</td>
|
||||
<td>{{ part.minimum_stock }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if on_order > 0 %}
|
||||
<tr>
|
||||
<td><span class='fas fa-shopping-cart'></span></td>
|
||||
@@ -310,7 +325,7 @@
|
||||
|
||||
$("#toggle-starred").click(function() {
|
||||
toggleStar({
|
||||
part: {{ part.id }},
|
||||
url: '{% url "api-part-detail" part.pk %}',
|
||||
button: '#part-star-icon',
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user