2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Replace mklint with djlint (#4746)

* remove markuplint

* remove dedicated html step - will be done by pre-commit

* add djlint for django template linting

* Fix T003: Endblock should have name

* Fix H013: Img tag should have an alt attribute

* Fix H014: Found extra blank lines

* Fix T003: Endblock should have name

* Fix H013: Img tag should have an alt attribute

* small fixes

* Fix T001: Variables should be wrapped in a single whitespace

* Fix T003: Endblock should have name

* small fixes

* fix form method

* add entry to contributing

* fix template changes

* another fix

* use current version
This commit is contained in:
Matthias Mair
2023-05-02 12:03:52 +02:00
committed by GitHub
parent 09fabff551
commit 10c3d101e8
145 changed files with 510 additions and 2589 deletions

View File

@ -5,7 +5,7 @@
{% block sidebar %}
{% include 'part/category_sidebar.html' %}
{% endblock %}
{% endblock sidebar %}
{% block breadcrumb_tree %}
<div id="breadcrumb-tree"></div>
@ -22,7 +22,7 @@
{% else %}
{% trans "Parts" %}
{% endif %}
{% endblock %}
{% endblock heading %}
{% block actions %}
{% if category and user.is_staff and roles.part_category.change %}
@ -69,7 +69,7 @@
</div>
{% endif %}
{% endif %}
{% endblock %}
{% endblock actions %}
{% block details_left %}
<table class='table table-striped table-condensed'>
@ -245,11 +245,11 @@
</div>
</div>
{% endblock %}
{% endblock page_content %}
{% block js_load %}
{{ block.super }}
{% endblock %}
{% endblock js_load %}
{% block js_ready %}
{{ block.super }}
@ -352,7 +352,6 @@
editCategory({{ category.pk }});
});
$('#cat-delete').click(function() {
deletePartCategory({{ category.pk }}, {
{% if category.parent %}
@ -384,4 +383,4 @@
// Enable left-hand navigation sidebar
enableSidebar('category');
{% endblock %}
{% endblock js_ready %}

View File

@ -22,4 +22,4 @@
</ul>
{% endif %}
{% endblock %}
{% endblock pre_form_content %}

View File

@ -21,4 +21,4 @@
</div>
{% endif %}
{% endblock %}
{% endblock pre_form_content %}

View File

@ -6,7 +6,7 @@
{% block sidebar %}
{% include 'part/part_sidebar.html' %}
{% endblock %}
{% endblock sidebar %}
{% block breadcrumb_tree %}
<div id="breadcrumb-tree"></div>
@ -431,11 +431,11 @@
</div>
</div>
{% endblock %}
{% endblock page_content %}
{% block js_load %}
{{ block.super }}
{% endblock %}
{% endblock js_load %}
{% block js_ready %}
{{ block.super }}
@ -733,7 +733,7 @@
$('#new-variant').click(function() {
duplicatePart(
{{ part.pk}},
{{ part.pk }},
{
variant: true,
}
@ -757,7 +757,6 @@
});
});
$("#part-order2").click(function() {
inventreeGet(
'{% url "api-part-detail" part.pk %}',
@ -926,4 +925,4 @@
}
});
{% endblock %}
{% endblock js_ready %}

View File

@ -86,4 +86,4 @@ $('.fieldselect').select2({
matcher: partialMatcher,
});
{% endblock %}
{% endblock js_ready %}

View File

@ -81,4 +81,4 @@ $('.currencyselect').select2({
dropdownAutoWidth: true,
});
{% endblock %}
{% endblock js_ready %}

View File

@ -30,4 +30,4 @@
</div>
{% endif %}
</div>
{% endblock %}
{% endblock form %}

View File

@ -96,4 +96,4 @@ $('.fieldselect').select2({
matcher: partialMatcher,
});
{% endblock %}
{% endblock js_ready %}

View File

@ -88,4 +88,4 @@ $('.currencyselect').select2({
dropdownAutoWidth: true,
});
{% endblock %}
{% endblock js_ready %}

View File

@ -7,7 +7,7 @@
{% url 'part-index' as url %}
{% trans "Return to Parts" as text %}
{% include "sidebar_link.html" with url=url text=text icon="fa-undo" %}
{% endblock %}
{% endblock sidebar %}
{% block content %}
{% trans "Import Parts from File" as header_text %}
@ -66,7 +66,7 @@
{% endif %}
</div>
</div>
{% endblock %}
{% endblock content %}
{% block js_ready %}
{{ block.super }}
@ -113,4 +113,4 @@ function downloadPartImportTemplate(options={}) {
});
}
{% endblock %}
{% endblock js_ready %}

View File

@ -11,7 +11,7 @@
{% else %}
{% inventree_title %} | {% trans "Part List" %}
{% endif %}
{% endblock %}
{% endblock page_title %}
{% block breadcrumbs %}
<a href='#' id='breadcrumb-tree-toggle' class="breadcrumb-item"><span class="fas fa-bars"></span></a>

View File

@ -6,15 +6,15 @@
{% block sidebar %}
{% include "part/part_sidebar.html" %}
{% endblock %}
{% endblock sidebar %}
{% block thumbnail %}
{% include "part/part_thumb.html" %}
{% endblock %}
{% endblock thumbnail %}
{% block heading %}
{{ part.full_name }}
{% endblock %}
{% endblock heading %}
{% block actions %}
<!-- Admin View -->
@ -104,7 +104,7 @@
</ul>
</div>
{% endif %}
{% endblock %}
{% endblock actions %}
{% block details %}
@ -170,7 +170,7 @@
<tr>
<td><span class='fas fa-info-circle'></span></td>
<td>{% trans "Description" %}</td>
<td>{{ part.description }}{% include "clip.html"%}</td>
<td>{{ part.description }}{% include "clip.html" %}</td>
</tr>
{% if part.variant_of %}
@ -269,7 +269,7 @@
<tr>
<td><span class='fas fa-tag'></span></td>
<td>{% trans "IPN" %}</td>
<td>{{ part.IPN }}{% include "clip.html"%}</td>
<td>{{ part.IPN }}{% include "clip.html" %}</td>
</tr>
{% endif %}
{% settings_value "PART_ENABLE_REVISION" as show_revision %}
@ -277,7 +277,7 @@
<tr>
<td><span class='fas fa-code-branch'></span></td>
<td>{% trans "Revision" %}</td>
<td>{{ part.revision }}{% include "clip.html"%}</td>
<td>{{ part.revision }}{% include "clip.html" %}</td>
</tr>
{% endif %}
{% if part.units %}
@ -298,7 +298,7 @@
<tr>
<td><span class='fas fa-key'></span></td>
<td>{% trans "Keywords" %}</td>
<td>{{ part.keywords }}{% include "clip.html"%}</td>
<td>{{ part.keywords }}{% include "clip.html" %}</td>
</tr>
{% endif %}
{% include "barcode_data.html" with instance=part %}
@ -444,7 +444,7 @@
$("#show-qr-code").click(function() {
showQRDialog(
'{% trans "Part QR Code" %}',
'{"part": {{ part.pk }}}',
'{"part": {{ part.pk }} }',
);
});
@ -567,7 +567,6 @@
)
});
function onSelectImage(response) {
// Callback when the image-selection modal form is displayed
// Populate the form with image data (requested via AJAX)
@ -591,7 +590,7 @@
title: 'Image',
searchable: true,
formatter: function(value, row, index, field) {
return "<img src='/media/" + value + "' class='grid-image'/>"
return "<img src='/media/" + value + "' alt='image' class='grid-image'/>"
}
}
],
@ -694,4 +693,4 @@
findStockItemBySerialNumber({{ part.pk }});
});
{% endblock %}
{% endblock js_ready %}

View File

@ -10,7 +10,7 @@
<table class='table table-striped table-condensed table-price-two'>
<tr>
<td><strong>{% trans 'Part' %}</strong></td>
<td>{{ part }}</td>
<td>{{ part }}</td>
</tr>
<tr>
<td><strong>{% trans 'Quantity' %}</strong></td>
@ -124,4 +124,4 @@
</div>
{% endif %}
<hr>
{% endblock %}
{% endblock pre_form_content %}

View File

@ -17,7 +17,7 @@
</div>
</div>
{% endif %}
<img class="part-thumb" id='part-image'
<img class="part-thumb" id='part-image' alt="{% trans 'Part image' %}"
{% if part.image %}
src="{{ part.image.preview.url }}"
{% else %}

View File

@ -233,7 +233,6 @@
</div>
{% endif %}
{% if part.assembly and part.has_bom %}
<a class="anchor" id="bom-cost"></a>
<div class='panel-heading'>

View File

@ -22,7 +22,7 @@ $('#part-pricing-refresh').click(function() {
// Internal Pricebreaks
{% if show_internal_price and roles.sales_order.view %}
initPriceBreakSet($('#internal-price-break-table'), {
part_id: {{part.id}},
part_id: {{ part.id }},
pb_human_name: 'internal price break',
pb_url_slug: 'internal-price',
pb_url: '{% url 'api-part-internal-price-list' %}',
@ -63,7 +63,7 @@ loadVariantPricingChart({
initPriceBreakSet(
$('#price-break-table'),
{
part_id: {{part.id}},
part_id: {{ part.id }},
pb_human_name: 'sale price break',
pb_url_slug: 'sale-price',
pb_url: "{% url 'api-part-sale-price-list' %}",

View File

@ -4,8 +4,7 @@
{{ block.super }}
{% endblock %}
{% endblock pre_form_content %}
{% block form %}
<form method='post' action='' class='js-modal-form' enctype='multipart/form-data'>
@ -18,4 +17,4 @@
</table>
</form>
{% endblock %}
{% endblock form %}

View File

@ -7,11 +7,11 @@
{% url "part-detail" part.id as url %}
{% trans "Return to BOM" as text %}
{% include "sidebar_link.html" with url=url text=text icon="fa-undo" %}
{% endblock %}
{% endblock sidebar %}
{% block heading %}
{% trans "Upload Bill of Materials" %}
{% endblock %}
{% endblock heading %}
{% block actions %}
<!--
@ -28,7 +28,7 @@
<button type='button' class='btn btn-success' id='bom-submit' style='display: none;'>
<span class='fas fa-sign-in-alt' id='bom-submit-icon'></span> {% trans "Submit BOM Data" %}
</button>
{% endblock %}
{% endblock actions %}
{% block page_info %}
<div class='panel-content'>

View File

@ -10,4 +10,4 @@
{% trans "Create a new variant part from this template" %}
</div>
{% endblock %}
{% endblock pre_form_content %}