From 93b693412747f3b2dd1b95a6767a6987cc86762a Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 20 May 2022 13:20:55 +0200 Subject: [PATCH] fix trailing --- .github/workflows/check_translations.yaml | 2 +- .github/workflows/qc_checks.yaml | 2 +- .gitpod.yml | 2 +- CONTRIBUTING.md | 5 +- .../static/css/bootstrap-treeview.css | 6 +- .../static/css/color-themes/dark-reader.css | 62 +- InvenTree/InvenTree/static/css/inventree.css | 10 +- .../fontawesome/webfonts/fa-brands-400.svg | 886 ++++---- .../fontawesome/webfonts/fa-regular-400.svg | 304 +-- .../fontawesome/webfonts/fa-solid-900.svg | 1992 ++++++++--------- .../fonts/glyphicons-halflings-regular.svg | 2 +- .../static/fullcalendar/locales-all.js | 2 +- .../InvenTree/static/fullcalendar/main.js | 6 +- .../script/bootstrap/bootstrap-treeview.js | 22 +- .../static/script/inventree/inventree.js | 12 +- InvenTree/InvenTree/static/treegrid/LICENSE | 2 +- .../treegrid/examples/example-basic.html | 10 +- .../examples/example-bootstrap-2.html | 10 +- .../examples/example-bootstrap-3.html | 14 +- .../examples/example-bootstrap-resize.html | 14 +- .../treegrid/examples/example-column.html | 8 +- .../treegrid/examples/example-events.html | 12 +- .../treegrid/examples/example-huge.html | 12 +- .../treegrid/examples/example-save-state.html | 10 +- .../InvenTree/static/treegrid/index.html | 42 +- .../InvenTree/static/treegrid/styles.css | 28 +- InvenTree/InvenTree/static/treegrid/test.html | 4 +- InvenTree/build/fixtures/build.yaml | 2 +- .../build/templates/build/build_base.html | 6 +- InvenTree/build/templates/build/detail.html | 8 +- InvenTree/build/templates/build/index.html | 12 +- .../migrations/0019_auto_20200413_0642.py | 18 +- .../migrations/0026_auto_20201110_1011.py | 8 +- .../migrations/0036_supplierpart_update_2.py | 14 +- .../company/templates/company/detail.html | 14 +- .../company/templates/company/index.html | 8 +- .../templates/company/manufacturer_part.html | 12 +- .../templates/company/supplier_part.html | 4 +- InvenTree/config_template.yaml | 6 +- .../migrations/0055_auto_20211025_0645.py | 2 +- .../order/purchase_order_detail.html | 6 +- .../templates/order/purchase_orders.html | 8 +- .../templates/order/sales_order_detail.html | 6 +- .../order/templates/order/sales_orders.html | 8 +- InvenTree/part/fixtures/part.yaml | 2 +- .../migrations/0034_auto_20200404_1238.py | 2 +- .../migrations/0056_auto_20201110_1125.py | 8 +- InvenTree/part/templates/part/bom.html | 2 +- InvenTree/part/templates/part/category.html | 10 +- InvenTree/part/templates/part/detail.html | 94 +- InvenTree/part/templates/part/part_base.html | 8 +- InvenTree/part/templates/part/prices.html | 33 +- InvenTree/stock/fixtures/stock.yaml | 13 +- .../migrations/0061_auto_20210511_0911.py | 20 +- InvenTree/stock/templates/stock/item.html | 12 +- .../stock/templates/stock/item_base.html | 10 +- InvenTree/stock/templates/stock/location.html | 18 +- .../templates/stock/location_delete.html | 4 +- InvenTree/templates/503.html | 2 +- InvenTree/templates/InvenTree/search.html | 2 +- .../templates/InvenTree/settings/part.html | 2 +- .../templates/InvenTree/settings/plugin.html | 6 +- .../InvenTree/settings/plugin_settings.html | 2 +- .../InvenTree/settings/settings.html | 2 +- .../InvenTree/settings/user_display.html | 4 +- .../InvenTree/settings/user_search.html | 4 +- InvenTree/templates/account/base.html | 4 +- InvenTree/templates/base.html | 8 +- InvenTree/templates/js/dynamic/nav.js | 10 +- InvenTree/templates/js/dynamic/settings.js | 6 +- InvenTree/templates/js/translated/api.js | 8 +- .../templates/js/translated/attachment.js | 8 +- InvenTree/templates/js/translated/barcode.js | 8 +- InvenTree/templates/js/translated/bom.js | 40 +- InvenTree/templates/js/translated/build.js | 54 +- InvenTree/templates/js/translated/company.js | 22 +- InvenTree/templates/js/translated/filters.js | 19 +- InvenTree/templates/js/translated/forms.js | 168 +- InvenTree/templates/js/translated/helpers.js | 19 +- InvenTree/templates/js/translated/label.js | 4 +- InvenTree/templates/js/translated/modals.js | 60 +- .../js/translated/model_renderers.js | 36 +- .../templates/js/translated/notification.js | 16 +- InvenTree/templates/js/translated/order.js | 126 +- InvenTree/templates/js/translated/part.js | 70 +- InvenTree/templates/js/translated/report.js | 2 +- InvenTree/templates/js/translated/search.js | 22 +- InvenTree/templates/js/translated/stock.js | 40 +- InvenTree/templates/js/translated/tables.js | 22 +- InvenTree/templates/navbar.html | 4 +- InvenTree/templates/page_base.html | 4 +- InvenTree/templates/search.html | 1 - .../socialaccount/snippets/provider_list.html | 6 +- InvenTree/templates/status_codes.html | 2 +- README.md | 8 +- docker/nginx.dev.conf | 2 +- docker/production/docker-compose.yml | 2 +- docker/production/nginx.prod.conf | 2 +- setup.cfg | 2 +- 99 files changed, 2341 insertions(+), 2347 deletions(-) diff --git a/.github/workflows/check_translations.yaml b/.github/workflows/check_translations.yaml index 3407dc7fd8..eb02ceff09 100644 --- a/.github/workflows/check_translations.yaml +++ b/.github/workflows/check_translations.yaml @@ -31,7 +31,7 @@ jobs: sudo apt-get install gettext pip3 install invoke invoke install - - name: Test Translations + - name: Test Translations run: invoke translate - name: Check Migration Files run: python3 ci/check_migration_files.py diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index b884796cec..2245a5242f 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -197,7 +197,7 @@ jobs: invoke migrate invoke import-records -f data.json invoke import-records -f data.json - - name: Test Translations + - name: Test Translations run: invoke translate - name: Check Migration Files run: python3 ci/check_migration_files.py diff --git a/.gitpod.yml b/.gitpod.yml index 33389c5960..1cc823a74f 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -29,7 +29,7 @@ tasks: git clone https://github.com/inventree/demo-dataset /workspace/InvenTree/inventree-data invoke delete-data -f invoke import-records -f /workspace/InvenTree/inventree-data/inventree_data.json - + inv server # List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e6a58dba54..f1bdc6ad85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Please read the contribution guidelines below, before submitting your first pull ## Setup -Please run `invoke setup_dev` in the root directory of your InvenTree code base to set up your development setup before starting to contribute. This will install and set up pre-commit to run some checks before each commit and help reduce the style errors. +Please run `invoke setup_dev` in the root directory of your InvenTree code base to set up your development setup before starting to contribute. This will install and set up pre-commit to run some checks before each commit and help reduce the style errors. ## Branches and Versioning @@ -94,7 +94,7 @@ The various github actions can be found in the `./github/workflows` directory ## Code Style -Sumbitted Python code is automatically checked against PEP style guidelines. Locally you can run `invoke style` to ensure the style checks will pass, before submitting the PR. +Sumbitted Python code is automatically checked against PEP style guidelines. Locally you can run `invoke style` to ensure the style checks will pass, before submitting the PR. Please write docstrings for each function and class - we follow the [google doc-style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) for python. Docstrings for general javascript code is encouraged! Docstyles are checked by `invoke style`. ## Documentation @@ -166,4 +166,3 @@ The tags describe issues and PRs in multiple areas: | | docker | Docker / docker-compose | | | CI | CI / unit testing ecosystem | | | setup | Relates to the InvenTree setup / installation process | - diff --git a/InvenTree/InvenTree/static/css/bootstrap-treeview.css b/InvenTree/InvenTree/static/css/bootstrap-treeview.css index 23c6cf0668..1023438a24 100644 --- a/InvenTree/InvenTree/static/css/bootstrap-treeview.css +++ b/InvenTree/InvenTree/static/css/bootstrap-treeview.css @@ -1,9 +1,9 @@ /* ========================================================= * bootstrap-treeview.css v1.2.0 * ========================================================= - * Copyright 2013 Jonathan Miles + * Copyright 2013 Jonathan Miles * Project URL : http://www.jondmiles.com/bootstrap-treeview - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -34,4 +34,4 @@ .treeview .node-disabled { color: silver; cursor: not-allowed; -} \ No newline at end of file +} diff --git a/InvenTree/InvenTree/static/css/color-themes/dark-reader.css b/InvenTree/InvenTree/static/css/color-themes/dark-reader.css index 5270d5ead5..9a383d4fde 100644 --- a/InvenTree/InvenTree/static/css/color-themes/dark-reader.css +++ b/InvenTree/InvenTree/static/css/color-themes/dark-reader.css @@ -104,7 +104,7 @@ select:-webkit-autofill { fill: rgb(232, 230, 227); } .fad.fa-inverse { - color: rgb(232, 230, 227); + color: rgb(232, 230, 227); } :root { --bs-blue: #0d6efd; --bs-indigo: #6610f2; --bs-purple: #6f42c1; --bs-pink: #d63384; --bs-red: #dc3545; --bs-orange: #fd7e14; --bs-yellow: #ffc107; --bs-green: #198754; --bs-teal: #20c997; --bs-cyan: #0dcaf0; --bs-white: #fff; --bs-gray: #6c757d; --bs-gray-dark: #343a40; --bs-gray-100: #f8f9fa; --bs-gray-200: #e9ecef; --bs-gray-300: #dee2e6; --bs-gray-400: #ced4da; --bs-gray-500: #adb5bd; --bs-gray-600: #6c757d; --bs-gray-700: #495057; --bs-gray-800: #343a40; --bs-gray-900: #212529; --bs-primary: #0d6efd; --bs-secondary: #6c757d; --bs-success: #198754; --bs-info: #0dcaf0; --bs-warning: #ffc107; --bs-danger: #dc3545; --bs-light: #f8f9fa; --bs-dark: #212529; --darkreader-bg--bs-primary-rgb: 13,110,253; --darkreader-text--bs-primary-rgb: 13,110,253; --darkreader-bg--bs-secondary-rgb: 108,117,125; --darkreader-text--bs-secondary-rgb: 108,117,125; --darkreader-bg--bs-success-rgb: 25,135,84; --darkreader-text--bs-success-rgb: 25,135,84; --darkreader-bg--bs-info-rgb: 13,202,240; --darkreader-text--bs-info-rgb: 13,202,240; --darkreader-bg--bs-warning-rgb: 255,193,7; --darkreader-text--bs-warning-rgb: 255,193,7; --darkreader-bg--bs-danger-rgb: 220,53,69; --darkreader-text--bs-danger-rgb: 220,53,69; --darkreader-bg--bs-light-rgb: 248,249,250; --darkreader-text--bs-light-rgb: 248,249,250; --darkreader-bg--bs-dark-rgb: 33,37,41; --darkreader-text--bs-dark-rgb: 33,37,41; --darkreader-bg--bs-white-rgb: 255,255,255; --darkreader-text--bs-white-rgb: 255,255,255; --darkreader-bg--bs-black-rgb: 0,0,0; --darkreader-text--bs-black-rgb: 0,0,0; --darkreader-text--bs-body-color-rgb: 33,37,41; --darkreader-bg--bs-body-bg-rgb: 255,255,255; --bs-font-sans-serif: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; --bs-font-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New", @@ -701,13 +701,13 @@ iframe { } .form-check-input:checked { background-color: rgb(2, 80, 196); - border-color: rgb(1, 71, 174); + border-color: rgb(1, 71, 174); } .form-check-input:checked[type="checkbox"] { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"); + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"); } .form-check-input:checked[type="radio"] { - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e"); + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e"); } .form-check-input[type="checkbox"]:indeterminate { background-color: rgb(2, 80, 196); @@ -2211,26 +2211,26 @@ iframe { } @media (max-width: 1399.98px) { .modal-fullscreen-xxl-down .modal-content { - border-color: initial; + border-color: initial; } } .tooltip { - text-decoration-color: initial; text-shadow: none; + text-decoration-color: initial; text-shadow: none; } .tooltip .tooltip-arrow::before { - border-color: transparent; + border-color: transparent; } .bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before, .bs-tooltip-top .tooltip-arrow::before { - border-top-color: rgb(140, 130, 115); + border-top-color: rgb(140, 130, 115); } .bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before, .bs-tooltip-end .tooltip-arrow::before { - border-right-color: rgb(140, 130, 115); + border-right-color: rgb(140, 130, 115); } .bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before, .bs-tooltip-bottom .tooltip-arrow::before { - border-bottom-color: rgb(140, 130, 115); + border-bottom-color: rgb(140, 130, 115); } .bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before, .bs-tooltip-start .tooltip-arrow::before { @@ -2244,42 +2244,42 @@ iframe { text-decoration-color: initial; text-shadow: none; background-color: rgb(24, 26, 27); - border-color: rgba(140, 130, 115, 0.2); + border-color: rgba(140, 130, 115, 0.2); } .popover .popover-arrow::after, .popover .popover-arrow::before { - border-color: transparent; + border-color: transparent; } .bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::before, .bs-popover-top > .popover-arrow::before { - border-top-color: rgba(140, 130, 115, 0.25); + border-top-color: rgba(140, 130, 115, 0.25); } .bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::after, .bs-popover-top > .popover-arrow::after { - border-top-color: rgb(48, 52, 54); + border-top-color: rgb(48, 52, 54); } .bs-popover-auto[data-popper-placement^="right"] > .popover-arrow::before, .bs-popover-end > .popover-arrow::before { - border-right-color: rgba(140, 130, 115, 0.25); + border-right-color: rgba(140, 130, 115, 0.25); } .bs-popover-auto[data-popper-placement^="right"] > .popover-arrow::after, .bs-popover-end > .popover-arrow::after { - border-right-color: rgb(48, 52, 54); + border-right-color: rgb(48, 52, 54); } .bs-popover-auto[data-popper-placement^="bottom"] > .popover-arrow::before, .bs-popover-bottom > .popover-arrow::before { - border-bottom-color: rgba(140, 130, 115, 0.25); + border-bottom-color: rgba(140, 130, 115, 0.25); } .bs-popover-auto[data-popper-placement^="bottom"] > .popover-arrow::after, .bs-popover-bottom > .popover-arrow::after { - border-bottom-color: rgb(48, 52, 54); + border-bottom-color: rgb(48, 52, 54); } .bs-popover-auto[data-popper-placement^="bottom"] .popover-header::before, .bs-popover-bottom .popover-header::before { - border-bottom-color: rgb(52, 57, 59); + border-bottom-color: rgb(52, 57, 59); } .bs-popover-auto[data-popper-placement^="left"] > .popover-arrow::before, .bs-popover-start > .popover-arrow::before { - border-left-color: rgba(140, 130, 115, 0.25); + border-left-color: rgba(140, 130, 115, 0.25); } .bs-popover-auto[data-popper-placement^="left"] > .popover-arrow::after, .bs-popover-start > .popover-arrow::after { @@ -2786,13 +2786,13 @@ iframe { background-color: rgb(34, 36, 38); } .select2-container--default .select2-search--dropdown .select2-search__field { - border-color: rgb(72, 78, 81); + border-color: rgb(72, 78, 81); } .select2-container--default .select2-search--inline .select2-search__field { - background-image: initial; background-color: transparent; border-color: initial; outline-color: initial; box-shadow: none; + background-image: initial; background-color: transparent; border-color: initial; outline-color: initial; box-shadow: none; } .select2-container--default .select2-results__option[aria-disabled="true"] { - color: rgb(168, 160, 149); + color: rgb(168, 160, 149); } .select2-container--default .select2-results__option[aria-selected="true"] { background-color: rgb(43, 47, 49); @@ -2827,7 +2827,7 @@ iframe { rgb(53, 57, 59) 100%); } .select2-container--classic .select2-selection--single .select2-selection__arrow b { - border-color: rgb(82, 88, 92) transparent transparent; + border-color: rgb(82, 88, 92) transparent transparent; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { border-top-color: initial; @@ -2895,13 +2895,13 @@ iframe { box-shadow: none; } .select2-container--classic .select2-dropdown { - background-color: rgb(24, 26, 27); border-color: transparent; + background-color: rgb(24, 26, 27); border-color: transparent; } .select2-container--classic .select2-dropdown--above { - border-bottom-color: initial; + border-bottom-color: initial; } .select2-container--classic .select2-dropdown--below { - border-top-color: initial; + border-top-color: initial; } .select2-container--classic .select2-results__option[aria-disabled="true"] { color: rgb(152, 143, 129); @@ -2962,14 +2962,14 @@ iframe { } .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted { color: rgb(232, 230, 227); - background-color: rgb(27, 30, 31); + background-color: rgb(27, 30, 31); } .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected, .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-selected="true"] { color: rgb(232, 230, 227); - background-color: rgb(2, 80, 196); + background-color: rgb(2, 80, 196); } .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--disabled, .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-disabled="true"] { - color: rgb(158, 150, 137); + color: rgb(158, 150, 137); } .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[role="group"] .select2-results__group { color: rgb(158, 150, 137); @@ -3685,7 +3685,7 @@ a.ui-button:active, border-color: rgb(62, 68, 70); } .form-field-error { - color: rgb(194, 102, 100); + color: rgb(194, 102, 100); } input[type="submit"] { color: rgb(200, 195, 188); diff --git a/InvenTree/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css index 4abba23b09..ca3f8a2955 100644 --- a/InvenTree/InvenTree/static/css/inventree.css +++ b/InvenTree/InvenTree/static/css/inventree.css @@ -19,7 +19,7 @@ main { } .login-screen { - background: url(/static/img/paper_splash.jpg) no-repeat center fixed; + background: url(/static/img/paper_splash.jpg) no-repeat center fixed; background-size: cover; height: 100vh; font-family: 'Numans', sans-serif; @@ -259,7 +259,7 @@ main { } .rowinvalid { - color: #A00; + color: #A00; } .rowinherited { @@ -306,7 +306,7 @@ main { padding-left: 2px; transform: translate(0%, -25%); } - + .filter-list .close:hover { background: #bbb; } @@ -1008,7 +1008,7 @@ input[type='number']{ .product-card-panel{ height: 100%; - margin-bottom: 5px; + margin-bottom: 5px; } .borderless { @@ -1047,4 +1047,4 @@ a { padding: 3px; margin-top: 3px; overflow: hidden; -} \ No newline at end of file +} diff --git a/InvenTree/InvenTree/static/fontawesome/webfonts/fa-brands-400.svg b/InvenTree/InvenTree/static/fontawesome/webfonts/fa-brands-400.svg index 46ad237a61..304135c663 100644 --- a/InvenTree/InvenTree/static/fontawesome/webfonts/fa-brands-400.svg +++ b/InvenTree/InvenTree/static/fontawesome/webfonts/fa-brands-400.svg @@ -12,7 +12,7 @@ Copyright (c) Font Awesome - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/InvenTree/InvenTree/static/fullcalendar/locales-all.js b/InvenTree/InvenTree/static/fullcalendar/locales-all.js index 81eaf9e99e..ee756eca09 100644 --- a/InvenTree/InvenTree/static/fullcalendar/locales-all.js +++ b/InvenTree/InvenTree/static/fullcalendar/locales-all.js @@ -1507,7 +1507,7 @@ /* eslint max-len: off */ var localesAll = [ - l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36, l37, l38, l39, l40, l41, l42, l43, l44, l45, l46, l47, l48, l49, l50, l51, l52, l53, l54, l55, l56, l57, l58, l59, l60, l61, l62, l63, l64, l65, l66, l67, l68, l69, l70, l71, + l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36, l37, l38, l39, l40, l41, l42, l43, l44, l45, l46, l47, l48, l49, l50, l51, l52, l53, l54, l55, l56, l57, l58, l59, l60, l61, l62, l63, l64, l65, l66, l67, l68, l69, l70, l71, ]; return localesAll; diff --git a/InvenTree/InvenTree/static/fullcalendar/main.js b/InvenTree/InvenTree/static/fullcalendar/main.js index f173a6e89d..27ec8f07b9 100644 --- a/InvenTree/InvenTree/static/fullcalendar/main.js +++ b/InvenTree/InvenTree/static/fullcalendar/main.js @@ -6736,7 +6736,7 @@ var FullCalendar = (function (exports) { var endMarker = framingRange.end; var instanceStarts = []; while (dayMarker < endMarker) { - var instanceStart + var instanceStart // if everyday, or this particular day-of-week = void 0; // if everyday, or this particular day-of-week @@ -11900,7 +11900,7 @@ var FullCalendar = (function (exports) { /* known bug: events that are force to be list-item but span multiple days still take up space in later columns */ - nodes.push(createElement("div", { className: 'fc-daygrid-event-harness' + (isAbsolute ? ' fc-daygrid-event-harness-abs' : ''), key: instanceId, + nodes.push(createElement("div", { className: 'fc-daygrid-event-harness' + (isAbsolute ? ' fc-daygrid-event-harness-abs' : ''), key: instanceId, // in print mode when in mult cols, could collide ref: isMirror ? null : this.segHarnessRefs.createRef(instanceId + ':' + seg.firstCol), style: { visibility: isInvisible ? 'hidden' : '', @@ -13209,7 +13209,7 @@ var FullCalendar = (function (exports) { if (!slatCoords) { return null; } - return segs.map(function (seg, i) { return (createElement(NowIndicatorRoot, { isAxis: false, date: date, + return segs.map(function (seg, i) { return (createElement(NowIndicatorRoot, { isAxis: false, date: date, // key doesn't matter. will only ever be one key: i }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement("div", { ref: rootElRef, className: ['fc-timegrid-now-indicator-line'].concat(classNames).join(' '), style: { top: slatCoords.computeDateTop(seg.start, date) } }, innerContent)); })); }); }; diff --git a/InvenTree/InvenTree/static/script/bootstrap/bootstrap-treeview.js b/InvenTree/InvenTree/static/script/bootstrap/bootstrap-treeview.js index 7a82a2eeb5..1febf52b74 100644 --- a/InvenTree/InvenTree/static/script/bootstrap/bootstrap-treeview.js +++ b/InvenTree/InvenTree/static/script/bootstrap/bootstrap-treeview.js @@ -321,7 +321,7 @@ var target = $(event.target); var node = this.findNode(target); if (!node || node.state.disabled) return; - + var classList = target.attr('class') ? target.attr('class').split(' ') : []; if ((classList.indexOf('expand-icon') !== -1)) { @@ -329,12 +329,12 @@ this.render(); } else if ((classList.indexOf('check-icon') !== -1)) { - + this.toggleCheckedState(node, _default.options); this.render(); } else { - + if (node.selectable) { this.toggleSelectedState(node, _default.options); } else { @@ -516,7 +516,7 @@ .addClass(node.state.checked ? 'node-checked' : '') .addClass(node.state.disabled ? 'node-disabled': '') .addClass(node.state.selected ? 'node-selected' : '') - .addClass(node.searchResult ? 'search-result' : '') + .addClass(node.searchResult ? 'search-result' : '') .attr('data-nodeid', node.nodeId) .attr('style', _this.buildStyleOverride(node)); @@ -548,13 +548,13 @@ // Add node icon if (_this.options.showIcon) { - + var classList = ['node-icon']; classList.push(node.icon || _this.options.nodeIcon); if (node.state.selected) { classList.pop(); - classList.push(node.selectedIcon || _this.options.selectedIcon || + classList.push(node.selectedIcon || _this.options.selectedIcon || node.icon || _this.options.nodeIcon); } @@ -569,7 +569,7 @@ var classList = ['check-icon']; if (node.state.checked) { - classList.push(_this.options.checkedIcon); + classList.push(_this.options.checkedIcon); } else { classList.push(_this.options.uncheckedIcon); @@ -935,7 +935,7 @@ this.forEachIdentifier(identifiers, options, $.proxy(function (node, options) { this.toggleExpandedState(node, options); }, this)); - + this.render(); }; @@ -1085,7 +1085,7 @@ $.each(identifiers, $.proxy(function (index, identifier) { callback(this.identifyNode(identifier), options); - }, this)); + }, this)); }; /* @@ -1156,9 +1156,9 @@ }); if (options.render) { - this.render(); + this.render(); } - + this.$element.trigger('searchCleared', $.extend(true, {}, results)); }; diff --git a/InvenTree/InvenTree/static/script/inventree/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js index efad99c3ec..7999e4a7be 100644 --- a/InvenTree/InvenTree/static/script/inventree/inventree.js +++ b/InvenTree/InvenTree/static/script/inventree/inventree.js @@ -47,7 +47,7 @@ function attachClipboard(selector, containerselector, textElement) { /** - * Return a standard list of export format options * + * Return a standard list of export format options * */ function exportFormatOptions() { return [ @@ -167,7 +167,7 @@ function inventreeDocReady() { function isFileTransfer(transfer) { - /* Determine if a transfer (e.g. drag-and-drop) is a file transfer + /* Determine if a transfer (e.g. drag-and-drop) is a file transfer */ return transfer.files.length > 0; @@ -176,7 +176,7 @@ function isFileTransfer(transfer) { function enableDragAndDrop(element, url, options) { /* Enable drag-and-drop file uploading for a given element. - + Params: element - HTML element lookup string e.g. "#drop-div" url - URL to POST the file to @@ -205,7 +205,7 @@ function enableDragAndDrop(element, url, options) { if (isFileTransfer(transfer)) { formData.append(label, transfer.files[0]); - + inventreeFormDataUpload( url, formData, @@ -234,7 +234,7 @@ function enableDragAndDrop(element, url, options) { /** * Save a key:value pair to local storage - * @param {String} name - settting key + * @param {String} name - settting key * @param {String} value - setting value */ function inventreeSave(name, value) { @@ -248,7 +248,7 @@ function inventreeSave(name, value) { * Retrieve a key:value pair from local storage * @param {*} name - setting key * @param {*} defaultValue - default value (returned if no matching key:value pair is found) - * @returns + * @returns */ function inventreeLoad(name, defaultValue) { diff --git a/InvenTree/InvenTree/static/treegrid/LICENSE b/InvenTree/InvenTree/static/treegrid/LICENSE index 41cb9c4b70..6308e939b7 100644 --- a/InvenTree/InvenTree/static/treegrid/LICENSE +++ b/InvenTree/InvenTree/static/treegrid/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 +Copyright (c) 2013 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/InvenTree/InvenTree/static/treegrid/examples/example-basic.html b/InvenTree/InvenTree/static/treegrid/examples/example-basic.html index f954edfee5..9377a5c2be 100644 --- a/InvenTree/InvenTree/static/treegrid/examples/example-basic.html +++ b/InvenTree/InvenTree/static/treegrid/examples/example-basic.html @@ -44,7 +44,7 @@
- +

TreeGrid Basic example

@@ -61,10 +61,10 @@ Node 1-2-1Additional info - +

Code

- +
 
 <!doctype html>
@@ -100,7 +100,7 @@
         <tr class="treegrid-4 treegrid-parent-3">
           <td>Node 1-2-1</td><td>Additional info</td>
         </tr>
-      </table>	  
+      </table>
 
   </body>
 </html>
@@ -128,4 +128,4 @@
       }
 
   
-
\ No newline at end of file
+
diff --git a/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-2.html b/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-2.html
index 6feee1dd16..2e975850b5 100644
--- a/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-2.html
+++ b/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-2.html
@@ -76,7 +76,7 @@
                 
                 
                     Node 2-2-1Additional info
-                        
+                
             
             

Source

@@ -89,7 +89,7 @@ $(document).ready(function() { $('.tree').treegrid(); }); -</script>
+</script>

Bootstrap grid example
table-bordered table-striped table-condensed
with custom expander

@@ -117,8 +117,8 @@ Node 2-2-1Additional info - - + +

Source

<link href="bootstrap-2.3.2/css/bootstrap.css" rel="stylesheet">
@@ -133,7 +133,7 @@
                     expanderCollapsedClass: 'icon-plus-sign'
                 });
     });
-</script>
+</script>
diff --git a/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-3.html b/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-3.html index 9faf397511..a251e137a3 100644 --- a/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-3.html +++ b/InvenTree/InvenTree/static/treegrid/examples/example-bootstrap-3.html @@ -29,7 +29,7 @@ }); }); - + + - \ No newline at end of file + diff --git a/InvenTree/InvenTree/static/treegrid/examples/example-events.html b/InvenTree/InvenTree/static/treegrid/examples/example-events.html index e31ea545a7..0c6d0acd83 100644 --- a/InvenTree/InvenTree/static/treegrid/examples/example-events.html +++ b/InvenTree/InvenTree/static/treegrid/examples/example-events.html @@ -73,7 +73,7 @@ Node 1-2-1Additional info - +

Code

@@ -95,16 +95,16 @@ $('.tree').treegrid({ onChange: function() { alert("Changed: "+$(this).attr("id")); - }, + }, onCollapse: function() { alert("Collapsed: "+$(this).attr("id")); - }, + }, onExpand: function() { alert("Expanded "+$(this).attr("id")); }}); $('#node-1').on("change", function() { alert("Event from " + $(this).attr("id")); - }); + }); }); </script> @@ -124,7 +124,7 @@ <tr class="treegrid-4 treegrid-parent-3"> <td>Node 1-2-1</td><td>Additional info</td> </tr> - </table> + </table> </body> </html> @@ -152,4 +152,4 @@ } - \ No newline at end of file + diff --git a/InvenTree/InvenTree/static/treegrid/examples/example-huge.html b/InvenTree/InvenTree/static/treegrid/examples/example-huge.html index 3a63fe56ce..3bba1cdba5 100644 --- a/InvenTree/InvenTree/static/treegrid/examples/example-huge.html +++ b/InvenTree/InvenTree/static/treegrid/examples/example-huge.html @@ -30,7 +30,7 @@ - + @@ -51,13 +51,13 @@ - +
- +
- + {% endblock %} {% block js_load %} @@ -197,4 +197,4 @@ $('#multi-build-print').click(function() { }); {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/company/migrations/0019_auto_20200413_0642.py b/InvenTree/company/migrations/0019_auto_20200413_0642.py index cfbc3da4da..3b7c928489 100644 --- a/InvenTree/company/migrations/0019_auto_20200413_0642.py +++ b/InvenTree/company/migrations/0019_auto_20200413_0642.py @@ -65,7 +65,7 @@ def reverse_association(apps, schema_editor): # pragma: no cover # Now extract the "name" for the manufacturer response = cursor.execute(f"SELECT name from company_company where id={manufacturer_id};") - + row = cursor.fetchone() name = row[0] @@ -77,7 +77,7 @@ def reverse_association(apps, schema_editor): # pragma: no cover def associate_manufacturers(apps, schema_editor): """ This migration is the "middle step" in migration of the "manufacturer" field for the SupplierPart model. - + Previously the "manufacturer" field was a simple text field with the manufacturer name. This is quite insufficient. The new "manufacturer" field is a link to Company object which has the "is_manufacturer" parameter set to True @@ -87,7 +87,7 @@ def associate_manufacturers(apps, schema_editor): It uses fuzzy pattern matching to help the user out as much as possible. """ - + def get_manufacturer_name(part_id): """ THIS IS CRITICAL! @@ -149,7 +149,7 @@ def associate_manufacturers(apps, schema_editor): return True - # Have we already mapped this + # Have we already mapped this if name in links.keys(): # pragma: no cover print(" - Part[{pk}]: Mapped '{n}' - manufacturer <{c}>".format(pk=part_id, n=name, c=links[name])) @@ -178,7 +178,7 @@ def associate_manufacturers(apps, schema_editor): links[company_name] = manufacturer.pk companies[company_name] = manufacturer.pk - + print(" - Part[{pk}]: Created new manufacturer: '{name}'".format(pk=part_id, name=company_name)) # Update SupplierPart object in the database @@ -228,9 +228,9 @@ def associate_manufacturers(apps, schema_editor): # Present a list of options if not TESTING: # pragma: no cover print("----------------------------------") - + print("Checking part [{pk}] ({idx} of {total})".format(pk=part_id, idx=idx+1, total=total)) - + if not TESTING: # pragma: no cover print("Manufacturer name: '{n}'".format(n=name)) print("----------------------------------") @@ -293,7 +293,7 @@ def associate_manufacturers(apps, schema_editor): if not response or len(response) == 0: # Response cannot be empty! print("Please select an option") - + # Double-check if the typed name corresponds to an existing item elif response in companies.keys(): link_part(part, companies[response]) @@ -334,7 +334,7 @@ def associate_manufacturers(apps, schema_editor): results = cursor.fetchall() part_count = len(results) - + # Create a unique set of manufacturer names for index, row in enumerate(results): pk, MPN, SKU, manufacturer_id, manufacturer_name = row diff --git a/InvenTree/company/migrations/0026_auto_20201110_1011.py b/InvenTree/company/migrations/0026_auto_20201110_1011.py index 193d191ed6..f61b64d29f 100644 --- a/InvenTree/company/migrations/0026_auto_20201110_1011.py +++ b/InvenTree/company/migrations/0026_auto_20201110_1011.py @@ -32,7 +32,7 @@ def migrate_currencies(apps, schema_editor): # The 'suffix' field denotes the currency code response = cursor.execute('SELECT id, suffix, description from common_currency;') - + results = cursor.fetchall() remap = {} @@ -56,7 +56,7 @@ def migrate_currencies(apps, schema_editor): # Now iterate through each SupplierPriceBreak and update the rows response = cursor.execute('SELECT id, cost, currency_id, price, price_currency from part_supplierpricebreak;') - + results = cursor.fetchall() count = 0 @@ -92,7 +92,7 @@ def reverse_currencies(apps, schema_editor): # pragma: no cover # Extract a list of currency codes which are in use response = cursor.execute(f'SELECT id, price, price_currency from part_supplierpricebreak;') - + results = cursor.fetchall() codes_in_use = set() @@ -123,7 +123,7 @@ def reverse_currencies(apps, schema_editor): # pragma: no cover # Create a new object in the database print(f"Creating new Currency object for {code}") - + # Construct a query to create a new Currency object query = f'INSERT into common_currency (symbol, suffix, description, value, base) VALUES ("$", "{code}", "{description}", 1.0, False);' diff --git a/InvenTree/company/migrations/0036_supplierpart_update_2.py b/InvenTree/company/migrations/0036_supplierpart_update_2.py index 82e1e1ba97..9c986437e3 100644 --- a/InvenTree/company/migrations/0036_supplierpart_update_2.py +++ b/InvenTree/company/migrations/0036_supplierpart_update_2.py @@ -9,7 +9,7 @@ def supplierpart_make_manufacturer_parts(apps, schema_editor): SupplierPart = apps.get_model('company', 'SupplierPart') supplier_parts = SupplierPart.objects.all() - + if supplier_parts: print(f'\nCreating ManufacturerPart Objects\n{"-"*10}') for supplier_part in supplier_parts: @@ -23,7 +23,7 @@ def supplierpart_make_manufacturer_parts(apps, schema_editor): if not part: # pragma: no cover print(f'[ERROR: SUPPLIER PART IS NOT CONNECTED TO PART]') continue - + manufacturer = supplier_part.manufacturer MPN = supplier_part.MPN link = supplier_part.link @@ -31,7 +31,7 @@ def supplierpart_make_manufacturer_parts(apps, schema_editor): if manufacturer or MPN: print(f' | {part.name[:15].ljust(15)}', end='') - + try: print(f' | {manufacturer.name[:15].ljust(15)}', end='') except AttributeError: @@ -73,12 +73,12 @@ def supplierpart_populate_manufacturer_info(apps, schema_editor): # pragma: no SupplierPart = apps.get_model('company', 'SupplierPart') supplier_parts = SupplierPart.objects.all() - + if supplier_parts: print(f'\nSupplierPart: Populating Manufacturer Information\n{"-"*10}') for supplier_part in supplier_parts: print(f'{supplier_part.supplier.name[:15].ljust(15)} | {supplier_part.SKU[:15].ljust(15)}\t', end='') - + manufacturer_part = supplier_part.manufacturer_part if manufacturer_part: @@ -89,13 +89,13 @@ def supplierpart_populate_manufacturer_info(apps, schema_editor): # pragma: no supplier_part.MPN = manufacturer_part.MPN supplier_part.save() - + print(f'[SUCCESS: UPDATED MANUFACTURER INFO]') else: print(f'[IGNORED: NO MANUFACTURER PART]') print(f'{"-"*10}\nDone\n') - + class Migration(migrations.Migration): diff --git a/InvenTree/company/templates/company/detail.html b/InvenTree/company/templates/company/detail.html index 4474278613..9ae40f0833 100644 --- a/InvenTree/company/templates/company/detail.html +++ b/InvenTree/company/templates/company/detail.html @@ -90,7 +90,7 @@ {% endif %} - + {% include "filter_list.html" with id="manufacturer-part" %} @@ -172,9 +172,9 @@ {% include "filter_list.html" with id="customerstock" %} - +
- + @@ -313,7 +313,7 @@ var selections = $("#manufacturer-part-table").bootstrapTable("getSelections"); deleteManufacturerParts(selections, { - onSuccess: function() { + onSuccess: function() { $("#manufacturer-part-table").bootstrapTable("refresh"); } }); @@ -378,10 +378,10 @@ accept: function() { selections.forEach(function(part) { var url = `/api/company/part/${part.pk}/`; - + requests.push(inventreeDelete(url)); }); - + $.when.apply($, requests).done(function() { $('#supplier-part-table').bootstrapTable('refresh'); }); @@ -412,4 +412,4 @@ enableSidebar('company'); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index d7fbee1732..f9790a9a1d 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -5,7 +5,7 @@ {% load inventree_extras %} {% block page_title %} -{% inventree_title %} | {% trans "Supplier List" %} +{% inventree_title %} | {% trans "Supplier List" %} {% endblock %} {% block heading %} @@ -23,11 +23,11 @@ {% block page_info %}
- +
{% include "filter_list.html" with id='company' %}
- +
@@ -59,4 +59,4 @@ } ); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/company/templates/company/manufacturer_part.html b/InvenTree/company/templates/company/manufacturer_part.html index aa087fe207..d46f99b68f 100644 --- a/InvenTree/company/templates/company/manufacturer_part.html +++ b/InvenTree/company/templates/company/manufacturer_part.html @@ -137,7 +137,7 @@ src="{% static 'img/blank_image.png' %}" {% include "filter_list.html" with id='supplier-part' %} - +
@@ -267,10 +267,10 @@ $("#supplier-part-delete").click(function() { accept: function() { selections.forEach(function(part) { var url = `/api/company/part/${part.pk}/`; - + requests.push(inventreeDelete(url)); }); - + $.when.apply($, requests).done(function() { reloadSupplierPartTable(); }); @@ -295,7 +295,7 @@ $("#multi-parameter-delete").click(function() { text += ` `; - + showQuestionDialog( '{% trans "Delete Parameters" %}', text, @@ -353,7 +353,7 @@ $('#order-part, #order-part2').click(function() { '{% url "api-part-detail" part.part.pk %}', {}, { success: function(response) { - + orderParts([response], { manufacturer_part: {{ part.pk }}, {% if part.manufacturer %} @@ -389,4 +389,4 @@ $('#delete-part').click(function() { enableSidebar('manufacturerpart'); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/company/templates/company/supplier_part.html b/InvenTree/company/templates/company/supplier_part.html index f990b66898..d833d581f0 100644 --- a/InvenTree/company/templates/company/supplier_part.html +++ b/InvenTree/company/templates/company/supplier_part.html @@ -165,7 +165,7 @@ src="{% static 'img/blank_image.png' %}" - {% endif %} + {% endif %} @@ -198,7 +198,7 @@ src="{% static 'img/blank_image.png' %}"
- +
diff --git a/InvenTree/config_template.yaml b/InvenTree/config_template.yaml index cad7012ebe..6b0d3d29ae 100644 --- a/InvenTree/config_template.yaml +++ b/InvenTree/config_template.yaml @@ -39,7 +39,7 @@ database: #PASSWORD: inventree_password #HOST: 'localhost' #PORT: '5432' - + # --- Example Configuration - sqlite3 --- # ENGINE: sqlite3 # NAME: '/home/inventree/database.sqlite3' @@ -98,7 +98,7 @@ email: debug: True # Set debug_toolbar to True to enable a debugging toolbar for InvenTree -# Note: This will only be displayed if DEBUG mode is enabled, +# Note: This will only be displayed if DEBUG mode is enabled, # and only if InvenTree is accessed from a local IP (127.0.0.1) debug_toolbar: False @@ -118,7 +118,7 @@ allowed_hosts: - '*' # Cross Origin Resource Sharing (CORS) settings (see https://github.com/ottoyiu/django-cors-headers) -# Following parameters are +# Following parameters are cors: # CORS_ORIGIN_ALLOW_ALL - If True, the whitelist will not be used and all origins will be accepted. allow_all: True diff --git a/InvenTree/order/migrations/0055_auto_20211025_0645.py b/InvenTree/order/migrations/0055_auto_20211025_0645.py index d9ee366f5f..0efab70da8 100644 --- a/InvenTree/order/migrations/0055_auto_20211025_0645.py +++ b/InvenTree/order/migrations/0055_auto_20211025_0645.py @@ -19,7 +19,7 @@ def add_shipment(apps, schema_editor): Allocation = apps.get_model('order', 'salesorderallocation') SalesOrder = apps.get_model('order', 'salesorder') Shipment = apps.get_model('order', 'salesordershipment') - + n = 0 for order in SalesOrder.objects.all(): diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index 542a7a90ca..4c9bc16ca7 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -30,7 +30,7 @@ {% trans "Receive Items" %} {% endif %} - {% endif %} + {% endif %} @@ -38,7 +38,7 @@
{% include "filter_list.html" with id="purchase-order-lines" %}
- +
@@ -260,4 +260,4 @@ loadOrderTotal( enableSidebar('purchaseorder'); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/order/templates/order/purchase_orders.html b/InvenTree/order/templates/order/purchase_orders.html index 8ddae982b9..f76cc936af 100644 --- a/InvenTree/order/templates/order/purchase_orders.html +++ b/InvenTree/order/templates/order/purchase_orders.html @@ -41,12 +41,12 @@ - +
- +
- + {% endblock %} @@ -192,4 +192,4 @@ loadPurchaseOrderTable("#purchase-order-table", { url: "{% url 'api-po-list' %}", }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index 628e510d37..f55480d288 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -181,7 +181,7 @@ {% endif %} }); - + onPanelLoad('order-shipments-complete', function() { loadSalesOrderShipmentTable('#completed-shipments-table', { order: {{ order.pk }}, @@ -293,5 +293,5 @@ ); enableSidebar('salesorder'); - -{% endblock %} \ No newline at end of file + +{% endblock %} diff --git a/InvenTree/order/templates/order/sales_orders.html b/InvenTree/order/templates/order/sales_orders.html index 7f4f09b8d2..81c9f3670d 100644 --- a/InvenTree/order/templates/order/sales_orders.html +++ b/InvenTree/order/templates/order/sales_orders.html @@ -44,13 +44,13 @@ - +
- +
- + {% endblock %} {% block js_load %} @@ -192,4 +192,4 @@ $("#so-create").click(function() { createSalesOrder(); }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/part/fixtures/part.yaml b/InvenTree/part/fixtures/part.yaml index fd38036fa9..762a0bf740 100644 --- a/InvenTree/part/fixtures/part.yaml +++ b/InvenTree/part/fixtures/part.yaml @@ -1,4 +1,4 @@ -# Create some fasteners +# Create some fasteners - model: part.part pk: 1 diff --git a/InvenTree/part/migrations/0034_auto_20200404_1238.py b/InvenTree/part/migrations/0034_auto_20200404_1238.py index 3868191c02..a720fffa1e 100644 --- a/InvenTree/part/migrations/0034_auto_20200404_1238.py +++ b/InvenTree/part/migrations/0034_auto_20200404_1238.py @@ -7,7 +7,7 @@ def create_thumbnails(apps, schema_editor): """ Create thumbnails for all existing Part images. - Note: This functionality is now performed in apps.py, + Note: This functionality is now performed in apps.py, as running the thumbnail script here caused too many database level errors. This migration is left here to maintain the database migration history diff --git a/InvenTree/part/migrations/0056_auto_20201110_1125.py b/InvenTree/part/migrations/0056_auto_20201110_1125.py index efb36b1812..bb3d930f99 100644 --- a/InvenTree/part/migrations/0056_auto_20201110_1125.py +++ b/InvenTree/part/migrations/0056_auto_20201110_1125.py @@ -33,7 +33,7 @@ def migrate_currencies(apps, schema_editor): # The 'suffix' field denotes the currency code response = cursor.execute('SELECT id, suffix, description from common_currency;') - + results = cursor.fetchall() remap = {} @@ -57,7 +57,7 @@ def migrate_currencies(apps, schema_editor): # Now iterate through each PartSellPriceBreak and update the rows response = cursor.execute('SELECT id, cost, currency_id, price, price_currency from part_partsellpricebreak;') - + results = cursor.fetchall() count = 0 @@ -93,7 +93,7 @@ def reverse_currencies(apps, schema_editor): # pragma: no cover # Extract a list of currency codes which are in use response = cursor.execute(f'SELECT id, price, price_currency from part_partsellpricebreak;') - + results = cursor.fetchall() codes_in_use = set() @@ -124,7 +124,7 @@ def reverse_currencies(apps, schema_editor): # pragma: no cover # Create a new object in the database print(f"Creating new Currency object for {code}") - + # Construct a query to create a new Currency object query = f"INSERT into common_currency (symbol, suffix, description, value, base) VALUES ('$', '{code}', '{description}', 1.0, False);" diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html index 7a3ab1ad6d..e817f60d08 100644 --- a/InvenTree/part/templates/part/bom.html +++ b/InvenTree/part/templates/part/bom.html @@ -34,7 +34,7 @@
  • {% trans "Delete Items" %}
  • - {% endif %} + {% endif %} {% include "filter_list.html" with id="bom" %} diff --git a/InvenTree/part/templates/part/category.html b/InvenTree/part/templates/part/category.html index 41df553a5e..30c0867968 100644 --- a/InvenTree/part/templates/part/category.html +++ b/InvenTree/part/templates/part/category.html @@ -188,7 +188,7 @@
    -
    +
    @@ -221,9 +221,9 @@ {% include "filter_list.html" with id="category" %} - +
    - + @@ -255,7 +255,7 @@ onPanelLoad('parameters', function() { loadParametricPartTable( "#parametric-part-table", - { + { category: {{ category.pk }}, } ); @@ -341,7 +341,7 @@ location.href = `/part/${data.pk}/`; }, }); - + }); {% endif %} diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index 1c80a88c28..23d8af755a 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -66,14 +66,14 @@ {% include "filter_list.html" with id="parttests" %} - -
    + +
    -
    +

    {% trans "Purchase Orders" %}

    {% include "spacer.html" %}
    @@ -89,9 +89,9 @@ {% include "filter_list.html" with id="partpurchaseorders" %}
    - + -
    +
    @@ -114,7 +114,7 @@

    {% trans "Sales Order Allocations" %}

    - +
    {% include "filter_list.html" with id="salesorderallocation" %} @@ -167,7 +167,7 @@ {% include "filter_list.html" with id="variants" %}
    - +
    @@ -268,7 +268,7 @@
  • {% trans "Validate BOM" %}
  • - + {% if roles.part.change %} - +
    @@ -230,11 +230,11 @@ {% if part.has_bom and roles.sales_order.view %}
    -

    {% trans "BOM Cost" %} +

    {% trans "BOM Cost" %}

    - +
    @@ -256,11 +256,11 @@ {% if part.salable and roles.sales_order.view %}
    -

    {% trans "Sale Cost" %} +

    {% trans "Sale Cost" %}

    - +
    @@ -274,7 +274,7 @@ {% trans "Add Price Break" %}
    - +
    @@ -285,11 +285,11 @@ {% if show_price_history %}
    -

    {% trans "Sale Price" %} +

    {% trans "Sale Price" %}

    - +
    {% if sale_history|length > 0 %}
    @@ -303,4 +303,3 @@
    {% endif %} {% endif %} - \ No newline at end of file diff --git a/InvenTree/stock/fixtures/stock.yaml b/InvenTree/stock/fixtures/stock.yaml index 2fd5b7eb92..fb798e74be 100644 --- a/InvenTree/stock/fixtures/stock.yaml +++ b/InvenTree/stock/fixtures/stock.yaml @@ -274,7 +274,7 @@ tree_id: 0 lft: 0 rght: 0 - + - model: stock.stockitem pk: 1002 fields: @@ -285,7 +285,7 @@ tree_id: 0 lft: 0 rght: 0 - + - model: stock.stockitem pk: 1003 fields: @@ -307,7 +307,7 @@ tree_id: 0 lft: 0 rght: 0 - + - model: stock.stockitem pk: 1005 fields: @@ -318,7 +318,7 @@ tree_id: 0 lft: 0 rght: 0 - + - model: stock.stockitem pk: 1006 fields: @@ -329,7 +329,7 @@ tree_id: 0 lft: 0 rght: 0 - + - model: stock.stockitem pk: 1007 fields: @@ -340,7 +340,7 @@ tree_id: 0 lft: 0 rght: 0 - + - model: stock.stockitem pk: 1008 fields: @@ -351,4 +351,3 @@ tree_id: 0 lft: 0 rght: 0 - \ No newline at end of file diff --git a/InvenTree/stock/migrations/0061_auto_20210511_0911.py b/InvenTree/stock/migrations/0061_auto_20210511_0911.py index 1e20071d59..887bff0ea8 100644 --- a/InvenTree/stock/migrations/0061_auto_20210511_0911.py +++ b/InvenTree/stock/migrations/0061_auto_20210511_0911.py @@ -26,7 +26,7 @@ def update_history(apps, schema_editor): # Note we cannot use the 'pathstring' function here as we don't have access to model functions! path = [location.name] - + loc = location while loc.parent: @@ -48,7 +48,7 @@ def update_history(apps, schema_editor): deltas = {} updated = False - + q = entry.quantity if idx == 0 or not q == quantity: @@ -69,7 +69,7 @@ def update_history(apps, schema_editor): if 'completed build' in title: tracking_type = StockHistoryCode.BUILD_OUTPUT_COMPLETED - + elif 'removed' in title and 'item' in title: if entry.notes.lower().startswith('split '): @@ -81,7 +81,7 @@ def update_history(apps, schema_editor): result = re.search(r"^removed ([\d\.]+) items", title) if result: - + removed = result.groups()[0] try: @@ -93,12 +93,12 @@ def update_history(apps, schema_editor): print(f"WARNING: Error converting removed quantity '{removed}'") else: print(f"Could not decode '{title}'") - + elif 'split from existing' in title: tracking_type = StockHistoryCode.SPLIT_FROM_PARENT deltas['quantity'] = float(q) - + elif 'moved to' in title: tracking_type = StockHistoryCode.STOCK_MOVE @@ -119,7 +119,7 @@ def update_history(apps, schema_editor): # Direct match for name if text == location.name: matches.add(location) - + # Match for "name - description" compare = f"{location.name} - {location.description}" @@ -140,7 +140,7 @@ def update_history(apps, schema_editor): else: print(f"No location match: '{text}'") break - + elif 'created stock item' in title: tracking_type = StockHistoryCode.CREATED @@ -152,7 +152,7 @@ def update_history(apps, schema_editor): elif 'counted' in title: tracking_type = StockHistoryCode.STOCK_COUNT - + elif 'added' in title: tracking_type = StockHistoryCode.STOCK_ADD @@ -160,7 +160,7 @@ def update_history(apps, schema_editor): result = re.search(r"^added ([\d\.]+) items", title) if result: - + added = result.groups()[0] try: diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index 66069c7a2e..efb4a6e39f 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -26,7 +26,7 @@
    -
    +
    {% include "filter_list.html" with id="stocktracking" %}
    @@ -111,8 +111,8 @@ {% include "filter_list.html" with id="stocktests" %}
    - -
    + +
    @@ -210,7 +210,7 @@ quantity: {{ item.quantity|unlocalize }}, } ); - + onPanelLoad('notes', function() { setupNotesField( 'stock-notes', @@ -322,7 +322,7 @@ reload: true, } ); - }); + }); loadStockTrackingTable($("#track-table"), { params: { @@ -330,7 +330,7 @@ item: {{ item.pk }}, user_detail: true, }, - url: "{% url 'api-stock-tracking-list' %}", + url: "{% url 'api-stock-tracking-list' %}", }); enableSidebar('stockitem'); diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index da4b832266..1e5abb7ebc 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -102,7 +102,7 @@
  • {% trans "Uninstall" %}
  • {% else %} {% if item.part.get_used_in %} - {% endif %} @@ -260,13 +260,13 @@ {% trans "This stock item is allocated to Build Order" %} {{ link }} {% if qty < item.quantity %}({% trans "Quantity" %}: {{ qty }}){% endif %}
    {% endfor %} - + {% if item.serialized %}
    {% trans "This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted." %}
    {% endif %} - +
    {% endblock details %} @@ -473,7 +473,7 @@ $("#print-label").click(function() { {% if roles.stock.change %} $("#stock-duplicate").click(function() { - // Duplicate a stock item + // Duplicate a stock item duplicateStockItem({{ item.pk }}, {}); }); @@ -512,7 +512,7 @@ $("#barcode-unlink").click(function() { }); $("#barcode-scan-into-location").click(function() { - + inventreeGet('{% url "api-stock-detail" item.pk %}', {}, { success: function(item) { scanItemsIntoLocation([item]); diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index 1066adf6ea..496e0b4e1c 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -205,7 +205,7 @@ {% include "filter_list.html" with id="location" %}
    - +
    @@ -235,33 +235,33 @@ allowTreeView: true, }); }); - + linkButtonsToSelection( $('#sublocation-table'), [ '#location-print-options', ] ); - + {% if labels_enabled %} $('#print-label').click(function() { var locs = [{{ location.pk }}]; - printStockLocationLabels(locs); + printStockLocationLabels(locs); }); - + $('#multi-location-print-label').click(function() { - + var selections = $('#sublocation-table').bootstrapTable('getSelections'); - + var locations = []; - + selections.forEach(function(loc) { locations.push(loc.pk); }); - + printStockLocationLabels(locations); }); {% endif %} diff --git a/InvenTree/stock/templates/stock/location_delete.html b/InvenTree/stock/templates/stock/location_delete.html index c86ab4bc05..b4e4deb49d 100644 --- a/InvenTree/stock/templates/stock/location_delete.html +++ b/InvenTree/stock/templates/stock/location_delete.html @@ -7,7 +7,7 @@
    {% trans "Are you sure you want to delete this stock location?" %}
    - + {% if location.children.all|length > 0 %}
    {% blocktrans with n=location.children.all|length %}This location contains {{ n }} child locations{% endblocktrans %}.
    @@ -31,4 +31,4 @@
    {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/templates/503.html b/InvenTree/templates/503.html index 606fc03ff0..bc72ace5c0 100644 --- a/InvenTree/templates/503.html +++ b/InvenTree/templates/503.html @@ -14,7 +14,7 @@ {% block body_class %}login-screen{% endblock %} {% block body %} -
    diff --git a/InvenTree/templates/InvenTree/search.html b/InvenTree/templates/InvenTree/search.html index 2759cb0b8b..5ba618137e 100644 --- a/InvenTree/templates/InvenTree/search.html +++ b/InvenTree/templates/InvenTree/search.html @@ -224,7 +224,7 @@ {% endif %} - {% endif %} + {% endif %} enableSidebar( 'search', diff --git a/InvenTree/templates/InvenTree/settings/part.html b/InvenTree/templates/InvenTree/settings/part.html index 4f9841aaaf..1004113dc6 100644 --- a/InvenTree/templates/InvenTree/settings/part.html +++ b/InvenTree/templates/InvenTree/settings/part.html @@ -46,7 +46,7 @@
    +
    diff --git a/InvenTree/templates/InvenTree/settings/plugin.html b/InvenTree/templates/InvenTree/settings/plugin.html index a451fb6544..cd2d921bca 100644 --- a/InvenTree/templates/InvenTree/settings/plugin.html +++ b/InvenTree/templates/InvenTree/settings/plugin.html @@ -36,7 +36,7 @@
    {% url 'admin:plugin_pluginconfig_changelist' as url %} {% include "admin_button.html" with url=url %} - +
    @@ -52,7 +52,7 @@ {% trans "Version" %} - + {% plugin_list as pl_list %} {% for plugin_key, plugin in pl_list.items %} @@ -133,7 +133,7 @@ {% trans "Message" %} - + {% for stage, errors in pl_errors.items %} {% for error_detail in errors %} diff --git a/InvenTree/templates/InvenTree/settings/plugin_settings.html b/InvenTree/templates/InvenTree/settings/plugin_settings.html index 79150ec879..2ba3a401b2 100644 --- a/InvenTree/templates/InvenTree/settings/plugin_settings.html +++ b/InvenTree/templates/InvenTree/settings/plugin_settings.html @@ -70,7 +70,7 @@
    {% trans 'The code information is pulled from the latest git commit for this plugin. It might not reflect official version numbers or information but the actual code running.' %}
    - + {% endif %}
    diff --git a/InvenTree/templates/InvenTree/settings/settings.html b/InvenTree/templates/InvenTree/settings/settings.html index 4e460398f1..3d5519db54 100644 --- a/InvenTree/templates/InvenTree/settings/settings.html +++ b/InvenTree/templates/InvenTree/settings/settings.html @@ -99,7 +99,7 @@ $('table').find('.boolean-setting').change(function() { } } ); - + }); // Callback for when non-boolean settings are edited diff --git a/InvenTree/templates/InvenTree/settings/user_display.html b/InvenTree/templates/InvenTree/settings/user_display.html index 1f52c095ac..bab90aadf9 100644 --- a/InvenTree/templates/InvenTree/settings/user_display.html +++ b/InvenTree/templates/InvenTree/settings/user_display.html @@ -76,7 +76,7 @@ {% if lang_translated > 10 or lang_code == 'en' or lang_code == LANGUAGE_CODE %}{% define True as use_lang %}{% else %}{% define False as use_lang %}{% endif %} {% if ALL_LANG or use_lang %}
    -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/templates/InvenTree/settings/user_search.html b/InvenTree/templates/InvenTree/settings/user_search.html index f18fb5816c..5e6df86170 100644 --- a/InvenTree/templates/InvenTree/settings/user_search.html +++ b/InvenTree/templates/InvenTree/settings/user_search.html @@ -25,11 +25,11 @@ {% include "InvenTree/settings/setting.html" with key="SEARCH_PREVIEW_EXCLUDE_INACTIVE_PURCHASE_ORDERS" user_setting=True icon='fa-eye-slash' %} {% include "InvenTree/settings/setting.html" with key="SEARCH_PREVIEW_SHOW_SALES_ORDERS" user_setting=True icon='fa-truck' %} {% include "InvenTree/settings/setting.html" with key="SEARCH_PREVIEW_EXCLUDE_INACTIVE_SALES_ORDERS" user_setting=True icon='fa-eye-slash' %} - + {% include "InvenTree/settings/setting.html" with key="SEARCH_PREVIEW_RESULTS" user_setting=True icon='fa-search' %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/InvenTree/templates/account/base.html b/InvenTree/templates/account/base.html index 9a68f7ba31..241be9bb9f 100644 --- a/InvenTree/templates/account/base.html +++ b/InvenTree/templates/account/base.html @@ -50,7 +50,7 @@ -
    @@ -130,4 +130,4 @@ $(document).ready(function () { - \ No newline at end of file + diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html index 795a5679aa..1ae46c34f9 100644 --- a/InvenTree/templates/base.html +++ b/InvenTree/templates/base.html @@ -65,7 +65,7 @@ {% block page_title %} -{% inventree_title %} +{% inventree_title %} {% endblock %} @@ -91,7 +91,7 @@
    - + {% block alerts %}
    @@ -164,7 +164,7 @@ - + @@ -246,4 +246,4 @@ $(document).ready(function () { {% endblock %} - \ No newline at end of file + diff --git a/InvenTree/templates/js/dynamic/nav.js b/InvenTree/templates/js/dynamic/nav.js index eed098f162..e22ea19388 100644 --- a/InvenTree/templates/js/dynamic/nav.js +++ b/InvenTree/templates/js/dynamic/nav.js @@ -68,7 +68,7 @@ function activatePanel(label, panel_name, options={}) { function onPanelLoad(panel, callback) { // One-time callback when a panel is first displayed - // Used to implement lazy-loading, rather than firing + // Used to implement lazy-loading, rather than firing // multiple AJAX queries when the page is first loaded. var panelId = `#panel-${panel}`; @@ -130,12 +130,12 @@ function enableSidebar(label, options={}) { // By default, the menu is "expanded" var state = localStorage.getItem(`inventree-menu-state-${label}`) || 'expanded'; - + // We wish to "toggle" the state! setSidebarState(label, state == 'expanded' ? 'collapsed' : 'expanded'); }); } - + // Set the initial state (default = expanded) var state = localStorage.getItem(`inventree-menu-state-${label}`) || 'expanded'; @@ -204,7 +204,7 @@ function enableBreadcrumbTree(options) { node = nodes[node.parent]; } } - + } else { roots.push(node); } @@ -227,7 +227,7 @@ function enableBreadcrumbTree(options) { // Toggle treeview visibilty $('#breadcrumb-tree-collapse').toggle(); - + }); } diff --git a/InvenTree/templates/js/dynamic/settings.js b/InvenTree/templates/js/dynamic/settings.js index 5b52c2a015..4d4434c0c5 100644 --- a/InvenTree/templates/js/dynamic/settings.js +++ b/InvenTree/templates/js/dynamic/settings.js @@ -58,13 +58,13 @@ function editSetting(key, options={}) { // First, read the settings object from the server inventreeGet(url, {}, { success: function(response) { - + if (response.choices && response.choices.length > 0) { response.type = 'choice'; reload_required = true; } - // Construct the field + // Construct the field var fields = { value: { label: response.name, @@ -77,7 +77,7 @@ function editSetting(key, options={}) { // Foreign key lookup available! if (response.type == 'related field') { - + if (response.model_name && response.api_url) { fields.value.type = 'related field'; fields.value.model = response.model_name.split('.').at(-1); diff --git a/InvenTree/templates/js/translated/api.js b/InvenTree/templates/js/translated/api.js index 17b1b2fca0..e260f605cc 100644 --- a/InvenTree/templates/js/translated/api.js +++ b/InvenTree/templates/js/translated/api.js @@ -14,11 +14,11 @@ $.urlParam = function(name) { // eslint-disable-next-line no-useless-escape var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); - + if (results == null) { return null; } - + return decodeURI(results[1]) || 0; }; @@ -80,9 +80,9 @@ function inventreeGet(url, filters={}, options={}) { function inventreeFormDataUpload(url, data, options={}) { /* Upload via AJAX using the FormData approach. - * + * * Note that the following AJAX parameters are required for FormData upload - * + * * processData: false * contentType: false */ diff --git a/InvenTree/templates/js/translated/attachment.js b/InvenTree/templates/js/translated/attachment.js index 858ca8bd84..dd1fe31c66 100644 --- a/InvenTree/templates/js/translated/attachment.js +++ b/InvenTree/templates/js/translated/attachment.js @@ -14,7 +14,7 @@ /* * Add callbacks to buttons for creating new attachments. - * + * * Note: Attachments can also be external links! */ function addAttachmentButtonCallbacks(url, fields={}) { @@ -46,7 +46,7 @@ function addAttachmentButtonCallbacks(url, fields={}) { }; Object.assign(link_fields, fields); - + constructForm(url, { fields: link_fields, method: 'POST', @@ -88,7 +88,7 @@ function loadAttachmentTable(url, options) { constructForm(`${url}${pk}/`, { fields: { link: {}, - comment: {}, + comment: {}, }, processResults: function(data, fields, opts) { // Remove the "link" field if the attachment is a file! @@ -100,7 +100,7 @@ function loadAttachmentTable(url, options) { title: '{% trans "Edit Attachment" %}', }); }); - + // Add callback for 'delete' button $(table).find('.button-attachment-delete').click(function() { var pk = $(this).attr('pk'); diff --git a/InvenTree/templates/js/translated/barcode.js b/InvenTree/templates/js/translated/barcode.js index d6ce81fa38..3c2211e710 100644 --- a/InvenTree/templates/js/translated/barcode.js +++ b/InvenTree/templates/js/translated/barcode.js @@ -324,7 +324,7 @@ function barcodeDialog(title, options={}) { function barcodeScanDialog() { /* * Perform a barcode scan, - * and (potentially) redirect the browser + * and (potentially) redirect the browser */ var modal = '#modal-form'; @@ -345,9 +345,9 @@ function barcodeScanDialog() { 'warning' ); } - } + } }, - ); + ); } @@ -647,7 +647,7 @@ function scanItemsIntoLocation(item_list, options={}) { item_list.forEach(function(item) { items.push({ pk: item.pk || item.id, - quantity: item.quantity, + quantity: item.quantity, }); }); diff --git a/InvenTree/templates/js/translated/bom.js b/InvenTree/templates/js/translated/bom.js index 0119b36664..b15a2613f8 100644 --- a/InvenTree/templates/js/translated/bom.js +++ b/InvenTree/templates/js/translated/bom.js @@ -95,7 +95,7 @@ function constructBomUploadTable(data, options={}) { // Handle any errors raised by initial data import if (row.data.errors.part) { - addFieldErrorMessage(`items_sub_part_${idx}`, row.data.errors.part); + addFieldErrorMessage(`items_sub_part_${idx}`, row.data.errors.part); } if (row.data.errors.quantity) { @@ -156,7 +156,7 @@ function constructBomUploadTable(data, options={}) { // Request API endpoint options getApiEndpointOptions('{% url "api-bom-list" %}', function(response) { - + var fields = response.actions.POST; data.rows.forEach(function(row, idx) { @@ -543,7 +543,7 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) { ${part_thumb} ${part_name} - ${part_desc}
    `; - + // Add a table of individual rows html += ` @@ -643,7 +643,7 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) { // Re-enable the "submit" button $(opts.modal).find('#modal-form-submit').prop('disabled', false); - + // Reload the parent BOM table reloadParentTable(); } @@ -659,7 +659,7 @@ function deleteBomItems(items, options={}) { var sub_part = item.sub_part_detail; var thumb = thumbnailImage(sub_part.thumbnail || sub_part.image); - + var html = ` @@ -709,7 +709,7 @@ function deleteBomItems(items, options={}) { function deleteNextBomItem() { if (items.length > 0) { - + var item = items.shift(); inventreeDelete(`/api/bom/${item.pk}/`, @@ -735,13 +735,13 @@ function deleteBomItems(items, options={}) { function loadBomTable(table, options={}) { /* Load a BOM table with some configurable options. - * + * * Following options are available: * editable - Should the BOM table be editable? * bom_url - Address to request BOM data from * part_url - Address to request Part data from * parent_id - Parent ID of the owning part - * + * * BOM data are retrieved from the server via AJAX query */ @@ -831,10 +831,10 @@ function loadBomTable(table, options={}) { var html = ''; var sub_part = row.sub_part_detail; - + // Display an extra icon if this part is an assembly if (sub_part.assembly) { - + if (row.sub_assembly_received) { // Data received, ignore } else if (row.sub_assembly_requested) { @@ -895,7 +895,7 @@ function loadBomTable(table, options={}) { text = parseFloat(text); if (row.optional) { - text += ' ({% trans "Optional" %})'; + text += ' ({% trans "Optional" %})'; } if (row.overage) { @@ -920,7 +920,7 @@ function loadBomTable(table, options={}) { var variant_stock = row.allow_variants ? (row.available_variant_stock || 0) : 0; var available_stock = availableQuantity(row); - + var text = `${available_stock}`; if (available_stock <= 0) { @@ -957,7 +957,7 @@ function loadBomTable(table, options={}) { } } }); - + if (show_pricing) { cols.push({ field: 'purchase_price_range', @@ -1139,7 +1139,7 @@ function loadBomTable(table, options={}) { row.sub_assembly_received = true; $(table).bootstrapTable('updateByUniqueId', bom_pk, row, true); - + table.bootstrapTable('append', response); }, error: function(xhr) { @@ -1302,10 +1302,10 @@ function loadBomTable(table, options={}) { * Arguments: * - table: The ID string of the table element e.g. '#used-in-table' * - part_id: The ID (PK) of the part we are interested in - * + * * Options: - * - - * + * - + * * The following "options" are available. */ function loadUsedInTable(table, part_id, options={}) { @@ -1343,14 +1343,14 @@ function loadUsedInTable(table, part_id, options={}) { // Iterate through each variant item for (var jj = 0; jj < variantData.length; jj++) { variantData[jj].parent = row.pk; - + var variant = variantData[jj]; // Add this variant to the table, augmented $(table).bootstrapTable('append', [{ - // Point the parent to the "master" assembly row + // Point the parent to the "master" assembly row parent: row.pk, - part: variant.pk, + part: variant.pk, part_detail: variant, sub_part: row.sub_part, sub_part_detail: row.sub_part_detail, diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index 814f2a3247..34e071a461 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -126,7 +126,7 @@ function newBuildOrder(options={}) { /* Construct a form to cancel a build order */ function cancelBuildOrder(build_id, options={}) { - + constructForm( `/api/build/${build_id}/cancel/`, { @@ -304,7 +304,7 @@ function createBuildOutput(build_id, options) { * Construct a set of output buttons for a particular build output */ function makeBuildOutputButtons(output_id, build_info, options={}) { - + var html = `
    `; // Tracked parts? Must be individually allocated @@ -355,7 +355,7 @@ function makeBuildOutputButtons(output_id, build_info, options={}) { /* * Unallocate stock against a particular build order - * + * * Options: * - output: pk value for a stock item "build output" * - bom_item: pk value for a particular BOMItem (build item) @@ -401,7 +401,7 @@ function unallocateStock(build_id, options={}) { * Launch a modal form to complete selected build outputs */ function completeBuildOutputs(build_id, outputs, options={}) { - + if (outputs.length == 0) { showAlertDialog( '{% trans "Select Build Outputs" %}', @@ -487,7 +487,7 @@ function completeBuildOutputs(build_id, outputs, options={}) { }); }, onSubmit: function(fields, opts) { - + // Extract data elements from the form var data = { outputs: [], @@ -631,7 +631,7 @@ function deleteBuildOutputs(build_id, outputs, options={}) { var pk = $(this).attr('pk'); $(opts.modal).find(`#output_row_${pk}`).remove(); - }); + }); }, onSubmit: function(fields, opts) { var data = { @@ -753,7 +753,7 @@ function loadBuildOrderAllocationTable(table, options={}) { if (!value) { return '{% trans "Location not specified" %}'; } - + var link = `/stock/location/${value}`; var text = row.location_detail.description; @@ -803,7 +803,7 @@ function sumAllocationsForBomRow(bom_row, allocations) { * Display a "build output" table for a particular build. * * This displays a list of "active" (i.e. "in production") build outputs for a given build - * + * */ function loadBuildOutputTable(build_info, options={}) { @@ -825,7 +825,7 @@ function loadBuildOutputTable(build_info, options={}) { setupFilterList('builditems', $(table), options.filterTarget || '#filter-list-incompletebuilditems'); function setupBuildOutputButtonCallbacks() { - + // Callback for the "allocate" button $(table).find('.button-output-allocate').click(function() { var pk = $(this).attr('pk'); @@ -997,7 +997,7 @@ function loadBuildOutputTable(build_info, options={}) { // Check how many BOM lines have been completely allocated for this build output bom_items.forEach(function(bom_item) { - + var required_quantity = bom_item.quantity * row.quantity; if (sumAllocationsForBomRow(bom_item, row.allocations) >= required_quantity) { @@ -1281,7 +1281,7 @@ function loadBuildOutputTable(build_info, options={}) { $(table).on('expand-row.bs.table', function(detail, index, row) { $(`#button-output-allocate-${row.pk}`).prop('disabled', false); }); - + // Disable the "allocate" button when the sub-table is collapsed $(table).on('collapse-row.bs.table', function(detail, index, row) { $(`#button-output-allocate-${row.pk}`).prop('disabled', true); @@ -1364,9 +1364,9 @@ function loadBuildOutputTable(build_info, options={}) { /* * Display the "allocation table" for a particular build output. - * + * * This displays a table of required allocations for a particular build output - * + * * Args: * - buildId: The PK of the Build object * - partId: The PK of the Part object @@ -1375,7 +1375,7 @@ function loadBuildOutputTable(build_info, options={}) { * -- table: The #id of the table (will be auto-calculated if not provided) */ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { - + var buildId = buildInfo.pk; var partId = buildInfo.part; @@ -1628,7 +1628,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { $(table).inventreeTable({ data: bom_items, disablePagination: true, - formatNoMatches: function() { + formatNoMatches: function() { return '{% trans "No BOM items found" %}'; }, name: 'build-allocation', @@ -1715,7 +1715,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { field: 'actions', formatter: function(value, row) { /* Actions available for a particular stock item allocation: - * + * * - Edit the allocation quantity * - Delete the allocation */ @@ -1812,15 +1812,15 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { var variant_stock = row.allow_variants ? (row.available_variant_stock || 0) : 0; var available_stock = availableQuantity(row); - + var required = requiredQuantity(row); var text = ''; - + if (available_stock > 0) { text += `${available_stock}`; } - + if (available_stock < required) { text += ``; } else { @@ -1838,12 +1838,12 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { } else if (substitute_stock > 0) { extra = '{% trans "Includes substitute stock" %}'; } - + if (extra) { text += ``; } } - + return renderLink(text, url); }, sorter: function(valA, valB, rowA, rowB) { @@ -1862,7 +1862,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { }, sorter: function(valA, valB, rowA, rowB) { // Custom sorting function for progress bars - + var aA = allocatedQuantity(rowA); var aB = allocatedQuantity(rowB); @@ -1932,12 +1932,12 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { /** * Allocate stock items to a build - * + * * arguments: * - buildId: ID / PK value for the build * - partId: ID / PK value for the part being built * - bom_items: A list of BomItem objects to be allocated - * + * * options: * - output: ID / PK of the associated build output (or null for untracked items) * - source_location: ID / PK of the top-level StockLocation to source stock from (or null) @@ -2109,7 +2109,7 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) {
    ${thumb} ${sub_part.full_name}
    `; - + constructForm(`/api/build/${build_id}/allocate/`, { method: 'POST', fields: {}, @@ -2193,7 +2193,7 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) { filters.location = location; filters.cascade = true; - + return filters; }, noResults: function(query) { @@ -2371,7 +2371,7 @@ function loadBuildTable(table, options) { columns: [ { field: 'pk', - title: 'ID', + title: 'ID', visible: false, switchable: false, }, diff --git a/InvenTree/templates/js/translated/company.js b/InvenTree/templates/js/translated/company.js index d7b98841e4..1ed38e4b7d 100644 --- a/InvenTree/templates/js/translated/company.js +++ b/InvenTree/templates/js/translated/company.js @@ -10,7 +10,7 @@ setupFilterList, showQuestionDialog, */ - + /* exported createCompany, createManufacturerPart, @@ -26,7 +26,7 @@ /** * Construct a set of form fields for creating / editing a ManufacturerPart - * @returns + * @returns */ function manufacturerPartFields() { @@ -46,7 +46,7 @@ function manufacturerPartFields() { /** * Launches a form to create a new ManufacturerPart - * @param {object} options + * @param {object} options */ function createManufacturerPart(options={}) { @@ -67,7 +67,7 @@ function createManufacturerPart(options={}) { var company_fields = companyFormFields(); company_fields.is_manufacturer.value = true; - + return company_fields; } }; @@ -84,7 +84,7 @@ function createManufacturerPart(options={}) { /** * Launches a form to edit a ManufacturerPart * @param {integer} part - ID of a ManufacturerPart - * @param {object} options + * @param {object} options */ function editManufacturerPart(part, options={}) { @@ -414,7 +414,7 @@ function deleteManufacturerParts(selections, options={}) {

    ${item.MPN} - ${item.part_detail.full_name}

    `; }); - + text += ` `; @@ -577,7 +577,7 @@ function loadManufacturerPartTable(table, url, options) { var pk = $(this).attr('pk'); editManufacturerPart( - pk, + pk, { onSuccess: function() { $(table).bootstrapTable('refresh'); @@ -590,7 +590,7 @@ function loadManufacturerPartTable(table, url, options) { var pk = $(this).attr('pk'); deleteManufacturerPart( - pk, + pk, { onSuccess: function() { $(table).bootstrapTable('refresh'); @@ -775,7 +775,7 @@ function loadSupplierPartTable(table, url, options) { formatter: function(value, row) { if (value) { var name = row.supplier_detail.name; - var url = `/company/${value}/`; + var url = `/company/${value}/`; var html = imageHoverIcon(row.supplier_detail.image) + renderLink(name, url); return html; @@ -875,7 +875,7 @@ function loadSupplierPartTable(table, url, options) { var pk = $(this).attr('pk'); editSupplierPart( - pk, + pk, { onSuccess: function() { $(table).bootstrapTable('refresh'); @@ -888,7 +888,7 @@ function loadSupplierPartTable(table, url, options) { var pk = $(this).attr('pk'); deleteSupplierPart( - pk, + pk, { onSuccess: function() { $(table).bootstrapTable('refresh'); diff --git a/InvenTree/templates/js/translated/filters.js b/InvenTree/templates/js/translated/filters.js index dd45aa6628..349b3028ed 100644 --- a/InvenTree/templates/js/translated/filters.js +++ b/InvenTree/templates/js/translated/filters.js @@ -6,22 +6,22 @@ inventreeSave, reloadTableFilters, */ - + /* exported setupFilterList, */ /** * Code for managing query filters / table options. - * + * * Optional query filters are available to the user for various * tables display in the web interface. - * These filters are saved to the web session, and should be + * These filters are saved to the web session, and should be * persistent for a given table type. - * + * * This makes use of the 'inventreeSave' and 'inventreeLoad' functions * for writing to and reading from session storage. - * + * */ @@ -39,7 +39,7 @@ function defaultFilters() { /** * Load table filters for the given table from session storage - * + * * @param tableKey - String key for the particular table * @param defaults - Default filters for this table e.g. 'cascade=1&location=5' */ @@ -73,7 +73,7 @@ function loadTableFilters(tableKey) { /** * Save table filters to session storage - * + * * @param {*} tableKey - string key for the given table * @param {*} filters - object of string:string pairs */ @@ -251,7 +251,7 @@ function generateFilterInput(tableKey, filterKey) { /** * Configure a filter list for a given table - * + * * @param {*} tableKey - string lookup key for filter settings * @param {*} table - bootstrapTable element to update * @param {*} target - name of target element on page @@ -410,7 +410,7 @@ function setupFilterList(tableKey, table, target, options={}) { /** * Return the pretty title for the given table and filter selection. * If no title is provided, default to the key value. - * + * */ function getFilterTitle(tableKey, filterKey) { var settings = getFilterSettings(tableKey, filterKey); @@ -460,4 +460,3 @@ function getFilterOptionValue(tableKey, filterKey, valueKey) { // Cannot map to a display string - return the original text return value; } - diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index d45a2de78c..a4af51ef74 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -62,7 +62,7 @@ $.fn.select2.defaults.set('theme', 'bootstrap-5'); * can perform a GET method at the endpoint. */ function canView(OPTIONS) { - + if ('actions' in OPTIONS) { return ('GET' in OPTIONS.actions); } else { @@ -90,7 +90,7 @@ function canCreate(OPTIONS) { * can perform a PUT or PATCH method at the endpoint */ function canChange(OPTIONS) { - + if ('actions' in OPTIONS) { return ('PUT' in OPTIONS.actions || 'PATCH' in OPTIONS.actions); } else { @@ -147,25 +147,25 @@ function getApiEndpointOptions(url, callback) { /* * Construct a 'creation' (POST) form, to create a new model in the database. - * + * * arguments: * - fields: The 'actions' object provided by the OPTIONS endpoint - * + * * options: - * - + * - */ function constructCreateForm(fields, options) { // Check if default values were provided for any fields for (const name in fields) { - + var field = fields[name]; var field_options = options.fields[name] || {}; // If a 'value' is not provided for the field, if (field.value == null) { - + if ('value' in field_options) { // Client has specified the default value for the field field.value = field_options.value; @@ -183,12 +183,12 @@ function constructCreateForm(fields, options) { /* * Construct a 'change' (PATCH) form, to create a new model in the database. - * + * * arguments: * - fields: The 'actions' object provided by the OPTIONS endpoint - * + * * options: - * - + * - */ function constructChangeForm(fields, options) { @@ -203,12 +203,12 @@ function constructChangeForm(fields, options) { json: 'application/json', }, success: function(data) { - + // An optional function can be provided to process the returned results, // before they are rendered to the form if (options.processResults) { var processed = options.processResults(data, fields, options); - + // If the processResults function returns data, it will be stored if (processed) { data = processed; @@ -225,7 +225,7 @@ function constructChangeForm(fields, options) { // Store the entire data object options.instance = data; - + constructFormBody(fields, options); }, error: function(xhr) { @@ -240,7 +240,7 @@ function constructChangeForm(fields, options) { /* * Construct a 'delete' form, to remove a model instance from the database. - * + * * arguments: * - fields: The 'actions' object provided by the OPTIONS request * - options: The 'options' object provided by the client @@ -282,7 +282,7 @@ function constructDeleteForm(fields, options) { /* * Request API OPTIONS data from the server, * and construct a modal form based on the response. - * + * * url: API URL which defines form data * options: * - method: The HTTP method e.g. 'PUT', 'POST', 'DELETE' (default='PATCH') @@ -310,7 +310,7 @@ function constructDeleteForm(fields, options) { * - reload: Set to true to reload the current page after form success * - confirm: Set to true to require a "confirm" button * - confirmText: Text for confirm button (default = "Confirm") - * + * */ function constructForm(url, options) { @@ -321,7 +321,7 @@ function constructForm(url, options) { options.fields = options.fields || {}; - // Save the URL + // Save the URL options.url = url; // Default HTTP method @@ -345,7 +345,7 @@ function constructForm(url, options) { /* * Determine what "type" of form we want to construct, * based on the requested action. - * + * * First we must determine if the user has the correct permissions! */ @@ -360,7 +360,7 @@ function constructForm(url, options) { details: '{% trans "Create operation not allowed" %}', icon: 'fas fa-user-times', }); - + console.warn(`'POST action unavailable at ${url}`); } break; @@ -375,7 +375,7 @@ function constructForm(url, options) { details: '{% trans "Update operation not allowed" %}', icon: 'fas fa-user-times', }); - + console.warn(`${options.method} action unavailable at ${url}`); } break; @@ -389,7 +389,7 @@ function constructForm(url, options) { details: '{% trans "Delete operation not allowed" %}', icon: 'fas fa-user-times', }); - + console.warn(`DELETE action unavailable at ${url}`); } break; @@ -403,7 +403,7 @@ function constructForm(url, options) { details: '{% trans "View operation not allowed" %}', icon: 'fas fa-user-times', }); - + console.warn(`GET action unavailable at ${url}`); } break; @@ -417,7 +417,7 @@ function constructForm(url, options) { /* * Construct a modal form based on the provided options - * + * * arguments: * - fields: The endpoint description returned from the OPTIONS request * - options: form options object provided by the client. @@ -450,7 +450,7 @@ function constructFormBody(fields, options) { // Provide each field object with its own name for (field in fields) { fields[field].name = field; - + // If any "instance_filters" are defined for the endpoint, copy them across (overwrite) if (fields[field].instance_filters) { fields[field].filters = Object.assign(fields[field].filters || {}, fields[field].instance_filters); @@ -512,7 +512,7 @@ function constructFormBody(fields, options) { default: break; } - + html += constructField(field_name, field, options); } @@ -529,7 +529,7 @@ function constructFormBody(fields, options) { var modal = options.modal; modalEnable(modal, true); - + // Insert generated form content $(modal).find('#form-content').html(html); @@ -547,7 +547,7 @@ function constructFormBody(fields, options) { if (options.postFormContent) { $(modal).find('#post-form-content').html(options.postFormContent); } - + // Clear any existing buttons from the modal $(modal).find('#modal-footer-buttons').html(''); @@ -659,7 +659,7 @@ function extractFormData(fields, options) { var data = {}; for (var idx = 0; idx < options.field_names.length; idx++) { - + var name = options.field_names[idx]; var field = fields[name] || null; @@ -677,7 +677,7 @@ function extractFormData(fields, options) { /* * Submit form data to the server. - * + * */ function submitFormData(fields, options) { @@ -712,7 +712,7 @@ function submitFormData(fields, options) { case 'decimal': if (!validateFormField(name, options)) { data_valid = false; - + data_errors[name] = ['{% trans "Enter a valid number" %}']; } break; @@ -734,7 +734,7 @@ function submitFormData(fields, options) { var file = field_files[0]; form_data.append(name, file); - + has_files = true; } } else { @@ -780,7 +780,7 @@ function submitFormData(fields, options) { handleFormSuccess(response, options); }, error: function(xhr) { - + $(options.modal).find('#modal-progress-spinner').hide(); switch (xhr.status) { @@ -808,7 +808,7 @@ function submitFormData(fields, options) { * */ function updateFieldValues(fields, options) { - + for (var idx = 0; idx < options.field_names.length; idx++) { var name = options.field_names[idx]; @@ -896,7 +896,7 @@ function getFormFieldElement(name, options) { * An invalid number is expunged at the client side by the getFormFieldValue() function, * which means that an empty string '' is sent to the server if the number is not valud. * This can result in confusing error messages displayed under the form field. - * + * * So, we can invalid numbers and display errors *before* the form is submitted! */ function validateFormField(name, options) { @@ -962,7 +962,7 @@ function getFormFieldValue(name, field={}, options={}) { /* * Handle successful form posting - * + * * arguments: * - response: The JSON response object from the server * - options: The original options object provided by the client @@ -1004,7 +1004,7 @@ function handleFormSuccess(response, options) { target: msg_target, }); } - + if (response && response.info) { showAlertOrCache(response.info, cache, {style: 'info'}); } @@ -1020,7 +1020,7 @@ function handleFormSuccess(response, options) { if (persist) { // Instead of closing the form and going somewhere else, // reload (empty) the form so the user can input more data - + // Reset the status of the "submit" button if (options.modal) { $(options.modal).find('#modal-form-submit').prop('disabled', false); @@ -1065,7 +1065,7 @@ function clearFormErrors(options={}) { if (options && options.modal) { // Remove the individual error messages $(options.modal).find('.form-error-message').remove(); - + $(options.modal).find('.modal-content').removeClass('modal-error'); // Remove the "has error" class @@ -1086,12 +1086,12 @@ function clearFormErrors(options={}) { * * We need to know the unique ID of each item in the array, * and the array length must equal the length of the array returned from the server - * + * * arguments: * - response: The JSON error response from the server * - parent: The name of the parent field e.g. "items" * - options: The global options struct - * + * * options: * - nested: A map of nested ID values for the "parent" field * e.g. @@ -1102,7 +1102,7 @@ function clearFormErrors(options={}) { * 12 * ] * } - * + * */ function handleNestedErrors(errors, field_name, options={}) { @@ -1115,7 +1115,7 @@ function handleNestedErrors(errors, field_name, options={}) { } var nest_list = nest_list = options['nested'][field_name]; - + // Nest list must be provided! if (!nest_list) { console.warn(`handleNestedErrors missing nesting options for field '${fieldName}'`); @@ -1123,9 +1123,9 @@ function handleNestedErrors(errors, field_name, options={}) { } for (var idx = 0; idx < error_list.length; idx++) { - + var error_item = error_list[idx]; - + if (idx >= nest_list.length) { console.warn(`handleNestedErrors returned greater number of errors (${error_list.length}) than could be handled (${nest_list.length})`); break; @@ -1133,7 +1133,7 @@ function handleNestedErrors(errors, field_name, options={}) { // Extract the particular ID of the nested item var nest_id = nest_list[idx]; - + // Here, error_item is a map of field names to error messages for (sub_field_name in error_item) { @@ -1158,7 +1158,7 @@ function handleNestedErrors(errors, field_name, options={}) { row.after(html); } - + } // Find the target (nested) field @@ -1178,7 +1178,7 @@ function handleNestedErrors(errors, field_name, options={}) { /* * Display form error messages as returned from the server. - * + * * arguments: * - errors: The JSON error response from the server * - fields: The form data object @@ -1195,7 +1195,7 @@ function handleFormErrors(errors, fields={}, options={}) { clearFormErrors(options); var non_field_errors = null; - + if (options.modal) { non_field_errors = $(options.modal).find('#non-field-errors'); } else { @@ -1310,13 +1310,13 @@ function isFieldVisible(field, options) { /* * Attach callbacks to specified fields, * triggered after the field value is edited. - * + * * Callback function is called with arguments (name, field, options) */ function addFieldCallbacks(fields, options) { for (var idx = 0; idx < options.field_names.length; idx++) { - + var name = options.field_names[idx]; var field = fields[name]; @@ -1581,7 +1581,7 @@ function addSecondaryModal(field, fields, options) { /* * Initialize a single related-field - * + * * argument: * - modal: DOM identifier for the modal window * - name: name of the field e.g. 'location' @@ -1657,7 +1657,7 @@ function initializeRelatedField(field, fields, options={}) { query.search = params.term; query.offset = offset; query.limit = pageSize; - + // Allow custom run-time filter augmentation if ('adjustFilters' in field) { query = field.adjustFilters(query, options); @@ -1707,7 +1707,7 @@ function initializeRelatedField(field, fields, options={}) { // Extract 'instance' data passed through from an initial value // Or, use the raw 'item' data as a backup var data = item; - + if (item.element && item.element.instance) { data = item.element.instance; } @@ -1732,7 +1732,7 @@ function initializeRelatedField(field, fields, options={}) { // Extract 'instance' data passed through from an initial value // Or, use the raw 'item' data as a backup var data = item; - + if (item.element && item.element.instance) { data = item.element.instance; } @@ -1761,7 +1761,7 @@ function initializeRelatedField(field, fields, options={}) { // If a 'value' is already defined, grab the model info from the server if (field.value) { - + var pk = field.value; var url = `${field.api_url}/${pk}/`.replace('//', '/'); @@ -1806,7 +1806,7 @@ function initializeRelatedField(field, fields, options={}) { /* * Set the value of a select2 instace for a "related field", * e.g. with data returned from a secondary modal - * + * * arguments: * - name: The name of the field * - data: JSON data representing the model instance @@ -1852,7 +1852,7 @@ function searching() { /* * Render a "foreign key" model reference in a select2 instance. * Allows custom rendering with access to the entire serialized object. - * + * * arguments: * - name: The name of the field e.g. 'location' * - model: The name of the InvenTree model e.g. 'stockitem' @@ -1872,7 +1872,7 @@ function renderModelData(name, model, data, parameters, options) { var renderer = null; - // Find a custom renderer + // Find a custom renderer switch (model) { case 'company': renderer = renderCompany; @@ -1919,7 +1919,7 @@ function renderModelData(name, model, data, parameters, options) { default: break; } - + if (renderer != null) { html = renderer(name, data, parameters, options); } @@ -1954,16 +1954,16 @@ function getFieldName(name, options={}) { /* * Construct a single form 'field' for rendering in a form. - * + * * arguments: * - name: The 'name' of the field * - parameters: The field parameters supplied by the DRF OPTIONS method - * + * * options: - * - - * + * - + * * The function constructs a fieldset which mostly replicates django "crispy" forms: - * + * * - Field name * - Field (depends on specified field type) * - Field description (help text) @@ -2012,7 +2012,7 @@ function constructField(name, parameters, options={}) { if (group_options.collapsible) { html += `
    - + `; } else { html += `
    `; @@ -2044,7 +2044,7 @@ function constructField(name, parameters, options={}) { if (parameters.before) { html += parameters.before; } - + var hover_title = ''; if (parameters.help_text) { @@ -2062,7 +2062,7 @@ function constructField(name, parameters, options={}) { // Does this input deserve "extra" decorators? var extra = (parameters.icon != null) || (parameters.prefix != null) || (parameters.prefixRaw != null); - + // Some fields can have 'clear' inputs associated with them if (!parameters.required && !parameters.read_only) { switch (parameters.type) { @@ -2080,10 +2080,10 @@ function constructField(name, parameters, options={}) { break; } } - + if (extra) { html += `
    `; - + if (parameters.prefix) { html += `${parameters.prefix}`; } else if (parameters.prefixRaw) { @@ -2120,7 +2120,7 @@ function constructField(name, parameters, options={}) { html += `
    `; // controls html += `
    `; // form-group - + if (parameters.after) { html += parameters.after; } @@ -2145,17 +2145,17 @@ function constructLabel(name, parameters) { } var html = ``; return html; @@ -2164,11 +2164,11 @@ function constructLabel(name, parameters) { /* * Construct a form input based on the field parameters - * + * * arguments: * - name: The name of the field * - parameters: Field parameters returned by the OPTIONS method - * + * */ function constructInput(name, parameters, options={}) { @@ -2212,7 +2212,7 @@ function constructInput(name, parameters, options={}) { // Unsupported field type! break; } - + if (func != null) { html = func(name, parameters, options); } else { @@ -2499,14 +2499,14 @@ function constructRawInput(name, parameters) { /* * Construct a 'help text' div based on the field parameters - * + * * arguments: * - name: The name of the field * - parameters: Field parameters returned by the OPTIONS method - * + * */ function constructHelpText(name, parameters) { - + var html = `
    ${parameters.help_text}
    `; return html; @@ -2567,7 +2567,7 @@ function selectImportFields(url, data={}, options={}) { var headers = `{% trans "File Column" %}{% trans "Field Name" %}`; var html = ''; - + if (options.preamble) { html += options.preamble; } @@ -2580,7 +2580,7 @@ function selectImportFields(url, data={}, options={}) { fields: {}, preFormContent: html, onSubmit: function(fields, opts) { - + var columns = []; for (var idx = 0; idx < field_names.length; idx++) { @@ -2605,16 +2605,16 @@ function selectImportFields(url, data={}, options={}) { } }, error: function(xhr) { - + $(opts.modal).find('#modal-progress-spinner').hide(); - + switch (xhr.status) { case 400: handleFormErrors(xhr.responseJSON, fields, opts); break; default: $(opts.modal).modal('hide'); - + console.error(`upload error at ${opts.url}`); showApiError(xhr, opts.url); break; diff --git a/InvenTree/templates/js/translated/helpers.js b/InvenTree/templates/js/translated/helpers.js index dc40d1e30c..5747c2f71e 100644 --- a/InvenTree/templates/js/translated/helpers.js +++ b/InvenTree/templates/js/translated/helpers.js @@ -60,7 +60,7 @@ function imageHoverIcon(url) { /** * Renders a simple thumbnail image - * @param {String} url is the image URL + * @param {String} url is the image URL * @returns html tag */ function thumbnailImage(url, options={}) { @@ -131,7 +131,7 @@ function makeIconButton(icon, cls, pk, title, options={}) { /* * Render a progessbar! - * + * * @param value is the current value of the progress bar * @param maximum is the maximum value of the progress bar */ @@ -164,7 +164,7 @@ function makeProgressBar(value, maximum, opts={}) { var style = options.style || ''; var text = options.text; - + if (!text) { if (style == 'percent') { // Display e.g. "50%" @@ -247,13 +247,13 @@ function setupNotesField(element, url, options={}) { if (editable) { // Heading icons toolbar_icons.push('heading-1', 'heading-2', 'heading-3', '|'); - + // Font style toolbar_icons.push('bold', 'italic', 'strikethrough', '|'); - + // Text formatting toolbar_icons.push('unordered-list', 'ordered-list', 'code', 'quote', '|'); - + // Elements toolbar_icons.push('table', 'link', 'image'); } @@ -275,11 +275,11 @@ function setupNotesField(element, url, options={}) { if (!editable) { // Set readonly mde.codemirror.setOption('readOnly', true); - + // Hide the "edit" and "save" buttons $('#edit-notes').hide(); $('#save-notes').hide(); - + } else { mde.togglePreview(); @@ -289,7 +289,7 @@ function setupNotesField(element, url, options={}) { $('#save-notes').show(); // Show the toolbar - $(`#${element}`).next('.EasyMDEContainer').find('.editor-toolbar').show(); + $(`#${element}`).next('.EasyMDEContainer').find('.editor-toolbar').show(); mde.togglePreview(); }); @@ -313,4 +313,3 @@ function setupNotesField(element, url, options={}) { }); } } - diff --git a/InvenTree/templates/js/translated/label.js b/InvenTree/templates/js/translated/label.js index 388509c8bf..c95962e526 100644 --- a/InvenTree/templates/js/translated/label.js +++ b/InvenTree/templates/js/translated/label.js @@ -224,7 +224,7 @@ function selectLabel(labels, items, options={}) { /** * Present the user with the available labels, * and allow them to select which label to print. - * + * * The intent is that the available labels have been requested * (via AJAX) from the server. */ @@ -249,7 +249,7 @@ function selectLabel(labels, items, options={}) { } var plugin_selection = ''; - + if (plugins_enabled && plugins.length > 0) { plugin_selection =`
    diff --git a/InvenTree/templates/js/translated/modals.js b/InvenTree/templates/js/translated/modals.js index 464006ae12..128278dd23 100644 --- a/InvenTree/templates/js/translated/modals.js +++ b/InvenTree/templates/js/translated/modals.js @@ -20,7 +20,7 @@ /* * Create and display a new modal dialog - * + * * options: * - title: Form title to render * - submitText: Text to render on 'submit' button (default = "Submit") @@ -94,7 +94,7 @@ function createNewModal(options={}) { if (options.focus) { getFieldByName(modal_name, options.focus).focus(); } - + // Steal keyboard focus $(modal_name).focus(); @@ -122,7 +122,7 @@ function createNewModal(options={}) { // Simulate a click on the 'Submit' button $(modal_name).find('#modal-form-submit').click(); } - + return false; } }); @@ -163,10 +163,10 @@ function makeOptionsList(elements, textFunc, valueFunc, titleFunc) { * from the (assumed array) of elements. * For each element, we pass the element to the supplied functions, * which (in turn) generate display / value / title values. - * + * * Args: * - elements: List of elements - * - textFunc: Function which takes an element and generates the text to be displayed + * - textFunc: Function which takes an element and generates the text to be displayed * - valueFunc: optional function which takes an element and generates the value * - titleFunc: optional function which takes an element and generates a title */ @@ -214,7 +214,7 @@ function setFieldOptions(fieldName, optionList, options={}) { var addEmptyOption = options.addEmptyOption || true; - // If not appending, clear out the field... + // If not appending, clear out the field... if (!append) { field.find('option').remove(); } @@ -246,7 +246,7 @@ function reloadFieldOptions(fieldName, options) { * * Args: * - fieldName: The name of the field - * - options: + * - options: * -- url: Query url * -- params: Query params * -- value: A function which takes a returned option and returns the 'value' (if not specified, the `pk` field is used) @@ -289,7 +289,7 @@ function reloadFieldOptions(fieldName, options) { function enableField(fieldName, enabled, options={}) { /* Enable (or disable) a particular field in a modal. - * + * * Args: * - fieldName: The name of the field * - enabled: boolean enabled / disabled status @@ -366,7 +366,7 @@ function partialMatcher(params, data) { function attachSelect(modal) { - /* Attach 'select2' functionality to any drop-down list in the modal. + /* Attach 'select2' functionality to any drop-down list in the modal. * Provides search filtering for dropdown items */ @@ -391,7 +391,7 @@ function attachBootstrapCheckbox(modal) { function loadingMessageContent() { - /* Render a 'loading' message to display in a form + /* Render a 'loading' message to display in a form * when waiting for a response from the server */ @@ -404,7 +404,7 @@ function afterForm(response, options) { /* afterForm is called after a form is successfully submitted, * and the form is dismissed. * Used for general purpose functionality after form submission: - * + * * - Display a bootstrap alert (success / info / warning / danger) * - Run a supplied success callback function * - Redirect the browser to a different URL @@ -424,11 +424,11 @@ function afterForm(response, options) { if (response.info) { showAlertOrCache(response.info, cache, {style: 'info'}); } - + if (response.warning) { showAlertOrCache(response.warning, cache, {style: 'warning'}); } - + if (response.danger) { showAlertOrCache(response.danger, cache, {style: 'danger'}); } @@ -467,7 +467,7 @@ function modalEnable(modal, enable=true) { function modalSetTitle(modal, title='') { - /* Update the title of a modal form + /* Update the title of a modal form */ $(modal + ' #modal-title').html(title); } @@ -496,7 +496,7 @@ function modalSetCloseText(modal, text) { function modalSetButtonText(modal, submit_text, close_text) { /* Set the button text for a modal form - * + * * submit_text - text for the form submit button * close_text - text for the form dismiss button */ @@ -575,8 +575,8 @@ function renderErrorMessage(xhr) { function showAlertDialog(title, content, options={}) { /* Display a modal dialog message box. - * - * title - Title text + * + * title - Title text * content - HTML content of the dialog window */ @@ -600,7 +600,7 @@ function showAlertDialog(title, content, options={}) { function showQuestionDialog(title, content, options={}) { /* Display a modal dialog for user input (Yes/No confirmation dialog) - * + * * title - Title text * content - HTML content of the dialog window * options: @@ -609,7 +609,7 @@ function showQuestionDialog(title, content, options={}) { * cancel_text - Text for the cancel button (default = 'Cancel') * accept - Function to run if the user presses 'Accept' * cancel - Functino to run if the user presses 'Cancel' - */ + */ var modal = createNewModal({ title: title, @@ -632,9 +632,9 @@ function showQuestionDialog(title, content, options={}) { function openModal(options) { /* Open a modal form, and perform some action based on the provided options object: - * + * * options can contain: - * + * * modal - ID of the modal form element (default = '#modal-form') * title - Custom title for the form * content - Default content for the form panel @@ -743,7 +743,7 @@ function attachSecondaryModal(modal, options) { /* Attach a secondary modal form to the primary modal form. * Inserts a button into the primary form which, when clicked, * will launch the secondary modal to do /something/ and then return a result. - * + * * options: * field: Name of the field to attach to * label: Button text @@ -834,7 +834,7 @@ function attachButtons(modal, buttons) { function attachFieldCallback(modal, callback) { /* Attach a 'callback' function to a given field in the modal form. * When the value of that field is changed, the callback function is performed. - * + * * options: * - field: The name of the field to attach to * - action: A function to perform @@ -867,7 +867,7 @@ function attachCallbacks(modal, callbacks) { function handleModalForm(url, options) { /* Update a modal form after data are received from the server. * Manages POST requests until the form is successfully submitted. - * + * * The server should respond with a JSON object containing a boolean value 'form_valid' * Form submission repeats (after user interaction) until 'form_valid' = true */ @@ -952,8 +952,8 @@ function handleModalForm(url, options) { error: function(xhr) { // There was an error submitting form data via POST - $(modal).modal('hide'); - showAlertDialog('{% trans "Error posting form data" %}', renderErrorMessage(xhr)); + $(modal).modal('hide'); + showAlertDialog('{% trans "Error posting form data" %}', renderErrorMessage(xhr)); }, complete: function() { // TODO @@ -965,15 +965,15 @@ function handleModalForm(url, options) { function launchModalForm(url, options = {}) { /* Launch a modal form, and request data from the server to fill the form - * If the form data is returned from the server, calls handleModalForm() + * If the form data is returned from the server, calls handleModalForm() * * A successful request will return a JSON object with, at minimum, * an object called 'html_form' - * + * * If the request is NOT successful, displays an appropriate error message. - * + * * options: - * + * * modal - Name of the modal (default = '#modal-form') * data - Data to pass through to the AJAX request to fill the form * submit_text - Text for the submit button (default = 'Submit') diff --git a/InvenTree/templates/js/translated/model_renderers.js b/InvenTree/templates/js/translated/model_renderers.js index 1d88fb90d7..7be7c2d656 100644 --- a/InvenTree/templates/js/translated/model_renderers.js +++ b/InvenTree/templates/js/translated/model_renderers.js @@ -21,9 +21,9 @@ /* * This file contains functions for rendering various InvenTree database models, * in particular for displaying them in modal forms in a 'select2' context. - * + * * Each renderer is provided with three arguments: - * + * * - name: The 'name' of the model instance in the referring model * - data: JSON data which represents the model instance. Returned via a GET request. * - parameters: The field parameters provided via an OPTIONS request to the endpoint. @@ -40,7 +40,7 @@ function renderId(title, pk, parameters={}) { if ('render_pk' in parameters) { render = parameters['render_pk']; } - + if (render) { return `${title}: ${pk}`; } else { @@ -52,7 +52,7 @@ function renderId(title, pk, parameters={}) { // Renderer for "Company" model // eslint-disable-next-line no-unused-vars function renderCompany(name, data, parameters={}, options={}) { - + var html = select2Thumbnail(data.image); html += `${data.name} - ${data.description}`; @@ -68,11 +68,11 @@ function renderCompany(name, data, parameters={}, options={}) { function renderStockItem(name, data, parameters={}, options={}) { var image = blankImage(); - + if (data.part_detail) { image = data.part_detail.thumbnail || data.part_detail.image || blankImage(); } - + var render_part_detail = true; if ('render_part_detail' in parameters) { @@ -151,12 +151,12 @@ function renderStockLocation(name, data, parameters={}, options={}) { // eslint-disable-next-line no-unused-vars function renderBuild(name, data, parameters={}, options={}) { - + var image = null; if (data.part_detail && data.part_detail.thumbnail) { image = data.part_detail.thumbnail; - } + } var html = select2Thumbnail(image); @@ -173,7 +173,7 @@ function renderBuild(name, data, parameters={}, options={}) { function renderPart(name, data, parameters={}, options={}) { var html = select2Thumbnail(data.image); - + html += ` ${data.full_name || data.name}`; if (data.description) { @@ -245,9 +245,9 @@ function renderPurchaseOrder(name, data, parameters={}, options={}) { var prefix = global_settings.PURCHASEORDER_REFERENCE_PREFIX; var html = `${prefix}${data.reference}`; - + var thumbnail = null; - + if (data.supplier_detail) { thumbnail = data.supplier_detail.thumbnail || data.supplier_detail.image; @@ -268,10 +268,10 @@ function renderPurchaseOrder(name, data, parameters={}, options={}) { // Renderer for "SalesOrder" model // eslint-disable-next-line no-unused-vars function renderSalesOrder(name, data, parameters={}, options={}) { - + var prefix = global_settings.SALESORDER_REFERENCE_PREFIX; var html = `${prefix}${data.reference}`; - + var thumbnail = null; if (data.customer_detail) { @@ -335,7 +335,7 @@ function renderPartParameterTemplate(name, data, parameters={}, options={}) { if (data.units) { units = ` [${data.units}]`; } - + var html = `${data.name}${units}`; return html; @@ -377,7 +377,7 @@ function renderSupplierPart(name, data, parameters={}, options={}) { var supplier_image = null; var part_image = null; - + if (data.supplier_detail) { supplier_image = data.supplier_detail.image; } @@ -387,13 +387,13 @@ function renderSupplierPart(name, data, parameters={}, options={}) { } var html = ''; - + html += select2Thumbnail(supplier_image); - + if (data.part_detail) { html += select2Thumbnail(part_image); } - + if (data.supplier_detail) { html += ` ${data.supplier_detail.name} - ${data.SKU}`; } diff --git a/InvenTree/templates/js/translated/notification.js b/InvenTree/templates/js/translated/notification.js index 74079669ab..f88c8fbcbb 100644 --- a/InvenTree/templates/js/translated/notification.js +++ b/InvenTree/templates/js/translated/notification.js @@ -74,14 +74,14 @@ function showCachedAlerts() { } -/* +/* * Display an alert message at the top of the screen. * The message will contain a "close" button, * and also dismiss automatically after a certain amount of time. - * + * * arguments: * - message: Text / HTML content to display - * + * * options: * - style: alert style e.g. 'success' / 'warning' * - timeout: Time (in milliseconds) after which the message will be dismissed @@ -119,7 +119,7 @@ function showMessage(message, options={}) { ${icon} ${message} ${details} - +
    `; @@ -152,7 +152,7 @@ var notificationUpdateTic = 0; /** * The notification checker is initiated when the document is loaded. It checks if there are unread notifications * if unread messages exist the notification indicator is updated - * + * * options: * - force: set true to force an update now (if you got in focus for example) **/ @@ -182,10 +182,10 @@ function notificationCheck(force = false) { /** * handles read / unread buttons and UI rebuilding - * + * * arguments: * - btn: element that got clicked / fired the event -> must contain pk and target as attributes - * + * * options: * - panel_caller: this button was clicked in the notification panel **/ @@ -220,7 +220,7 @@ function updateNotificationReadState(btn, panel_caller=false) { /** * Returns the html for a read / unread button - * + * * arguments: * - pk: primary key of the notification * - state: current state of the notification (read / unread) -> just pass what you were handed by the api diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index 53dead4b60..f2a3684163 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -190,7 +190,7 @@ function completePurchaseOrder(order_id, options={}) { * Launches a modal form to mark a PurchaseOrder as 'cancelled' */ function cancelPurchaseOrder(order_id, options={}) { - + constructForm( `/api/order/po/${order_id}/cancel/`, { @@ -343,7 +343,7 @@ function createSalesOrder(options={}) { title: '{% trans "Add Customer" %}', fields: function() { var fields = companyFormFields(); - + fields.is_customer.value = true; return fields; @@ -531,7 +531,7 @@ function newSupplierPartFromOrderWizard(e) { createSupplierPart({ part: part, onSuccess: function(data) { - + // TODO: 2021-08-23 - This whole form wizard needs to be refactored. // In the future, use the API forms functionality to add the new item // For now, this hack will have to do... @@ -568,9 +568,9 @@ function newSupplierPartFromOrderWizard(e) { /** * Export an order (PurchaseOrder or SalesOrder) - * + * * - Display a simple form which presents the user with export options - * + * */ function exportOrder(redirect_url, options={}) { @@ -828,7 +828,7 @@ function orderParts(parts_list, options={}) { filters: supplier_part_filters, noResults: function(query) { return '{% trans "No matching supplier parts" %}'; - } + } }, null, opts); // Configure the "purchase order" field @@ -971,26 +971,26 @@ function newPurchaseOrderFromOrderWizard(e) { var dropdown = `#id-purchase-order-${supplier}`; var option = new Option(text, pk, true, true); - + $('#modal-form').find(dropdown).append(option).trigger('change'); } } ); } - }); + }); } /** * Receive stock items against a PurchaseOrder * Uses the PurchaseOrderReceive API endpoint - * + * * arguments: * - order_id, ID / PK for the PurchaseOrder instance * - line_items: A list of PurchaseOrderLineItems objects to be allocated - * + * * options: - * - + * - */ function receivePurchaseOrderItems(order_id, line_items, options={}) { @@ -1012,7 +1012,7 @@ function receivePurchaseOrderItems(order_id, line_items, options={}) { var thumb = thumbnailImage(line_item.part_detail.thumbnail); var quantity = (line_item.quantity || 0) - (line_item.received || 0); - + if (quantity < 0) { quantity = 0; } @@ -1022,14 +1022,14 @@ function receivePurchaseOrderItems(order_id, line_items, options={}) { - `; + `; var toggle_serials = ` `; - + // Quantity to Receive var quantity_input = constructField( `items_quantity_${pk}`, @@ -1363,7 +1363,7 @@ function editPurchaseOrderLineItem(e) { function removePurchaseOrderLineItem(e) { - /* Delete a purchase order line item in a modal form + /* Delete a purchase order line item in a modal form */ e = e || window.event; @@ -1371,7 +1371,7 @@ function removePurchaseOrderLineItem(e) { var src = e.target || e.srcElement; var url = $(src).attr('url'); - + // TODO: Migrate this to the API forms launchModalForm(url, { reload: true, @@ -1437,7 +1437,7 @@ function loadPurchaseOrderTable(table, options) { return html; } - }, + }, { field: 'supplier_detail', title: '{% trans "Supplier" %}', @@ -1491,11 +1491,11 @@ function loadPurchaseOrderTable(table, options) { switchable: true, sortable: false, formatter: function(value, row) { - + if (!row.responsible_detail) { return '-'; } - + var html = row.responsible_detail.name; if (row.responsible_detail.label == 'group') { @@ -1514,7 +1514,7 @@ function loadPurchaseOrderTable(table, options) { /** * Load a table displaying line items for a particular PurchasesOrder - * @param {String} table - HTML ID tag e.g. '#table' + * @param {String} table - HTML ID tag e.g. '#table' * @param {Object} options - options which must provide: * - order (integer PK) * - supplier (integer PK) @@ -1533,7 +1533,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) { for (var key in options.params) { filters[key] = options.params[key]; } - + var target = options.filter_target || '#filter-list-purchase-order-lines'; setupFilterList('purchaseorderlineitem', $(table), target, {download: true}); @@ -1651,7 +1651,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) { formatter: function(value, row, index, field) { if (row.part) { return imageHoverIcon(row.part_detail.thumbnail) + renderLink(row.part_detail.full_name, `/part/${row.part_detail.pk}/`); - } else { + } else { return '-'; } }, @@ -1752,7 +1752,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) { currency: currency } ); - + return formatter.format(total); } }, @@ -1789,14 +1789,14 @@ function loadPurchaseOrderLineItemTable(table, options={}) { }); }, sorter: function(valA, valB, rowA, rowB) { - + if (rowA.received == 0 && rowB.received == 0) { return (rowA.quantity > rowB.quantity) ? 1 : -1; } - + var progressA = parseFloat(rowA.received) / rowA.quantity; var progressB = parseFloat(rowB.received) / rowB.quantity; - + return (progressA < progressB) ? 1 : -1; } }, @@ -1821,9 +1821,9 @@ function loadPurchaseOrderLineItemTable(table, options={}) { title: '', formatter: function(value, row, index, field) { var html = `
    `; - + var pk = row.pk; - + if (options.allow_receive && row.received < row.quantity) { html += makeIconButton('fa-sign-in-alt icon-green', 'button-line-receive', pk, '{% trans "Receive line item" %}'); } @@ -1835,7 +1835,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) { } html += `
    `; - + return html; }, } @@ -1847,7 +1847,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) { /** * Load a table displaying lines for a particular PurchaseOrder - * + * * @param {String} table : HTML ID tag e.g. '#table' * @param {Object} options : object which contains: * - order {integer} : pk of the PurchaseOrder @@ -1872,7 +1872,7 @@ function loadPurchaseOrderExtraLineTable(table, options={}) { options.params.order = options.order; options.params.part_detail = true; options.params.allocations = true; - + var filters = loadTableFilters('purchaseorderextraline'); for (var key in options.params) { @@ -1948,15 +1948,15 @@ function loadPurchaseOrderExtraLineTable(table, options={}) { }, 0); var currency = (data.slice(-1)[0] && data.slice(-1)[0].price_currency) || 'USD'; - + var formatter = new Intl.NumberFormat( 'en-US', { - style: 'currency', + style: 'currency', currency: currency } ); - + return formatter.format(total); } } @@ -2359,21 +2359,21 @@ function loadSalesOrderShipmentTable(table, options={}) { /** * Allocate stock items against a SalesOrder - * + * * arguments: * - order_id: The ID / PK value for the SalesOrder * - lines: A list of SalesOrderLineItem objects to be allocated - * + * * options: * - source_location: ID / PK of the top-level StockLocation to source stock from (or null) */ function allocateStockToSalesOrder(order_id, line_items, options={}) { - + function renderLineItemRow(line_item, quantity) { // Function to render a single line_item row var pk = line_item.pk; - + var part = line_item.part_detail; var thumb = thumbnailImage(part.thumbnail || part.image); @@ -2449,7 +2449,7 @@ function allocateStockToSalesOrder(order_id, line_items, options={}) { '{% trans "Select Parts" %}', '{% trans "You must select at least one part to allocate" %}', ); - + return; } @@ -2757,12 +2757,12 @@ function loadSalesOrderAllocationTable(table, options={}) { /** * Display an "allocations" sub table, showing stock items allocated againt a sales order - * @param {*} index - * @param {*} row - * @param {*} element + * @param {*} index + * @param {*} row + * @param {*} element */ function showAllocationSubTable(index, row, element, options) { - + // Construct a sub-table element var html = `
    @@ -2798,7 +2798,7 @@ function showAllocationSubTable(index, row, element, options) { // Add callbacks for 'delete' buttons table.find('.button-allocation-delete').click(function() { var pk = $(this).attr('pk'); - + constructForm( `/api/order/so-allocation/${pk}/`, { @@ -2894,7 +2894,7 @@ function showFulfilledSubTable(index, row, element, options) { } var id = `fulfilled-table-${row.pk}`; - + var html = `
    @@ -2976,7 +2976,7 @@ function reloadTotal() { /** * Load a table displaying line items for a particular SalesOrder - * + * * @param {String} table : HTML ID tag e.g. '#table' * @param {Object} options : object which contains: * - order {integer} : pk of the SalesOrder @@ -3001,7 +3001,7 @@ function loadSalesOrderLineItemTable(table, options={}) { options.params.order = options.order; options.params.part_detail = true; options.params.allocations = true; - + var filters = loadTableFilters('salesorderlineitem'); for (var key in options.params) { @@ -3107,15 +3107,15 @@ function loadSalesOrderLineItemTable(table, options={}) { }, 0); var currency = (data.slice(-1)[0] && data.slice(-1)[0].sale_price_currency) || 'USD'; - + var formatter = new Intl.NumberFormat( 'en-US', { - style: 'currency', + style: 'currency', currency: currency } ); - + return formatter.format(total); } }, @@ -3138,7 +3138,7 @@ function loadSalesOrderLineItemTable(table, options={}) { return `${renderDate(row.order_detail.target_date)}`; } else { return '-'; - } + } } } ]; @@ -3166,17 +3166,17 @@ function loadSalesOrderLineItemTable(table, options={}) { }); }, sorter: function(valA, valB, rowA, rowB) { - + var A = rowA.allocated; var B = rowB.allocated; - + if (A == 0 && B == 0) { return (rowA.quantity > rowB.quantity) ? 1 : -1; } - + var progressA = parseFloat(A) / rowA.quantity; var progressB = parseFloat(B) / rowB.quantity; - + return (progressA < progressB) ? 1 : -1; } }, @@ -3391,11 +3391,11 @@ function loadSalesOrderLineItemTable(table, options={}) { // Extract the row data from the table! var idx = $(this).closest('tr').attr('data-index'); - + var row = $(table).bootstrapTable('getData')[idx]; - + var quantity = 1; - + if (row.allocated < row.quantity) { quantity = row.quantity - row.allocated; } @@ -3489,7 +3489,7 @@ function loadSalesOrderLineItemTable(table, options={}) { /** * Load a table displaying lines for a particular SalesOrder - * + * * @param {String} table : HTML ID tag e.g. '#table' * @param {Object} options : object which contains: * - order {integer} : pk of the SalesOrder @@ -3514,7 +3514,7 @@ function loadSalesOrderExtraLineTable(table, options={}) { options.params.order = options.order; options.params.part_detail = true; options.params.allocations = true; - + var filters = loadTableFilters('salesorderextraline'); for (var key in options.params) { @@ -3590,15 +3590,15 @@ function loadSalesOrderExtraLineTable(table, options={}) { }, 0); var currency = (data.slice(-1)[0] && data.slice(-1)[0].price_currency) || 'USD'; - + var formatter = new Intl.NumberFormat( 'en-US', { - style: 'currency', + style: 'currency', currency: currency } ); - + return formatter.format(total); } } diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 8d76b833a6..91a0cf80cd 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -209,7 +209,7 @@ function partFields(options={}) { help_text: '{% trans "Create initial supplier data for this part" %}', group: 'supplier', }; - + fields.supplier = { type: 'related field', model: 'company', @@ -221,14 +221,14 @@ function partFields(options={}) { api_url: '{% url "api-company-list" %}', group: 'supplier', }; - + fields.SKU = { type: 'string', - label: '{% trans "SKU" %}', + label: '{% trans "SKU" %}', help_text: '{% trans "Supplier stock keeping unit" %}', group: 'supplier', }; - + fields.manufacturer = { type: 'related field', model: 'company', @@ -240,7 +240,7 @@ function partFields(options={}) { api_url: '{% url "api-company-list" %}', group: 'supplier', }; - + fields.MPN = { type: 'string', label: '{% trans "MPN" %}', @@ -357,7 +357,7 @@ function duplicatePart(pk, options={}) { inventreeGet(`/api/part/${pk}/`, {}, { success: function(data) { - + var fields = partFields({ duplicate: pk, }); @@ -378,7 +378,7 @@ function duplicatePart(pk, options={}) { // By default, disable "is_template" when making a variant *of* a template data.is_template = false; } - + constructForm('{% url "api-part-list" %}', { method: 'POST', fields: fields, @@ -397,7 +397,7 @@ function duplicatePart(pk, options={}) { /* Toggle the 'starred' status of a part. * Performs AJAX queries and updates the display on the button. - * + * * options: * - button: ID of the button (default = '#part-star-icon') * - URL: API url of the object @@ -578,7 +578,7 @@ function makePartIcons(part) { } if (!part.active) { - html += `{% trans "Inactive" %} `; + html += `{% trans "Inactive" %} `; } return html; @@ -655,7 +655,7 @@ function loadPartVariantTable(table, partId, options={}) { } if (!row.active) { - html += `{% trans "Inactive" %}`; + html += `{% trans "Inactive" %}`; } return html; @@ -839,7 +839,7 @@ function loadPartParameterTable(table, url, options) { /* * Construct a table showing a list of purchase orders for a given part. - * + * * This requests API data from the PurchaseOrderLineItem endpoint */ function loadPartPurchaseOrderTable(table, part_id, options={}) { @@ -850,7 +850,7 @@ function loadPartPurchaseOrderTable(table, part_id, options={}) { options.params.base_part = part_id; options.params.part_detail = true; options.params.order_detail = true; - + var filters = loadTableFilters('purchaseorderlineitem'); for (var key in options.params) { @@ -1014,7 +1014,7 @@ function loadPartPurchaseOrderTable(table, part_id, options={}) { title: '', switchable: false, formatter: function(value, row) { - + if (row.received >= row.quantity) { // Already recevied return `{% trans "Received" %}`; @@ -1089,7 +1089,7 @@ function loadRelatedPartsTable(table, part_id, options={}) { title: '', switchable: false, formatter: function(value, row) { - + var html = `
    `; html += makeIconButton('fa-trash-alt icon-red', 'button-related-delete', row.pk, '{% trans "Delete part relationship" %}'); @@ -1234,7 +1234,7 @@ function partGridTile(part) { } var html = ` - +
    @@ -1258,7 +1258,7 @@ function partGridTile(part) {
    -
    + `; return html; @@ -1267,7 +1267,7 @@ function partGridTile(part) { function loadPartTable(table, url, options={}) { /* Load part listing data into specified table. - * + * * Args: * - table: HTML reference to the table * - url: Base URL for API query @@ -1340,7 +1340,7 @@ function loadPartTable(table, url, options={}) { display += makePartIcons(row); - return display; + return display; } }; @@ -1373,7 +1373,7 @@ function loadPartTable(table, url, options={}) { } else { return '{% trans "No category" %}'; } - } + } }; if (!options.params.ordering) { @@ -1386,7 +1386,7 @@ function loadPartTable(table, url, options={}) { field: 'unallocated_stock', title: '{% trans "Stock" %}', searchable: false, - formatter: function(value, row) { + formatter: function(value, row) { var link = '?display=part-stock'; if (row.in_stock) { @@ -1538,7 +1538,7 @@ function loadPartTable(table, url, options={}) { html = `
    `; data.forEach(function(row, index) { - + // Force a new row every 5 columns if ((index > 0) && (index % 5 == 0) && (index < data.length)) { html += `
    `; @@ -1552,7 +1552,7 @@ function loadPartTable(table, url, options={}) { return html; } }); - + if (options.buttons) { linkButtonsToSelection($(table), options.buttons); } @@ -1624,11 +1624,11 @@ function loadPartCategoryTable(table, options) { filters = loadTableFilters(filterKey); } - + var tree_view = options.allowTreeView && inventreeLoad('category-tree-view') == 1; if (tree_view) { - params.cascade = true; + params.cascade = true; } var original = {}; @@ -1652,7 +1652,7 @@ function loadPartCategoryTable(table, options) { queryParams: filters, disablePagination: tree_view, sidePagination: tree_view ? 'client' : 'server', - serverSort: !tree_view, + serverSort: !tree_view, search: !tree_view, name: 'category', original: original, @@ -1707,14 +1707,14 @@ function loadPartCategoryTable(table, options) { $('#view-category-list').removeClass('btn-secondary').addClass('btn-outline-secondary'); $('#view-category-tree').removeClass('btn-outline-secondary').addClass('btn-secondary'); - + table.treegrid({ treeColumn: 0, onChange: function() { table.bootstrapTable('resetView'); }, onExpand: function() { - + } }); } else { @@ -1862,7 +1862,7 @@ function loadPartTestTemplateTable(table, options) { } else { var text = '{% trans "This test is defined for a parent part" %}'; - return renderLink(text, `/part/${row.part}/tests/`); + return renderLink(text, `/part/${row.part}/tests/`); } } } @@ -1871,9 +1871,9 @@ function loadPartTestTemplateTable(table, options) { table.find('.button-test-edit').click(function() { var pk = $(this).attr('pk'); - + var url = `/api/part/test-template/${pk}/`; - + constructForm(url, { fields: { test_name: {}, @@ -1891,9 +1891,9 @@ function loadPartTestTemplateTable(table, options) { table.find('.button-test-delete').click(function() { var pk = $(this).attr('pk'); - + var url = `/api/part/test-template/${pk}/`; - + constructForm(url, { method: 'DELETE', title: '{% trans "Delete Test Result Template" %}', @@ -1975,14 +1975,14 @@ function loadPriceBreakTable(table, options) { sortable: true, formatter: function(value, row) { var html = value; - + html += `
    `; html += makeIconButton('fa-edit icon-blue', `button-${name}-edit`, row.pk, `{% trans "Edit ${human_name}" %}`); html += makeIconButton('fa-trash-alt icon-red', `button-${name}-delete`, row.pk, `{% trans "Delete ${human_name}" %}`); - + html += `
    `; - + return html; } }, diff --git a/InvenTree/templates/js/translated/report.js b/InvenTree/templates/js/translated/report.js index 49afbcb7ea..eac707f804 100644 --- a/InvenTree/templates/js/translated/report.js +++ b/InvenTree/templates/js/translated/report.js @@ -25,7 +25,7 @@ function selectReport(reports, items, options={}) { /** * Present the user with the available reports, * and allow them to select which report to print. - * + * * The intent is that the available report templates have been requested * (via AJAX) from the server. */ diff --git a/InvenTree/templates/js/translated/search.js b/InvenTree/templates/js/translated/search.js index 9758ee2ff9..9cc0fd83bf 100644 --- a/InvenTree/templates/js/translated/search.js +++ b/InvenTree/templates/js/translated/search.js @@ -34,11 +34,11 @@ function openSearchPanel() { // Prevent this button from actually submitting the form event.preventDefault(); - + panel.find('#search-input').val(''); clearSearchResults(); }); - + // Callback for the "close search" button panel.find('#search-close').click(function(event) { // Prevent this button from actually submitting the form @@ -67,11 +67,11 @@ function updateSearch() { } clearSearchResults(); - + if (searchText.length == 0) { return; } - + searchTextCurrent = searchText; // Cancel any previous AJAX requests @@ -83,7 +83,7 @@ function updateSearch() { // Show the "searching" text $('#offcanvas-search').find('#search-pending').show(); - + if (user_settings.SEARCH_PREVIEW_SHOW_PARTS) { var params = {}; @@ -122,7 +122,7 @@ function updateSearch() { if (user_settings.SEARCH_PREVIEW_SHOW_STOCK) { // Search for matching stock items - + var filters = { part_detail: true, location_detail: true, @@ -220,7 +220,7 @@ function updateSearch() { } ); } - + // Wait until all the pending queries are completed $.when.apply($, searchQueries).done(function() { $('#offcanvas-search').find('#search-pending').hide(); @@ -231,13 +231,13 @@ function updateSearch() { function clearSearchResults() { var panel = $('#offcanvas-search'); - + // Ensure the 'no results found' element is visible panel.find('#search-no-results').show(); // Ensure that the 'searching' element is hidden panel.find('#search-pending').hide(); - + // Delete any existing search results panel.find('#search-results').empty(); @@ -287,7 +287,7 @@ function addSearchQuery(key, title, query_url, query_params, render_func, render // Add a group of results to the list function addSearchResults(key, results, title, renderFunc, renderParams={}) { - + if (results.length == 0) { // Do not display this group, as there are no results return; @@ -297,7 +297,7 @@ function addSearchResults(key, results, title, renderFunc, renderParams={}) { // Ensure the 'no results found' element is hidden panel.find('#search-no-results').hide(); - + panel.find(`#search-results-wrapper-${key}`).append(`
    diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index 94f4d73ae1..ffac1d58c2 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -202,7 +202,7 @@ function stockItemFields(options={}) { } else { clearFormInput('supplier_part', opts); clearFormInput('purchase_price', opts); - + disableFormInput('supplier_part', opts); disableFormInput('purchase_price', opts); disableFormInput('purchase_price_currency', opts); @@ -315,11 +315,11 @@ function duplicateStockItem(pk, options) { delete data['serial']; options.data = data; - + options.create = true; options.fields = stockItemFields(options); options.groups = stockItemGroups(options); - + options.method = 'POST'; options.title = '{% trans "Duplicate Stock Item" %}'; @@ -342,7 +342,7 @@ function editStockItem(pk, options={}) { options.groups = stockItemGroups(options); options.title = '{% trans "Edit Stock Item" %}'; - + // Query parameters for retrieving stock item data options.params = { part_detail: true, @@ -443,7 +443,7 @@ function findStockItemBySerialNumber(part_id) { onSubmit: function(fields, opts) { var serial = getFormFieldValue('serial', fields['serial'], opts); - + serial = serial.toString().trim(); if (!serial) { @@ -540,7 +540,7 @@ function assignStockToCustomer(items, options={}) { for (var idx = 0; idx < items.length; idx++) { var item = items[idx]; - + var pk = item.pk; var part = item.part_detail; @@ -1069,7 +1069,7 @@ function adjustStock(action, items, options={}) { } }, onSubmit: function(fields, opts) { - + // Extract data elements from the form var data = { items: [], @@ -1094,7 +1094,7 @@ function adjustStock(action, items, options={}) { if (row.exists()) { item_pk_values.push(pk); - + var quantity = getFormFieldValue(`items_quantity_${pk}`, {}, opts); data.items.push({ @@ -1514,9 +1514,9 @@ function loadStockTestResultsTable(table, options) { function locationDetail(row, showLink=true) { - /* + /* * Function to display a "location" of a StockItem. - * + * * Complicating factors: A StockItem may not actually *be* in a location! * - Could be at a customer * - Could be installed in another stock item @@ -1568,7 +1568,7 @@ function loadStockTable(table, options) { /* Load data into a stock table with adjustable options. * Fetches data (via AJAX) and loads into a bootstrap table. * Also links in default button callbacks. - * + * * Options: * url - URL for the stock query * params - query params for augmenting stock data request @@ -1657,7 +1657,7 @@ function loadStockTable(table, options) { return html; } }; - + if (!options.params.ordering) { col['sortable'] = true; } @@ -1711,7 +1711,7 @@ function loadStockTable(table, options) { if (row.is_building) { html += makeIconBadge('fa-tools', '{% trans "Stock item is in production" %}'); - } + } if (row.sales_order) { // Stock item has been assigned to a sales order @@ -1760,7 +1760,7 @@ function loadStockTable(table, options) { return html; } }; - + columns.push(col); col = { @@ -1870,7 +1870,7 @@ function loadStockTable(table, options) { }); col = { - + field: 'supplier_part', title: '{% trans "Supplier Part" %}', visible: params['supplier_part_detail'] || false, @@ -1987,7 +1987,7 @@ function loadStockTable(table, options) { }); if (global_settings.BARCODE_ENABLE) { - $('#multi-item-barcode-scan-into-location').click(function() { + $('#multi-item-barcode-scan-into-location').click(function() { var selections = $(table).bootstrapTable('getSelections'); var items = []; @@ -2158,7 +2158,7 @@ function loadStockTable(table, options) { } -/* +/* * Display a table of stock locations */ function loadStockLocationTable(table, options) { @@ -2220,14 +2220,14 @@ function loadStockLocationTable(table, options) { $('#view-location-list').removeClass('btn-secondary').addClass('btn-outline-secondary'); $('#view-location-tree').removeClass('btn-outline-secondary').addClass('btn-secondary'); - + table.treegrid({ treeColumn: 1, onChange: function() { table.bootstrapTable('resetView'); }, onExpand: function() { - + } }); } else { @@ -2664,7 +2664,7 @@ function uninstallStockItem(installed_item_id, options={}) { }, preFormContent: function(opts) { var html = ''; - + if (installed_item_id == null) { html += `
    diff --git a/InvenTree/templates/js/translated/tables.js b/InvenTree/templates/js/translated/tables.js index 96c561b49b..a20978dd7d 100644 --- a/InvenTree/templates/js/translated/tables.js +++ b/InvenTree/templates/js/translated/tables.js @@ -15,7 +15,7 @@ /** * Reload a named table - * @param table + * @param table */ function reloadtable(table) { $(table).bootstrapTable('refresh'); @@ -25,7 +25,7 @@ function reloadtable(table) { /** * Download data from a table, via the API. * This requires a number of conditions to be met: - * + * * - The API endpoint supports data download (on the server side) * - The table is "flat" (does not support multi-level loading, etc) * - The table has been loaded using the inventreeTable() function, not bootstrapTable() @@ -60,16 +60,16 @@ function downloadTableData(table, opts={}) { }, onSubmit: function(fields, form_options) { var format = getFormFieldValue('format', fields['format'], form_options); - + // Hide the modal $(form_options.modal).modal('hide'); for (const [key, value] of Object.entries(query_params)) { url += `${key}=${value}&`; } - + url += `export=${format}`; - + location.href = url; } }); @@ -80,9 +80,9 @@ function downloadTableData(table, opts={}) { /** * Render a URL for display - * @param {String} text - * @param {String} url - * @param {object} options + * @param {String} text + * @param {String} url + * @param {object} options * @returns link text */ function renderLink(text, url, options={}) { @@ -134,8 +134,8 @@ function linkButtonsToSelection(table, buttons) { /** * Returns true if the input looks like a valid number - * @param {String} n - * @returns + * @param {String} n + * @returns */ function isNumeric(n) { return !isNaN(parseFloat(n)) && isFinite(n); @@ -251,7 +251,7 @@ function convertQueryParameters(params, filters) { delete params['original_search']; } - + return params; } diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html index 4660123e0d..620aaf3eff 100644 --- a/InvenTree/templates/navbar.html +++ b/InvenTree/templates/navbar.html @@ -95,9 +95,9 @@ {% include "spacer.html" %} {% include "spacer.html" %} {% endif %} - +
    - + {% block page_info %}
    {% block details_above %} @@ -57,7 +57,7 @@
    {% endblock %} - + {% block page_content %} diff --git a/InvenTree/templates/search.html b/InvenTree/templates/search.html index b43175b4b0..3a855b4c2e 100644 --- a/InvenTree/templates/search.html +++ b/InvenTree/templates/search.html @@ -40,4 +40,3 @@ - \ No newline at end of file diff --git a/InvenTree/templates/socialaccount/snippets/provider_list.html b/InvenTree/templates/socialaccount/snippets/provider_list.html index 268134b35f..d651bed0a6 100644 --- a/InvenTree/templates/socialaccount/snippets/provider_list.html +++ b/InvenTree/templates/socialaccount/snippets/provider_list.html @@ -5,13 +5,13 @@ {% for provider in socialaccount_providers %} {% if provider.id == "openid" %} {% for brand in provider.get_brands %} - {{brand.name}} {% endfor %} {% endif %} - {{provider.name}} {% endfor %} diff --git a/InvenTree/templates/status_codes.html b/InvenTree/templates/status_codes.html index 3b834a6e01..e48424477f 100644 --- a/InvenTree/templates/status_codes.html +++ b/InvenTree/templates/status_codes.html @@ -10,7 +10,7 @@ const {{ label }}Codes = { {% endfor %} }; -/* +/* * Render the status for a {{ label }} object. * Uses the values specified in "status_codes.py" * This function is generated by the "status_codes.html" template diff --git a/README.md b/README.md index 9ea268afb2..a8cbe0cb27 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ InvenTree is an open-source Inventory Management System which provides powerful low-level stock control and part tracking. The core of the InvenTree system is a Python/Django database backend which provides an admin interface (web-based) and a REST API for interaction with external interfaces and applications. -InvenTree is designed to be lightweight and easy to use for SME or hobbyist applications, where many existing stock management solutions are bloated and cumbersome to use. Updating stock is a single-action process and does not require a complex system of work orders or stock transactions. +InvenTree is designed to be lightweight and easy to use for SME or hobbyist applications, where many existing stock management solutions are bloated and cumbersome to use. Updating stock is a single-action process and does not require a complex system of work orders or stock transactions. Powerful business logic works in the background to ensure that stock tracking history is maintained, and users have ready access to stock level information. @@ -115,7 +115,7 @@ Refer to the [getting started guide](https://inventree.readthedocs.io/en/latest/ ## :iphone: Mobile App -InvenTree is supported by a [companion mobile app](https://inventree.readthedocs.io/en/latest/app/app/) which allows users access to stock control information and functionality. +InvenTree is supported by a [companion mobile app](https://inventree.readthedocs.io/en/latest/app/app/) which allows users access to stock control information and functionality.

    Android Play Store @@ -139,7 +139,7 @@ There are several options to deploy InvenTree. ## :wave: Contributing -Contributions are welcomed and encouraged. Please help to make this project even better! +Contributions are welcomed and encouraged. Please help to make this project even better! Refer to the [contribution page in the docs ](https://inventree.readthedocs.io/en/latest/contribute/) and check out [contributing.md](CONTRIBUTING.md). @@ -152,7 +152,7 @@ To contribute to the translation effort, navigate to the [InvenTree crowdin proj ## :money_with_wings: Sponsor -If you use InvenTree and find it to be useful, please consider making a donation toward its continued development. +If you use InvenTree and find it to be useful, please consider making a donation toward its continued development. [Donate via PayPal](https://paypal.me/inventree?locale.x=en_AU) diff --git a/docker/nginx.dev.conf b/docker/nginx.dev.conf index f3085ef57b..f76d239135 100644 --- a/docker/nginx.dev.conf +++ b/docker/nginx.dev.conf @@ -14,7 +14,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header CLIENT_IP $remote_addr; - + proxy_pass_request_headers on; proxy_redirect off; diff --git a/docker/production/docker-compose.yml b/docker/production/docker-compose.yml index 32fd3e0f48..f7549e702b 100644 --- a/docker/production/docker-compose.yml +++ b/docker/production/docker-compose.yml @@ -27,7 +27,7 @@ version: "3.8" # ------------------------ # By default, this docker-compose script targets the STABLE version of InvenTree, # image: inventree/inventree:stable -# +# # To run the LATEST (development) version of InvenTree, change the target image to: # image: inventree/inventree:latest # diff --git a/docker/production/nginx.prod.conf b/docker/production/nginx.prod.conf index a412d4094a..741cc7541a 100644 --- a/docker/production/nginx.prod.conf +++ b/docker/production/nginx.prod.conf @@ -14,7 +14,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header CLIENT_IP $remote_addr; - + proxy_pass_request_headers on; proxy_redirect off; diff --git a/setup.cfg b/setup.cfg index 7fcf9718fe..f1b744aa0f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ ignore = # - W605 - invalid escape sequence W605, # - E501 - line too long (82 characters) - E501, + E501, # - E722 - do not use bare except E722, # - C901 - function is too complex