diff --git a/config/packages/datatables.yaml b/config/packages/datatables.yaml index dc116f97..63d386ee 100644 --- a/config/packages/datatables.yaml +++ b/config/packages/datatables.yaml @@ -10,13 +10,12 @@ datatables: options: lengthMenu : [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]] pageLength: '%partdb.table.default_page_size%' # Set to -1 to disable pagination (i.e. show all rows) by default - #dom: "<'row' <'col-sm-12' tr>><'row' <'col-sm-6'l><'col-sm-6 text-right'pif>>" - dom: " <'row'<'col mb-2 input-group' B l> <'col mb-2' <'pull-end' p>>> - <'card' - rt - <'card-footer card-footer-table text-muted' i > - > - <'row'<'col mt-2 input-group' B l> <'col mt-2' <'pull-right' p>>>" + dom: " <'row' <'col mb-2 input-group flex-nowrap' B l > <'col-auto mb-2' < p >>> + <'card' + rt + <'card-footer card-footer-table text-muted' i > + > + <'row' <'col mt-2 input-group flex-nowrap' B l > <'col-auto mt-2' < p >>>" pagingType: 'simple_numbers' searching: true stateSave: true diff --git a/templates/parts/info/_main_infos.html.twig b/templates/parts/info/_main_infos.html.twig index 7bcdd355..34635b4e 100644 --- a/templates/parts/info/_main_infos.html.twig +++ b/templates/parts/info/_main_infos.html.twig @@ -1,96 +1,130 @@ {% import "helper.twig" as helper %} -
-
- {% include "parts/info/_picture.html.twig" %} -
-
-
- {% if part.manufacturer %} - {% if part.manufacturer.id is not null %} - {{ part.manufacturer.name}} +{% if part.manufacturer or part.manufacturerProductUrl or part.manufacturerProductNumber %} +
+ {% if part.manufacturer %} + {% if part.manufacturer.id is not null %} + {{ part.manufacturer.name}} + {% else %} + {{ part.manufacturer.name }} + {% endif %} + {% endif %} + {% if part.manufacturerProductUrl %} + + + {% if part.manufacturerProductNumber is not empty %} + {{ part.manufacturerProductNumber }} {% else %} - {{ part.manufacturer.name }} + {{ part.name }} {% endif %} - {% endif %} - {% if part.manufacturerProductUrl %} - - - {% if part.manufacturerProductNumber is not empty %} - {{ part.manufacturerProductNumber }} - {% else %} - {{ part.name }} - {% endif %} - - - {% else %} - {{ part.manufacturerProductNumber }} - {% endif %} -
-

{{ part.name }} - {# You need edit permission to use the edit button #} - {% if timeTravel is not null %} - - {% elseif is_granted('edit', part) %} - - {% endif %} -

-
{{ part.description|format_markdown(true) }}
-
- - {{ helper.structural_entity_link(part.category) }} -
-
- - {% if not part.amountUnknown %} - {# For known instock we can just show the label as normal #} - {{ part.amountSum | format_amount(part.partUnit) }} - {% else %} - {% if part.amountSum == 0.0 %} - ? - {% else %} - ≥{{ part.amountSum | format_amount(part.partUnit) }} - {% endif %} - {% endif %} - {% if part.expiredAmountSum > 0 %} - (+{{ part.expiredAmountSum }}) - {% endif %} - / - {{ part.minAmount | format_amount(part.partUnit) }} - - {% if part.notEnoughInstock %} -  {% trans %}part.info.amount.less_than_desired{% endtrans %} - {% endif %} -
-
- - {{ helper.structural_entity_link(part.footprint) }} -
+ +
+ {% elseif part.manufacturerProductNumber %} + {{ part.manufacturerProductNumber }} + {% endif %} + +{% endif %} - {% set min_order_amount = pricedetail_helper.minOrderAmount(part) %} - {% set max_order_amount = pricedetail_helper.maxDiscountAmount(part) %} - {% set max_order_price = pricedetail_helper.calculateAvgPrice(part, max_order_amount, app.user.currency ?? null) %} - {% set min_order_price = pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) %} - {% if max_order_price is not null %} -
+

+ {{ part.name }} + {# You need edit permission to use the edit button #} + {% if timeTravel is not null %} + + {% elseif is_granted('edit', part) %} + + {% endif %} +

+ +
+
+
+ {% trans %}description.label{% endtrans %} +
+
+ {{ part.description|format_markdown(true) }} +
+
+ +
+
+ {% trans %}category.label{% endtrans %} + +
+
+ {{ helper.structural_entity_link(part.category) }} +
+
+ +
+
+ {% trans %}part.part_lots.label{% endtrans %} + +
+
+ + {% if not part.amountUnknown %} + {# For known instock we can just show the label as normal #} + {{ part.amountSum | format_amount(part.partUnit) }} + {% else %} + {% if part.amountSum == 0.0 %} + ? + {% else %} + ≥{{ part.amountSum | format_amount(part.partUnit) }} + {% endif %} + {% endif %} + {% if part.expiredAmountSum > 0 %} + (+{{ part.expiredAmountSum }}) + {% endif %} + / + {{ part.minAmount | format_amount(part.partUnit) }} + + {% if part.notEnoughInstock %} +  {% trans %}part.info.amount.less_than_desired{% endtrans %} + {% endif %} +
+
+ +
+
+ {% trans %}footprint.label{% endtrans %} + +
+
+ {{ helper.structural_entity_link(part.footprint) }} +
+
+ + {% set min_order_amount = pricedetail_helper.minOrderAmount(part) %} + {% set max_order_amount = pricedetail_helper.maxDiscountAmount(part) %} + {% set max_order_price = pricedetail_helper.calculateAvgPrice(part, max_order_amount, app.user.currency ?? null) %} + {% set min_order_price = pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) %} + {% if max_order_price is not null %} +
+
+
+
{{ max_order_price | format_money(app.user.currency ?? null) }} {% if min_order_price is not null and min_order_amount < max_order_amount %} - {% if max_order_price is not null %}{{ min_order_price | format_money(app.user.currency ?? null) }}{% else %}???{% endif %} {% endif %} - - - {% endif %} - {# - {% if part.comment != "" %} -
- -
- {{ part.comment|nl2br }} -
-
- {% endif %} #} -
-
\ No newline at end of file + + +
+ {% endif %} + + {# {% if part.comment != "" %} +
+
+ {% trans %}comment.label{% endtrans %} + +
+
+ >{{ part.comment|nl2br }} +
+
+ {% endif %} #} + + diff --git a/templates/parts/info/show_part_info.html.twig b/templates/parts/info/show_part_info.html.twig index 41daba20..96b5e209 100644 --- a/templates/parts/info/show_part_info.html.twig +++ b/templates/parts/info/show_part_info.html.twig @@ -15,174 +15,177 @@ {% endblock %} {% block card_title %} - - {% trans %}part.info.title{% endtrans %} "{{ part.name }}" - {% if timeTravel != null %} - ({{ timeTravel | format_datetime('short') }}) - {% endif %} - {% if part.projectBuildPart %} - ({{ entity_type_label(part.builtProject) }}: {{ part.builtProject.name }}) - {% endif %} -
+ + + {% trans %}part.info.title{% endtrans %} "{{ part.name }}" + {% if timeTravel != null %} + ({{ timeTravel | format_datetime('short') }}) + {% endif %} + {% if part.projectBuildPart %} + ({{ entity_type_label(part.builtProject) }}: {{ part.builtProject.name }}) + {% endif %} + + {% trans %}id.label{% endtrans %}: {{ part.id }} {% if part.ipn is not empty %}({{ part.ipn }}){% endif %} -
+ {% endblock %} {% block card_content %}
-
+
+ {% include "parts/info/_picture.html.twig" %} +
+ +
{% include "parts/info/_main_infos.html.twig" %}
-
+
{% include "parts/info/_sidebar.html.twig" %}
-
-
- +
+ {% if part.comment is not empty %} +
+
+ {{ part.comment|format_markdown }}
- {% endif %} - -
- {% include "parts/info/_part_lots.html.twig" %}
+ {% endif %} - {% if part.attachments is not empty %} -
- {% include "parts/info/_attachments_info.html.twig" %} -
- {% endif %} +
+ {% include "parts/info/_part_lots.html.twig" %} +
- {% if part.orderdetails is not empty %} -
- {% include "parts/info/_order_infos.html.twig" %} + {% if part.attachments is not empty %} +
+ {% include "parts/info/_attachments_info.html.twig" %}
- {% endif %} + {% endif %} - {% if part.associatedPartsAll is not empty %} -
- {% include "parts/info/_associations.html.twig" %} -
- {% endif %} + {% if part.orderdetails is not empty %} +
+ {% include "parts/info/_order_infos.html.twig" %} +
+ {% endif %} -
- {% include "parts/info/_projects.html.twig" %} + {% if part.associatedPartsAll is not empty %} +
+ {% include "parts/info/_associations.html.twig" %}
+ {% endif %} -
- {% include "parts/info/_history.html.twig" %} +
+ {% include "parts/info/_projects.html.twig" %} +
+ +
+ {% include "parts/info/_history.html.twig" %} +
+ +
+ {% include "parts/info/_tools.html.twig" %} +
+ + {% if part.parameters is not empty or description_params is not empty or comment_params is not empty %} +
+ {% include "parts/info/_specifications.html.twig" %}
+ {% endif %} -
- {% include "parts/info/_tools.html.twig" %} -
+
- {% if part.parameters is not empty or description_params is not empty or comment_params is not empty %} -
- {% include "parts/info/_specifications.html.twig" %} -
- {% endif %} + {% include "parts/info/_extended_infos.html.twig" %} -
- - {% include "parts/info/_extended_infos.html.twig" %} - -
-{% endblock %} \ No newline at end of file +{% endblock %}