From 57413d263ebad89e1e35e53fc1c319011495f838 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 28 Oct 2021 09:36:49 -0300 Subject: [PATCH] layout de producto --- _data/layouts/cart.yml | 24 +++++++++ _data/layouts/product.yml | 14 ++--- _layouts/product.html | 110 ++++++++++++++++++++++++++++++++++++++ _sass/helpers.scss | 12 +++++ 4 files changed, 153 insertions(+), 7 deletions(-) create mode 100644 _layouts/product.html diff --git a/_data/layouts/cart.yml b/_data/layouts/cart.yml index 022177c..3ecb444 100644 --- a/_data/layouts/cart.yml +++ b/_data/layouts/cart.yml @@ -156,6 +156,30 @@ remove: default: es: 'Quitar del carrito' en: 'Remove product' +length_unit: + type: 'string' + required: true + label: + es: 'Unidad de medida de los productos' + en: 'Measurement unit for products' + help: + es: '' + en: '' + default: + es: 'mm' + en: 'mm' +weight_unit: + type: 'string' + required: true + label: + es: 'Unidad de medida para el peso de los productos' + en: 'Measurement unit for products weight' + help: + es: '' + en: '' + default: + es: 'gr' + en: 'gr' back: type: 'string' required: true diff --git a/_data/layouts/product.yml b/_data/layouts/product.yml index d14a7cb..7263585 100644 --- a/_data/layouts/product.yml +++ b/_data/layouts/product.yml @@ -94,8 +94,8 @@ width: es: 'Ancho' en: 'Width' help: - es: 'En milímetros' - en: 'In millimeters' + es: 'En la unidad de medida que configuraste en el carrito' + en: 'In measurement units configured in cart' height: type: 'number' writable: 'once' @@ -103,17 +103,17 @@ height: es: 'Alto' en: 'Height' help: - es: 'En milímetros' - en: 'In millimeters' + es: 'En la unidad de medida que configuraste en el carrito' + en: 'In measurement units configured in cart' depth: type: 'number' writable: 'once' label: - es: 'Profundidad (Lomo)' + es: 'Profundidad' en: 'Depth' help: - es: 'En milímetros' - en: 'In millimeters' + es: 'En la unidad de medida que configuraste en el carrito' + en: 'In measurement units configured in cart' weight: type: 'number' required: true diff --git a/_layouts/product.html b/_layouts/product.html new file mode 100644 index 0000000..19d7f94 --- /dev/null +++ b/_layouts/product.html @@ -0,0 +1,110 @@ +--- +layout: default +--- + +
+
+
+ + {{ page.image.description | default: page.title }} + + +
+

{{ site.i18n.libro.ficha }}

+ +
    +
  • + +
  • + + {% if page.width > 0 %} +
  • + {{ site.data.layouts.product.width.label[site.lang }} + {{ page.width }} + {{ site.cart.length_unit | default: site.data.layouts.cart.length_unit.default[site.lang] }} +
  • + {% endif %} + + {% if page.height > 0 %} +
  • + {{ site.data.layouts.product.height.label[site.lang }} + {{ page.height }} + {{ site.cart.length_unit | default: site.data.layouts.cart.length_unit.default[site.lang] }} +
  • + {% endif %} + + {% if page.depth > 0 %} +
  • + {{ site.data.layouts.product.depth.label[site.lang }} + {{ page.depth }} + {{ site.cart.length_unit | default: site.data.layouts.cart.length_unit.default[site.lang] }} +
  • + {% endif %} + + {% if page.weight > 0 %} +
  • + {{ site.data.layouts.product.weight.label[site.lang }} + {{ page.weight }} + {{ site.cart.weight_unit | default: site.data.layouts.cart.weight_unit.default[site.lang] }} +
  • + {% endif %} +
+ +
+
+ + + + + + {% if page.in_stock %} + + {% else %} + + {% endif %} + +

+ {{ page.price | floor }} + {{ site.cart.currency }} +

+ + +
+
+
+
+ +
+
+

{{ page.title }}

+

{{ page.description }}

+
+ +
+ {{ content }} +
+
+
+ + + + +
diff --git a/_sass/helpers.scss b/_sass/helpers.scss index e6170da..f162021 100644 --- a/_sass/helpers.scss +++ b/_sass/helpers.scss @@ -37,6 +37,18 @@ $directions: (top, right, bottom, left); &::-webkit-scrollbar { display: none; } } + :enabled { + .show-when-disabled#{$infix} { + display: none !important; + } + } + + :disabled { + .hide-when-disabled#{$infix} { + display: none !important; + } + } + /// Un elemento cuadrado /// /// @example html