diff --git a/templates/AdminPages/CompanyAdminBase.html.twig b/templates/AdminPages/CompanyAdminBase.html.twig index c89372fa..db913ff1 100644 --- a/templates/AdminPages/CompanyAdminBase.html.twig +++ b/templates/AdminPages/CompanyAdminBase.html.twig @@ -22,5 +22,6 @@ {% endblock %} {% block quick_links %} - {% include 'QuickLinks/_company.html.twig' %} + {% import "components/quick_links.macro.html.twig" as quick_links %} + {{ quick_links.company(entity) }} {% endblock %} \ No newline at end of file diff --git a/templates/Parts/lists/manufacturer_list.html.twig b/templates/Parts/lists/manufacturer_list.html.twig index a42f55ea..337b3bfb 100644 --- a/templates/Parts/lists/manufacturer_list.html.twig +++ b/templates/Parts/lists/manufacturer_list.html.twig @@ -9,7 +9,8 @@ {% embed "Parts/lists/_info_card.html.twig" with {'header_label': 'manufacturer.label'} %} {% block quick_links %}
- {% include 'QuickLinks/_company.html.twig' %} + {% import "components/quick_links.macro.html.twig" as quick_links %} + {{ quick_links.company(entity) }}
{% endblock %} {% endembed %} diff --git a/templates/Parts/lists/supplier_list.html.twig b/templates/Parts/lists/supplier_list.html.twig index e25d398e..d49a8ab4 100644 --- a/templates/Parts/lists/supplier_list.html.twig +++ b/templates/Parts/lists/supplier_list.html.twig @@ -9,7 +9,8 @@ {% embed "Parts/lists/_info_card.html.twig" with {'header_label': 'supplier.label'} %} {% block quick_links %}
- {% include 'QuickLinks/_company.html.twig' %} + {% import "components/quick_links.macro.html.twig" as quick_links %} + {{ quick_links.company(entity) }}
{% endblock %} {% endembed %} diff --git a/templates/QuickLinks/_company.html.twig b/templates/QuickLinks/_company.html.twig deleted file mode 100644 index 0b8e49f1..00000000 --- a/templates/QuickLinks/_company.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -
-
- {% if entity.website is not empty %} - - {% endif %} - {% if entity.emailAddress is not empty %} - - {% endif %} - {% if entity.phoneNumber is not empty %} - - {% endif %} - {% if entity.faxNumber is not empty %} - - {% endif %} -
-
\ No newline at end of file diff --git a/templates/components/quick_links.macro.html.twig b/templates/components/quick_links.macro.html.twig new file mode 100644 index 00000000..f0c04bff --- /dev/null +++ b/templates/components/quick_links.macro.html.twig @@ -0,0 +1,19 @@ +{# Renders an btn toolbar to quickly call/email or visit the website of a company #} +{% macro company(entity) %} +
+
+ {% if entity.website is not empty %} + + {% endif %} + {% if entity.emailAddress is not empty %} + + {% endif %} + {% if entity.phoneNumber is not empty %} + + {% endif %} + {% if entity.faxNumber is not empty %} + + {% endif %} +
+
+{% endmacro %} \ No newline at end of file