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.

Files changed (191) hide show
  1. bom/__init__.py +1 -0
  2. bom/admin.py +207 -0
  3. bom/apps.py +8 -0
  4. bom/auth_backends.py +47 -0
  5. bom/base_classes.py +31 -0
  6. bom/constants.py +217 -0
  7. bom/context_processors.py +9 -0
  8. bom/csv_headers.py +252 -0
  9. bom/decorators.py +32 -0
  10. bom/form_fields.py +59 -0
  11. bom/forms.py +1328 -0
  12. bom/helpers.py +367 -0
  13. bom/local_settings.py +35 -0
  14. bom/migrations/0001_initial.py +135 -0
  15. bom/migrations/0002_auto_20180908_2151.py +24 -0
  16. bom/migrations/0003_sellerpart_data_source.py +18 -0
  17. bom/migrations/0004_auto_20180911_0011.py +18 -0
  18. bom/migrations/0005_auto_20181007_1934.py +56 -0
  19. bom/migrations/0006_auto_20181007_1949.py +41 -0
  20. bom/migrations/0007_auto_20181009_0256.py +19 -0
  21. bom/migrations/0008_auto_20181030_0427.py +19 -0
  22. bom/migrations/0009_subpart_reference.py +18 -0
  23. bom/migrations/0010_auto_20181202_0733.py +23 -0
  24. bom/migrations/0011_auto_20181202_2113.py +22 -0
  25. bom/migrations/0012_partchangehistory.py +30 -0
  26. bom/migrations/0013_auto_20190222_1631.py +19 -0
  27. bom/migrations/0014_auto_20190223_2353.py +18 -0
  28. bom/migrations/0015_auto_20190303_1915.py +136 -0
  29. bom/migrations/0016_auto_20190405_2308.py +58 -0
  30. bom/migrations/0017_auto_20190616_1912.py +19 -0
  31. bom/migrations/0018_auto_20190616_2143.py +24 -0
  32. bom/migrations/0019_auto_20190624_1246.py +45 -0
  33. bom/migrations/0020_auto_20190627_0207.py +38 -0
  34. bom/migrations/0021_auto_20190627_0428.py +23 -0
  35. bom/migrations/0022_auto_20190811_2140.py +35 -0
  36. bom/migrations/0023_auto_20191205_2351.py +255 -0
  37. bom/migrations/0024_auto_20191214_1342.py +89 -0
  38. bom/migrations/0025_auto_20191221_1907.py +38 -0
  39. bom/migrations/0026_auto_20191222_2258.py +22 -0
  40. bom/migrations/0027_auto_20191222_2347.py +17 -0
  41. bom/migrations/0028_partrevision_displayable_synopsis.py +74 -0
  42. bom/migrations/0029_auto_20191231_1630.py +23 -0
  43. bom/migrations/0030_auto_20200101_2253.py +22 -0
  44. bom/migrations/0031_auto_20200104_1352.py +38 -0
  45. bom/migrations/0032_auto_20200126_1806.py +27 -0
  46. bom/migrations/0033_auto_20200203_0618.py +29 -0
  47. bom/migrations/0034_auto_20200222_0359.py +30 -0
  48. bom/migrations/0035_auto_20200303_0111.py +34 -0
  49. bom/migrations/0036_auto_20200303_0538.py +17 -0
  50. bom/migrations/0037_auto_20200405_1642.py +44 -0
  51. bom/migrations/0038_auto_20200422_0504.py +19 -0
  52. bom/migrations/0039_auto_20200929_2315.py +41 -0
  53. bom/migrations/0040_alter_organization_currency.py +19 -0
  54. bom/migrations/0041_organization_subscription_quantity.py +18 -0
  55. bom/migrations/0042_auto_20210720_2137.py +23 -0
  56. bom/migrations/0043_auto_20211123_0157.py +24 -0
  57. bom/migrations/0044_auto_20220831_1241.py +23 -0
  58. bom/migrations/0045_sellerpart_link.py +18 -0
  59. bom/migrations/0046_alter_sellerpart_unique_together.py +17 -0
  60. bom/migrations/0047_sellerpart_seller_part_number.py +18 -0
  61. bom/migrations/0048_rename_part_organization_number_class_bom_part_organiz_b333d6_idx_and_more.py +1017 -0
  62. bom/migrations/0049_alter_assembly_id_alter_assemblysubparts_id_and_more.py +99 -0
  63. bom/migrations/0050_alter_organization_options.py +17 -0
  64. bom/migrations/0051_alter_manufacturer_organization_and_more.py +41 -0
  65. bom/migrations/0052_remove_partrevision_attribute_and_more.py +584 -0
  66. bom/migrations/__init__.py +0 -0
  67. bom/models.py +886 -0
  68. bom/part_bom.py +192 -0
  69. bom/settings.py +262 -0
  70. bom/static/bom/css/dashboard.css +17 -0
  71. bom/static/bom/css/jquery.treetable.css +28 -0
  72. bom/static/bom/css/materialize.min.css +13 -0
  73. bom/static/bom/css/part-info.css +15 -0
  74. bom/static/bom/css/style.css +482 -0
  75. bom/static/bom/css/tablesorter-theme.materialize.css +176 -0
  76. bom/static/bom/css/treetable-theme.css +42 -0
  77. bom/static/bom/doc/sample_part_classes.csv +38 -0
  78. bom/static/bom/doc/test_bom.csv +6 -0
  79. bom/static/bom/doc/test_bom_5_intelligent.csv +4 -0
  80. bom/static/bom/doc/test_full_bom.csv +37 -0
  81. bom/static/bom/doc/test_new_parts.csv +5 -0
  82. bom/static/bom/doc/test_new_parts_5_intelligent.csv +5 -0
  83. bom/static/bom/img/_ionicons_svg_md-arrow-dropdown.svg +1 -0
  84. bom/static/bom/img/_ionicons_svg_md-arrow-dropright.svg +1 -0
  85. bom/static/bom/img/favicon.ico +0 -0
  86. bom/static/bom/img/google/web/1x/btn_google_signin_dark_disabled_web.png +0 -0
  87. bom/static/bom/img/google/web/1x/btn_google_signin_dark_focus_web.png +0 -0
  88. bom/static/bom/img/google/web/1x/btn_google_signin_dark_normal_web.png +0 -0
  89. bom/static/bom/img/google/web/1x/btn_google_signin_dark_pressed_web.png +0 -0
  90. bom/static/bom/img/google/web/1x/btn_google_signin_light_disabled_web.png +0 -0
  91. bom/static/bom/img/google/web/1x/btn_google_signin_light_focus_web.png +0 -0
  92. bom/static/bom/img/google/web/1x/btn_google_signin_light_normal_web.png +0 -0
  93. bom/static/bom/img/google/web/1x/btn_google_signin_light_pressed_web.png +0 -0
  94. bom/static/bom/img/google/web/2x/btn_google_signin_dark_disabled_web@2x.png +0 -0
  95. bom/static/bom/img/google/web/2x/btn_google_signin_dark_focus_web@2x.png +0 -0
  96. bom/static/bom/img/google/web/2x/btn_google_signin_dark_normal_web@2x.png +0 -0
  97. bom/static/bom/img/google/web/2x/btn_google_signin_dark_pressed_web@2x.png +0 -0
  98. bom/static/bom/img/google/web/2x/btn_google_signin_light_disabled_web@2x.png +0 -0
  99. bom/static/bom/img/google/web/2x/btn_google_signin_light_focus_web@2x.png +0 -0
  100. bom/static/bom/img/google/web/2x/btn_google_signin_light_normal_web@2x.png +0 -0
  101. bom/static/bom/img/google/web/2x/btn_google_signin_light_pressed_web@2x.png +0 -0
  102. bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.eps +814 -0
  103. bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.svg +24 -0
  104. bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.eps +1866 -0
  105. bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.svg +51 -0
  106. bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.eps +1031 -0
  107. bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.svg +50 -0
  108. bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.eps +1031 -0
  109. bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.svg +50 -0
  110. bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.eps +814 -0
  111. bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.svg +24 -0
  112. bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.eps +1837 -0
  113. bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.svg +44 -0
  114. bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.eps +1002 -0
  115. bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.svg +43 -0
  116. bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.eps +1002 -0
  117. bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.svg +43 -0
  118. bom/static/bom/img/google_drive_logo.svg +1 -0
  119. bom/static/bom/img/indabom.png +0 -0
  120. bom/static/bom/img/mouser.png +0 -0
  121. bom/static/bom/img/octopart_blue.svg +19 -0
  122. bom/static/bom/js/formset-handler.js +65 -0
  123. bom/static/bom/js/jquery-3.4.1.min.js +2 -0
  124. bom/static/bom/js/jquery.ba-floatingscrollbar.min.js +10 -0
  125. bom/static/bom/js/jquery.treetable.js +629 -0
  126. bom/static/bom/js/materialize.min.js +6 -0
  127. bom/templates/bom/account-delete.html +23 -0
  128. bom/templates/bom/add-manufacturer-part.html +66 -0
  129. bom/templates/bom/add-sellerpart.html +93 -0
  130. bom/templates/bom/base-menu.html +16 -0
  131. bom/templates/bom/base.html +129 -0
  132. bom/templates/bom/bom-action-btn.html +23 -0
  133. bom/templates/bom/bom-action-table.html +57 -0
  134. bom/templates/bom/bom-base-menu.html +6 -0
  135. bom/templates/bom/bom-base.html +24 -0
  136. bom/templates/bom/bom-form-modal.html +36 -0
  137. bom/templates/bom/bom-form.html +30 -0
  138. bom/templates/bom/bom-modal-add-users.html +49 -0
  139. bom/templates/bom/bom-signup.html +12 -0
  140. bom/templates/bom/components/bom-flat.html +131 -0
  141. bom/templates/bom/components/bom-indented.html +237 -0
  142. bom/templates/bom/components/manufacturer-part-list.html +270 -0
  143. bom/templates/bom/components/seller-part-list.html +62 -0
  144. bom/templates/bom/create-part.html +65 -0
  145. bom/templates/bom/dashboard-menu.html +15 -0
  146. bom/templates/bom/dashboard.html +303 -0
  147. bom/templates/bom/edit-manufacturer-part.html +72 -0
  148. bom/templates/bom/edit-part-class.html +120 -0
  149. bom/templates/bom/edit-part.html +67 -0
  150. bom/templates/bom/edit-quantity-of-measure.html +119 -0
  151. bom/templates/bom/edit-user-meta.html +70 -0
  152. bom/templates/bom/help.html +1356 -0
  153. bom/templates/bom/manufacturer-info.html +82 -0
  154. bom/templates/bom/manufacturers.html +97 -0
  155. bom/templates/bom/nothing-to-see.html +15 -0
  156. bom/templates/bom/organization-create.html +135 -0
  157. bom/templates/bom/part-info.html +448 -0
  158. bom/templates/bom/part-revision-display.html +50 -0
  159. bom/templates/bom/part-revision-edit.html +39 -0
  160. bom/templates/bom/part-revision-manage-bom.html +115 -0
  161. bom/templates/bom/part-revision-new.html +57 -0
  162. bom/templates/bom/part-revision-release.html +41 -0
  163. bom/templates/bom/search-help.html +101 -0
  164. bom/templates/bom/seller-info.html +82 -0
  165. bom/templates/bom/sellers.html +97 -0
  166. bom/templates/bom/settings.html +734 -0
  167. bom/templates/bom/signup.html +28 -0
  168. bom/templates/bom/subscription_panel.html +16 -0
  169. bom/templates/bom/table_of_contents.html +47 -0
  170. bom/templates/bom/upload-bom.html +111 -0
  171. bom/templates/bom/upload-parts-help.html +103 -0
  172. bom/templates/bom/upload-parts.html +50 -0
  173. bom/templates/registration/login.html +39 -0
  174. bom/tests.py +1592 -0
  175. bom/third_party_apis/__init__.py +0 -0
  176. bom/third_party_apis/base_api.py +51 -0
  177. bom/third_party_apis/google_drive.py +166 -0
  178. bom/third_party_apis/mouser.py +132 -0
  179. bom/third_party_apis/test_apis.py +24 -0
  180. bom/urls.py +100 -0
  181. bom/utils.py +228 -0
  182. bom/validators.py +23 -0
  183. bom/views/__init__.py +0 -0
  184. bom/views/json_views.py +55 -0
  185. bom/views/views.py +1773 -0
  186. bom/wsgi.py +16 -0
  187. django_bom-1.262.dist-info/METADATA +206 -0
  188. django_bom-1.262.dist-info/RECORD +191 -0
  189. django_bom-1.262.dist-info/WHEEL +5 -0
  190. django_bom-1.262.dist-info/licenses/LICENSE +674 -0
  191. django_bom-1.262.dist-info/top_level.txt +1 -0
@@ -0,0 +1,57 @@
1
+ {% extends 'bom/bom-base.html' %}
2
+
3
+ {% load materializecss %}
4
+ {% load static %}
5
+
6
+ {% block head-title %}{{ title }}{% endblock %}
7
+
8
+ {% block bom-menu %}
9
+ <li><a href="javascript:history.back()">Cancel</a></li>
10
+ {% endblock %}
11
+
12
+ {% block content %}
13
+ <div class="container-app">
14
+ {% if profile.role == 'A' %}
15
+ {% if h1 %}<h2 class="light" style="margin-top: 0px;">{{ h1 }}</h2>{% endif %}
16
+ <form name="seller" action="{{ action }}" method="post" class="col s12">
17
+ <div class="row">
18
+ {% csrf_token %}
19
+
20
+ {% include 'bom/part-revision-display.html' with part_revision_form=part_revision_new_form %}
21
+
22
+ {{ part_revision_new_form.copy_assembly|materializecss:'m6 s12' }}
23
+
24
+ </div>
25
+ {% if used_part_revisions.count > 0 %}
26
+ <div class="row">
27
+ <div class="col s12">
28
+ <h5>This part is used by {{ used_part_revisions.count }} working parent assemblies. Select any parent assemblies you want to roll this revision into:</h5>
29
+ <div class="collection">
30
+ {% for upr in used_part_revisions %}
31
+ <div class="collection-item">
32
+ <label>
33
+ <input type="checkbox" name="roll" value="{{ upr.id }}"/>
34
+ <span>{{ upr.part.full_part_number }} Rev {{ upr.revision }} {{ upr.description }} <a
35
+ href="{% url 'bom:part-info-history' part_id=upr.part.id part_revision_id=upr.id %}" target="_blank">[view]</a></span>
36
+ </label>
37
+ </div>
38
+ {% endfor %}
39
+ </div>
40
+ </div>
41
+ </div>
42
+ {% endif %}
43
+ <div class="row">
44
+ <div class="col s6">
45
+ <a href="javascript:history.back()" class="waves-effect waves-light btn-flat grey-text lighten-1" style="margin-left: -16px;">Cancel</a>
46
+ </div>
47
+ <div class="col s6 right-align">
48
+ <button class="waves-effect waves-light btn btn-primary" type="submit" name="action">Save
49
+ </button>
50
+ </div>
51
+ </div>
52
+ </form>
53
+ {% else %}
54
+ {% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
55
+ {% endif %}
56
+ </div>
57
+ {% endblock %}
@@ -0,0 +1,41 @@
1
+ {% extends 'bom/bom-base.html' %}
2
+
3
+ {% load materializecss %}
4
+ {% load static %}
5
+
6
+ {% block head-title %}{{ title|safe }}{% endblock %}
7
+
8
+ {% block content %}
9
+ <div class="container-app">
10
+ {% if profile.role == 'A' %}
11
+ <form name="seller" action="{{ action }}" method="post" class="col s12">
12
+ {% csrf_token %}
13
+ <div class="row">
14
+ {% if subparts.count > 0 %}
15
+ <div class="col s12 m8 push-m2">
16
+ <h5><b>Warning!</b> This part has {{ subparts.count }} unreleased subparts. It is strongly recommended to release the below subparts before proceeding:</h5>
17
+ <div class="collection">
18
+ {% for s in subparts %}
19
+ <a href="{% url 'bom:part-info-history' part_id=s.part_revision.part.id part_revision_id=s.part_revision.id %}" target="_blank"
20
+ class="collection-item hoverable">{{ s.part_revision.part.full_part_number }} Rev {{ s.part_revision.revision }} {{ s.part_revision.description }}</a>
21
+ {% endfor %}
22
+ </div>
23
+ </div>
24
+ {% endif %}
25
+ </div>
26
+ <div class="row">
27
+ <div class="col s6 m4 push-m2">
28
+ <a href="javascript:history.back()"
29
+ class="waves-effect waves-light btn{% if not release_warning %}-flat{% endif %} {% if release_warning %}green{% else %}grey-text{% endif %} lighten-1">Cancel</a>
30
+ </div>
31
+ <div class="col s6 m4 push-m2 right-align">
32
+ <button class="waves-effect waves-light btn{% if release_warning %}-flat{% endif %} {% if not release_warning %}green{% else %}grey-text{% endif %} lighten-1" type="submit"
33
+ name="action">Release{% if release_warning %} Anyway{% endif %}</button>
34
+ </div>
35
+ </div>
36
+ </form>
37
+ {% else %}
38
+ {% include 'bom/nothing-to-see.html' with required_privilege='Admin' %}
39
+ {% endif %}
40
+ </div>
41
+ {% endblock %}
@@ -0,0 +1,101 @@
1
+ {% extends 'bom/bom-base.html' %}
2
+
3
+ {% load static %}
4
+ {% load materializecss %}
5
+
6
+ {% block head-title %}Help - Part Search{% endblock %}
7
+
8
+ {% block bom-menu %}
9
+ <li><a href="{% url 'bom:home' %}">Home</a></li>
10
+ {% endblock %}
11
+
12
+ {% block content %}
13
+ <div class="container" style="font-size: 16px;">
14
+ <h1 class="text-center">Help With Searching for Parts</h1>
15
+
16
+ <p>
17
+ You can use free-form searching to find parts based upon a part’s part number, synopsis,
18
+ primary manufacturer’s name or primary manufacturer’s part number (MPN). Terms that
19
+ represents these elements may be mixed and matched in your search expression.
20
+ </p>
21
+ <h2>Contents</h2>
22
+ <ul class="browser-default">
23
+ <li>Searching by Part Number</li>
24
+ <li>Searching Free-form</li>
25
+ <li>Part Class Filtering</li>
26
+ <li>Searching With Multiple Terms</li>
27
+ </ul>
28
+
29
+ <div class="divider"></div>
30
+ <h2>Searching by Part Number</h2>
31
+ <p>
32
+ If you enter a part number as a search term then to be recognized as a part number, it
33
+ must at least include the part class number and the item number. It may optionally include
34
+ the number item variation.
35
+ </p>
36
+
37
+ <p>
38
+ For example, both <b>102-00033-04</b> and <b>102-000033</b> are valid part number search terms. This
39
+ example assumes that your organization uses 5 digits for its item number.
40
+ </p>
41
+
42
+ <div class="divider"></div>
43
+ <h2>Searching Free-form</h2>
44
+ <p>
45
+ When entering a free-form search expression, the special characters that are used by IndaBOM
46
+ to display units of measure need to be represented as standard text characters in your search term:
47
+ </p>
48
+
49
+ <ul class="browser-default">
50
+ <li>&Omega; is represented as Ohms or ohms</li>
51
+ <li>&#181; is represented as U or u</li>
52
+ <li>&#8451; is represented as C or c</li>
53
+ <li>&#8457; is represented as F or f</li>
54
+ <li>&#8491; is represented A or a</li>
55
+ </ul>
56
+
57
+ <div class="divider"></div>
58
+ <h2>Part Class Filtering</h2>
59
+ <p>
60
+ You can narrow your search to a specific class of parts by first selecting a part class.
61
+ </p>
62
+
63
+ <p>
64
+ For example, to search for all capacitors whose capacitance is 10&#181;F, you would first select
65
+ the capacitor part class, then enter <b>10uF</b> as the search term.
66
+ </p>
67
+
68
+ <p>
69
+ Matches will be made against partial words as well, for example <b>yel</b> will match all parts that
70
+ contain the word “yellow” or “Yellow” or “yell” and so-on.
71
+ </p>
72
+
73
+ <div class="divider"></div>
74
+ <h2>Searching With Multiple Terms</h2>
75
+ <p>
76
+ If your search expression is composed of multiple terms, then each search term is OR’ed,
77
+ meaning that the search results will list all of the parts that match at least one of the
78
+ terms of your search expression.
79
+ </p>
80
+
81
+ <p>
82
+ For example, if your search term is <b>270Ohms 5% 0805</b> then your search will list all parts
83
+ that contain “270&Omega; ” or the “5%” or “0805”.
84
+ </p>
85
+
86
+ <p>
87
+ White space, comprised of any number of spaces or tabs, separates your search terms. If
88
+ you have a term that is composed of multiple words and you want these words to be treated as
89
+ a single term then they should be put in quotes, for example <b>“Big Company Inc.”</b> will be treated
90
+ as single term whereas <b>Big Company Inc.</b> will be treated as three separate terms.
91
+ </p>
92
+
93
+ <p>
94
+ Given how white space is interpreted, you should not have whitespace between a value and
95
+ the associated units of measure. In other words, want to search for parts that contain “10V”,
96
+ then your search term should be <b>10V</b> or <b>“10V”</b> as opposed to 10 V. If you
97
+ type <b>10 V</b> then the <b>10</b> and the <b>V</b> will be treated as separate search terms
98
+ and the search will match all parts that contain “10” and “V”, which is probably not what you want!
99
+ </p>
100
+ </div>
101
+ {% endblock %}
@@ -0,0 +1,82 @@
1
+ {% extends 'bom/bom-base.html' %}
2
+
3
+ {% load static %}
4
+ {% load djmoney %}
5
+
6
+ {% block head-title %}{{ part.full_part_number }}{% if part_revision %} {{ part_revision.synopsis }}{% endif %}{% endblock %}
7
+
8
+ {% block head %}
9
+ <link rel="stylesheet" type="text/css" href="{% static 'bom/css/part-info.css' %}"/>
10
+ {% endblock %}
11
+
12
+ {% block content %}
13
+ {% include 'bom/bom-action-btn.html' with profile=profile %}
14
+ <div class="container-app">
15
+ <div class="row" style="margin-bottom: 5px;">
16
+ <div class="col m8 hide-on-small-and-down">
17
+ <h3 class="light">Seller / {{ seller.name }}</h3>
18
+ <a href="{% url 'bom:sellers' %}">Back to sellers</a>
19
+ </div>
20
+ </div>
21
+ <div class="col {% if seller %}m3 s1{% else %}m3 s12{% endif %}">
22
+ {% if profile.role == 'A' and seller %}
23
+ <div style="margin-top: 1.5rem;">
24
+ <!-- Dropdown Trigger -->
25
+ <button class='dropdown-trigger hide-on-small-and-down waves-effect waves-light btn-flat'
26
+ href='#' data-target='dropdown-revision'><i class="material-icons right">arrow_drop_down</i>Manage
27
+ </button>
28
+ <a class='dropdown-trigger hide-on-med-and-up' href='#' data-target='dropdown-revision'><i
29
+ class="material-icons green-text text-lighten-1">more_vert</i></a>
30
+ <!-- Dropdown Structure -->
31
+ <ul id='dropdown-revision' class='dropdown-content'>
32
+ <li>
33
+ <a class="green-text text-lighten-1"
34
+ href="{% url 'bom:seller-edit' seller_id=seller.id %}">
35
+ <i class="material-icons green-text text-lighten-1">edit</i>Edit</a>
36
+ </li>
37
+ <li class="divider" tabindex="-1"></li>
38
+ <li>
39
+ <a class="red-text text-lighten-1" onclick="deleteSeller()">
40
+ <i class="material-icons red-text text-lighten-1">delete</i>Delete</a>
41
+ </li>
42
+ </ul>
43
+ </div>
44
+ {% endif %}
45
+ </div>
46
+
47
+ {% include 'bom/components/seller-part-list.html' with seller_parts=seller_parts profile=profile %}
48
+ </div>
49
+ {% endblock %}
50
+
51
+ {% block bom-script %}
52
+ <script>
53
+ function deleteSeller() {
54
+ {% if seller is not None %}
55
+ let url = "{% url 'bom:seller-delete' seller_id=seller.id %}";
56
+ if (confirm("Warning! Are you sure you want to delete this seller?\n\n{{ seller_parts.count }} of its seller parts will also be permanently deleted.")) {
57
+ window.location.href = url;
58
+ }
59
+ {% else %}
60
+ confirm("No seller to delete!");
61
+ {% endif %}
62
+ }
63
+ </script>
64
+
65
+ <!-- Handle if there's an anchor, select tab -->
66
+ <script type='text/javascript'>
67
+ // For dropdown menu
68
+ $(document).ready(function () {
69
+ $('.dropdown-trigger').dropdown({
70
+ inDuration: 300,
71
+ outDuration: 225,
72
+ constrainWidth: false, // Does not change width of dropdown to that of the activator
73
+ hover: false, // Activate on hover
74
+ gutter: 0, // Spacing from edge
75
+ alignment: 'left', // Displays dropdown with edge aligned to the left of button
76
+ stopPropagation: false, // Stops event propagation
77
+ coverTrigger: false
78
+ }
79
+ );
80
+ });
81
+ </script>
82
+ {% endblock %}
@@ -0,0 +1,97 @@
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 content %}
13
+ <div class="container-app">
14
+ <form id="searchForm" name="search-form" action="{% url 'bom:sellers' %}" method="get" enctype="multipart/form-data">
15
+ {% csrf_token %}
16
+ <div class="row">
17
+ <div class="input-field col s12 m10">
18
+ <i class="material-icons prefix">search</i>
19
+ <input type="search" id="autocomplete-input" autocomplete="off" class="text autocomplete" name="q" value="{% if query %}{{ query }}{% endif %}">
20
+ <label for="autocomplete-input">Search for sellers:</label>
21
+ </div>
22
+ <div class="col s12 m2 text-center">
23
+ <button type="submit" class="waves-effect waves-green btn btn-primary input-field" name="action">
24
+ Submit
25
+ </button>
26
+ {% if query %}
27
+ <a class="waves-effect waves-green btn-flat input-field btn-icon-round" onclick="clearSearchExpression()"><i class="material-icons">clear</i></a>
28
+ {% endif %}
29
+ </div>
30
+ </div>
31
+ </form>
32
+ <div class="part-list push-footer">
33
+ <div class="responsive-table-wrapper">
34
+ <table class="highlight part-list tight single-line" style="margin-bottom: 14px;">
35
+ <thead>
36
+ <tr>
37
+ {% if profile.role == 'A' %}
38
+ <th class="text-normal td-small action-checkbox-column" style="display: none;"><label><input type="checkbox" id="action-select-all"><span></span></label></th>
39
+ {% endif %}
40
+ <th class="text-normal td-med">Seller</th>
41
+ <th class="text-normal td-med">Seller Parts</th>
42
+ </tr>
43
+ </thead>
44
+ <tbody>
45
+ {% for seller in sellers %}
46
+ <tr>
47
+ {% if profile.role == 'A' %}
48
+ <td class="action-checkbox-column" style="display: none;"><label>{% if part_rev.part.id %}
49
+ <input type="checkbox" class="checkbox-array" name="actions" value="{{ part_rev.part.id }}">{% endif %}<span></span></label></td>
50
+ {% endif %}
51
+ <td class="text-normal td-med"><a href="{% url 'bom:seller-info' seller_id=seller.id %}">{{ seller.name|default:"<i>No name</i>" }}</a></td>
52
+ <td class="text-normal td-med">{{ seller.sellerpart_count }}</td>
53
+ </tr>
54
+ {% empty %}
55
+ <tr>
56
+ <td colspan="99" style="text-align: center; padding: 5%;"><i>No sellers found. To add your first seller, first create a part on the <a
57
+ href="{% url 'bom:home' %}">home</a> page, then go to the sourcing tab to create a seller and seller part.</i></td>
58
+ </tr>
59
+ {% endfor %}
60
+ </tbody>
61
+ </table>
62
+ </div>
63
+ {% if sellers.has_other_pages %}
64
+ <ul class="pagination center" style="padding-top: 24px;">
65
+ {% if sellers.has_previous %}
66
+ <li><a href="?page={{ sellers.previous_page_number }}{% if query %}&q={{ query }}{% endif %}"><i class="material-icons">chevron_left</i></a></li>
67
+ {% else %}
68
+ <li class="disabled"><i class="material-icons">chevron_left</i></li>
69
+ {% endif %}
70
+ {% for i in sellers.paginator.page_range %}
71
+ {% if sellers.number == i %}
72
+ <li class="active green lighten-2"><a>{{ i }}</a></li>
73
+ {% else %}
74
+ <li class="waves-effect waves-green"><a href="?page={{ i }}{% if query %}&q={{ query }}{% endif %}">{{ i }}</a></li>
75
+ {% endif %}
76
+ {% endfor %}
77
+ {% if sellers.has_next %}
78
+ <li><a href="?page={{ sellers.next_page_number }}{% if query %}&q={{ query }}{% endif %}"><i class="material-icons">chevron_right</i></a></li>
79
+ {% else %}
80
+ <li class="disabled"><i class="material-icons">chevron_right</i></li>
81
+ {% endif %}
82
+ </ul>
83
+ {% endif %}
84
+ </div>
85
+ </form>
86
+ </div>
87
+ {% endblock %}
88
+
89
+ {% block bom-script %}
90
+ <!-- Floating Horizontal Scrollbar -->
91
+ <script type="text/javascript" src="{% static 'bom/js/jquery.ba-floatingscrollbar.min.js' %}"></script>
92
+ <script>
93
+ $(function () {
94
+ $('.responsive-table-wrapper').floatingScrollbar();
95
+ });
96
+ </script>
97
+ {% endblock bom-script %}