django-bom 1.262__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.
Potentially problematic release.
This version of django-bom might be problematic. Click here for more details.
- bom/__init__.py +1 -0
- bom/admin.py +207 -0
- bom/apps.py +8 -0
- bom/auth_backends.py +47 -0
- bom/base_classes.py +31 -0
- bom/constants.py +217 -0
- bom/context_processors.py +9 -0
- bom/csv_headers.py +252 -0
- bom/decorators.py +32 -0
- bom/form_fields.py +59 -0
- bom/forms.py +1328 -0
- bom/helpers.py +367 -0
- bom/local_settings.py +35 -0
- bom/migrations/0001_initial.py +135 -0
- bom/migrations/0002_auto_20180908_2151.py +24 -0
- bom/migrations/0003_sellerpart_data_source.py +18 -0
- bom/migrations/0004_auto_20180911_0011.py +18 -0
- bom/migrations/0005_auto_20181007_1934.py +56 -0
- bom/migrations/0006_auto_20181007_1949.py +41 -0
- bom/migrations/0007_auto_20181009_0256.py +19 -0
- bom/migrations/0008_auto_20181030_0427.py +19 -0
- bom/migrations/0009_subpart_reference.py +18 -0
- bom/migrations/0010_auto_20181202_0733.py +23 -0
- bom/migrations/0011_auto_20181202_2113.py +22 -0
- bom/migrations/0012_partchangehistory.py +30 -0
- bom/migrations/0013_auto_20190222_1631.py +19 -0
- bom/migrations/0014_auto_20190223_2353.py +18 -0
- bom/migrations/0015_auto_20190303_1915.py +136 -0
- bom/migrations/0016_auto_20190405_2308.py +58 -0
- bom/migrations/0017_auto_20190616_1912.py +19 -0
- bom/migrations/0018_auto_20190616_2143.py +24 -0
- bom/migrations/0019_auto_20190624_1246.py +45 -0
- bom/migrations/0020_auto_20190627_0207.py +38 -0
- bom/migrations/0021_auto_20190627_0428.py +23 -0
- bom/migrations/0022_auto_20190811_2140.py +35 -0
- bom/migrations/0023_auto_20191205_2351.py +255 -0
- bom/migrations/0024_auto_20191214_1342.py +89 -0
- bom/migrations/0025_auto_20191221_1907.py +38 -0
- bom/migrations/0026_auto_20191222_2258.py +22 -0
- bom/migrations/0027_auto_20191222_2347.py +17 -0
- bom/migrations/0028_partrevision_displayable_synopsis.py +74 -0
- bom/migrations/0029_auto_20191231_1630.py +23 -0
- bom/migrations/0030_auto_20200101_2253.py +22 -0
- bom/migrations/0031_auto_20200104_1352.py +38 -0
- bom/migrations/0032_auto_20200126_1806.py +27 -0
- bom/migrations/0033_auto_20200203_0618.py +29 -0
- bom/migrations/0034_auto_20200222_0359.py +30 -0
- bom/migrations/0035_auto_20200303_0111.py +34 -0
- bom/migrations/0036_auto_20200303_0538.py +17 -0
- bom/migrations/0037_auto_20200405_1642.py +44 -0
- bom/migrations/0038_auto_20200422_0504.py +19 -0
- bom/migrations/0039_auto_20200929_2315.py +41 -0
- bom/migrations/0040_alter_organization_currency.py +19 -0
- bom/migrations/0041_organization_subscription_quantity.py +18 -0
- bom/migrations/0042_auto_20210720_2137.py +23 -0
- bom/migrations/0043_auto_20211123_0157.py +24 -0
- bom/migrations/0044_auto_20220831_1241.py +23 -0
- bom/migrations/0045_sellerpart_link.py +18 -0
- bom/migrations/0046_alter_sellerpart_unique_together.py +17 -0
- bom/migrations/0047_sellerpart_seller_part_number.py +18 -0
- bom/migrations/0048_rename_part_organization_number_class_bom_part_organiz_b333d6_idx_and_more.py +1017 -0
- bom/migrations/0049_alter_assembly_id_alter_assemblysubparts_id_and_more.py +99 -0
- bom/migrations/0050_alter_organization_options.py +17 -0
- bom/migrations/0051_alter_manufacturer_organization_and_more.py +41 -0
- bom/migrations/0052_remove_partrevision_attribute_and_more.py +584 -0
- bom/migrations/__init__.py +0 -0
- bom/models.py +886 -0
- bom/part_bom.py +192 -0
- bom/settings.py +262 -0
- bom/static/bom/css/dashboard.css +17 -0
- bom/static/bom/css/jquery.treetable.css +28 -0
- bom/static/bom/css/materialize.min.css +13 -0
- bom/static/bom/css/part-info.css +15 -0
- bom/static/bom/css/style.css +482 -0
- bom/static/bom/css/tablesorter-theme.materialize.css +176 -0
- bom/static/bom/css/treetable-theme.css +42 -0
- bom/static/bom/doc/sample_part_classes.csv +38 -0
- bom/static/bom/doc/test_bom.csv +6 -0
- bom/static/bom/doc/test_bom_5_intelligent.csv +4 -0
- bom/static/bom/doc/test_full_bom.csv +37 -0
- bom/static/bom/doc/test_new_parts.csv +5 -0
- bom/static/bom/doc/test_new_parts_5_intelligent.csv +5 -0
- bom/static/bom/img/_ionicons_svg_md-arrow-dropdown.svg +1 -0
- bom/static/bom/img/_ionicons_svg_md-arrow-dropright.svg +1 -0
- bom/static/bom/img/favicon.ico +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_dark_disabled_web.png +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_dark_focus_web.png +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_dark_normal_web.png +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_dark_pressed_web.png +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_light_disabled_web.png +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_light_focus_web.png +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_light_normal_web.png +0 -0
- bom/static/bom/img/google/web/1x/btn_google_signin_light_pressed_web.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_dark_disabled_web@2x.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_dark_focus_web@2x.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_dark_normal_web@2x.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_dark_pressed_web@2x.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_light_disabled_web@2x.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_light_focus_web@2x.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_light_normal_web@2x.png +0 -0
- bom/static/bom/img/google/web/2x/btn_google_signin_light_pressed_web@2x.png +0 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.eps +814 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.svg +24 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.eps +1866 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.svg +51 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.eps +1031 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.svg +50 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.eps +1031 -0
- bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.svg +50 -0
- bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.eps +814 -0
- bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.svg +24 -0
- bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.eps +1837 -0
- bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.svg +44 -0
- bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.eps +1002 -0
- bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.svg +43 -0
- bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.eps +1002 -0
- bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.svg +43 -0
- bom/static/bom/img/google_drive_logo.svg +1 -0
- bom/static/bom/img/indabom.png +0 -0
- bom/static/bom/img/mouser.png +0 -0
- bom/static/bom/img/octopart_blue.svg +19 -0
- bom/static/bom/js/formset-handler.js +65 -0
- bom/static/bom/js/jquery-3.4.1.min.js +2 -0
- bom/static/bom/js/jquery.ba-floatingscrollbar.min.js +10 -0
- bom/static/bom/js/jquery.treetable.js +629 -0
- bom/static/bom/js/materialize.min.js +6 -0
- bom/templates/bom/account-delete.html +23 -0
- bom/templates/bom/add-manufacturer-part.html +66 -0
- bom/templates/bom/add-sellerpart.html +93 -0
- bom/templates/bom/base-menu.html +16 -0
- bom/templates/bom/base.html +129 -0
- bom/templates/bom/bom-action-btn.html +23 -0
- bom/templates/bom/bom-action-table.html +57 -0
- bom/templates/bom/bom-base-menu.html +6 -0
- bom/templates/bom/bom-base.html +24 -0
- bom/templates/bom/bom-form-modal.html +36 -0
- bom/templates/bom/bom-form.html +30 -0
- bom/templates/bom/bom-modal-add-users.html +49 -0
- bom/templates/bom/bom-signup.html +12 -0
- bom/templates/bom/components/bom-flat.html +131 -0
- bom/templates/bom/components/bom-indented.html +237 -0
- bom/templates/bom/components/manufacturer-part-list.html +270 -0
- bom/templates/bom/components/seller-part-list.html +62 -0
- bom/templates/bom/create-part.html +65 -0
- bom/templates/bom/dashboard-menu.html +15 -0
- bom/templates/bom/dashboard.html +303 -0
- bom/templates/bom/edit-manufacturer-part.html +72 -0
- bom/templates/bom/edit-part-class.html +120 -0
- bom/templates/bom/edit-part.html +67 -0
- bom/templates/bom/edit-quantity-of-measure.html +119 -0
- bom/templates/bom/edit-user-meta.html +70 -0
- bom/templates/bom/help.html +1356 -0
- bom/templates/bom/manufacturer-info.html +82 -0
- bom/templates/bom/manufacturers.html +97 -0
- bom/templates/bom/nothing-to-see.html +15 -0
- bom/templates/bom/organization-create.html +135 -0
- bom/templates/bom/part-info.html +448 -0
- bom/templates/bom/part-revision-display.html +50 -0
- bom/templates/bom/part-revision-edit.html +39 -0
- bom/templates/bom/part-revision-manage-bom.html +115 -0
- bom/templates/bom/part-revision-new.html +57 -0
- bom/templates/bom/part-revision-release.html +41 -0
- bom/templates/bom/search-help.html +101 -0
- bom/templates/bom/seller-info.html +82 -0
- bom/templates/bom/sellers.html +97 -0
- bom/templates/bom/settings.html +734 -0
- bom/templates/bom/signup.html +28 -0
- bom/templates/bom/subscription_panel.html +16 -0
- bom/templates/bom/table_of_contents.html +47 -0
- bom/templates/bom/upload-bom.html +111 -0
- bom/templates/bom/upload-parts-help.html +103 -0
- bom/templates/bom/upload-parts.html +50 -0
- bom/templates/registration/login.html +39 -0
- bom/tests.py +1592 -0
- bom/third_party_apis/__init__.py +0 -0
- bom/third_party_apis/base_api.py +51 -0
- bom/third_party_apis/google_drive.py +166 -0
- bom/third_party_apis/mouser.py +132 -0
- bom/third_party_apis/test_apis.py +24 -0
- bom/urls.py +100 -0
- bom/utils.py +228 -0
- bom/validators.py +23 -0
- bom/views/__init__.py +0 -0
- bom/views/json_views.py +55 -0
- bom/views/views.py +1773 -0
- bom/wsgi.py +16 -0
- django_bom-1.262.dist-info/METADATA +206 -0
- django_bom-1.262.dist-info/RECORD +191 -0
- django_bom-1.262.dist-info/WHEEL +5 -0
- django_bom-1.262.dist-info/licenses/LICENSE +674 -0
- django_bom-1.262.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{% if profile.role == 'A' %}
|
|
2
|
+
<li>
|
|
3
|
+
<!-- Dropdown Trigger -->
|
|
4
|
+
<a class="dropdown-trigger" href='#' data-target='upload-lists-menu{{ upload_id }}'>Upload<i class="material-icons right">arrow_drop_down</i></a>
|
|
5
|
+
<ul id='upload-lists-menu{{ upload_id }}' class='dropdown-content'>
|
|
6
|
+
<li><a class="green-text text-lighten-1" href="{% url 'bom:upload-parts' %}">
|
|
7
|
+
<i class="material-icons green-text text-lighten-1">cloud_upload</i>Upload Parts CSV</a>
|
|
8
|
+
</li>
|
|
9
|
+
<li><a class="green-text text-lighten-1" href="{% url 'bom:upload-bom' %}">
|
|
10
|
+
<i class="material-icons green-text text-lighten-1">cloud_upload</i>Upload BOM CSV</a>
|
|
11
|
+
</li>
|
|
12
|
+
</ul>
|
|
13
|
+
<!-- End dropdown structure -->
|
|
14
|
+
</li>
|
|
15
|
+
{% endif %}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
{% extends 'bom/bom-base.html' %}
|
|
2
|
+
|
|
3
|
+
{% load static %}
|
|
4
|
+
{% load materializecss %}
|
|
5
|
+
|
|
6
|
+
{% block head-title %}{{ title }}{% if query %} Search Results{% endif %}{% endblock %}
|
|
7
|
+
|
|
8
|
+
{% block main %}
|
|
9
|
+
<link rel="stylesheet" type="text/css" href="{% static 'bom/css/dashboard.css' %}"/>
|
|
10
|
+
{% endblock %}
|
|
11
|
+
|
|
12
|
+
{% block bom-menu %}
|
|
13
|
+
{% include 'bom/dashboard-menu.html' %}
|
|
14
|
+
{% endblock %}
|
|
15
|
+
|
|
16
|
+
{% block bom-menu-mobile %}
|
|
17
|
+
{% include 'bom/dashboard-menu.html' with upload_id='-mobile' %}
|
|
18
|
+
{% endblock %}
|
|
19
|
+
|
|
20
|
+
{% block content %}
|
|
21
|
+
<div class="container-app">
|
|
22
|
+
<form id="searchForm" name="search-form" action="{% url 'bom:home' %}" method="get" enctype="multipart/form-data">
|
|
23
|
+
{# {% csrf_token %}#}
|
|
24
|
+
<div class="row">
|
|
25
|
+
{% if organization.number_scheme == 'S' %}
|
|
26
|
+
<div class="col s12 m4">
|
|
27
|
+
{{ part_class_selection_form|materializecss }}
|
|
28
|
+
</div>
|
|
29
|
+
{% endif %}
|
|
30
|
+
<div class="input-field col s12 {% if organization.number_scheme == 'S' %}m6{% else %}m10{% endif %}">
|
|
31
|
+
<i class="material-icons prefix">search</i>
|
|
32
|
+
<input type="search" id="autocomplete-input" autocomplete="off" class="text autocomplete" name="q" value="{% if query %}{{ query }}{% endif %}">
|
|
33
|
+
{% if part_class %}
|
|
34
|
+
<label for="autocomplete-input">Search for parts within selected part class:</label>
|
|
35
|
+
{% elif part_assembly %}
|
|
36
|
+
<label for="autocomplete-input">Search for parts within selected part assembly:</label>
|
|
37
|
+
{% else %}
|
|
38
|
+
<label for="autocomplete-input">Search for parts:</label>
|
|
39
|
+
{% endif %}
|
|
40
|
+
</div>
|
|
41
|
+
<div class="col s12 m2 text-center">
|
|
42
|
+
<button type="submit" class="waves-effect waves-green btn btn-primary input-field" name="action">
|
|
43
|
+
Submit
|
|
44
|
+
</button>
|
|
45
|
+
<a class="waves-effect waves-green btn-flat input-field btn-icon-round tooltipped" data-position="bottom" data-tooltip="Help with search" href="{% url 'bom:search-help' %}"><i
|
|
46
|
+
class="material-icons">help</i></a>
|
|
47
|
+
{% if part_class or query %}
|
|
48
|
+
<a class="waves-effect waves-green btn-flat input-field btn-icon-round" onclick="clearSearchExpression()"><i class="material-icons">clear</i></a>
|
|
49
|
+
{% endif %}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</form>
|
|
53
|
+
<form id="actionForm" name="action-form" action="{% url 'bom:home' %}" method="post" enctype="multipart/form-data">
|
|
54
|
+
{% csrf_token %}
|
|
55
|
+
<div class="row actions-row" style="margin-bottom: 0;">
|
|
56
|
+
<div class="col s6 no-padding">
|
|
57
|
+
{% if profile.role == 'A' %}
|
|
58
|
+
<div class="row action-checkbox-hide" style="margin: 0; padding: 0; display: none;">
|
|
59
|
+
<div class="col s10 m6">
|
|
60
|
+
<select name="part-action">
|
|
61
|
+
<option value="" disabled selected>Choose your action</option>
|
|
62
|
+
<option name="submit-part-delete">Delete</option>
|
|
63
|
+
</select>
|
|
64
|
+
<label>Action</label>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="col s12 m4" style="margin: 8px 0;">
|
|
67
|
+
<button class="waves-effect waves-light btn btn-primary" type="submit" name="actions">
|
|
68
|
+
Go
|
|
69
|
+
</button>
|
|
70
|
+
<span><a class="btn-flat waves-green" href="#" onclick="disableActionCheckboxColumn()">Hide</a></span>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<span><a class="btn-flat action-checkbox-show" href="#" onclick="enableActionCheckboxColumn()">Actions</a></span>
|
|
74
|
+
{% endif %}
|
|
75
|
+
</div>
|
|
76
|
+
<div class="col s6 right-align">
|
|
77
|
+
<a class="button waves-effect waves-green btn-flat btn-icon-round tooltipped" data-position="bottom" data-tooltip="Download results as CSV." href="{% url 'bom:home' %}?download=1"><i
|
|
78
|
+
class="material-icons">file_download</i></a>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div class="part-list push-footer">
|
|
83
|
+
<div class="responsive-table-wrapper">
|
|
84
|
+
<table class="highlight part-list tight single-line" style="margin-bottom: 14px;">
|
|
85
|
+
<thead>
|
|
86
|
+
<tr>
|
|
87
|
+
{% if profile.role == 'A' %}
|
|
88
|
+
<th class="text-normal td-small action-checkbox-column" style="display: none;"><label><input type="checkbox" id="action-select-all"><span></span></label></th>
|
|
89
|
+
{% endif %}
|
|
90
|
+
|
|
91
|
+
<th class="text-normal td-med">Part Number</th>
|
|
92
|
+
|
|
93
|
+
{% if organization.number_scheme == 'S' %}
|
|
94
|
+
<th class="text-normal td-small">Category</th>
|
|
95
|
+
{% endif %}
|
|
96
|
+
|
|
97
|
+
<th class="text-normal td-large">Synopsis</th>
|
|
98
|
+
|
|
99
|
+
<th class="text-normal td-small">Revision</th>
|
|
100
|
+
|
|
101
|
+
<th class="text-normal td-med">Manufacturer</th>
|
|
102
|
+
|
|
103
|
+
<th class="text-normal td-med">MPN</th>
|
|
104
|
+
|
|
105
|
+
<th class="text-normal td-med">Options</th>
|
|
106
|
+
</tr>
|
|
107
|
+
</thead>
|
|
108
|
+
<tbody>
|
|
109
|
+
{% for part_rev in part_revs %}
|
|
110
|
+
<tr>
|
|
111
|
+
{% if profile.role == 'A' %}
|
|
112
|
+
<td class="action-checkbox-column" style="display: none;"><label>{% if part_rev.part.id %}
|
|
113
|
+
<input type="checkbox" class="checkbox-array" name="actions" value="{{ part_rev.part.id }}">{% endif %}<span></span></label></td>
|
|
114
|
+
{% endif %}
|
|
115
|
+
|
|
116
|
+
<td class="text-normal td-med"><a href="{% url 'bom:part-info' part_id=part_rev.part.id %}">{{ part_rev.part.full_part_number }}</a></td>
|
|
117
|
+
|
|
118
|
+
{% if organization.number_scheme == 'S' %}
|
|
119
|
+
<td class="text-normal td-small">{{ part_rev.part.number_class.name }}</td>
|
|
120
|
+
{% endif %}
|
|
121
|
+
|
|
122
|
+
<td class="text-normal td-large">{{ part_rev.synopsis }}</td>
|
|
123
|
+
|
|
124
|
+
<td class="text-normal td-small">{{ part_rev.revision }}</td>
|
|
125
|
+
|
|
126
|
+
<td class="text-normal td-med">{{ part_rev.part.primary_manufacturer_part.manufacturer.name }}</td>
|
|
127
|
+
|
|
128
|
+
<td class="text-normal td-med">{{ part_rev.part.primary_manufacturer_part.manufacturer_part_number }}</td>
|
|
129
|
+
|
|
130
|
+
<td class="text-normal td-med">
|
|
131
|
+
<!-- Dropdown Trigger -->
|
|
132
|
+
<a class="dropdown-trigger" href='#' data-target='part-menu-{{ part_rev.id }}'><i class="material-icons green-text">more_horiz</i></a>
|
|
133
|
+
<!-- Dropdown Structure -->
|
|
134
|
+
<ul id='part-menu-{{ part_rev.id }}' class='dropdown-content'>
|
|
135
|
+
{% if part_rev.configuration == 'W' %}
|
|
136
|
+
<li>
|
|
137
|
+
<a class="green-text text-lighten-1"
|
|
138
|
+
href="{% url 'bom:part-revision-edit' part_id=part_rev.part.id part_revision_id=part_rev.id %}">
|
|
139
|
+
<i class="material-icons green-text text-lighten-1">edit</i>Edit Revision</a>
|
|
140
|
+
</li>
|
|
141
|
+
<li>
|
|
142
|
+
<a class="green-text text-lighten-1" href="{% url 'bom:part-manage-bom' part_id=part_rev.part.id part_revision_id=part_rev.id %}">
|
|
143
|
+
<i class="material-icons green-text text-lighten-1">format_list_numbered</i>Edit BOM</a>
|
|
144
|
+
</li>
|
|
145
|
+
{% endif %}
|
|
146
|
+
<li>
|
|
147
|
+
<a class="green-text text-lighten-1" href="{% url 'bom:part-info' part_id=part_rev.part.id %}?tab_anchor=used">
|
|
148
|
+
<i class="material-icons green-text text-lighten-1">my_location</i>Where Used</a>
|
|
149
|
+
</li>
|
|
150
|
+
<li>
|
|
151
|
+
<a class="green-text text-lighten-1" href="{% url 'bom:part-info' part_id=part_rev.part.id %}?tab_anchor=sourcing">
|
|
152
|
+
<i class="material-icons green-text text-lighten-1">local_airport</i>Sourcing</a>
|
|
153
|
+
</li>
|
|
154
|
+
<li class="divider" tabindex="-1"></li>
|
|
155
|
+
<li><a class="green-text text-lighten-1"
|
|
156
|
+
href="{% url 'bom:part-revision-export-bom' part_revision_id=part_rev.id %}"><i
|
|
157
|
+
class="material-icons green-text text-lighten-1">cloud_download</i>Download CSV (indented)</a>
|
|
158
|
+
</li>
|
|
159
|
+
<li><a class="green-text text-lighten-1"
|
|
160
|
+
href="{% url 'bom:part-revision-export-bom-flat' part_revision_id=part_rev.id %}"><i
|
|
161
|
+
class="material-icons green-text text-lighten-1">cloud_download</i>Download CSV (flat)</a>
|
|
162
|
+
</li>
|
|
163
|
+
</ul>
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
{% empty %}
|
|
167
|
+
<tr>
|
|
168
|
+
<td colspan="99" style="text-align: center; padding: 5%;"><i>No parts found. To add your first part, first create a Part Class on the <a
|
|
169
|
+
href="{% url 'bom:settings' tab_anchor='indabom' %}">settings</a> page, then click the red + button in the bottom right of your screen.</i></td>
|
|
170
|
+
</tr>
|
|
171
|
+
{% endfor %}
|
|
172
|
+
</tbody>
|
|
173
|
+
</table>
|
|
174
|
+
</div>
|
|
175
|
+
{% if part_revs.has_other_pages %}
|
|
176
|
+
<ul class="pagination center" style="padding-top: 24px;">
|
|
177
|
+
{% if part_revs.has_previous %}
|
|
178
|
+
<li><a href="?page={{ part_revs.previous_page_number }}{% if part_class %}&part_class={{ part_class }}{% endif %}{% if query %}&q={{ query }}{% endif %}"><i class="material-icons">chevron_left</i></a></li>
|
|
179
|
+
{% else %}
|
|
180
|
+
<li class="disabled"><i class="material-icons">chevron_left</i></li>
|
|
181
|
+
{% endif %}
|
|
182
|
+
{% for i in part_revs.paginator.page_range %}
|
|
183
|
+
{% if part_revs.number == i %}
|
|
184
|
+
<li class="active green lighten-2"><a>{{ i }}</a></li>
|
|
185
|
+
{% else %}
|
|
186
|
+
<li class="waves-effect waves-green"><a href="?page={{ i }}{% if part_class %}&part_class={{ part_class }}{% endif %}{% if query %}&q={{ query }}{% endif %}">{{ i }}</a></li>
|
|
187
|
+
{% endif %}
|
|
188
|
+
{% endfor %}
|
|
189
|
+
{% if part_revs.has_next %}
|
|
190
|
+
<li><a href="?page={{ part_revs.next_page_number }}{% if part_class %}&part_class={{ part_class }}{% endif %}{% if query %}&q={{ query }}{% endif %}"><i class="material-icons">chevron_right</i></a></li>
|
|
191
|
+
{% else %}
|
|
192
|
+
<li class="disabled"><i class="material-icons">chevron_right</i></li>
|
|
193
|
+
{% endif %}
|
|
194
|
+
</ul>
|
|
195
|
+
{% endif %}
|
|
196
|
+
</div>
|
|
197
|
+
</form>
|
|
198
|
+
</div>
|
|
199
|
+
{% include 'bom/bom-action-btn.html' with profile=profile %}
|
|
200
|
+
{% endblock %}
|
|
201
|
+
|
|
202
|
+
{% block bom-script %}
|
|
203
|
+
<!-- Autocomplete -->
|
|
204
|
+
<script>
|
|
205
|
+
var data = JSON.parse('{{ autocomplete|safe }}');
|
|
206
|
+
$(document).ready(function () {
|
|
207
|
+
$('input.autocomplete').autocomplete({
|
|
208
|
+
data: data,
|
|
209
|
+
{#limit: 10, // The max amount of results that can be shown at once. Default: Infinity.#}
|
|
210
|
+
onAutocomplete: function (val) {
|
|
211
|
+
var form = document.getElementById("searchForm");
|
|
212
|
+
var input = document.getElementById("autocomplete-input");
|
|
213
|
+
input.value = `"${val}"`;
|
|
214
|
+
form.submit();
|
|
215
|
+
},
|
|
216
|
+
minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
</script>
|
|
220
|
+
|
|
221
|
+
<!-- Floating Horizontal Scrollbar -->
|
|
222
|
+
<script type="text/javascript" src="{% static 'bom/js/jquery.ba-floatingscrollbar.min.js' %}"></script>
|
|
223
|
+
<script>
|
|
224
|
+
$(function () {
|
|
225
|
+
$('.responsive-table-wrapper').floatingScrollbar();
|
|
226
|
+
});
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<!-- Handle if there's an anchor, select tab -->
|
|
230
|
+
<script type='text/javascript'>
|
|
231
|
+
// For dropdown menu
|
|
232
|
+
$(document).ready(function () {
|
|
233
|
+
$('.dropdown-trigger').dropdown({
|
|
234
|
+
inDuration: 300,
|
|
235
|
+
outDuration: 225,
|
|
236
|
+
constrainWidth: false, // Does not change width of dropdown to that of the activator
|
|
237
|
+
alignment: 'left', // Displays dropdown with edge aligned to the left of button
|
|
238
|
+
stopPropagation: false, // Stops event propagation
|
|
239
|
+
coverTrigger: false
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
// For tooltips!
|
|
244
|
+
$('.tooltipped').tooltip();
|
|
245
|
+
});
|
|
246
|
+
</script>
|
|
247
|
+
|
|
248
|
+
<script type='text/javascript'>
|
|
249
|
+
function enableActionCheckboxColumn() {
|
|
250
|
+
$(".action-checkbox-column").show();
|
|
251
|
+
$(".action-checkbox-hide").show();
|
|
252
|
+
$(".action-checkbox-show").hide();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function disableActionCheckboxColumn() {
|
|
256
|
+
$(".action-checkbox-column").hide();
|
|
257
|
+
$(".action-checkbox-hide").hide();
|
|
258
|
+
$(".action-checkbox-show").show();
|
|
259
|
+
}
|
|
260
|
+
</script>
|
|
261
|
+
|
|
262
|
+
<script type='text/javascript'>
|
|
263
|
+
function clearSearchExpression() {
|
|
264
|
+
$("#autocomplete-input").val("");
|
|
265
|
+
$('#id_part_class').val('');
|
|
266
|
+
$('#searchForm').submit();
|
|
267
|
+
}
|
|
268
|
+
</script>
|
|
269
|
+
|
|
270
|
+
<script type='text/javascript'>
|
|
271
|
+
$(document).ready(function () {
|
|
272
|
+
$('#action-select-all').change(function () {
|
|
273
|
+
if ($("#action-select-all").is(":checked")) {
|
|
274
|
+
$("input[type='checkbox']:not(:checked)").prop("checked", true)
|
|
275
|
+
} else {
|
|
276
|
+
$("input[type='checkbox']:checked").prop("checked", false)
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
</script>
|
|
281
|
+
|
|
282
|
+
<script>
|
|
283
|
+
$(document).ready(function () {
|
|
284
|
+
let $checkbox = $('.checkbox-array');
|
|
285
|
+
let lastChecked = null;
|
|
286
|
+
|
|
287
|
+
$checkbox.click(function (e) {
|
|
288
|
+
if (!lastChecked) {
|
|
289
|
+
lastChecked = this;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (e.shiftKey) {
|
|
294
|
+
const start = $checkbox.index(this);
|
|
295
|
+
const end = $checkbox.index(lastChecked);
|
|
296
|
+
$checkbox.slice(Math.min(start, end), Math.max(start, end) + 1).prop('checked', lastChecked.checked);
|
|
297
|
+
}
|
|
298
|
+
lastChecked = this;
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
</script>
|
|
302
|
+
|
|
303
|
+
{% endblock bom-script %}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{% extends 'bom/bom-base.html' %}
|
|
2
|
+
|
|
3
|
+
{% load static %}
|
|
4
|
+
{% load materializecss %}
|
|
5
|
+
|
|
6
|
+
{% block head-title %}{{ title }}{% endblock %}
|
|
7
|
+
|
|
8
|
+
{% block bom-menu %}
|
|
9
|
+
<li><a href="{% url 'bom:part-info' part_id=part.id %}">Cancel</a></li>
|
|
10
|
+
{% endblock %}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
{% block content %}
|
|
14
|
+
<div class="container-app">
|
|
15
|
+
{% if profile.role == 'A' %}
|
|
16
|
+
<div class="row">
|
|
17
|
+
<form action="{% url 'bom:manufacturer-part-edit' manufacturer_part_id=manufacturer_part.id %}" method="post" class="col s12">
|
|
18
|
+
{% csrf_token %}
|
|
19
|
+
{{ manufacturer_form.non_field_errors }}
|
|
20
|
+
{{ manufacturer_part_form.non_field_errors }}
|
|
21
|
+
{{ manufacturer_form.errors }}
|
|
22
|
+
{{ manufacturer_part_form.errors }}
|
|
23
|
+
<div class="row">
|
|
24
|
+
<div class="col">
|
|
25
|
+
<p>Manufacturer <i>(skip if custom part)</i></p>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="row">
|
|
29
|
+
<div class="fieldWrapper col s6">
|
|
30
|
+
<label for="{{ manufacturer_part_form.manufacturer.id_for_label }}">Select existing Manufacturer</label>
|
|
31
|
+
{{ manufacturer_part_form.manufacturer.errors }}
|
|
32
|
+
{{ manufacturer_part_form.manufacturer }}
|
|
33
|
+
</div>
|
|
34
|
+
<div class="fieldWrapper col s6">
|
|
35
|
+
<label for="{{ manufacturer_form.name.id_for_label }}">-or- Create New Manufacturer</label>
|
|
36
|
+
{{ manufacturer_form.name.errors }}
|
|
37
|
+
{{ manufacturer_form.name }}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="row">
|
|
41
|
+
<div class="fieldWrapper col s6">
|
|
42
|
+
<label for="{{ manufacturer_part_form.manufacturer_part_number.id_for_label }}"><b>Manufacturer Part Number</b></label>
|
|
43
|
+
{{ manufacturer_part_form.manufacturer_part_number.errors }}
|
|
44
|
+
{{ manufacturer_part_form.manufacturer_part_number }}
|
|
45
|
+
</div>
|
|
46
|
+
<div class="fieldWrapper col s6">
|
|
47
|
+
<label for="{{ manufacturer_part_form.link.id_for_label }}"><b>Manufacturer Part Link</b></label>
|
|
48
|
+
{{ manufacturer_part_form.link.errors }}
|
|
49
|
+
{{ manufacturer_part_form.link }}
|
|
50
|
+
</div>
|
|
51
|
+
{% if part.number_class.mouser_enabled %}
|
|
52
|
+
{# <label for="{{ manufacturer_part_form.source_mouser.id_for_label }}"><b>Disable sourcing info from Mouser</b></label>#}
|
|
53
|
+
{{ manufacturer_part_form.mouser_disable.errors }}
|
|
54
|
+
{{ manufacturer_part_form.mouser_disable|materializecss:'col s6 input-field' }}
|
|
55
|
+
{% endif %}
|
|
56
|
+
</div>
|
|
57
|
+
<div class="row">
|
|
58
|
+
<div class="col s6">
|
|
59
|
+
<a href="javascript:history.back()" class="waves-effect waves-light btn-flat grey-text lighten-1" style="margin-left: -16px;">Cancel</a>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="col s6 right-align">
|
|
62
|
+
<button class="waves-effect waves-light btn btn-primary" type="submit" name="action">Save
|
|
63
|
+
</button>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</form>
|
|
67
|
+
</div>
|
|
68
|
+
{% else %}
|
|
69
|
+
{% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
|
|
70
|
+
{% endif %}
|
|
71
|
+
</div>
|
|
72
|
+
{% endblock %}
|
|
@@ -0,0 +1,120 @@
|
|
|
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="{% url 'bom:part-class-edit' part_class_id=part_class.id %}" method="post"
|
|
12
|
+
class="col s12">
|
|
13
|
+
{% csrf_token %}
|
|
14
|
+
|
|
15
|
+
<div class="row">
|
|
16
|
+
<div class="col s12 m3">
|
|
17
|
+
{{ part_class_form.code|materializecss }}
|
|
18
|
+
</div>
|
|
19
|
+
<div class="col s12 m9">
|
|
20
|
+
{{ part_class_form.name|materializecss }}
|
|
21
|
+
</div>
|
|
22
|
+
<div class="col s12">
|
|
23
|
+
{{ part_class_form.comment|materializecss }}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="row" style="margin-top: 40px; margin-bottom: 20px;">
|
|
28
|
+
<div class="col s12">
|
|
29
|
+
<h5>Property Definitions</h5>
|
|
30
|
+
<p class="grey-text text-darken-1">Define the custom fields available to parts in this
|
|
31
|
+
class.</p>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="property-definitions-wrapper">
|
|
36
|
+
{{ property_definitions_formset.management_form }}
|
|
37
|
+
|
|
38
|
+
<table class="highlight" style="border-bottom: 1px solid #e0e0e0;">
|
|
39
|
+
<thead>
|
|
40
|
+
<tr class="grey-text">
|
|
41
|
+
<th style="width: 90%;">Property Definition</th>
|
|
42
|
+
<th style="width: 10%;" class="center-align">Action</th>
|
|
43
|
+
</tr>
|
|
44
|
+
</thead>
|
|
45
|
+
<tbody id="property-definitions-body">
|
|
46
|
+
{% for form in property_definitions_formset %}
|
|
47
|
+
<tr class="property-definition-row">
|
|
48
|
+
{% for hidden in form.hidden_fields %}
|
|
49
|
+
{{ hidden }}
|
|
50
|
+
{% endfor %}
|
|
51
|
+
|
|
52
|
+
<td>{{ form.property_definition|materializecss }}</td>
|
|
53
|
+
<td class="center-align">
|
|
54
|
+
{% if forloop.counter0 < property_definitions_formset.initial_form_count %}
|
|
55
|
+
<div style="display:none;">{{ form.DELETE }}</div>
|
|
56
|
+
<a href="#!" class="btn-flat btn-small red-text delete-existing-row">
|
|
57
|
+
<i class="material-icons">delete</i>
|
|
58
|
+
</a>
|
|
59
|
+
{% else %}
|
|
60
|
+
<a href="#!" class="btn-flat btn-small red-text remove-new-row">
|
|
61
|
+
<i class="material-icons">close</i>
|
|
62
|
+
</a>
|
|
63
|
+
{% endif %}
|
|
64
|
+
</td>
|
|
65
|
+
</tr>
|
|
66
|
+
{% endfor %}
|
|
67
|
+
</tbody>
|
|
68
|
+
</table>
|
|
69
|
+
|
|
70
|
+
<div class="row" style="margin-top: 15px;">
|
|
71
|
+
<div class="col s12">
|
|
72
|
+
<button type="button" class="btn-flat waves-effect"
|
|
73
|
+
id="add-property-definition" style="padding-left: 0;">
|
|
74
|
+
<i class="material-icons left">add</i> Add Property
|
|
75
|
+
</button>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="row" style="margin-top: 50px;">
|
|
81
|
+
<div class="col s12 right-align">
|
|
82
|
+
<a href="{% url 'bom:settings' %}indabom"
|
|
83
|
+
class="btn btn-flat waves-effect"
|
|
84
|
+
style="margin-right: 10px;">Cancel</a>
|
|
85
|
+
<button class="waves-effect waves-light btn btn-primary" type="submit" name="action">
|
|
86
|
+
Save
|
|
87
|
+
</button>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</form>
|
|
91
|
+
</div>
|
|
92
|
+
{% else %}
|
|
93
|
+
{% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
|
|
94
|
+
{% endif %}
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<script type="text/template" id="empty-form-template">
|
|
98
|
+
<tr class="property-definition-row">
|
|
99
|
+
<td>{{ property_definitions_formset.empty_form.property_definition|materializecss }}</td>
|
|
100
|
+
<td class="center-align">
|
|
101
|
+
<a href="#!" class="btn-flat btn-small red-text remove-new-row">
|
|
102
|
+
<i class="material-icons">close</i>
|
|
103
|
+
</a>
|
|
104
|
+
</td>
|
|
105
|
+
</tr>
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<script src="{% static 'bom/js/formset-handler.js' %}"></script>
|
|
109
|
+
<script>
|
|
110
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
111
|
+
initFormset({
|
|
112
|
+
prefix: '{{ property_definitions_formset.prefix }}',
|
|
113
|
+
addBtnId: 'add-property-definition',
|
|
114
|
+
formContainerId: 'property-definitions-body',
|
|
115
|
+
emptyFormTemplateId: 'empty-form-template',
|
|
116
|
+
rowSelector: '.property-definition-row'
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
</script>
|
|
120
|
+
{% endblock %}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{% extends 'bom/bom-base.html' %}
|
|
2
|
+
|
|
3
|
+
{% load static %}
|
|
4
|
+
{% load materializecss %}
|
|
5
|
+
|
|
6
|
+
{% block head-title %}{{ title }}{% endblock %}
|
|
7
|
+
|
|
8
|
+
{% block bom-menu %}
|
|
9
|
+
<li><a href="{% url 'bom:part-info' part_id=part.id %}">Cancel</a></li>
|
|
10
|
+
{% endblock %}
|
|
11
|
+
|
|
12
|
+
{% block content %}
|
|
13
|
+
<div class="container-app">
|
|
14
|
+
{% if profile.role == 'A' %}
|
|
15
|
+
<div class="row">
|
|
16
|
+
<form action="{% url 'bom:part-edit' part_id=part.id %}" method="post" class="col s12">
|
|
17
|
+
<div class="row">
|
|
18
|
+
{% csrf_token %}
|
|
19
|
+
{{ part_form.non_field_errors }}
|
|
20
|
+
<div class="fieldWrapper">
|
|
21
|
+
{{ part_form.number_class|materializecss:'m4 s12' }}
|
|
22
|
+
</div>
|
|
23
|
+
<div class="fieldWrapper">
|
|
24
|
+
{{ part_form.number_item|materializecss:'m4 s12' }}
|
|
25
|
+
</div>
|
|
26
|
+
<div class="fieldWrapper">
|
|
27
|
+
{{ part_form.number_variation|materializecss:'m4 s12' }}
|
|
28
|
+
</div>
|
|
29
|
+
<div class="fieldWrapper">
|
|
30
|
+
{{ part_form.primary_manufacturer_part|materializecss:'m12 s12' }}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="row">
|
|
34
|
+
{% csrf_token %}
|
|
35
|
+
{{ part_revision_form.non_field_errors }}
|
|
36
|
+
<div class="fieldWrapper">
|
|
37
|
+
{{ part_revision_form.revision|materializecss:'m2 s12' }}
|
|
38
|
+
</div>
|
|
39
|
+
<div class="fieldWrapper">
|
|
40
|
+
{{ part_revision_form.description|materializecss:'m10 s12' }}
|
|
41
|
+
</div>
|
|
42
|
+
<div class="fieldWrapper">
|
|
43
|
+
{{ part_revision_form.attribute|materializecss:'m6 s12' }}
|
|
44
|
+
</div>
|
|
45
|
+
<div class="fieldWrapper">
|
|
46
|
+
{{ part_revision_form.value|materializecss:'m6 s12' }}
|
|
47
|
+
</div>
|
|
48
|
+
<div class="fieldWrapper">
|
|
49
|
+
{{ part_revision_form.package|materializecss:'m6 s12' }}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="row">
|
|
53
|
+
<div class="col s6">
|
|
54
|
+
<a href="javascript:history.back()" class="waves-effect waves-light btn-flat grey-text lighten-1" style="margin-left: -16px;">Cancel</a>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="col s6 right-align">
|
|
57
|
+
<button class="waves-effect waves-light btn btn-primary" type="submit" name="action">Save
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</form>
|
|
62
|
+
</div>
|
|
63
|
+
{% else %}
|
|
64
|
+
{% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
|
|
65
|
+
{% endif %}
|
|
66
|
+
</div>
|
|
67
|
+
{% endblock %}
|