2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 15:41:10 +00:00

Javascript consolidation

This commit is contained in:
Oliver
2018-04-29 12:25:07 +10:00
parent 55310be393
commit aca0d236ee
12 changed files with 71 additions and 26 deletions

View File

@@ -11,8 +11,6 @@
{% include 'part/tabs.html' with tab='bom' %}
{% include 'modals.html' %}
<h3>Bill of Materials</h3>
<table class="table table-striped" id='bom-table' data-sorting='true'>

View File

@@ -35,14 +35,10 @@
<button class="btn btn-success" id='start-build'>Start New Build</button>
</div>
{% include 'modals.html' %}
{% endblock %}
{% block js_load %}
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#start-build").click(function() {
launchModalForm("#modal-form",
"{% url 'build-create' %}",

View File

@@ -1,4 +1,4 @@
<table class="table table-striped" data-sorting='true' id="part-list">
<table class="table table-striped" data-sorting='true' data-filtering='true' id="part-list">
<thead>
<tr>
<th>Part</th>

View File

@@ -6,8 +6,6 @@
<h3>Part Details</h3>
{% include 'modals.html' %}
<table class='table table-striped'>
<tr>
<td>Part name</td>
@@ -88,14 +86,14 @@
{% endblock %}
{% block js_load %}
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#edit-part").click(function() {
launchModalForm("#modal-form", "{% url 'part-edit' part.id %}");
launchModalForm("#modal-form",
"{% url 'part-edit' part.id %}",
{
reload: true
});
});
$('#delete-part').click(function() {

View File

@@ -10,7 +10,7 @@
<div class="col-sm-6">
<div class="media">
<div class="media-left">
<img class="part-thumb"
<img class="part-thumb" id="part-thumb"
{% if part.image %}
src="{{ part.image.url }}"
{% else %}
@@ -94,4 +94,19 @@
{% endblock %}
</div>
{% include 'modals.html' %}
{% endblock %}
{% block js_load %}
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
{% endblock %}
{% block js_ready %}
$("#part-thumb").click(function() {
launchModalForm("#modal-form",
"{% url 'part-image' part.id %}",
);
});
{% endblock %}

View File

@@ -45,16 +45,14 @@
<button class='btn btn-success' id='add-stock-item'>Add new Stock Item</button>
</div>
{% include 'modals.html' %}
{% endblock %}
{% block js_load %}
{{ block.super }}
<script type='text/javascript' src="{% static 'script/footable.js' %}"></script>
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}
$('#stock-table').footable();
$('#add-stock-item').click(function () {

View File

@@ -35,16 +35,14 @@
<button class="btn btn-success" id='supplier-create'>New Supplier Part</button>
</div>
{% include 'modals.html' %}
{% endblock %}
{% block js_load %}
{{ block.super }}
<script type='text/javascript' src="{% static 'script/footable.js' %}"></script>``
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}
$('#supplier-table').footable();
$('#supplier-create').click(function () {