From 439c96bd22bb318a0b831e4df0e788f7fefeb75a Mon Sep 17 00:00:00 2001 From: Carotte <65663837+web-cooking-factory@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:38:31 +0100 Subject: [PATCH 1/8] Add renderThemeIcon function --- templates/_partials/helpers.tpl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/templates/_partials/helpers.tpl b/templates/_partials/helpers.tpl index dd52efe44..4fe428a5d 100644 --- a/templates/_partials/helpers.tpl +++ b/templates/_partials/helpers.tpl @@ -14,3 +14,22 @@ > {/function} + +{function renderThemeIcon iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]} + {if isset($iconsMap) && $iconName && !empty($iconsMap[$iconName])} + $value} + {if $key != 'class'} + {$key}="{$value}" + {/if} + {/foreach} + > + {$iconsMap[$iconName]} + + {/if} +{/function} From 9950b5aed9001d503d901398f30db9516f91495f Mon Sep 17 00:00:00 2001 From: Carotte <65663837+web-cooking-factory@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:39:18 +0100 Subject: [PATCH 2/8] Create variables.tpl with icons mapping --- templates/_partials/variables.tpl | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 templates/_partials/variables.tpl diff --git a/templates/_partials/variables.tpl b/templates/_partials/variables.tpl new file mode 100644 index 000000000..4f82d7a7a --- /dev/null +++ b/templates/_partials/variables.tpl @@ -0,0 +1,55 @@ +{assign + var=iconsMap + value=[ + "chevron_right" => "", + "chevron_left" => "", + "chevron_up" => "", + "chevron_down" => "", + "previous" => "", + "next" => "", + "check" => "", + "cross" => "", + "close" => "", + "cart" => "", + "account" => "", + "account_info" => "", + "account_addresses" => "", + "account_orders" => "", + "account_slips" => "", + "account_vouchers" => "", + "account_returns" => "refresh", + "plus" => "", + "minus" => "", + "phone" => "", + "fax" => "", + "mail" => "", + "location" => "", + "show_plain" => "", + "hide_plain" => "", + "toggler" => "", + "download" => "", + "pdf" => "", + "add" => "", + "delete" => "", + "edit" => "", + "add_address" => "", + "delete_address" => "", + "edit_address" => "", + "edit_order_step" => "", + "search" => "", + "zoom" => "", + "info" => "", + "success" => "", + "warning" => "", + "danger" => "", + "login" => "", + "logout" => "", + "favorites" => "", + "add_favorite" => "", + "remove_favorite" => "", + "account_mailalerts" => "", + "account_rgpd" => "", + "clear" => "" + ] + scope="global" +} From 4f2e6e2397813c79037d49a146e0d9e8a1671bf6 Mon Sep 17 00:00:00 2001 From: Carotte <65663837+web-cooking-factory@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:40:07 +0100 Subject: [PATCH 3/8] Add variables partial --- templates/layouts/layout-both-columns.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/layouts/layout-both-columns.tpl b/templates/layouts/layout-both-columns.tpl index 32c1401f3..ea25e8dcf 100644 --- a/templates/layouts/layout-both-columns.tpl +++ b/templates/layouts/layout-both-columns.tpl @@ -3,6 +3,7 @@ * file that was distributed with this source code. *} +{include file='_partials/variables.tpl'} {include file='_partials/helpers.tpl'} From 9d800a3aafa0e2b2d22442ca96b1f4a045e8caa3 Mon Sep 17 00:00:00 2001 From: Carotte <65663837+web-cooking-factory@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:56:33 +0100 Subject: [PATCH 4/8] Allow multiple icon groups --- templates/_partials/variables.tpl | 100 +++++++++++++++--------------- 1 file changed, 51 insertions(+), 49 deletions(-) diff --git a/templates/_partials/variables.tpl b/templates/_partials/variables.tpl index 4f82d7a7a..e614bd37a 100644 --- a/templates/_partials/variables.tpl +++ b/templates/_partials/variables.tpl @@ -1,55 +1,57 @@ {assign var=iconsMap value=[ - "chevron_right" => "", - "chevron_left" => "", - "chevron_up" => "", - "chevron_down" => "", - "previous" => "", - "next" => "", - "check" => "", - "cross" => "", - "close" => "", - "cart" => "", - "account" => "", - "account_info" => "", - "account_addresses" => "", - "account_orders" => "", - "account_slips" => "", - "account_vouchers" => "", - "account_returns" => "refresh", - "plus" => "", - "minus" => "", - "phone" => "", - "fax" => "", - "mail" => "", - "location" => "", - "show_plain" => "", - "hide_plain" => "", - "toggler" => "", - "download" => "", - "pdf" => "", - "add" => "", - "delete" => "", - "edit" => "", - "add_address" => "", - "delete_address" => "", - "edit_address" => "", - "edit_order_step" => "", - "search" => "", - "zoom" => "", - "info" => "", - "success" => "", - "warning" => "", - "danger" => "", - "login" => "", - "logout" => "", - "favorites" => "", - "add_favorite" => "", - "remove_favorite" => "", - "account_mailalerts" => "", - "account_rgpd" => "", - "clear" => "" + "material-icons" => [ + "chevron_right" => "", + "chevron_left" => "", + "chevron_up" => "", + "chevron_down" => "", + "previous" => "", + "next" => "", + "check" => "", + "cross" => "", + "close" => "", + "cart" => "", + "account" => "", + "account_info" => "", + "account_addresses" => "", + "account_orders" => "", + "account_slips" => "", + "account_vouchers" => "", + "account_returns" => "refresh", + "plus" => "", + "minus" => "", + "phone" => "", + "fax" => "", + "mail" => "", + "location" => "", + "show_plain" => "", + "hide_plain" => "", + "toggler" => "", + "download" => "", + "pdf" => "", + "add" => "", + "delete" => "", + "edit" => "", + "add_address" => "", + "delete_address" => "", + "edit_address" => "", + "edit_order_step" => "", + "search" => "", + "zoom" => "", + "info" => "", + "success" => "", + "warning" => "", + "danger" => "", + "login" => "", + "logout" => "", + "favorites" => "", + "add_favorite" => "", + "remove_favorite" => "", + "account_mailalerts" => "", + "account_rgpd" => "", + "clear" => "" + ] ] scope="global" } From 5a63fc80a345089d097ac7502f9a6824185d27e3 Mon Sep 17 00:00:00 2001 From: Carotte <65663837+web-cooking-factory@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:58:48 +0100 Subject: [PATCH 5/8] Multiple icon groups in render function --- templates/_partials/helpers.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/_partials/helpers.tpl b/templates/_partials/helpers.tpl index 4fe428a5d..716685c38 100644 --- a/templates/_partials/helpers.tpl +++ b/templates/_partials/helpers.tpl @@ -15,10 +15,10 @@ {/function} -{function renderThemeIcon iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]} - {if isset($iconsMap) && $iconName && !empty($iconsMap[$iconName])} +{function renderThemeIcon iconGoup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]} + {if isset($iconsMap) && !empty($iconsMap[$iconGroup]) && $iconName && !empty($iconsMap[$iconGroup][$iconName])} - {$iconsMap[$iconName]} + {$iconsMap[$iconGroup][$iconName]} {/if} {/function} From 085f0dcb4ad452659fb53861911940970a43acd0 Mon Sep 17 00:00:00 2001 From: Carotte <65663837+web-cooking-factory@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:42:26 +0100 Subject: [PATCH 6/8] Fix --- templates/_partials/helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/_partials/helpers.tpl b/templates/_partials/helpers.tpl index 716685c38..a49f3ea7a 100644 --- a/templates/_partials/helpers.tpl +++ b/templates/_partials/helpers.tpl @@ -15,7 +15,7 @@ {/function} -{function renderThemeIcon iconGoup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]} +{function renderThemeIcon iconGroup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]} {if isset($iconsMap) && !empty($iconsMap[$iconGroup]) && $iconName && !empty($iconsMap[$iconGroup][$iconName])} Date: Wed, 21 Feb 2024 17:43:07 +0100 Subject: [PATCH 7/8] List icons --- templates/_partials/variables.tpl | 153 ++++++++++++++++++++---------- 1 file changed, 104 insertions(+), 49 deletions(-) diff --git a/templates/_partials/variables.tpl b/templates/_partials/variables.tpl index e614bd37a..cee057e4c 100644 --- a/templates/_partials/variables.tpl +++ b/templates/_partials/variables.tpl @@ -2,55 +2,110 @@ var=iconsMap value=[ "material-icons" => [ - "chevron_right" => "", - "chevron_left" => "", - "chevron_up" => "", - "chevron_down" => "", - "previous" => "", - "next" => "", - "check" => "", - "cross" => "", - "close" => "", - "cart" => "", - "account" => "", - "account_info" => "", - "account_addresses" => "", - "account_orders" => "", - "account_slips" => "", - "account_vouchers" => "", - "account_returns" => "refresh", - "plus" => "", - "minus" => "", - "phone" => "", - "fax" => "", - "mail" => "", - "location" => "", - "show_plain" => "", - "hide_plain" => "", - "toggler" => "", - "download" => "", - "pdf" => "", - "add" => "", - "delete" => "", - "edit" => "", - "add_address" => "", - "delete_address" => "", - "edit_address" => "", - "edit_order_step" => "", - "search" => "", - "zoom" => "", - "info" => "", - "success" => "", - "warning" => "", - "danger" => "", - "login" => "", - "logout" => "", - "favorites" => "", - "add_favorite" => "", - "remove_favorite" => "", - "account_mailalerts" => "", - "account_rgpd" => "", - "clear" => "" + "chevron_right" => "chevron_right", + "chevron_left" => "chevron_left", + "chevron_up" => "expand_less", + "chevron_down" => "expand_more", + "arrow_right" => "arrow_backward", + "arrow_left" => "arrow_forward", + "arrow_up" => "arrow_upward", + "arrow_down" => "arrow_downward", + "caret_right" => "arrow_right", + "caret_left" => "arrow_left", + "caret_up" => "arrow_drop_up", + "caret_down" => "arrow_drop_down", + + "info" => "info", + "info_alt" => "info", + "success" => "check", + "success_alt" => "check", + "warning" => "warning", + "warning_alt" => "warning", + "danger" => "error", + "danger_alt" => "error", + + "close" => "close", + "close_alt" => "close", + + "phone" => "phone", + "fax" => "fax", + "mail" => "mail", + "location" => "place", + + "add" => "add_circle_outline", + "add_alt" => "add_circle_outline", + "edit" => "edit", + "edit_alt" => "edit", + "delete" => "remove", + "delete_alt" => "remove_circle_outline", + + "submit" => "check", + "cancel" => "close", + + "dropdown" => "arrow_drop_down", + "toggler" => "menu", + "download" => "download", + "pdf" => "picture_as_pdf", + "search" => "search", + "clear" => "clear", + "home" => "home", + "sort" => "sort", + + "previous" => "arrow_backward", + "next" => "arrow_forward", + + "expand" => "expand_more", + "collapse" => "expand_less", + + "account" => "person", + "account_settings" => "manage_accounts", + "account_info" => "account_circle", + "account_addresses" => "person_pin_circle", + "account_first_address" => "add_location", + "account_orders" => "date_range", + "account_slips" => "receipt", + "account_vouchers" => "local_offer", + "account_returns" => "assignment_return", + "account_mailalerts" => "drafts", + "account_gdpr" => "account_box", + "account_wishlists" => "favorite", + + "addresses" => "person_pin_circle", + "add_address" => "add_location", + "delete_address" => "delete", + "edit_address" => "edit", + + "cart" => "shopping_cart", + "add_to_cart" => "add_shopping_cart", + "remove_from_cart" => "remove_shopping_cart", + + "wishlists" => "favorite", + "add_to_wishlist" => "favorite_border", + "remove_from_wishlist" => "favorite", + + "log_in" => "person", + "log_out" => "exit_to_app", + + "increment" => "add", + "decrement" => "remove", + + "show_password" => "visibility", + "hide_password" => "visibility_off", + + "comments" => "chat", + "add_comment" => "edit", + "edit_comments" => "edit", + + "pagination_first" => "first_page", + "pagination_last" => "last_page", + "pagination_previous" => "chevron_left", + "pagination_next" => "chevron_right", + + "zoom" => "search", + "zoom_in" => "search", + "zoom_out" => "search", + + "edit_order_step" => "edit" ] ] scope="global" From 270d9765a714fb2ef5f4b31ea2cd2ba83bad41ec Mon Sep 17 00:00:00 2001 From: Carotte <65663837+web-cooking-factory@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:43:36 +0100 Subject: [PATCH 8/8] Change function name --- templates/_partials/helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/_partials/helpers.tpl b/templates/_partials/helpers.tpl index a49f3ea7a..95b173428 100644 --- a/templates/_partials/helpers.tpl +++ b/templates/_partials/helpers.tpl @@ -15,7 +15,7 @@ {/function} -{function renderThemeIcon iconGroup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]} +{function renderIcon iconGroup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]} {if isset($iconsMap) && !empty($iconsMap[$iconGroup]) && $iconName && !empty($iconsMap[$iconGroup][$iconName])}