diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php index 4df37e50..0b614a34 100644 --- a/src/Controller/PartController.php +++ b/src/Controller/PartController.php @@ -52,7 +52,7 @@ class PartController extends AbstractController $filename = $part->getMasterPictureFilename(true); - return $this->render('Parts/show_part_info.html.twig', + return $this->render('Parts/info/show_part_info.html.twig', [ 'part' => $part, 'main_image' => $attachmentFilenameService->attachmentPathToAbsolutePath($filename), diff --git a/templates/Parts/info/_main_infos.html.twig b/templates/Parts/info/_main_infos.html.twig new file mode 100644 index 00000000..e43ebe3a --- /dev/null +++ b/templates/Parts/info/_main_infos.html.twig @@ -0,0 +1,47 @@ +
+
+ Part main image +
+
+
{{ part.manufacturer.name ?? ""}}
+

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

+
{{ part.description|bbCode }}
+
+ + {{ part.category.fullPath ?? "-"}} +
+
+ + {{ part.storelocation.fullPath ?? "-"}} +
+
+ + {{ part.instock }} + / + {{ part.mininstock }} + +
+
+ + {{ part.footprint.fullPath ?? "-"}} +
+
+ + {{ "TODO" }} +
+ {# + {% if part.comment != "" %} +
+ +
+ {{ part.comment|nl2br }} +
+
+ {% endif %} #} +
+
\ No newline at end of file diff --git a/templates/Parts/_order_infos.html.twig b/templates/Parts/info/_order_infos.html.twig similarity index 100% rename from templates/Parts/_order_infos.html.twig rename to templates/Parts/info/_order_infos.html.twig diff --git a/templates/Parts/info/_sidebar.html.twig b/templates/Parts/info/_sidebar.html.twig new file mode 100644 index 00000000..dc0ca548 --- /dev/null +++ b/templates/Parts/info/_sidebar.html.twig @@ -0,0 +1,184 @@ +
+ +
+
+ +
+ +
+
+ + + +
+
+
+
+
+
+ +

+ +
+ +
+
+ +
+ +
+
+ + + +
+
+
+
+
+
+ +

+ +{# +{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.addedDate | localizeddate("long")}} + {#{if !empty($creation_user)} {% trans %}by{% endtrans %} + {if $can_visit_user} + {$creation_user} + {else} + {$creation_user} + {/if} + {/if} #} +

+
+ +

+ +
+ +

{{ part.lastModified | localizeddate("long") }} + {# {if !empty($last_modified_user)} {% trans %}by{% endtrans %} + {if $can_visit_user} + {$last_modified_user} + {else} + {$last_modified_user} + {/if} + {/if} #} +

+
+ +

+ +{# +
+ {if $can_generate_barcode} + {if count($barcode_profiles) > 0} + + + +
+ + + + + +
+ {else} + + + + + + + {/if} +
+ +

+{/if} + +
+ +
+ +

+ +
+ +
+ +#} \ No newline at end of file diff --git a/templates/Parts/info/_tools.html.twig b/templates/Parts/info/_tools.html.twig new file mode 100644 index 00000000..44b3107f --- /dev/null +++ b/templates/Parts/info/_tools.html.twig @@ -0,0 +1,28 @@ +{% if is_granted('edit', part) %} + + + {% trans %}part.edit.btn{% endtrans %} + +{% endif %} + + +{% if is_granted('create', part) %} +
+
+ + + {% trans %}part.clone.btn{% endtrans %} + + + +
+ + +{% endif %} \ No newline at end of file diff --git a/templates/Parts/info/show_part_info.html.twig b/templates/Parts/info/show_part_info.html.twig new file mode 100644 index 00000000..b8638e79 --- /dev/null +++ b/templates/Parts/info/show_part_info.html.twig @@ -0,0 +1,95 @@ +{% extends "main_card.html.twig" %} + +{% block title %} + {% trans %}part.info.title{% endtrans %} {{ part.name }} +{% endblock %} + +{% block card_title %} + + {% trans %}part.info.title{% endtrans %} "{{ part.name }}" +
+ {% trans %}id.label{% endtrans %}: {{ part.id }} +
+{% endblock %} + +{% block card_content %} + +
+
+ {% include "Parts/info/_main_infos.html.twig" %} +
+ +
+ {% include "Parts/info/_sidebar.html.twig" %} +
+ +
+ +
+
+ +
+ {% if part.comment is not empty %} +
+
+ {{ part.comment|bbCode }} +
+
+ {% endif %} +
+ Test +
+ +
+ {% include "Parts/info/_order_infos.html.twig" %} +
+ +
+ TODO +
+ +
+ + {% include "Parts/info/_tools.html.twig" %} + +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/Parts/show_part_info.html.twig b/templates/Parts/show_part_info.html.twig deleted file mode 100644 index d99fae48..00000000 --- a/templates/Parts/show_part_info.html.twig +++ /dev/null @@ -1,346 +0,0 @@ -{% extends "main_card.html.twig" %} - -{% block title %} - {% trans %}part.info.title{% endtrans %} {{ part.name }} -{% endblock %} - -{% block card_title %} - - {% trans %}part.info.title{% endtrans %} "{{ part.name }}" -
- {% trans %}id.label{% endtrans %}: {{ part.id }} -
-{% endblock %} - -{% block card_content %} - -
-
-
-
- Part main image -
-
-
{{ part.manufacturer.name ?? ""}}
-

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

-
{{ part.description|bbCode }}
-
- - {{ part.category.fullPath ?? "-"}} -
-
- - {{ part.storelocation.fullPath ?? "-"}} -
-
- - {{ part.instock }} - / - {{ part.mininstock }} - -
-
- - {{ part.footprint.fullPath ?? "-"}} -
-
- - {{ "TODO" }} -
- {# - {% if part.comment != "" %} -
- -
- {{ part.comment|nl2br }} -
-
- {% endif %} #} -
-
- -
- -
- {% if part.comment is not empty %} -
-
- {{ part.comment|bbCode }} -
-
- {% endif %} -
- Test -
- -
- {% include "Parts/_order_infos.html.twig" %} -
- -
- TODO -
-
- {% if is_granted('edit', part) %} - - - {% trans %}part.edit.btn{% endtrans %} - - {% endif %} - - - {% if is_granted('create', part) %} -
- - {% 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.addedDate | localizeddate("long")}} - {#{if !empty($creation_user)} {% trans %}by{% endtrans %} - {if $can_visit_user} - {$creation_user} - {else} - {$creation_user} - {/if} - {/if} #} -

-
- -

- -
- -

{{ part.lastModified | localizeddate("long") }} - {# {if !empty($last_modified_user)} {% trans %}by{% endtrans %} - {if $can_visit_user} - {$last_modified_user} - {else} - {$last_modified_user} - {/if} - {/if} #} -

-
- -

- - {# -
- {if $can_generate_barcode} - {if count($barcode_profiles) > 0} - - - -
- - - - - -
- {else} - - - - - - - {/if} -
- -

- {/if} - -
- -
- -

- -
- -
-
- #} -
- - -{% endblock %} \ No newline at end of file