Add button on part page to duplicate part

- Opens modal form
- Takes user to created page
This commit is contained in:
Oliver Walters 2019-04-18 23:17:21 +10:00
parent deaaa48b7d
commit 6de58edd41

View File

@ -32,7 +32,7 @@
<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>
@ -95,4 +95,17 @@
}
);
});
$("#duplicate-part").click(function() {
launchModalForm(
"{% url 'part-create' %}",
{
follow: true,
data: {
copy_part: {{ part.id }},
},
}
);
});
{% endblock %}