blob: ea6b00fc58acbc444ecccb2b74996cd58a88bf42 [file] [log] [blame]
Anand Doshida858cc2015-02-24 17:50:44 +05301{% macro product_image_square(website_image, css_class="") %}
Rushabh Mehta440650d2016-11-14 13:13:53 +05302<div class="product-image product-image-square
3 {% if not website_image -%} missing-image {%- endif %} {{ css_class }}"
4 {% if website_image -%}
5 style="background-image: url('{{ frappe.utils.quoted(website_image) | abs_url }}');"
6 {%- endif %}>
Anand Doshida858cc2015-02-24 17:50:44 +05307</div>
8{% endmacro %}
9
Shivam Mishraa0954e62020-08-07 14:34:54 +053010{% macro product_image(website_image, css_class="", alt="") %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053011 <div class="border text-center rounded h-100 {{ css_class }}" style="overflow: hidden;">
Shivam Mishraa0954e62020-08-07 14:34:54 +053012 <img itemprop="image" class="website-image h-100 w-100" alt="{{ alt }}" src="{{ frappe.utils.quoted(website_image or 'no-image.jpg') | abs_url }}">
Rushabh Mehta156ce602015-09-11 18:49:59 +053013 </div>
14{% endmacro %}
pratu16x760fe77c2017-02-13 21:52:43 +053015
16{% macro media_image(website_image, name, css_class="") %}
pratu16x70e94b4b2017-02-14 16:32:48 +053017 <div class="product-image sidebar-image-wrapper {{ css_class }}">
18 {% if not website_image -%}
19 <div class="sidebar-standard-image"> <div class="standard-image" style="background-color: rgb(250, 251, 252);">{{name}}</div> </div>
20 {%- endif %}
pratu16x760fe77c2017-02-13 21:52:43 +053021 {% if website_image -%}
22 <a href="{{ frappe.utils.quoted(website_image) }}">
pratu16x70e94b4b2017-02-14 16:32:48 +053023 <img itemprop="image" src="{{ frappe.utils.quoted(website_image) | abs_url }}"
24 class="img-responsive img-thumbnail sidebar-image" style="min-height:100%; min-width:100%;">
pratu16x760fe77c2017-02-13 21:52:43 +053025 </a>
26 {%- endif %}
27 </div>
28{% endmacro %}
Faris Ansari5f8b3582019-03-19 11:48:32 +053029
30{% macro render_homepage_section(section) %}
31
32{% if section.section_based_on == 'Custom HTML' and section.section_html %}
33 {{ section.section_html }}
34{% elif section.section_based_on == 'Cards' %}
35<section class="container my-5">
36 <h3>{{ section.name }}</h3>
37
38 <div class="row">
39 {% for card in section.section_cards %}
40 <div class="col-md-{{ section.column_value }} mb-4">
41 <div class="card h-100 justify-content-between">
42 {% if card.image %}
43 <div class="website-image-lazy" data-class="card-img-top h-100" data-src="{{ card.image }}" data-alt="{{ card.title }}"></div>
44 {% endif %}
45 <div class="card-body">
46 <h5 class="card-title">{{ card.title }}</h5>
47 <p class="card-subtitle mb-2 text-muted">{{ card.subtitle or '' }}</p>
Faris Ansarib8eaa3d2019-06-01 20:56:37 +053048 <p class="card-text">{{ card.content or '' | truncate(140, True) }}</p>
Faris Ansari5f8b3582019-03-19 11:48:32 +053049 </div>
50 <div class="card-body flex-grow-0">
51 <a href="{{ card.route }}" class="card-link">{{ _('More details') }}</a>
52 </div>
53 </div>
54 </div>
55 {% endfor %}
56 </div>
57</section>
58{% endif %}
59
60{% endmacro %}