File size: 3,286 Bytes
9eee17e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{% extends "base.html" %}
{% block content %}
<section class="page-shell compact-hero">
  <nav class="breadcrumbs" aria-label="Breadcrumb">
    <a href="/">Home</a><span aria-hidden="true">&rsaquo;</span>
    <a href="/compare/">Compare</a><span aria-hidden="true">&rsaquo;</span>
    <span>{{ product_a.name }} vs {{ product_b.name }}</span>
  </nav>
  <h1>{{ product_a.name }} vs {{ product_b.name }}</h1>
  <p class="category-lede">A side-by-side look at ratings, pricing, and feature coverage from this edition's catalog.</p>
</section>

<section class="page-shell comparison-pair" aria-label="Product comparison">
  <div class="comparison-pair-grid">
    {% for product in (product_a, product_b) %}
    <article class="side-card comparison-column" data-testid="comparison-column-{{ product.id }}">
      <div class="comparison-head">
        {% if product.logo_asset %}
        <img class="product-logo large" src="{{ product.logo_asset }}" alt="{{ product.name }} logo" width="64" height="64">
        {% else %}
        <span class="result-monogram large" aria-hidden="true">{{ product.name[0] }}</span>
        {% endif %}
        <h2><a class="text-link" href="/p/{{ product.id }}/{{ product.url_slug }}/">{{ product.name }}</a></h2>
      </div>
      <p class="rating">
        <span class="stars rating-{{ product.rating | string | replace('.', '-') }}" aria-hidden="true"></span>
        <b>{{ "%.1f" | format(product.rating) }}</b> ({{ product.local_review_count }})
      </p>
      <dl class="comparison-facts">
        <div><dt>Starting price</dt><dd>{{ product.pricing or "Contact vendor" }}</dd></div>
        {% if product.sub_ratings %}
        {% if product.sub_ratings.ease_of_use %}<div><dt>Ease of Use</dt><dd>{{ product.sub_ratings.ease_of_use }}</dd></div>{% endif %}
        {% if product.sub_ratings.customer_service %}<div><dt>Customer Service</dt><dd>{{ product.sub_ratings.customer_service }}</dd></div>{% endif %}
        {% if product.sub_ratings.value_for_money %}<div><dt>Value for Money</dt><dd>{{ product.sub_ratings.value_for_money }}</dd></div>{% endif %}
        {% endif %}
      </dl>
      <p class="card-blurb">{{ product.description }}</p>
      {% if product.features %}
      <p class="features-lede">Most valued features</p>
      <ul class="feature-chips">
        {% for feature in product.features[:6] %}
        <li class="chip">{{ feature }}</li>
        {% endfor %}
      </ul>
      {% endif %}
      <div class="result-actions comparison-actions">
        <a class="primary-button" href="/p/{{ product.id }}/{{ product.url_slug }}/">View Profile</a>
        <a class="secondary-button" href="/out/vendor-site/{{ product.id }}">Visit Website</a>
      </div>
    </article>
    {% endfor %}
  </div>
</section>

{% if swap_options %}
<section class="page-shell category-crosslinks">
  <h2>Compare {{ product_a.name }} with another product</h2>
  <div class="crosslink-grid">
    {% for option in swap_options %}
    <a class="text-link" href="/compare/{{ [product_a.id, option.id] | sort | join('-') }}/{{ product_a.url_slug }}-vs-{{ option.url_slug }}">{{ product_a.name }} vs {{ option.name }}</a>
    {% endfor %}
    <a class="text-link" href="/compare/">Comparison builder</a>
  </div>
</section>
{% endif %}
{% endblock %}