summaryrefslogtreecommitdiff
path: root/app/trading/templates/products/snippet.html
blob: 3fc9f6f7efa0000911c31fd6389eec54d97f5d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{% load get_image_by_size %}
{% load get_image_width %}
{% with image=object.featured_image %}
<div itemscope itemtype="http://schema.org/Product" class="product-card">
    <meta itemprop="brand" content="{{object.brand.name}}" />
    <figure itemscope itemtype="http://schema.org/ImageObject" class="picfull">
        <a href="{% get_image_by_size image 'original' %}" title="view larger image">
            <img class="u-photo" itemprop="contentUrl" sizes="(max-width: 750px) 100vw, (min-width: 751) 750px" srcset="{% for size in image.sizes.all%}{% get_image_by_size image size.name %} {{size.width}}w{% if forloop.last%}"{%else%}, {%endif%}{%endfor%}{% for size in image.sizes.all%}{%if not forloop.first and not forloop.last%} src="{% get_image_by_size image size.name%}"{%endif%}{%endfor%} alt="{{image.alt}} photographed by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}luxagraf{%endif%}" >
        </a>
            <figcaption>{% if image.caption %}{{image.caption|safe}}{% endif %}{% if image.photo_credit_source %}{%if image.caption %} | {%endif%}image: {% if image.photo_credit_url %}<a href="{{image.photo_credit_url}}" itemprop="author">{%endif%}{{image.photo_credit_source|lower}}{% if image.photo_credit_url %}</a>{%endif%}{%endif%}
        </figcaption>
    </figure>
    <div class="buy-btn-wrapper">
        <h4 class="product-header" itemprop="name">{{object.get_full_name}}</h4>
        <h5 class="product-link" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
            <a href="{{object.primary_offer_url}}" title="buy the {{object.get_full_name}} for ${{object.primary_offer_price}} from {{object.primary_offer_retailer.get_primary_offer_retailer_display}}" itemprop="url" rel="nofollow"> 
                Buy Now ({{object.get_primary_offer_retailer_display}} 
                <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price" content="{{object.primary_offer_price}}">{{object.primary_offer_price}}</span>) 
            </a>
            <link itemprop="availability" href="http://schema.org/InStock" />
        </h5>{% if object.secondary_offer_url %}
        <h5 class="product-link" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
            <a href="{{object.secondary_offer_url}}" title="buy the {{object.get_full_name}} for ${{object.secondary_offer_price}} from {{object.secondary_offer_retailer.get_secondary_offer_retailer_display}}" itemprop="url">
                Buy Now ({{object.get_secondary_offer_retailer_display}} 
                <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price" content="{{object.secondary_offer_price}}">{{object.secondary_offer_price}}</span>)
            </a>
            <link itemprop="availability" href="http://schema.org/InStock" />
        </h5>{% endif %}
    </div>
    <span itemprop="review" itemscope itemtype="http://schema.org/Review">
        <meta itemprop="name" content="{{object.get_full_name}}" />
        <meta itemprop="author" content="Scott Gilbertson" />
        <meta itemprop="datePublished" content="{{object.pub_date}}" />
        <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
        <meta itemprop="worstRating" content = "1"/>
        <meta itemprop="ratingValue" content="{{object.rating}}" />
        <meta itemprop="bestRating" content="10" />
    </span>
    <meta itemprop="description" content="{{object.body_markdown}}" />
</div>
{% endwith %}