django-bom 1.252__py3-none-any.whl → 1.258__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bom/admin.py +52 -12
- bom/constants.py +7 -0
- bom/csv_headers.py +22 -44
- bom/forms.py +966 -1019
- bom/helpers.py +79 -4
- bom/migrations/0052_remove_partrevision_attribute_and_more.py +584 -0
- bom/models.py +191 -80
- bom/static/bom/css/style.css +19 -0
- bom/static/bom/js/formset-handler.js +65 -0
- bom/templates/bom/edit-part-class.html +98 -11
- bom/templates/bom/edit-quantity-of-measure.html +119 -0
- bom/templates/bom/edit-user-meta.html +58 -26
- bom/templates/bom/part-info.html +10 -1
- bom/templates/bom/part-revision-display.html +22 -159
- bom/templates/bom/settings.html +138 -11
- bom/tests.py +117 -31
- bom/urls.py +6 -0
- bom/views/views.py +179 -42
- {django_bom-1.252.dist-info → django_bom-1.258.dist-info}/METADATA +1 -1
- {django_bom-1.252.dist-info → django_bom-1.258.dist-info}/RECORD +23 -20
- {django_bom-1.252.dist-info → django_bom-1.258.dist-info}/WHEEL +0 -0
- {django_bom-1.252.dist-info → django_bom-1.258.dist-info}/licenses/LICENSE +0 -0
- {django_bom-1.252.dist-info → django_bom-1.258.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{% extends 'bom/bom-base.html' %}
|
|
2
|
+
{% load static %}
|
|
3
|
+
{% load materializecss %}
|
|
4
|
+
|
|
5
|
+
{% block head-title %}{{ title }}{% endblock %}
|
|
6
|
+
|
|
7
|
+
{% block content %}
|
|
8
|
+
<div class="container" style="padding-top: 40px; max-width: 1000px;">
|
|
9
|
+
{% if profile.role == 'A' %}
|
|
10
|
+
<div class="row">
|
|
11
|
+
<form action="{% if quantity_of_measure %}{% url 'bom:quantity-of-measure-edit' quantity_of_measure_id=quantity_of_measure.id %}{% else %}{% url 'bom:quantity-of-measure-add' %}{% endif %}" method="post"
|
|
12
|
+
class="col s12">
|
|
13
|
+
{% csrf_token %}
|
|
14
|
+
|
|
15
|
+
<div class="row">
|
|
16
|
+
<div class="col s12">
|
|
17
|
+
{{ form.name|materializecss }}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="row" style="margin-top: 40px; margin-bottom: 20px;">
|
|
22
|
+
<div class="col s12">
|
|
23
|
+
<h5>Units</h5>
|
|
24
|
+
<p class="grey-text text-darken-1">Define the units belonging to this quantity of measure. Base multiplier is relative to the base unit (multiplier 1.0).<br><br>For example, Voltage would have a base multiplier of 1.0, and millivolts would have a base multiplier of 0.001.</p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div id="unit-definitions-wrapper">
|
|
29
|
+
{{ unit_formset.management_form }}
|
|
30
|
+
|
|
31
|
+
<table class="highlight" style="border-bottom: 1px solid #e0e0e0;">
|
|
32
|
+
<thead>
|
|
33
|
+
<tr class="grey-text">
|
|
34
|
+
<th style="width: 35%;">Name</th>
|
|
35
|
+
<th style="width: 20%;">Symbol</th>
|
|
36
|
+
<th style="width: 35%;">Base Multiplier</th>
|
|
37
|
+
<th style="width: 10%;" class="center-align">Action</th>
|
|
38
|
+
</tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody id="unit-definitions-body">
|
|
41
|
+
{% for form in unit_formset %}
|
|
42
|
+
<tr class="unit-definition-row">
|
|
43
|
+
{% for hidden in form.hidden_fields %}
|
|
44
|
+
{{ hidden }}
|
|
45
|
+
{% endfor %}
|
|
46
|
+
|
|
47
|
+
<td>{{ form.name|materializecss }}</td>
|
|
48
|
+
<td>{{ form.symbol|materializecss }}</td>
|
|
49
|
+
<td>{{ form.base_multiplier|materializecss }}</td>
|
|
50
|
+
<td class="center-align">
|
|
51
|
+
{% if form.instance.pk %}
|
|
52
|
+
<div style="display:none;">{{ form.DELETE }}</div>
|
|
53
|
+
<a href="#!" class="btn-flat btn-small red-text delete-existing-row">
|
|
54
|
+
<i class="material-icons">delete</i>
|
|
55
|
+
</a>
|
|
56
|
+
{% else %}
|
|
57
|
+
<a href="#!" class="btn-flat btn-small red-text remove-new-row">
|
|
58
|
+
<i class="material-icons">close</i>
|
|
59
|
+
</a>
|
|
60
|
+
{% endif %}
|
|
61
|
+
</td>
|
|
62
|
+
</tr>
|
|
63
|
+
{% endfor %}
|
|
64
|
+
</tbody>
|
|
65
|
+
</table>
|
|
66
|
+
|
|
67
|
+
<div class="row" style="margin-top: 15px;">
|
|
68
|
+
<div class="col s12">
|
|
69
|
+
<button type="button" class="btn-flat waves-effect"
|
|
70
|
+
id="add-unit-definition" style="padding-left: 0;">
|
|
71
|
+
<i class="material-icons left">add</i> Add Unit
|
|
72
|
+
</button>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="row" style="margin-top: 50px;">
|
|
78
|
+
<div class="col s12 right-align">
|
|
79
|
+
<a href="{% url 'bom:settings' tab_anchor='indabom' %}"
|
|
80
|
+
class="btn btn-flat waves-effect"
|
|
81
|
+
style="margin-right: 10px;">Cancel</a>
|
|
82
|
+
<button class="waves-effect waves-light btn btn-primary" type="submit" name="action">
|
|
83
|
+
Save
|
|
84
|
+
</button>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</form>
|
|
88
|
+
</div>
|
|
89
|
+
{% else %}
|
|
90
|
+
{% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
|
|
91
|
+
{% endif %}
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<script type="text/template" id="empty-form-template">
|
|
95
|
+
<tr class="unit-definition-row">
|
|
96
|
+
<td>{{ unit_formset.empty_form.name|materializecss }}</td>
|
|
97
|
+
<td>{{ unit_formset.empty_form.symbol|materializecss }}</td>
|
|
98
|
+
<td>{{ unit_formset.empty_form.base_multiplier|materializecss }}</td>
|
|
99
|
+
<td class="center-align">
|
|
100
|
+
<a href="#!" class="btn-flat btn-small red-text remove-new-row">
|
|
101
|
+
<i class="material-icons">close</i>
|
|
102
|
+
</a>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<script src="{% static 'bom/js/formset-handler.js' %}"></script>
|
|
108
|
+
<script>
|
|
109
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
110
|
+
initFormset({
|
|
111
|
+
prefix: '{{ unit_formset.prefix }}',
|
|
112
|
+
addBtnId: 'add-unit-definition',
|
|
113
|
+
formContainerId: 'unit-definitions-body',
|
|
114
|
+
emptyFormTemplateId: 'empty-form-template',
|
|
115
|
+
rowSelector: '.unit-definition-row'
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
</script>
|
|
119
|
+
{% endblock %}
|
|
@@ -1,38 +1,70 @@
|
|
|
1
1
|
{% extends 'bom/bom-base.html' %}
|
|
2
2
|
|
|
3
|
-
{% load static %}
|
|
4
3
|
{% load materializecss %}
|
|
4
|
+
{% load static %}
|
|
5
5
|
|
|
6
6
|
{% block head-title %}{{ title }}{% endblock %}
|
|
7
7
|
|
|
8
|
+
{% block bom-menu %}
|
|
9
|
+
<li><a href="javascript:history.back()">Cancel</a></li>
|
|
10
|
+
{% endblock %}
|
|
11
|
+
|
|
8
12
|
{% block content %}
|
|
9
|
-
<div class="container-app">
|
|
10
|
-
|
|
11
|
-
<div class="
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
<div class="container container-app">
|
|
14
|
+
<div class="row">
|
|
15
|
+
<div class="col s12 m8 offset-m2">
|
|
16
|
+
<div class="card">
|
|
17
|
+
<div class="card-content">
|
|
18
|
+
{% if h1 %}<span class="card-title">{{ h1 }}</span>{% endif %}
|
|
19
|
+
|
|
20
|
+
<div class="row" style="margin-bottom: 30px;">
|
|
21
|
+
<div class="col s12">
|
|
22
|
+
<ul class="collection" style="border: none;">
|
|
23
|
+
<li class="collection-item avatar"
|
|
24
|
+
style="border-bottom: 1px solid #e0e0e0; min-height: 64px;">
|
|
25
|
+
<i class="material-icons circle">business</i>
|
|
26
|
+
<span class="title">Organization</span>
|
|
27
|
+
<p class="grey-text">{{ organization }}</p>
|
|
28
|
+
</li>
|
|
29
|
+
<li class="collection-item avatar"
|
|
30
|
+
style="border-bottom: 1px solid #e0e0e0; min-height: 64px;">
|
|
31
|
+
<i class="material-icons circle">person</i>
|
|
32
|
+
<span class="title">Username</span>
|
|
33
|
+
<p class="grey-text">{{ user.username }}</p>
|
|
34
|
+
</li>
|
|
35
|
+
<li class="collection-item avatar" style="min-height: 64px;">
|
|
36
|
+
<i class="material-icons circle">email</i>
|
|
37
|
+
<span class="title">Email</span>
|
|
38
|
+
<p class="grey-text">{{ user.email }}</p>
|
|
39
|
+
</li>
|
|
40
|
+
</ul>
|
|
41
|
+
</div>
|
|
30
42
|
</div>
|
|
43
|
+
|
|
44
|
+
<form name="seller" action="{{ action }}" method="post">
|
|
45
|
+
{% csrf_token %}
|
|
46
|
+
<div class="row">
|
|
47
|
+
{{ form|materializecss:'s12' }}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="card-action"
|
|
51
|
+
style="padding: 16px 0 0 0; border-top: 1px solid rgba(160,160,160,0.2);">
|
|
52
|
+
<div class="row" style="margin-bottom: 0;">
|
|
53
|
+
<div class="col s6">
|
|
54
|
+
<a href="javascript:history.back()"
|
|
55
|
+
class="waves-effect waves-teal btn-flat grey-text">Cancel</a>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="col s6 right-align">
|
|
58
|
+
<button class="waves-effect waves-light btn btn-primary" type="submit"
|
|
59
|
+
name="action">Save Changes
|
|
60
|
+
</button>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</form>
|
|
31
65
|
</div>
|
|
32
|
-
</
|
|
66
|
+
</div>
|
|
33
67
|
</div>
|
|
34
|
-
|
|
35
|
-
{% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
|
|
36
|
-
{% endif %}
|
|
68
|
+
</div>
|
|
37
69
|
</div>
|
|
38
70
|
{% endblock %}
|
bom/templates/bom/part-info.html
CHANGED
|
@@ -142,6 +142,15 @@
|
|
|
142
142
|
){% endif %}
|
|
143
143
|
</i></div>
|
|
144
144
|
</div>
|
|
145
|
+
{% for property in part_revision.properties.all %}
|
|
146
|
+
<div class="row">
|
|
147
|
+
<div class="col s4 l2 text-right"
|
|
148
|
+
style="padding-left: 0px;">{{ property.property_definition.name }}:
|
|
149
|
+
</div>
|
|
150
|
+
<div class="col s8 l10">{{ property.value_raw }}{% if property.unit_definition %}
|
|
151
|
+
{{ property.unit_definition.symbol }}{% endif %}</div>
|
|
152
|
+
</div>
|
|
153
|
+
{% endfor %}
|
|
145
154
|
<div class="row">
|
|
146
155
|
<div class="col s4 l2 text-right" style="padding-left: 0;">
|
|
147
156
|
<img title="Via Google Drive" style="width: 16px;" src="{% static 'bom/img/google_drive_logo.svg' %}"> Files:
|
|
@@ -436,4 +445,4 @@
|
|
|
436
445
|
$('#bom-indented').show();
|
|
437
446
|
}
|
|
438
447
|
</script>
|
|
439
|
-
{% endblock bom-script %}
|
|
448
|
+
{% endblock bom-script %}
|
|
@@ -11,7 +11,6 @@ all of the properties of a part revision, as follows:
|
|
|
11
11
|
where XXX should be the name of the includee's object that represent its PartRevisionForm.
|
|
12
12
|
|
|
13
13
|
{% endcomment %}
|
|
14
|
-
<p>Must include a either a description or electronics value, and value units. The remaining fields are optional.</p>
|
|
15
14
|
<div class="row">
|
|
16
15
|
<div class="fieldWrapper">
|
|
17
16
|
{{ part_revision_form.revision|materializecss:'m2 s12' }}
|
|
@@ -23,162 +22,26 @@ where XXX should be the name of the includee's object that represent its PartRev
|
|
|
23
22
|
|
|
24
23
|
<div class="row">
|
|
25
24
|
<div class="col s12">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</div>
|
|
49
|
-
<div class="fieldWrapper">
|
|
50
|
-
{{ part_revision_form.supply_voltage_units|materializecss:'m1 s12' }}
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<div class="row">
|
|
55
|
-
<div class="col s12">
|
|
56
|
-
<h4>Ratings</h4>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<div class="row">
|
|
61
|
-
<div class="fieldWrapper">
|
|
62
|
-
{{ part_revision_form.power_rating|materializecss:'m1 s12' }}
|
|
63
|
-
</div>
|
|
64
|
-
<div class="fieldWrapper">
|
|
65
|
-
{{ part_revision_form.power_rating_units|materializecss:'m1 s12' }}
|
|
66
|
-
</div>
|
|
67
|
-
<div class="fieldWrapper">
|
|
68
|
-
{{ part_revision_form.voltage_rating|materializecss:'m1 s12' }}
|
|
69
|
-
</div>
|
|
70
|
-
<div class="fieldWrapper">
|
|
71
|
-
{{ part_revision_form.voltage_rating_units|materializecss:'m1 s12' }}
|
|
72
|
-
</div>
|
|
73
|
-
<div class="fieldWrapper">
|
|
74
|
-
{{ part_revision_form.current_rating|materializecss:'m1 s12' }}
|
|
75
|
-
</div>
|
|
76
|
-
<div class="fieldWrapper">
|
|
77
|
-
{{ part_revision_form.current_rating_units|materializecss:'m1 s12' }}
|
|
78
|
-
</div>
|
|
79
|
-
<div class="fieldWrapper">
|
|
80
|
-
{{ part_revision_form.temperature_rating|materializecss:'m1 s12' }}
|
|
81
|
-
</div>
|
|
82
|
-
<div class="fieldWrapper">
|
|
83
|
-
{{ part_revision_form.temperature_rating_range_max|materializecss:'m1 s12' }}
|
|
84
|
-
</div>
|
|
85
|
-
<div class="fieldWrapper">
|
|
86
|
-
{{ part_revision_form.temperature_rating_range_min|materializecss:'m1 s12' }}
|
|
87
|
-
</div>
|
|
88
|
-
<div class="fieldWrapper">
|
|
89
|
-
{{ part_revision_form.temperature_rating_units|materializecss:'m1 s12' }}
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<div class="row">
|
|
94
|
-
<div class="col s12">
|
|
95
|
-
<h4>Miscellaneous</h4>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<div class="row">
|
|
100
|
-
<div class="fieldWrapper">
|
|
101
|
-
{{ part_revision_form.memory|materializecss:'m1 s12' }}
|
|
102
|
-
</div>
|
|
103
|
-
<div class="fieldWrapper">
|
|
104
|
-
{{ part_revision_form.memory_units|materializecss:'m1 s12' }}
|
|
105
|
-
</div>
|
|
106
|
-
<div class="fieldWrapper">
|
|
107
|
-
{{ part_revision_form.interface|materializecss:'m2 s12' }}
|
|
108
|
-
</div>
|
|
109
|
-
<div class="fieldWrapper">
|
|
110
|
-
{{ part_revision_form.frequency|materializecss:'m1 s12' }}
|
|
111
|
-
</div>
|
|
112
|
-
<div class="fieldWrapper">
|
|
113
|
-
{{ part_revision_form.frequency_units|materializecss:'m1 s12' }}
|
|
114
|
-
</div>
|
|
115
|
-
<div class="fieldWrapper">
|
|
116
|
-
{{ part_revision_form.wavelength|materializecss:'m1 s12' }}
|
|
117
|
-
</div>
|
|
118
|
-
<div class="fieldWrapper">
|
|
119
|
-
{{ part_revision_form.wavelength_units|materializecss:'m1 s12' }}
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
<div class="row">
|
|
124
|
-
<div class="col s12">
|
|
125
|
-
<h4>Appearance</h4>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<div class="row">
|
|
130
|
-
<div class="fieldWrapper">
|
|
131
|
-
{{ part_revision_form.color|materializecss:'m2 s12' }}
|
|
132
|
-
</div>
|
|
133
|
-
<div class="fieldWrapper">
|
|
134
|
-
{{ part_revision_form.material|materializecss:'m2 s12' }}
|
|
135
|
-
</div>
|
|
136
|
-
<div class="fieldWrapper">
|
|
137
|
-
{{ part_revision_form.finish|materializecss:'m2 s12' }}
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
<div class="row">
|
|
142
|
-
<div class="col s12">
|
|
143
|
-
<h4>Dimensions</h4>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
<div class="row">
|
|
148
|
-
<div class="fieldWrapper">
|
|
149
|
-
{{ part_revision_form.length|materializecss:'m1 s12' }}
|
|
150
|
-
</div>
|
|
151
|
-
<div class="fieldWrapper">
|
|
152
|
-
{{ part_revision_form.length_units|materializecss:'m1 s12' }}
|
|
153
|
-
</div>
|
|
154
|
-
<div class="fieldWrapper">
|
|
155
|
-
{{ part_revision_form.width|materializecss:'m1 s12' }}
|
|
156
|
-
</div>
|
|
157
|
-
<div class="fieldWrapper">
|
|
158
|
-
{{ part_revision_form.width_units|materializecss:'m1 s12' }}
|
|
159
|
-
</div>
|
|
160
|
-
<div class="fieldWrapper">
|
|
161
|
-
{{ part_revision_form.height|materializecss:'m1 s12' }}
|
|
162
|
-
</div>
|
|
163
|
-
<div class="fieldWrapper">
|
|
164
|
-
{{ part_revision_form.height_units|materializecss:'m1 s12' }}
|
|
165
|
-
</div>
|
|
166
|
-
<div class="fieldWrapper">
|
|
167
|
-
{{ part_revision_form.weight|materializecss:'m1 s12' }}
|
|
168
|
-
</div>
|
|
169
|
-
<div class="fieldWrapper">
|
|
170
|
-
{{ part_revision_form.weight_units|materializecss:'m1 s12' }}
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
|
|
174
|
-
<div class="row">
|
|
175
|
-
<div class="col s12">
|
|
176
|
-
<h4>Other Attributes</h4>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
|
|
180
|
-
<div class="row">
|
|
181
|
-
<div class="fieldWrapper">
|
|
182
|
-
{{ part_revision_form.attribute|materializecss:'m12 s12' }}
|
|
183
|
-
</div>
|
|
25
|
+
{% if part_revision_form.property_definitions %}
|
|
26
|
+
<h4>Properties</h4>
|
|
27
|
+
{% else %}
|
|
28
|
+
<p><i>You can add part class specific properties (e.g. voltage, width, sheen, etc) after creating the
|
|
29
|
+
part.</i></p>
|
|
30
|
+
{% endif %}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="row">
|
|
35
|
+
{% for group in part_revision_form.property_fields %}
|
|
36
|
+
<div class="row">
|
|
37
|
+
<div class="fieldWrapper">
|
|
38
|
+
{{ group.property|materializecss:'m3 s6' }}
|
|
39
|
+
</div>
|
|
40
|
+
{% if group.unit %}
|
|
41
|
+
<div class="fieldWrapper">
|
|
42
|
+
{{ group.unit|materializecss:'m3 s6' }}
|
|
43
|
+
</div>
|
|
44
|
+
{% endif %}
|
|
45
|
+
</div>
|
|
46
|
+
{% endfor %}
|
|
184
47
|
</div>
|
bom/templates/bom/settings.html
CHANGED
|
@@ -45,10 +45,9 @@
|
|
|
45
45
|
</form>
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
|
-
<div class="section"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class="material-icons red-text text-darken-2">warning</i>Danger Zone</h5>
|
|
48
|
+
<div class="section" style="padding: 16px; border-radius: 6px;">
|
|
49
|
+
<h4 class="section-title red-text text-darken-2" style="margin-top:0;"><i
|
|
50
|
+
class="material-icons red-text text-darken-2">warning</i>Danger Zone</h4>
|
|
52
51
|
<p>Deleting your account is permanent. If you are the organization owner, your organization will also be
|
|
53
52
|
deleted unless you transfer ownership before proceeding.</p>
|
|
54
53
|
<div class="right-align" style="margin-top: 8px;">
|
|
@@ -120,7 +119,7 @@
|
|
|
120
119
|
title="Via Mouser.com"
|
|
121
120
|
src="{% static 'bom/img/mouser.png' %}">{% endif %}</td>
|
|
122
121
|
<td>
|
|
123
|
-
<a class="
|
|
122
|
+
<a class="table-action"
|
|
124
123
|
href="{% url 'bom:part-class-edit' part_class_id=part_class.id %}"><i
|
|
125
124
|
class="material-icons left">edit</i>Edit</a>
|
|
126
125
|
</td>
|
|
@@ -144,7 +143,134 @@
|
|
|
144
143
|
</div>
|
|
145
144
|
|
|
146
145
|
<div class="divider"></div>
|
|
146
|
+
{% endif %}
|
|
147
|
+
|
|
148
|
+
<div class="section">
|
|
149
|
+
<h4 class="section-title"><i class="material-icons teal-text text-darken-1">list_alt</i>Property
|
|
150
|
+
Definitions</h4>
|
|
151
|
+
<p>Define part properties (e.g. Capacitance, Length, Sheen), their data type, and their
|
|
152
|
+
associated quantity of measure.</p>
|
|
153
|
+
{% if property_definitions.count > 0 %}
|
|
154
|
+
<table class="striped tight">
|
|
155
|
+
<thead>
|
|
156
|
+
<tr>
|
|
157
|
+
<th class="text-normal">Name</th>
|
|
158
|
+
<th class="text-normal">Type</th>
|
|
159
|
+
<th class="text-normal">Required</th>
|
|
160
|
+
<th class="text-normal">Quantity of Measure</th>
|
|
161
|
+
<th class="text-normal">Options</th>
|
|
162
|
+
</tr>
|
|
163
|
+
</thead>
|
|
164
|
+
<tbody>
|
|
165
|
+
{% for prop in property_definitions %}
|
|
166
|
+
<tr>
|
|
167
|
+
<td class="text-normal">{{ prop.name }}</td>
|
|
168
|
+
<td class="text-normal">{{ prop.get_type_display }}</td>
|
|
169
|
+
<td class="text-normal">{% if prop.required %}Yes{% else %}No{% endif %}</td>
|
|
170
|
+
<td class="text-normal">{{ prop.quantity_of_measure.name|default:"-" }}</td>
|
|
171
|
+
<td>
|
|
172
|
+
{% if prop.organization == organization %}
|
|
173
|
+
<a class="table-action"
|
|
174
|
+
href="{% url 'bom:property-definition-edit' property_definition_id=prop.id %}"><i
|
|
175
|
+
class="material-icons left">edit</i>Edit</a>
|
|
176
|
+
<a class="table-action red-text"
|
|
177
|
+
href="{% url 'bom:property-definition-delete' property_definition_id=prop.id %}"
|
|
178
|
+
onclick="return confirm('Are you sure you want to delete this property definition?')"><i
|
|
179
|
+
class="material-icons left">delete</i></a>
|
|
180
|
+
{% else %}
|
|
181
|
+
<span class="table-action tooltipped grey-text d-flex-inline align-center"
|
|
182
|
+
data-position="top"
|
|
183
|
+
data-tooltip="System Default: Cannot be modified">
|
|
184
|
+
<i class="material-icons left" style="font-size: 1.2rem;">lock</i> System
|
|
185
|
+
</span>
|
|
186
|
+
{% endif %}
|
|
187
|
+
</td>
|
|
188
|
+
</tr>
|
|
189
|
+
{% endfor %}
|
|
190
|
+
</tbody>
|
|
191
|
+
</table>
|
|
192
|
+
{% else %}
|
|
193
|
+
<p>No global property definitions defined.</p>
|
|
194
|
+
{% endif %}
|
|
195
|
+
<div class="right-align" style="margin-top: 16px;">
|
|
196
|
+
<a href="{% url 'bom:property-definition-add' %}"
|
|
197
|
+
class="waves-effect waves-light btn btn-primary">
|
|
198
|
+
<i class="material-icons left">add</i>Add Property Definition
|
|
199
|
+
</a>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="divider"></div>
|
|
204
|
+
|
|
205
|
+
<div class="section">
|
|
206
|
+
<h4 class="section-title"><i class="material-icons teal-text text-darken-1">straighten</i>Units &
|
|
207
|
+
Quantities</h4>
|
|
208
|
+
<p>Define quantities of measure (e.g. Length, Resistance) and their associated units (e.g. m, mm,
|
|
209
|
+
Ohm, kOhm).</p>
|
|
210
|
+
{% if quantities_of_measure.count > 0 %}
|
|
211
|
+
<table class="striped tight">
|
|
212
|
+
<thead>
|
|
213
|
+
<tr>
|
|
214
|
+
<th class="text-normal">Quantity</th>
|
|
215
|
+
<th class="text-normal">Units</th>
|
|
216
|
+
<th class="text-normal">Options</th>
|
|
217
|
+
</tr>
|
|
218
|
+
</thead>
|
|
219
|
+
<tbody>
|
|
220
|
+
{% for qom in quantities_of_measure %}
|
|
221
|
+
<tr>
|
|
222
|
+
<td class="text-normal">{{ qom.name }}</td>
|
|
223
|
+
<td class="text-normal">
|
|
224
|
+
{% for unit in qom.units.all|slice:":3" %}
|
|
225
|
+
{{ unit.symbol }}{% if not forloop.last %}, {% endif %}
|
|
226
|
+
{% endfor %}
|
|
227
|
+
|
|
228
|
+
{% if qom.units.count > 3 %}
|
|
229
|
+
<span class="grey-text text-darken-1 tooltipped"
|
|
230
|
+
data-tooltip="
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
{% for unit in qom.units.all %}{{ unit.name }}{% if not forloop.last %}, {% endif %}{% endfor %}">
|
|
236
|
+
(+{{ qom.units.count|add:"-3" }} more)
|
|
237
|
+
</span>
|
|
238
|
+
{% endif %}
|
|
239
|
+
</td>
|
|
240
|
+
<td>
|
|
241
|
+
{% if qom.organization == organization %}
|
|
242
|
+
<a class="table-action"
|
|
243
|
+
href="{% url 'bom:quantity-of-measure-edit' quantity_of_measure_id=qom.id %}"><i
|
|
244
|
+
class="material-icons left">edit</i>Edit</a>
|
|
245
|
+
<a class="table-action red-text"
|
|
246
|
+
href="{% url 'bom:quantity-of-measure-delete' quantity_of_measure_id=qom.id %}"
|
|
247
|
+
onclick="return confirm('Are you sure you want to delete this quantity of measure and all its units?')"><i
|
|
248
|
+
class="material-icons left">delete</i></a>
|
|
249
|
+
{% else %}
|
|
250
|
+
<span class="table-action tooltipped grey-text d-flex-inline align-center"
|
|
251
|
+
data-position="top"
|
|
252
|
+
data-tooltip="System Default: Cannot be modified">
|
|
253
|
+
<i class="material-icons left" style="font-size: 1.2rem;">lock</i> System
|
|
254
|
+
</span>
|
|
255
|
+
{% endif %}
|
|
256
|
+
</td>
|
|
257
|
+
</tr>
|
|
258
|
+
{% endfor %}
|
|
259
|
+
</tbody>
|
|
260
|
+
</table>
|
|
261
|
+
{% else %}
|
|
262
|
+
<p>No quantities of measure defined.</p>
|
|
263
|
+
{% endif %}
|
|
264
|
+
<div class="right-align" style="margin-top: 16px;">
|
|
265
|
+
<a href="{% url 'bom:quantity-of-measure-add' %}"
|
|
266
|
+
class="waves-effect waves-light btn btn-primary">
|
|
267
|
+
<i class="material-icons left">add</i>Add Quantity of Measure
|
|
268
|
+
</a>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
147
271
|
|
|
272
|
+
{% if organization.number_scheme == 'S' %}
|
|
273
|
+
<div class="divider"></div>
|
|
148
274
|
<div class="section">
|
|
149
275
|
<h4 class="section-title" id="indabom-part-number"><i
|
|
150
276
|
class="material-icons teal-text text-darken-1">format_list_numbered</i>Part Number</h4>
|
|
@@ -266,17 +392,18 @@
|
|
|
266
392
|
{% for org_user in users_in_organization %}
|
|
267
393
|
<tr>
|
|
268
394
|
<td>
|
|
269
|
-
|
|
270
|
-
|
|
395
|
+
{% if org_user != organization.owner %}
|
|
396
|
+
<label><input type="checkbox" class="filled-in"
|
|
397
|
+
name="remove_user_meta_id_{{ org_user.bom_profile.id }}"><span/></label>{% endif %}
|
|
271
398
|
</td>
|
|
272
|
-
<td class="text-normal">{
|
|
399
|
+
<td class="text-normal">{% if org_user == organization.owner %}Owner{% else %}
|
|
400
|
+
{{ org_user.bom_profile.get_role_display }}{% endif %}</td>
|
|
273
401
|
<td class="text-normal">{{ org_user.username }}</td>
|
|
274
402
|
<td class="text-normal">{{ org_user.first_name }} {{ org_user.last_name }}</td>
|
|
275
403
|
<td class="text-normal"><a href="mailto:{{ user.email }}">{{ org_user.email }}</a>
|
|
276
404
|
</td>
|
|
277
|
-
<td>
|
|
278
|
-
<a
|
|
279
|
-
href="{% url 'bom:user-meta-edit' user_meta_id=org_user.bom_profile.id %}"><i
|
|
405
|
+
<td class="table-action right-align">
|
|
406
|
+
<a href="{% url 'bom:user-meta-edit' user_meta_id=org_user.bom_profile.id %}"><i
|
|
280
407
|
class="material-icons left">edit</i>Edit</a>
|
|
281
408
|
</td>
|
|
282
409
|
</tr>
|