diff --git a/templates/Parts/info/_sidebar.html.twig b/templates/Parts/info/_sidebar.html.twig index da670aa6..3b1bfd48 100644 --- a/templates/Parts/info/_sidebar.html.twig +++ b/templates/Parts/info/_sidebar.html.twig @@ -1,160 +1,46 @@ +{% import "helper.twig" as helper %} +
{{ part.lastModified | localizeddate("short") }} -
- +
+ {{ part.addedDate | localizeddate("short") }}
- -
- -
-
- -
- -
-
- - - -
-
-
-
+{# Needs Review tag #} +{% if part.needsReview %} +
+
+ {% trans %}part.needs_review.badge{% endtrans %} +
- +{% endif %} -
- -
-
- -
- -
-
- - - -
-
-
-
+{# Favorite Status tag #} +{% if part.favorite %} +
+
+ {% trans %}part.favorite.badge{% endtrans %} +
- +{% endif %} - -{# -{if $can_order_read && !$instock_unknown} -
- -
-
- {if $manual_order_exists} - - - {else} - {if $auto_order_exists} - {% trans %}The part is listed under "Parts marked for ordering", because the in stock amount is less than the minimum in stock value.{% endtrans %} - {else} - -
-
- - - -
- {/if} - {/if} -
+{% if part.obsolete %} +
+
+ {% trans %}part.obsolete.badge{% endtrans %} +
- -{/if} -#} - -{# -
- {if $can_generate_barcode} - {if count($barcode_profiles) > 0} - - - -
- - - - +{% endif %} +{# Show tags #} +{% if part.tags is not empty %} +
+
+ {{ helper.string_to_tags(part.tags) }} +
- {else} - - - - - - - {/if} - - -

-{/if} - -
- -
- -

- -
- -
-
-#} \ No newline at end of file +{% endif %} \ No newline at end of file diff --git a/templates/helper.twig b/templates/helper.twig index b1cd6b3e..b47a2c76 100644 --- a/templates/helper.twig +++ b/templates/helper.twig @@ -46,4 +46,10 @@ {% elseif not attachment_helper.fileExisting(attachment) %} {% endif %} +{% endmacro %} + +{% macro string_to_tags(string, class="badge badge-info") %} + {% for tag in string|split(',') %} + {{ tag | trim }} + {% endfor %} {% endmacro %} \ No newline at end of file