From e0141025dbbb37f6ac7da66dc2987425b2e38603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 31 Dec 2024 13:23:15 +0100 Subject: [PATCH] Improved styling of the buttons and added a badge to show a hint --- .../search/part_search.html.twig | 55 ++++++++++--------- translations/messages.en.xlf | 12 ++++ 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/templates/info_providers/search/part_search.html.twig b/templates/info_providers/search/part_search.html.twig index f9e697c6..5c4af6f2 100644 --- a/templates/info_providers/search/part_search.html.twig +++ b/templates/info_providers/search/part_search.html.twig @@ -52,8 +52,6 @@ {% trans %}part.table.manufacturingStatus{% endtrans %} {% trans %}info_providers.table.provider.label{% endtrans %} - - @@ -108,26 +106,7 @@
{{ dto.provider_id }} - - {# TODO: would like to have a sort of "part exists!" text here, but don't know how to style it - also it would be nice to have these two buttons closer together, but when I put them in one cell - they sometimes stack#} - {% if localPart is not null %} - - - - {% endif %} - - - {% if localPart is not null %} - - - - {% endif %} - - + {% if update_target %} {# We update an existing part #} {% set href = path('info_providers_update_part', @@ -137,10 +116,34 @@ {'providerKey': dto.provider_key, 'providerId': dto.provider_id}) %} {% endif %} - - - + {# If we have no local part, then we can just show the create button #} + {% if localPart is null %} + + + + {% else %} {# Otherwise add a button group with all three buttons #} + + + {% trans %}info_providers.search.existing_part_found.short{% endtrans %} + + +
+ + + + + + + + + +
+ + {% endif %} {% endfor %} diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index bd3484e9..655ec91a 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -12239,5 +12239,17 @@ Please note, that you can not impersonate a disabled user. If you try you will g Edit existing part + + + info_providers.search.existing_part_found.short + Part already existing + + + + + info_providers.search.existing_part_found + This part (or a very similar one) was already found in the database. Please check if it is the same and if you want to create it again! + +