mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-18 17:31:35 +00:00
Datasource-spezifische Suche für Projects/Assemblies sowie Parts umsetzen
This commit is contained in:
parent
dde91ff1c5
commit
ca6254cc53
39 changed files with 4695 additions and 494 deletions
|
|
@ -1,86 +1,230 @@
|
|||
{% macro settings_drodown(show_label_instead_icon = true) %}
|
||||
{% macro settings_drodown(show_label_instead_icon = true, searchFilter = null, isSearchList = false) %}
|
||||
|
||||
<div class="dropdown">
|
||||
<div class="dropdown" {{ stimulus_controller('elements/search_options', {
|
||||
'isSearchList': isSearchList or searchFilter is not null
|
||||
}) }}>
|
||||
<button class="btn dropdown-toggle my-2" type="button" id="navbar-search-options" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-bs-auto-close="true">
|
||||
{% if show_label_instead_icon %}{% trans %}search.options.label{% endtrans %}{% else %}<i class="fa-solid fa-gear"></i>{% endif %}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="navbar-search-options">
|
||||
<div class="px-2" style="width: max-content;">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_name" name="name" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_name" class="form-check-label justify-content-start">{% trans %}name.label{% endtrans %}</label>
|
||||
<div style="width: max-content;">
|
||||
<div class="mb-2 px-2">
|
||||
<label for="search_datasource" class="form-label">{% trans %}datasource{% endtrans %}</label>
|
||||
<select class="form-select form-select-sm" id="search_datasource" name="datasource"
|
||||
data-action="change->elements--search-options#onDatasourceChange"
|
||||
data-elements--search-options-target="datasource">
|
||||
<option value="parts" {% if (searchFilter and searchFilter.datasource == 'parts') or (not searchFilter and (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty)) %}selected{% endif %}>{% trans %}datasource.parts{% endtrans %}</option>
|
||||
<option value="projects" {% if (searchFilter and searchFilter.datasource == 'projects') or (not searchFilter and app.request.get('datasource') == 'projects') %}selected{% endif %}>{% trans %}datasource.projects{% endtrans %}</option>
|
||||
<option value="assemblies" {% if (searchFilter and searchFilter.datasource == 'assemblies') or (not searchFilter and app.request.get('datasource') == 'assemblies') %}selected{% endif %}>{% trans %}datasource.assemblies{% endtrans %}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_dbid" name="dbid" value="1" {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_dbid" class="form-check-label justify-content-start">{% trans %}id.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_category" name="category" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_category" class="form-check-label justify-content-start">{% trans %}category.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_description" name="description" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_description" class="form-check-label justify-content-start">{% trans %}description.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_mpn" name="mpn" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_mpn" class="form-check-label justify-content-start">{% trans %}part.edit.mpn{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_tags" name="tags" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_tags" class="form-check-label justify-content-start">{% trans %}tags.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_storelocation" name="storelocation" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_storelocation" class="form-check-label justify-content-start">{% trans %}storelocation.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_comment" name="comment" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_comment" class="form-check-label justify-content-start">{% trans %}comment.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_ipn" name="ipn" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_ipn" class="form-check-label justify-content-start">{% trans %}part.edit.ipn{% endtrans %}</label>
|
||||
</div>
|
||||
{% if true %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_supplierpartnr" name="ordernr" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_supplierpartnr" class="form-check-label justify-content-start">{% trans %}orderdetails.edit.supplierpartnr{% endtrans %}</label>
|
||||
<hr data-elements--search-options-target="divider" class="my-1">
|
||||
<div data-elements--search-options-target="partOptions" id="part-options-container">
|
||||
<div class="px-2">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_name" name="name" value="1"
|
||||
{% if (searchFilter and searchFilter.name) or (not searchFilter and (app.request.query.has('name') ? app.request.get('name') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_name" class="form-check-label justify-content-start">{% trans %}name.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_dbid" name="dbid" value="1"
|
||||
{% if (searchFilter and searchFilter.dbId) or (not searchFilter and app.request.get('dbid') == '1') %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_dbid" class="form-check-label justify-content-start">{% trans %}id.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_category" name="category" value="1"
|
||||
{% if (searchFilter and searchFilter.category) or (not searchFilter and (app.request.query.has('category') ? app.request.get('category') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_category" class="form-check-label justify-content-start">{% trans %}category.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_description" name="description" value="1"
|
||||
{% if (searchFilter and searchFilter.description) or (not searchFilter and (app.request.query.has('description') ? app.request.get('description') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_description" class="form-check-label justify-content-start">{% trans %}description.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_mpn" name="mpn" value="1"
|
||||
{% if (searchFilter and searchFilter.mpn) or (not searchFilter and (app.request.query.has('mpn') ? app.request.get('mpn') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_mpn" class="form-check-label justify-content-start">{% trans %}part.edit.mpn{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_tags" name="tags" value="1"
|
||||
{% if (searchFilter and searchFilter.tags) or (not searchFilter and (app.request.query.has('tags') ? app.request.get('tags') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_tags" class="form-check-label justify-content-start">{% trans %}tags.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_storelocation" name="storelocation" value="1"
|
||||
{% if (searchFilter and searchFilter.storelocation) or (not searchFilter and (app.request.query.has('storelocation') ? app.request.get('storelocation') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_storelocation" class="form-check-label justify-content-start">{% trans %}storelocation.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_comment" name="comment" value="1"
|
||||
{% if (searchFilter and searchFilter.comment is defined and searchFilter.comment) or (not searchFilter and (app.request.query.has('comment') ? app.request.get('comment') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_comment" class="form-check-label justify-content-start">{% trans %}comment.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_manufacturing_status" name="manufacturing_status" value="1"
|
||||
{% if (searchFilter and searchFilter.manufacturingStatus is defined and searchFilter.manufacturingStatus) or (not searchFilter and (app.request.query.has('manufacturing_status') ? app.request.get('manufacturing_status') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_manufacturing_status" class="form-check-label justify-content-start">{% trans %}part.edit.manufacturing_status{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_ipn" name="ipn" value="1"
|
||||
{% if (searchFilter and searchFilter.ipn) or (not searchFilter and (app.request.query.has('ipn') ? (app.request.get('ipn') == '1') : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_ipn" class="form-check-label justify-content-start">{% trans %}part.edit.ipn{% endtrans %}</label>
|
||||
</div>
|
||||
{% if true %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_ordernr" name="ordernr" value="1"
|
||||
{% if (searchFilter and searchFilter.ordernr) or (not searchFilter and (app.request.query.has('ordernr') ? app.request.get('ordernr') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_ordernr" class="form-check-label justify-content-start">{% trans %}orderdetails.edit.supplierpartnr{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_supplier" name="supplier" value="1"
|
||||
{% if (searchFilter and searchFilter.supplier) or (not searchFilter and app.request.get('supplier') == '1') %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_supplier" class="form-check-label justify-content-start">{% trans %}supplier.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if true %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_manufacturer" name="manufacturer" value="1"
|
||||
{% if (searchFilter and searchFilter.manufacturer) or (not searchFilter and app.request.get('manufacturer') == '1') %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_manufacturer" class="form-check-label justify-content-start">{% trans %}manufacturer.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if true %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_footprint" name="footprint" value="1"
|
||||
{% if (searchFilter and searchFilter.footprint) or (not searchFilter and app.request.get('footprint') == '1') %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_footprint" class="form-check-label justify-content-start">{% trans %}footprint.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly" name="assembly" value="1"
|
||||
{% if (searchFilter and searchFilter.assembly) or (not searchFilter and (app.request.query.has('assembly') ? app.request.get('assembly') == '1' : (app.request.get('datasource') == 'parts' or app.request.get('datasource') is empty))) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly" class="form-check-label justify-content-start">{% trans %}assembly.label{% endtrans %}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_supplier" name="supplier" value="1" {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_supplier" class="form-check-label justify-content-start">{% trans %}supplier.label{% endtrans %}</label>
|
||||
</div>
|
||||
|
||||
<div data-elements--search-options-target="assemblyOptions" id="assembly-options-container" class="d-none">
|
||||
<div class="px-2">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly_name" name="name" value="1"
|
||||
{% if (searchFilter and searchFilter.name) or (not searchFilter and (app.request.query.has('name') ? app.request.get('name') == '1' : app.request.get('datasource') == 'assemblies')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly_name" class="form-check-label justify-content-start">{% trans %}name.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly_dbid" name="dbid" value="1"
|
||||
{% if (searchFilter and searchFilter.dbId) or (not searchFilter and app.request.get('dbid') == '1') %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly_dbid" class="form-check-label justify-content-start">{% trans %}id.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly_ipn" name="ipn" value="1"
|
||||
{% if (searchFilter and searchFilter.ipn) or (not searchFilter and (app.request.query.has('ipn') ? (app.request.get('ipn') == '1' or app.request.get('iPN') == '1') : app.request.get('datasource') == 'assemblies')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly_ipn" class="form-check-label justify-content-start">{% trans %}assembly.edit.ipn{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly_description" name="description" value="1"
|
||||
{% if (searchFilter and searchFilter.description) or (not searchFilter and (app.request.query.has('description') ? app.request.get('description') == '1' : app.request.get('datasource') == 'assemblies')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly_description" class="form-check-label justify-content-start">{% trans %}description.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly_status" name="status" value="1"
|
||||
{% if (searchFilter and searchFilter.status) or (not searchFilter and (app.request.query.has('status') ? app.request.get('status') == '1' : app.request.get('datasource') == 'assemblies')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly_status" class="form-check-label justify-content-start">{% trans %}assembly.edit.status{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly_category" name="category" value="1"
|
||||
{% if (searchFilter and searchFilter.category) or (not searchFilter and (app.request.query.has('category') ? app.request.get('category') == '1' : app.request.get('datasource') == 'assemblies')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly_category" class="form-check-label justify-content-start">{% trans %}assembly.filter.parent{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly_notes" name="comment" value="1"
|
||||
{% if (searchFilter and searchFilter.comment) or (not searchFilter and (app.request.query.has('notes') or app.request.query.has('comment') ? (app.request.get('notes') == '1' or app.request.get('comment') == '1') : app.request.get('datasource') == 'assemblies')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_assembly_notes" class="form-check-label justify-content-start">{% trans %}assembly.filter.comment{% endtrans %}</label>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if true %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_manufacturer" name="manufacturer" value="1" {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_manufacturer" class="form-check-label justify-content-start">{% trans %}manufacturer.label{% endtrans %}</label>
|
||||
</div>
|
||||
|
||||
<div data-elements--search-options-target="projectOptions" id="project-options-container" class="d-none">
|
||||
<div class="px-2">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_project_name" name="name" value="1"
|
||||
{% if (searchFilter and searchFilter.name) or (not searchFilter and (app.request.query.has('name') ? app.request.get('name') == '1' : app.request.get('datasource') == 'projects')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_project_name" class="form-check-label justify-content-start">{% trans %}name.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_project_dbid" name="dbid" value="1"
|
||||
{% if (searchFilter and searchFilter.dbId) or (not searchFilter and app.request.get('dbid') == '1') %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_project_dbid" class="form-check-label justify-content-start">{% trans %}id.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_project_description" name="description" value="1"
|
||||
{% if (searchFilter and searchFilter.description) or (not searchFilter and (app.request.query.has('description') ? app.request.get('description') == '1' : app.request.get('datasource') == 'projects')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_project_description" class="form-check-label justify-content-start">{% trans %}description.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_project_notes" name="comment" value="1"
|
||||
{% if (searchFilter and searchFilter.comment) or (not searchFilter and (app.request.query.has('comment') or app.request.query.has('notes') ? (app.request.get('comment') == '1' or app.request.get('notes') == '1') : app.request.get('datasource') == 'projects')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_project_notes" class="form-check-label justify-content-start">{% trans %}project.filter.comment{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_project_status" name="status" value="1"
|
||||
{% if (searchFilter and searchFilter.status) or (not searchFilter and (app.request.query.has('status') ? app.request.get('status') == '1' : app.request.get('datasource') == 'projects')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_project_status" class="form-check-label justify-content-start">{% trans %}project.edit.status{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_project_category" name="category" value="1"
|
||||
{% if (searchFilter and searchFilter.category) or (not searchFilter and (app.request.query.has('category') ? app.request.get('category') == '1' : app.request.get('datasource') == 'projects')) %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="search_project_category" class="form-check-label justify-content-start">{% trans %}project.filter.parent{% endtrans %}</label>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if true %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_footprint" name="footprint" value="1" {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_footprint" class="form-check-label justify-content-start">{% trans %}footprint.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="search_assembly" name="assembly" value="1" {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="search_assembly" class="form-check-label justify-content-start">{% trans %}assembly.label{% endtrans %}</label>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="regex" name="regex" value="1" {{ stimulus_controller('elements/localStorage_checkbox') }}>
|
||||
<label for="regex" class="form-check-label justify-content-start">{% trans %}search.regexmatching{% endtrans %}</label>
|
||||
<div class="px-2">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="regex" name="regex" value="1"
|
||||
{% if (searchFilter and searchFilter.regex) or (not searchFilter and app.request.get('regex') == '1') %}checked{% endif %}
|
||||
{{ stimulus_controller('elements/sessionStorage_checkbox') }}>
|
||||
<label for="regex" class="form-check-label justify-content-start">{% trans %}search.regexmatching{% endtrans %}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# Render a complete usable search form including the form tags. mode can be "standalone" or "navbar" #}
|
||||
{% macro search_form(mode = "standalone") %}
|
||||
{% macro search_form(mode = "standalone", searchFilter = null, isSearchList = false) %}
|
||||
{% set is_navbar = (mode == "navbar") %}
|
||||
|
||||
<form action="{{ path('parts_search') }}" class="d-flex {% if is_navbar %}my-lg-0{% endif%} ms-auto" method="get"
|
||||
|
|
@ -89,7 +233,7 @@
|
|||
|
||||
{# Show the options left in navbar #}
|
||||
{% if is_navbar %}
|
||||
{{ _self.settings_drodown(is_navbar) }}
|
||||
{{ _self.settings_drodown(is_navbar, searchFilter, isSearchList) }}
|
||||
{% endif %}
|
||||
|
||||
<div {{ stimulus_controller('elements/part_search') }}
|
||||
|
|
@ -102,14 +246,15 @@
|
|||
data-autocomplete="{{ path('typeahead_parts', {'query': '__QUERY__'}) }}"
|
||||
data-detail-url="{{ path('part_info', {'id': '__ID__'}) }}"
|
||||
data-project-detail-url="{{ path('project_info', {'id': '__ID__'}) }}"
|
||||
data-assembly-detail-url="{{ path('assembly_info', {'id': '__ID__'}) }}">
|
||||
data-assembly-detail-url="{{ path('assembly_info', {'id': '__ID__'}) }}"
|
||||
data-initial-query="{{ searchFilter ? searchFilter.keyword : app.request.get('keyword') }}">
|
||||
|
||||
<input type="hidden" name="keyword" required {{ stimulus_target('elements/part_search', 'input') }}>
|
||||
<input type="hidden" name="keyword" required {{ stimulus_target('elements/part_search', 'input') }} value="{{ searchFilter ? searchFilter.keyword : app.request.get('keyword') }}">
|
||||
</div>
|
||||
|
||||
{# And right in the standalone mode #}
|
||||
{% if not is_navbar %}
|
||||
{{ _self.settings_drodown(is_navbar) }}
|
||||
{{ _self.settings_drodown(is_navbar, searchFilter, isSearchList) }}
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endmacro %}
|
||||
|
|
|
|||
|
|
@ -8,24 +8,32 @@
|
|||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="filter-common-tab" data-bs-toggle="tab" data-bs-target="#filter-common"><i class="fas fa-id-card fa-fw"></i> {% trans %}part.edit.tab.common{% endtrans %}</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-manufacturer-tab" data-bs-toggle="tab" data-bs-target="#filter-manufacturer"><i class="fas fa-industry fa-fw"></i> {% trans %}part.edit.tab.manufacturer{% endtrans %}</button>
|
||||
</li>
|
||||
{% if filterForm.manufacturer is defined or filterForm.manufacturing_status is defined %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-manufacturer-tab" data-bs-toggle="tab" data-bs-target="#filter-manufacturer"><i class="fas fa-industry fa-fw"></i> {% trans %}part.edit.tab.manufacturer{% endtrans %}</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-advanced-tab" data-bs-toggle="tab" data-bs-target="#filter-advanced"><i class="fas fa-shapes fa-fw"></i> {% trans %}part.edit.tab.advanced{% endtrans %}</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-stocks-tab" data-bs-toggle="tab" data-bs-target="#filter-stocks"><i class="fas fa-boxes fa-fw"></i> {% trans %}part.edit.tab.part_lots{% endtrans %}</button>
|
||||
</li>
|
||||
{% if filterForm.storelocation is defined or filterForm.minAmount is defined %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-stocks-tab" data-bs-toggle="tab" data-bs-target="#filter-stocks"><i class="fas fa-boxes fa-fw"></i> {% trans %}part.edit.tab.part_lots{% endtrans %}</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-attachments-tab" data-bs-toggle="tab" data-bs-target="#filter-attachments"><i class="fas fa-paperclip fa-fw"></i> {% trans %}part.edit.tab.attachments{% endtrans %}</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-orderdetails-tab" data-bs-toggle="tab" data-bs-target="#filter-orderdetails"><i class="fas fa-shopping-cart fa-fw"></i> {% trans %}part.edit.tab.orderdetails{% endtrans %}</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-parameters-tab" data-bs-toggle="tab" data-bs-target="#filter-parameters"><i class="fas fa-atlas fa-fw"></i> {% trans %}part.edit.tab.specifications{% endtrans %}</button>
|
||||
</li>
|
||||
{% if filterForm.supplier is defined or filterForm.orderdetailsCount is defined %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-orderdetails-tab" data-bs-toggle="tab" data-bs-target="#filter-orderdetails"><i class="fas fa-shopping-cart fa-fw"></i> {% trans %}part.edit.tab.orderdetails{% endtrans %}</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if filterForm.parameters is defined %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-parameters-tab" data-bs-toggle="tab" data-bs-target="#filter-parameters"><i class="fas fa-atlas fa-fw"></i> {% trans %}part.edit.tab.specifications{% endtrans %}</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if filterForm.project is defined %}
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="filter-projects-tab" data-bs-toggle="tab" data-bs-target="#filter-projects"><i class="fas fa-archive fa-fw"></i> {% trans %}project.labelp{% endtrans %}</button>
|
||||
|
|
@ -43,137 +51,143 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{{ form_start(filterForm, {"attr": {"data-controller": "helpers--form-cleanup", "data-action": "helpers--form-cleanup#submit"}}) }}
|
||||
{% if filterForm %}
|
||||
{{ form_start(filterForm, {"attr": {"data-controller": "helpers--form-cleanup", "data-action": "helpers--form-cleanup#submit"}}) }}
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active pt-3" id="filter-common" role="tabpanel" aria-labelledby="filter-common-tab" tabindex="0">
|
||||
{{ form_row(filterForm.name) }}
|
||||
{% if filterForm.description is defined %}{{ form_row(filterForm.description) }}{% endif %}
|
||||
{% if filterForm.category is defined %}{{ form_row(filterForm.category) }}{% endif %}
|
||||
{% if filterForm.footprint is defined %}{{ form_row(filterForm.footprint) }}{% endif %}
|
||||
{% if filterForm.tags is defined %}{{ form_row(filterForm.tags) }}{% endif %}
|
||||
{% if filterForm.status is defined %}{{ form_row(filterForm.status) }}{% endif %}
|
||||
{% if filterForm.comment is defined %}{{ form_row(filterForm.comment) }}{% endif %}
|
||||
{% if filterForm.notes is defined %}{{ form_row(filterForm.notes) }}{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-manufacturer" role="tabpanel" aria-labelledby="filter-manufacturer-tab" tabindex="0">
|
||||
{% if filterForm.manufacturer is defined %}{{ form_row(filterForm.manufacturer) }}{% endif %}
|
||||
{% if filterForm.manufacturing_status is defined %}{{ form_row(filterForm.manufacturing_status) }}{% endif %}
|
||||
{% if filterForm.manufacturer_product_number is defined %}{{ form_row(filterForm.manufacturer_product_number) }}{% endif %}
|
||||
{% if filterForm.manufacturer_product_url is defined %}{{ form_row(filterForm.manufacturer_product_url) }}{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-advanced" role="tabpanel" aria-labelledby="filter-advanced-tab" tabindex="0">
|
||||
{% if filterForm.favorite is defined %}{{ form_row(filterForm.favorite) }}{% endif %}
|
||||
{% if filterForm.needsReview is defined %}{{ form_row(filterForm.needsReview) }}{% endif %}
|
||||
{% if filterForm.measurementUnit is defined %}{{ form_row(filterForm.measurementUnit) }}{% endif %}
|
||||
{% if filterForm.partCustomState is defined %}{{ form_row(filterForm.partCustomState) }}{% endif %}
|
||||
{% if filterForm.mass is defined %}{{ form_row(filterForm.mass) }}{% endif %}
|
||||
{% if filterForm.dbId is defined %}{{ form_row(filterForm.dbId) }}{% endif %}
|
||||
{% if filterForm.ipn is defined %}{{ form_row(filterForm.ipn) }}{% endif %}
|
||||
{% if filterForm.gtin is defined %}{{ form_row(filterForm.gtin) }}{% endif %}
|
||||
{% if filterForm.lastModified is defined %}{{ form_row(filterForm.lastModified) }}{% endif %}
|
||||
{% if filterForm.addedDate is defined %}{{ form_row(filterForm.addedDate) }}{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-stocks" role="tabpanel" aria-labelledby="filter-stocks-tab" tabindex="0">
|
||||
{% if filterForm.storelocation is defined %}{{ form_row(filterForm.storelocation) }}{% endif %}
|
||||
{% if filterForm.minAmount is defined %}{{ form_row(filterForm.minAmount) }}{% endif %}
|
||||
{% if filterForm.amountSum is defined %}{{ form_row(filterForm.amountSum) }}{% endif %}
|
||||
{% if filterForm.lessThanDesired is defined %}{{ form_row(filterForm.lessThanDesired) }}{% endif %}
|
||||
{% if filterForm.lotCount is defined %}{{ form_row(filterForm.lotCount) }}{% endif %}
|
||||
{% if filterForm.lotExpirationDate is defined %}{{ form_row(filterForm.lotExpirationDate) }}{% endif %}
|
||||
{% if filterForm.lotDescription is defined %}{{ form_row(filterForm.lotDescription) }}{% endif %}
|
||||
{% if filterForm.lotOwner is defined %}{{ form_row(filterForm.lotOwner) }}{% endif %}
|
||||
{% if filterForm.lotNeedsRefill is defined %}{{ form_row(filterForm.lotNeedsRefill) }}{% endif %}
|
||||
{% if filterForm.lotUnknownAmount is defined %}{{ form_row(filterForm.lotUnknownAmount) }}{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-attachments" role="tabpanel" aria-labelledby="filter-attachments-tab" tabindex="0">
|
||||
{% if filterForm.attachmentsCount is defined %}{{ form_row(filterForm.attachmentsCount) }}{% endif %}
|
||||
{% if filterForm.attachmentType is defined %}{{ form_row(filterForm.attachmentType) }}{% endif %}
|
||||
{% if filterForm.attachmentName is defined %}{{ form_row(filterForm.attachmentName) }}{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-orderdetails" role="tabpanel" aria-labelledby="filter-orderdetails-tab" tabindex="0">
|
||||
{% if filterForm.supplier is defined %}{{ form_row(filterForm.supplier) }}{% endif %}
|
||||
{% if filterForm.orderdetailsCount is defined %}{{ form_row(filterForm.orderdetailsCount) }}{% endif %}
|
||||
{% if filterForm.obsolete is defined %}{{ form_row(filterForm.obsolete) }}{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-parameters" role="tabpanel" aria-labelledby="filter-parameters-tab" tabindex="0">
|
||||
{% if filterForm.parameters is defined %}
|
||||
{% import 'components/collection_type.macro.html.twig' as collection %}
|
||||
{{ form_row(filterForm.parametersCount) }}
|
||||
|
||||
<div {{ collection.controller(filterForm.parameters) }}>
|
||||
<table class="table table-striped table-sm" id="lots_table" {{ collection.target() }}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans %}specifications.property{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.symbol{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.value{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.unit{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.text{% endtrans %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for param in filterForm.parameters %}
|
||||
{{ form_widget(param) }}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<button type="button" class="btn btn-success" {{ collection.create_btn() }}>
|
||||
<i class="fas fa-plus-square fa-fw"></i>
|
||||
{% trans %}filter.constraint.add{% endtrans %}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if filterForm.project is defined %}
|
||||
<div class="tab-pane pt-3" id="filter-projects" role="tabpanel" aria-labelledby="filter-projects-tab" tabindex="0">
|
||||
{{ form_row(filterForm.project) }}
|
||||
{{ form_row(filterForm.bomQuantity) }}
|
||||
{{ form_row(filterForm.bomName) }}
|
||||
{{ form_row(filterForm.bomComment) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if filterForm.assembly is defined %}
|
||||
<div class="tab-pane pt-3" id="filter-assemblies" role="tabpanel" aria-labelledby="filter-assemblies-tab" tabindex="0">
|
||||
{{ form_row(filterForm.assembly) }}
|
||||
{{ form_row(filterForm.assemblyBomQuantity) }}
|
||||
{{ form_row(filterForm.assemblyBomName) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if filterForm.inBulkImportJob is defined %}
|
||||
<div class="tab-pane pt-3" id="filter-bulk-import" role="tabpanel" aria-labelledby="filter-bulk-import-tab" tabindex="0">
|
||||
{{ form_row(filterForm.inBulkImportJob) }}
|
||||
{{ form_row(filterForm.bulkImportJobStatus) }}
|
||||
{{ form_row(filterForm.bulkImportPartStatus) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active pt-3" id="filter-common" role="tabpanel" aria-labelledby="filter-common-tab" tabindex="0">
|
||||
{{ form_row(filterForm.name) }}
|
||||
{{ form_row(filterForm.description) }}
|
||||
{{ form_row(filterForm.category) }}
|
||||
{{ form_row(filterForm.footprint) }}
|
||||
{{ form_row(filterForm.tags) }}
|
||||
{{ form_row(filterForm.comment) }}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-manufacturer" role="tabpanel" aria-labelledby="filter-manufacturer-tab" tabindex="0">
|
||||
{{ form_row(filterForm.manufacturer) }}
|
||||
{{ form_row(filterForm.manufacturing_status) }}
|
||||
{{ form_row(filterForm.manufacturer_product_number) }}
|
||||
{{ form_row(filterForm.manufacturer_product_url) }}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-advanced" role="tabpanel" aria-labelledby="filter-advanced-tab" tabindex="0">
|
||||
{{ form_row(filterForm.favorite) }}
|
||||
{{ form_row(filterForm.needsReview) }}
|
||||
{{ form_row(filterForm.measurementUnit) }}
|
||||
{{ form_row(filterForm.partCustomState) }}
|
||||
{{ form_row(filterForm.mass) }}
|
||||
{{ form_row(filterForm.dbId) }}
|
||||
{{ form_row(filterForm.ipn) }}
|
||||
{{ form_row(filterForm.gtin) }}
|
||||
{{ form_row(filterForm.lastModified) }}
|
||||
{{ form_row(filterForm.addedDate) }}
|
||||
</div>
|
||||
{{ form_row(filterForm.submit) }}
|
||||
{{ form_row(filterForm.discard) }}
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-stocks" role="tabpanel" aria-labelledby="filter-stocks-tab" tabindex="0">
|
||||
{{ form_row(filterForm.storelocation) }}
|
||||
{{ form_row(filterForm.minAmount) }}
|
||||
{{ form_row(filterForm.amountSum) }}
|
||||
{{ form_row(filterForm.lessThanDesired) }}
|
||||
{{ form_row(filterForm.lotCount) }}
|
||||
{{ form_row(filterForm.lotExpirationDate) }}
|
||||
{{ form_row(filterForm.lotDescription) }}
|
||||
{{ form_row(filterForm.lotOwner) }}
|
||||
{{ form_row(filterForm.lotNeedsRefill) }}
|
||||
{{ form_row(filterForm.lotUnknownAmount) }}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-attachments" role="tabpanel" aria-labelledby="filter-attachments-tab" tabindex="0">
|
||||
{{ form_row(filterForm.attachmentsCount) }}
|
||||
{{ form_row(filterForm.attachmentType) }}
|
||||
{{ form_row(filterForm.attachmentName) }}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-orderdetails" role="tabpanel" aria-labelledby="filter-orderdetails-tab" tabindex="0">
|
||||
{{ form_row(filterForm.supplier) }}
|
||||
{{ form_row(filterForm.orderdetailsCount) }}
|
||||
{{ form_row(filterForm.obsolete) }}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane pt-3" id="filter-parameters" role="tabpanel" aria-labelledby="filter-parameters-tab" tabindex="0">
|
||||
{% import 'components/collection_type.macro.html.twig' as collection %}
|
||||
{{ form_row(filterForm.parametersCount) }}
|
||||
|
||||
<div {{ collection.controller(filterForm.parameters) }}>
|
||||
<table class="table table-striped table-sm" id="lots_table" {{ collection.target() }}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans %}specifications.property{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.symbol{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.value{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.unit{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.text{% endtrans %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for param in filterForm.parameters %}
|
||||
{{ form_widget(param) }}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<button type="button" class="btn btn-success" {{ collection.create_btn() }}>
|
||||
<i class="fas fa-plus-square fa-fw"></i>
|
||||
{% trans %}filter.constraint.add{% endtrans %}
|
||||
</button>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<button type="button" class="btn btn-danger" {{ stimulus_action('helpers/form_cleanup', 'clearAll') }}>{% trans %}filter.clear_filters{% endtrans %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if filterForm.project is defined %}
|
||||
<div class="tab-pane pt-3" id="filter-projects" role="tabpanel" aria-labelledby="filter-projects-tab" tabindex="0">
|
||||
{{ form_row(filterForm.project) }}
|
||||
{{ form_row(filterForm.bomQuantity) }}
|
||||
{{ form_row(filterForm.bomName) }}
|
||||
{{ form_row(filterForm.bomComment) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if filterForm.assembly is defined %}
|
||||
<div class="tab-pane pt-3" id="filter-assemblies" role="tabpanel" aria-labelledby="filter-assemblies-tab" tabindex="0">
|
||||
{{ form_row(filterForm.assembly) }}
|
||||
{{ form_row(filterForm.assemblyBomQuantity) }}
|
||||
{{ form_row(filterForm.assemblyBomName) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if filterForm.inBulkImportJob is defined %}
|
||||
<div class="tab-pane pt-3" id="filter-bulk-import" role="tabpanel" aria-labelledby="filter-bulk-import-tab" tabindex="0">
|
||||
{{ form_row(filterForm.inBulkImportJob) }}
|
||||
{{ form_row(filterForm.bulkImportJobStatus) }}
|
||||
{{ form_row(filterForm.bulkImportPartStatus) }}
|
||||
</div>
|
||||
{# Retain the query parameters of the search form if it is existing #}
|
||||
{% if searchFilter is defined %}
|
||||
{% for property, value in searchFilter|to_array %}
|
||||
<input type="hidden" name="{{ property }}" data-no-clear="true" value="{{ value }}">
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{{ form_row(filterForm.submit) }}
|
||||
{{ form_row(filterForm.discard) }}
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<button type="button" class="btn btn-danger" {{ stimulus_action('helpers/form_cleanup', 'clearAll') }}>{% trans %}filter.clear_filters{% endtrans %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Retain the query parameters of the search form if it is existing #}
|
||||
{% if searchFilter is defined %}
|
||||
{% for property, value in searchFilter|to_array %}
|
||||
<input type="hidden" name="{{ property }}" data-no-clear="true" value="{{ value }}">
|
||||
{% endfor %}
|
||||
|
||||
{{ form_end(filterForm) }}
|
||||
{% endif %}
|
||||
|
||||
{{ form_end(filterForm) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
{% extends "base.html.twig" %}
|
||||
|
||||
{% import "components/search.macro.html.twig" as search %}
|
||||
|
||||
{% block title %}
|
||||
{% trans %}parts_list.search.title{% endtrans %}: {{ keyword }}
|
||||
{% if datasource == 'assemblies' %}
|
||||
{% trans %}assembly.search.title{% endtrans %}
|
||||
{% elseif datasource == 'projects' %}
|
||||
{% trans %}project.search.title{% endtrans %}
|
||||
{% else %}
|
||||
{% trans %}parts_list.search.title{% endtrans %}
|
||||
{% endif %}
|
||||
: {{ keyword }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
@ -11,12 +20,27 @@
|
|||
<div class="accordion-header">
|
||||
<button class="accordion-button collapsed py-2" data-bs-toggle="collapse" data-bs-target="#searchInfo">
|
||||
<i class="fa-solid fa-magnifying-glass fa-fw"></i>
|
||||
{% trans %}parts_list.search.title{% endtrans %}: <b>{{ keyword }}</b>
|
||||
{% if datasource == 'assemblies' %}
|
||||
{% trans %}assembly.search.title{% endtrans %}
|
||||
{% elseif datasource == 'projects' %}
|
||||
{% trans %}project.search.title{% endtrans %}
|
||||
{% else %}
|
||||
{% trans %}parts_list.search.title{% endtrans %}
|
||||
{% endif %}
|
||||
: <b>{{ keyword }}</b>
|
||||
</button>
|
||||
</div>
|
||||
<div id="searchInfo" class="accordion-collapse collapse" data-bs-parent="#listAccordion">
|
||||
<div class="accordion-body">
|
||||
<h4>{% trans with {"%keyword%": keyword|escape} %}parts_list.search.searching_for{% endtrans %}</h4>
|
||||
<h4>
|
||||
{% if datasource == 'assemblies' %}
|
||||
{% trans with {"%keyword%": keyword|escape} %}parts_list.search.searching_for_assemblies{% endtrans %}
|
||||
{% elseif datasource == 'projects' %}
|
||||
{% trans with {"%keyword%": keyword|escape} %}parts_list.search.searching_for_projects{% endtrans %}
|
||||
{% else %}
|
||||
{% trans with {"%keyword%": keyword|escape} %}parts_list.search.searching_for{% endtrans %}
|
||||
{% endif %}
|
||||
</h4>
|
||||
{% trans %}parts_list.search_options.caption{% endtrans %}:
|
||||
|
||||
|
||||
|
|
@ -25,45 +49,98 @@
|
|||
<label class="form-check-label justify-content-start">{% trans %}name.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.category %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}category.label{% endtrans %}</label>
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.dbId %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}id.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% if datasource == 'parts' or datasource == 'assemblies' or datasource == 'projects' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.category %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">
|
||||
{% if datasource == 'parts' %}
|
||||
{% trans %}category.label{% endtrans %}
|
||||
{% elseif datasource == 'assemblies' %}
|
||||
{% trans %}assembly.filter.parent{% endtrans %}
|
||||
{% else %}
|
||||
{% trans %}project.filter.parent{% endtrans %}
|
||||
{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.description %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}description.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.mpn %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}part.edit.mpn{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.tags %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}tags.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.storelocation %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}storelocation.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.comment %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}comment.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.ordernr %}checked{% endif %}>
|
||||
<label for="search_supplierpartnr" class="form-check-label justify-content-start">{% trans %}orderdetails.edit.supplierpartnr{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.supplier %}checked{% endif %}>
|
||||
<label for="search_supplier" class="form-check-label justify-content-start">{% trans %}supplier.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.manufacturer %}checked{% endif %}>
|
||||
<label for="search_manufacturer" class="form-check-label justify-content-start">{% trans %}manufacturer.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.footprint %}checked{% endif %}>
|
||||
<label for="search_footprint" class="form-check-label justify-content-start">{% trans %}footprint.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% if datasource == 'parts' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.mpn %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}part.edit.mpn{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.tags %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}tags.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.storelocation %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}storelocation.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if datasource == 'assemblies' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.comment %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}assembly.filter.comment{% endtrans %}</label>
|
||||
</div>
|
||||
{% elseif datasource == 'projects' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.comment %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}project.filter.comment{% endtrans %}</label>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.comment %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}comment.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if datasource == 'parts' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.manufacturingStatus %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}part.edit.manufacturing_status{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if datasource == 'parts' or datasource == 'assemblies' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.ipn %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}part.edit.ipn{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if datasource == 'parts' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.ordernr %}checked{% endif %}>
|
||||
<label for="search_supplierpartnr" class="form-check-label justify-content-start">{% trans %}orderdetails.edit.supplierpartnr{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.supplier %}checked{% endif %}>
|
||||
<label for="search_supplier" class="form-check-label justify-content-start">{% trans %}supplier.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.manufacturer %}checked{% endif %}>
|
||||
<label for="search_manufacturer" class="form-check-label justify-content-start">{% trans %}manufacturer.label{% endtrans %}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.footprint %}checked{% endif %}>
|
||||
<label for="search_footprint" class="form-check-label justify-content-start">{% trans %}footprint.label{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if datasource == 'assemblies' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.status %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}assembly.edit.status{% endtrans %}</label>
|
||||
</div>
|
||||
{% elseif datasource == 'projects' %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.status %}checked{% endif %}>
|
||||
<label class="form-check-label justify-content-start">{% trans %}project.edit.status{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
<hr>
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" disabled {% if searchFilter.regex %}checked{% endif %}>
|
||||
|
|
@ -73,10 +150,13 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% include "parts/lists/_filter.html.twig" %}
|
||||
</div>
|
||||
|
||||
{% include "parts/lists/_parts_list.html.twig" %}
|
||||
|
||||
<form action="{{ path('parts_search') }}" method="get" class="d-none">
|
||||
<input type="hidden" name="keyword" value="{{ keyword }}">
|
||||
{{ search.settings_drodown(true, searchFilter, true) }}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue