mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #166 from SchrodingersGat/copy-button
Move 'duplicate' button to the Part options drop-down
This commit is contained in:
commit
165264bd0e
@ -14,6 +14,7 @@
|
||||
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
|
||||
<span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href='#' id='duplicate-part' title='Duplicate Part'>Duplicate</a></li>
|
||||
<li><a href="#" id='edit-part' title='Edit part'>Edit</a></li>
|
||||
<li><a href='#' id='stocktake-part' title='Stocktake'>Stocktake</a></li>
|
||||
<li><a href="#" id='delete-part' title='Delete part'>Delete</a></li>
|
||||
@ -119,6 +120,19 @@
|
||||
|
||||
{% block js_ready %}
|
||||
{{ block.super }}
|
||||
|
||||
$("#duplicate-part").click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'part-create' %}",
|
||||
{
|
||||
follow: true,
|
||||
data: {
|
||||
copy: {{ part.id }},
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("#edit-part").click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'part-edit' part.id %}",
|
||||
|
@ -32,7 +32,6 @@
|
||||
<td><a href="{{ part.URL }}">{{ part.URL }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<button class='btn btn-success' id='duplicate-part'>Copy Part</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -96,16 +95,4 @@
|
||||
);
|
||||
});
|
||||
|
||||
$("#duplicate-part").click(function() {
|
||||
launchModalForm(
|
||||
"{% url 'part-create' %}",
|
||||
{
|
||||
follow: true,
|
||||
data: {
|
||||
copy: {{ part.id }},
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user