mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-27 13:29:32 +00:00
Merge tag 'v2.2.1' into order-details
This commit is contained in:
commit
a64dec2985
90 changed files with 16636 additions and 1723 deletions
|
|
@ -22,9 +22,14 @@
|
|||
<div class="d-none" data-title="{{ current_page_title|trim|raw }}" {{ stimulus_controller('turbo/title') }}></div>
|
||||
|
||||
<div class="d-none" {{ stimulus_controller('turbo/locale_menu') }}>
|
||||
{% for locale in locale_menu %}
|
||||
{% set locales = settings_instance('localization').languageMenuEntries %}
|
||||
{% if locales is empty %}
|
||||
{% set locales = locale_menu %}
|
||||
{% endif %}
|
||||
|
||||
{% for locale in locales %}
|
||||
<a class="dropdown-item" data-turbo="false" data-turbo-frame="_top" href="{{ path(app.request.attributes.get('_route'),
|
||||
app.request.query.all|merge(app.request.attributes.get('_route_params'))|merge({'_locale': locale})) }}">
|
||||
{{ locale|language_name }} ({{ locale|upper }})</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -66,12 +66,6 @@
|
|||
{% block javascripts %}
|
||||
{{ encore_entry_script_tags('app') }}
|
||||
{{ encore_entry_script_tags('webauthn_tfa') }}
|
||||
|
||||
{# load translation files for ckeditor #}
|
||||
{% set two_chars_locale = app.request.locale|default("en")|slice(0,2) %}
|
||||
{% if two_chars_locale != "en" %}
|
||||
<script src="{{ asset("build/ckeditor_translations/" ~ two_chars_locale ~ ".js") }}"></script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body data-base-url="{{ path('homepage', {'_locale': app.request.locale}) }}" data-locale="{{ app.request.locale|default("en")|slice(0,2) }}">
|
||||
|
|
|
|||
|
|
@ -70,18 +70,20 @@
|
|||
{% endif %}
|
||||
|
||||
{% if show_presets %}
|
||||
{# This hidden field is there to ensure that none of the presets is submitted, if a user presses enter #}
|
||||
<input type="submit" name="group_admin_form[save]" class="d-none">
|
||||
<div class="col text-end">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{% trans %}permission.preset.button{% endtrans %}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><button type="submit" name="permission_preset" value="read_only" class="dropdown-item" >{% trans %}permission.preset.read_only{% endtrans%} <br><small class="text-muted">{% trans %}permission.preset.read_only.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="editor" class="dropdown-item" >{% trans %}permission.preset.editor{% endtrans%} <br><small class="text-muted">{% trans %}permission.preset.editor.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="admin" class="dropdown-item" >{% trans %}permission.preset.admin{% endtrans%} <br><small class="text-muted">{% trans %}permission.preset.admin.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="read_only" class="dropdown-item">{% trans %}permission.preset.read_only{% endtrans%} <br><small class="text-muted">{% trans %}permission.preset.read_only.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="editor" class="dropdown-item">{% trans %}permission.preset.editor{% endtrans%} <br><small class="text-muted">{% trans %}permission.preset.editor.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="admin" class="dropdown-item">{% trans %}permission.preset.admin{% endtrans%} <br><small class="text-muted">{% trans %}permission.preset.admin.desc{% endtrans%}</small></button></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><button type="submit" name="permission_preset" value="all_inherit" class="dropdown-item" >{% trans %}permission.preset.all_inherit{% endtrans%}<br><small class="text-muted">{% trans %}permission.preset.all_inherit.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="all_forbid" class="dropdown-item" >{% trans %}permission.preset.all_forbid{% endtrans%}<br><small class="text-muted">{% trans %}permission.preset.all_forbid.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="all_inherit" class="dropdown-item">{% trans %}permission.preset.all_inherit{% endtrans%}<br><small class="text-muted">{% trans %}permission.preset.all_inherit.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="all_forbid" class="dropdown-item">{% trans %}permission.preset.all_forbid{% endtrans%}<br><small class="text-muted">{% trans %}permission.preset.all_forbid.desc{% endtrans%}</small></button></li>
|
||||
<li><button type="submit" name="permission_preset" value="all_allow" class="dropdown-item" >{% trans %}permission.preset.all_allow{% endtrans%}<br><small class="text-muted">{% trans %}permission.preset.all_allow.desc{% endtrans%}</small></button></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -110,4 +112,4 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -214,11 +214,11 @@
|
|||
{% endmacro %}
|
||||
|
||||
{% macro parameters_table(parameters) %}
|
||||
<table class="table table-hover table-striped table-sm">
|
||||
<table class="table table-hover table-striped table-sm" style="table-layout: fixed;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans %}specifications.property{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.symbol{% endtrans %}</th>
|
||||
<th class="col-sm-1">{% trans %}specifications.symbol{% endtrans %}</th>
|
||||
<th>{% trans %}specifications.value{% endtrans %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -240,4 +240,4 @@
|
|||
{% else %}
|
||||
{{ datetime|format_datetime }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
{% endmacro %}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
{% block card_content %}
|
||||
{{ form_start(form) }}
|
||||
|
||||
{# Default submit to use when pressing enter. #}
|
||||
<input type="submit" name="label_dialog[update]" class="d-none">
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-bs-toggle="tab" id="common-tab" role="tab" aria-controls="common" aria-selected="true" href="#common"
|
||||
|
|
|
|||
|
|
@ -16,15 +16,18 @@
|
|||
</head>
|
||||
<body>
|
||||
{% for element in elements %}
|
||||
{# The page div ensures the page breaks, while the page-inner elements restrict the content to the page size. Sine dompdf 3.1.1 we cannot apply the position: absolute; to the page element directly. #}
|
||||
<div class="page">
|
||||
{% if options.barcodeType.none %}
|
||||
{% include "label_system/labels/label_page_none.html.twig" %}
|
||||
{% elseif options.barcodeType.is2D() %}
|
||||
{% include "label_system/labels/label_page_qr.html.twig" %}
|
||||
{% elseif options.barcodeType.is1D() %}
|
||||
{% include "label_system/labels/label_page_1d.html.twig" %}
|
||||
{% endif %}
|
||||
<div class="page-inner">
|
||||
{% if options.barcodeType.none %}
|
||||
{% include "label_system/labels/label_page_none.html.twig" %}
|
||||
{% elseif options.barcodeType.is2D() %}
|
||||
{% include "label_system/labels/label_page_qr.html.twig" %}
|
||||
{% elseif options.barcodeType.is1D() %}
|
||||
{% include "label_system/labels/label_page_1d.html.twig" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -3,17 +3,31 @@
|
|||
}
|
||||
|
||||
.page {
|
||||
/** We cannot apply the position: absolute trick here, because then dompdf will not respect the page break anymore **/
|
||||
|
||||
page-break-inside: avoid;
|
||||
page-break-before: avoid;
|
||||
page-break-after: always;
|
||||
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.page-inner {
|
||||
/* Absolute position prevents automatic page breaks */
|
||||
/*position: absolute;*/
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
page-break-inside: avoid;
|
||||
page-break-before: avoid;
|
||||
page-break-after: avoid;
|
||||
}
|
||||
|
||||
/* Last page should not break */
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
{% for name, parameters in part.groupedParameters %}
|
||||
{% if name is not empty %}<h5 class="mt-1">{{ name }}</h5>{% endif %}
|
||||
{{ helper.parameters_table(parameters) }}
|
||||
{% if not loop.last %}
|
||||
<hr class="my-0">
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if description_params is not empty %}
|
||||
|
|
@ -14,4 +17,4 @@
|
|||
{% if comment_params is not empty %}
|
||||
<h5 class="mt-1">{% trans %}parameters.auto_extracted_from_comment{% endtrans %}</h5>
|
||||
{{ helper.parameters_table(comment_params) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block card_content %}
|
||||
{% set can_build = buildHelper.projectBuildable(project, number_of_builds) %}
|
||||
{% set bom_empty = project.bomEntries | length == 0 %}
|
||||
{% set can_build = not bom_empty and buildHelper.projectBuildable(project, number_of_builds) %}
|
||||
{% import "components/projects.macro.html.twig" as project_macros %}
|
||||
|
||||
{% if project.status is not empty and project.status != "in_production" %}
|
||||
|
|
@ -17,8 +18,10 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="alert {% if can_build %}alert-success{% else %}alert-danger{% endif %}" role="alert">
|
||||
{% if not can_build %}
|
||||
<div class="alert {% if can_build %}alert-success{% elseif bom_empty%}alert-warning{% else %}alert-danger{% endif %}" role="alert">
|
||||
{% if bom_empty %}
|
||||
<h5><i class="fa-solid fa-circle-exclamation fa-fw"></i> {% trans %}project.builds.no_bom_entries{% endtrans %}</h5>
|
||||
{% elseif not can_build %}
|
||||
<h5><i class="fa-solid fa-circle-exclamation fa-fw"></i> {% trans %}project.builds.build_not_possible{% endtrans %}</h5>
|
||||
<b>{% trans with {"%number_of_builds%": number_of_builds} %}project.builds.following_bom_entries_miss_instock_n{% endtrans %}</b>
|
||||
<ul>
|
||||
|
|
@ -37,4 +40,4 @@
|
|||
{% include 'projects/build/_form.html.twig' %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{% set can_build = buildHelper.projectBuildable(project) %}
|
||||
{% set bom_empty = project.bomEntries | length == 0 %}
|
||||
{% set can_build = not bom_empty and buildHelper.projectBuildable(project) %}
|
||||
|
||||
{% import "components/projects.macro.html.twig" as project_macros %}
|
||||
|
||||
|
|
@ -8,8 +9,10 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="alert mt-2 {% if can_build %}alert-success{% else %}alert-danger{% endif %}" role="alert">
|
||||
{% if not can_build %}
|
||||
<div class="alert mt-2 {% if can_build %}alert-success{% elseif bom_empty%}alert-warning{% else %}alert-danger{% endif %}" role="alert">
|
||||
{% if bom_empty %}
|
||||
<h5><i class="fa-solid fa-circle-exclamation fa-fw"></i> {% trans %}project.builds.no_bom_entries{% endtrans %}</h5>
|
||||
{% elseif not can_build %}
|
||||
<h5><i class="fa-solid fa-circle-exclamation fa-fw"></i> {% trans %}project.builds.build_not_possible{% endtrans %}</h5>
|
||||
<b>{% trans %}project.builds.following_bom_entries_miss_instock{% endtrans %}</b>
|
||||
<ul>
|
||||
|
|
@ -19,7 +22,7 @@
|
|||
</ul>
|
||||
{% else %}
|
||||
<h5><i class="fa-solid fa-circle-check fa-fw"></i> {% trans %}project.builds.build_possible{% endtrans %}</h5>
|
||||
<span>{% trans with {"%max_builds%": buildHelper.maximumBuildableCount(project)} %}project.builds.number_of_builds_possible{% endtrans %}</span>
|
||||
<span>{% trans with {"%max_builds%": buildHelper.maximumBuildableCountAsString(project)} %}project.builds.number_of_builds_possible{% endtrans %}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
|
@ -27,7 +30,7 @@
|
|||
<div class="row mt-2">
|
||||
<div class="col-4">
|
||||
<div class="input-group mb-3">
|
||||
<input type="number" min="1" class="form-control" placeholder="{% trans %}project.builds.number_of_builds{% endtrans %}" name="n" required>
|
||||
<input type="number" min="1" class="form-control" placeholder="{% trans %}project.builds.number_of_builds{% endtrans %}" name="n" required value="1">
|
||||
<input type="hidden" name="_redirect" value="{{ uri_without_host(app.request) }}">
|
||||
<button class="btn btn-outline-secondary" type="submit" id="button-addon2">{% trans %}project.build.btn_build{% endtrans %}</button>
|
||||
</div>
|
||||
|
|
@ -37,4 +40,4 @@
|
|||
|
||||
{% if project.buildPart %}
|
||||
<p><b>{% trans %}project.builds.no_stocked_builds{% endtrans %}:</b> <a href="{{ entity_url(project.buildPart) }}">{{ project.buildPart.amountSum }}</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue