From a409045f91ecd0b9b69c6b5d6eca39044b4240c6 Mon Sep 17 00:00:00 2001 From: Adel Elshafey Date: Tue, 3 Dec 2024 12:47:58 +0200 Subject: [PATCH] Update master.twig --- src/views/layouts/master.twig | 226 ++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 103 deletions(-) diff --git a/src/views/layouts/master.twig b/src/views/layouts/master.twig index 5724329cf..28edca8dd 100644 --- a/src/views/layouts/master.twig +++ b/src/views/layouts/master.twig @@ -1,123 +1,143 @@ {# ############## Shared Variables in all views ################ -| Variable | Type | Description | -|----------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------| -| store | Store | | -| store.id | int | | -| store.name | string | | -| store.username | string | | -| store.description | string | | -| store.slogan | ?string | * if feature in twilight.json | -| store.logo | string | | -| store.url | string | | -| store.api | string | the api url for current store | -| store.icon | string | *fav icon url | -| store.contacts | object | [mobile, phone, email, whatsapp, telegram], ex. store.contacts.email | -| store.social | object | [instagram, snapchat, twitter, youtube, facebook, pinterest, maroof, whatsapp], ex. store.social.twitter | -| store.settings | object | | -| store.settings.auth.email_allowed | bool | | -| store.settings.auth.mobile_allowed | bool | | -| store.settings.auth.is_email_required | bool | | -| store.settings.cart.apply_coupon_enabled | bool | Does visitor allowed to applay coupon in cart page | -| store.settings.product.total_sold_enabled | bool | | -| store.settings.product.fit_type | ?string | null when equal product card size is off, or ['cover', 'contain'] | -| store.settings.category.testimonial_enabled | bool | Show random testimonials in category page | -| store.settings.tax.number | ?string | | -| store.settings.tax.certificate | ?string | certificate image url | -| store.settings.tax.taxable_prices_enabled | bool | Does tax included in the prices ex product_price 100 & tax is 15, price will be 115 | -| store.settings.rating_enabled | bool | Is one of: store_enabled or shipping_enabled or products_enabled | -| store.settings.arabic_numbers_enabled | bool | Does the merchant wants the numbers to be shown as Arabic format | -| store.settings.is_multilingual | bool | | -| store.settings.currencies_enabled | bool | -| theme | Theme | | -| theme.id | int | | -| theme.name | string | | -| theme.mode | string | `live`, `preview` | -| theme.is_rtl | bool | | -| theme.translations_hash | int | to be used in case merchant updated frontend store translations | -| theme.color | object | | -| theme.color.primary | string | | -| theme.color.text | string | suitable text color comparing to `theme.primary.color`, #000000, #FFFFFF | -| theme.color.reverse_primary | string | | -| theme.color.reverse_text | string | if `theme.text_color=#000000` means that `theme.reverse_text_color=#FFFFFF` | -| theme.color.is_dark | bool | Does main store color `theme.primary.color` considered as dim color? | -| theme.color.darker(float alpha, ?string hexColor) | string | get darker color from `theme.primary.color` or from passed color, `alpha` range from 0.0-1.0 | -| theme.color.lighter(float alpha, ?string hexColor) | string | get lighter color from `theme.primary.color` or from passed color, `alpha` range from 0.0-1.0 | -| theme.font | ?object | Salla predefined font, null when the theme doesn't have `fonts` feature | -| theme.font.name | string | DINNextLTArabic-Regular, Amazon-Ember, Apple, Dubai, Estedad | -| theme.font.url | string | css full url ex: 'https://my_store.test/dist/fonts/default.css' | -| theme.settings | object | dynamic object with values of the `settings` in twilight.json ex. `theme.settings.topnav_is_dark` | -| theme.settings.set(settingName, value) | string | set global var, then get it {{theme.settings.get('my_var','fallback') }} | -| theme.settings.get(settingName, default=null) | mixed | get theme setting ex `theme.settings.get('my_var', 'fallback')` | + | Variable | Type | Description | + |----------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------| + | store | Store | | + | store.id | int | | + | store.name | string | | + | store.username | string | | + | store.description | string | | + | store.slogan | ?string | * if feature in twilight.json | + | store.logo | string | | + | store.url | string | | + | store.api | string | the api url for current store | + | store.icon | string | *fav icon url | + | store.contacts | object | [mobile, phone, email, whatsapp, telegram], ex. store.contacts.email | + | store.social | object | [instagram, snapchat, twitter, youtube, facebook, pinterest, maroof, whatsapp], ex. store.social.twitter | + | store.settings | object | | + | store.settings.auth.email_allowed | bool | | + | store.settings.auth.mobile_allowed | bool | | + | store.settings.auth.is_email_required | bool | | + | store.settings.cart.apply_coupon_enabled | bool | Does visitor allowed to applay coupon in cart page | + | store.settings.product.total_sold_enabled | bool | | + | store.settings.product.fit_type | ?string | null when equal product card size is off, or ['cover', 'contain'] | + | store.settings.category.testimonial_enabled | bool | Show random testimonials in category page | + | store.settings.tax.number | ?string | | + | store.settings.tax.certificate | ?string | certificate image url | + | store.settings.tax.taxable_prices_enabled | bool | Does tax included in the prices ex product_price 100 & tax is 15, price will be 115 | + | store.settings.rating_enabled | bool | Is one of: store_enabled or shipping_enabled or products_enabled | + | store.settings.arabic_numbers_enabled | bool | Does the merchant wants the numbers to be shown as Arabic format | + | store.settings.is_multilingual | bool | | + | store.settings.currencies_enabled | bool | + | theme | Theme | | + | theme.id | int | | + | theme.name | string | | + | theme.mode | string | `live`, `preview` | + | theme.is_rtl | bool | | + | theme.translations_hash | int | to be used in case merchant updated frontend store translations | + | theme.color | object | | + | theme.color.primary | string | | + | theme.color.text | string | suitable text color comparing to `theme.primary.color`, #000000, #FFFFFF | + | theme.color.reverse_primary | string | | + | theme.color.reverse_text | string | if `theme.text_color=#000000` means that `theme.reverse_text_color=#FFFFFF` | + | theme.color.is_dark | bool | Does main store color `theme.primary.color` considered as dim color? | + | theme.color.darker(float alpha, ?string hexColor) | string | get darker color from `theme.primary.color` or from passed color, `alpha` range from 0.0-1.0 | + | theme.color.lighter(float alpha, ?string hexColor) | string | get lighter color from `theme.primary.color` or from passed color, `alpha` range from 0.0-1.0 | + | theme.font | ?object | Salla predefined font, null when the theme doesn't have `fonts` feature | + | theme.font.name | string | DINNextLTArabic-Regular, Amazon-Ember, Apple, Dubai, Estedad | + | theme.font.url | string | css full url ex: 'https://my_store.test/dist/fonts/default.css' | + | theme.settings | object | dynamic object with values of the `settings` in twilight.json ex. `theme.settings.topnav_is_dark` | + | theme.settings.set(settingName, value) | string | set global var, then get it {{theme.settings.get('my_var','fallback') }} | + | theme.settings.get(settingName, default=null) | mixed | get theme setting ex `theme.settings.get('my_var', 'fallback')` | #} - - - - - - {{ theme.settings.set('placeholder', 'images/placeholder.png') }} + + + + + + {{ theme.settings.set('placeholder', 'images/placeholder.png') }} - {% include 'pages.partials.loading-screen-assets' %} + {% include 'pages.partials.loading-screen-assets' %} - - + + - {% block head_scripts %}{% endblock %} + {% block head_scripts %}{% endblock %} - - - - {% hook 'head:start' %} - {% hook head %} - {% block styles %}{% endblock %} - - - - - - {# tracking services, custom css feature. #} - {% hook 'head:end' %} - - -
- -
- {% hook 'body:start' %} - {% component 'header.header' %} - {% block content %}{% endblock %} - {% component 'footer.footer' %} -
-{% hook 'body:end' %} - + {# tracking services, custom css feature. #} + {% hook 'head:end' %} + + +
+ +
+ {% hook 'body:start' %} + {% component 'header.header' %} + {% block content %}{% endblock %} + {% component 'footer.footer' %} +
+ {% hook 'body:end' %} + -{# Twilight Components #} - - + {# Twilight Components #} + + -{% if user.type=='guest' %} - -{% endif %} -{% block scripts %}{% endblock %} - + {% if user.type=='guest' %} + + {% endif %} + {% block scripts %}{% endblock %} +