2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-02 05:26:45 +00:00

Fix buttons in attachment table

This commit is contained in:
Oliver Walters 2019-06-19 19:05:18 +10:00
parent d837a1f9a2
commit 6e1b7bf3f0
3 changed files with 55 additions and 30 deletions

View File

@ -31,8 +31,12 @@
<td>{{ attachment.comment }}</td> <td>{{ attachment.comment }}</td>
<td> <td>
<div class='btn-group' style='float: right;'> <div class='btn-group' style='float: right;'>
<button type='button' class='btn btn-primary attachment-edit-button' url="{% url 'part-attachment-edit' attachment.id %}" data-toggle='tooltip' title='Edit attachment ({{ attachment.basename }})'><span class='glyphicon glyphicon-small glyphicon-edit'></span></button> <button type='button' class='btn btn-default btn-glyph' url="{% url 'part-attachment-edit' attachment.id %}" data-toggle='tooltip' title='Edit attachment ({{ attachment.basename }})'>
<button type='button' class='btn btn-danger attachment-delete-button' url="{% url 'part-attachment-delete' attachment.id %}" data-toggle='tooltip' title='Delete attachment ({{ attachment.basename }})'><span class='glyphicon glyphicon-small glyphicon-trash'></span></button> <span class='glyphicon glyphicon-edit'/>
</button>
<button type='button' class='btn btn-default btn-glyph' url="{% url 'part-attachment-delete' attachment.id %}" data-toggle='tooltip' title='Delete attachment ({{ attachment.basename }})'>
<span class='glyphicon glyphicon-trash'/>
</button>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -40,34 +40,41 @@
</h4> </h4>
<p><i>{{ part.description }}</i></p> <p><i>{{ part.description }}</i></p>
<p> <p>
<div class='btn-group'> <div class='btn-row'>
<button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'> <div class='btn-group'>
<span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/> <button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'>
</button> <span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/>
{% if part.is_template == False %} </button>
{% include "qr_button.html" %} {% if part.is_template == False %}
{% if part.active %} {% include "qr_button.html" %}
<button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'> {% if part.active %}
<span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/> <button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'>
</button> <span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/>
{% if part.purchaseable %} </button>
<button type='button' class='btn btn-default btn-glyph' id='part-order' title='Order part'> {% if not part.virtual %}
<span id='part-order-icon' class='part-order glyphicon glyphicon-shopping-cart'/> <button type='button' class='btn btn-default btn-glyph' id='part-count' title='Count part stock'>
</button> <span class='glyphicon glyphicon-ok-circle'/>
{% endif %} </button>
{% endif %} {% endif %}
{% endif %} {% if part.purchaseable %}
<button type='button' class='btn btn-default btn-glyph' id='part-duplicate' title='Duplicate part'> <button type='button' class='btn btn-default btn-glyph' id='part-order' title='Order part'>
<span id='part-duplicate-icon' class='part-duplicate glyphicon glyphicon-duplicate'/> <span id='part-order-icon' class='part-order glyphicon glyphicon-shopping-cart'/>
</button> </button>
<button type='button' class='btn btn-default btn-glyph' id='part-edit' title='Edit part'> {% endif %}
<span id='part-edit-icon' class='glyphicon glyphicon-cog part-cog'/> {% endif %}
</button> {% endif %}
{% if not part.active %} <button type='button' class='btn btn-default btn-glyph' id='part-duplicate' title='Duplicate part'>
<button type='button' class='btn btn-default btn-glyph' id='part-delete' title='Delete part'> <span id='part-duplicate-icon' class='part-duplicate glyphicon glyphicon-duplicate'/>
<span id='part-delete-icon' class='glyphicon glyphicon-trash'/> </button>
</button> <button type='button' class='btn btn-default btn-glyph' id='part-edit' title='Edit part'>
{% endif %} <span id='part-edit-icon' class='glyphicon glyphicon-edit'/>
</button>
{% if not part.active %}
<button type='button' class='btn btn-default btn-glyph' id='part-delete' title='Delete part'>
<span id='part-delete-icon' class='glyphicon glyphicon-trash'/>
</button>
{% endif %}
</div>
</div> </div>
</p> </p>
<table class='table table-condensed'> <table class='table table-condensed'>
@ -171,6 +178,16 @@
); );
}); });
$("#part-count").click(function() {
launchModalForm("/stock/adjust/", {
data: {
action: "count",
part: {{ part.id }},
reload: true,
}
});
});
$("#price-button").click(function() { $("#price-button").click(function() {
launchModalForm( launchModalForm(
"{% url 'part-pricing' part.id %}", "{% url 'part-pricing' part.id %}",

View File

@ -26,6 +26,10 @@
color: #5C5; color: #5C5;
} }
.glyphicon-ok-circle {
color: #55c;
}
.glyphicon-remove { .glyphicon-remove {
color: #C55; color: #C55;
} }