<commit_before>{% extends "base-v2.html" %}
{% load staticfiles %}

{% block metatags %}
    {% include "open_graph/og_single_product.html" %}
{% endblock %}

{% block sidebar %}
    <div class="col-sm-4 col-md-3 sidebar unimportant-sidebar">
        {% if product_type.simple_style %}
            Aðrar vörur í stílnum
            "<a href="{{ product_type.simple_style.get_absolute_url }}">{{ product_type.simple_style }}</a>":
            <ul>
                {% for similar_product_type in similar %}
                    <li {% if not similar_product_type.available %} class="unavailable-product" {% endif %}>
                        {% if similar_product_type.id != product_type.id %}
                            <a href="{{ similar_product_type.get_absolute_url }}">{{ similar_product_type.alias }}</a>
                        {% else %}
                            {{ similar_product_type.alias }}
                        {% endif %}
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
{% endblock %}

{% block content %}
    <div class="col-sm-8 col-sm-offset-4 col-md-9 col-md-offset-3 main">
        <div class="row">
            <div class="col-md-6">
                <h1 class="page-header">{{ product_type.alias }}</h1>
                <p class="lead">
                    {{ product_type.abv }}%
                    {% if product_type.untappd_info %}
                        {{ product_type.simple_style.name_in_sentence }} frá
                        {{ product_type.untappd_info.brewery.alias }}.
                    {% else %}
                        drykkur.
                    {% endif %}
                </p>
                {% if product_type.untappd_info %}
                    Varan hefur einkunnina {{ product_type.untappd_info.rating|floatformat:2 }} á
                    <a href="https://untappd.com/beer/{{ product_type.untappd_info.untappd_id }}" target="_blank">
                        Untappd</a>. Það er hærri einkunn en {{ lower_rated_percentage }}%
                    ({{ lower_rated_count }}/{{ total_count }}) af öllum vörum sem Bjórleitin veit af og hærri einkunn
                    en {{ style_lower_rated_percentage }}% ({{ style_lower_rated_count }}/{{ style_count }}) af vörum í
                    sama stíl.
                {% endif %}
            </div>
            <div class="col-md-6">
                {% if product_type.main_image %}
                    <img src="{{ product_type.main_image }}"
                         alt="Mynd af {{ product_type.alias }}"
                         class="main-product-image img-responsive center-block">
                {% endif %}
            </div>
        </div>

        <h3>Birgðastaða</h3>
        {% if product_type.available %}
            <div class="row">
                {% for product in product_type.product_set.all %}
                    <div class="col-md-6">
                        {% if product.available_in_jog %}
                            <p><strong>{{ product.volume }}ml {{ product.container.name|lower }}</strong> fæst á <a
                                    href="http://www.jarngler.is/serpantanir/">sérpöntunarlista Járns og Glers</a>
                                á {{ product.price }} krónur. Vöruauðkennið er
                                <code>{{ product.jog_id }}</code>.</p>
                        {% endif %}
                        {% if product.available_in_atvr %}
                            <p><strong>{{ product.volume }}ml {{ product.container.name|lower }}</strong> fæst í
                                Vínbúðinni
                                á {{ product.price }}
                                krónur.
                                <a href="http://www.vinbudin.is/Heim/v%C3%B6rur/stoek-vara.aspx/?productid={{ product.atvr_id }}/"
                                   target="_blank">Sjá á síðu Vínbúðarinnar</a>.</p>
                            <table class="table table-condensed table-striped">
                                <thead>
                                <tr>
                                    <th>Vínbúð</th>
                                    <th>Staða</th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for stock_entry in product.atvr_stock %}
                                    <tr>
                                        <td>{{ stock_entry.store }}</td>
                                        <td>{{ stock_entry.stock }}</td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        {% endif %}
                    </div>
                {% endfor %}
            </div>
        {% else %}
            <p>Bjórleitin finnur þessa vöru því miður hvergi.</p>
        {% endif %}
    </div><commit_msg>Prevent unavailable products from creating empty divs<commit_after>{% extends "base-v2.html" %}
{% load staticfiles %}

{% block metatags %}
    {% include "open_graph/og_single_product.html" %}
{% endblock %}

{% block sidebar %}
    <div class="col-sm-4 col-md-3 sidebar unimportant-sidebar">
        {% if product_type.simple_style %}
            Aðrar vörur í stílnum
            "<a href="{{ product_type.simple_style.get_absolute_url }}">{{ product_type.simple_style }}</a>":
            <ul>
                {% for similar_product_type in similar %}
                    <li {% if not similar_product_type.available %} class="unavailable-product" {% endif %}>
                        {% if similar_product_type.id != product_type.id %}
                            <a href="{{ similar_product_type.get_absolute_url }}">{{ similar_product_type.alias }}</a>
                        {% else %}
                            {{ similar_product_type.alias }}
                        {% endif %}
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
{% endblock %}

{% block content %}
    <div class="col-sm-8 col-sm-offset-4 col-md-9 col-md-offset-3 main">
        <div class="row">
            <div class="col-md-6">
                <h1 class="page-header">{{ product_type.alias }}</h1>
                <p class="lead">
                    {{ product_type.abv }}%
                    {% if product_type.untappd_info %}
                        {{ product_type.simple_style.name_in_sentence }} frá
                        {{ product_type.untappd_info.brewery.alias }}.
                    {% else %}
                        drykkur.
                    {% endif %}
                </p>
                {% if product_type.untappd_info %}
                    Varan hefur einkunnina {{ product_type.untappd_info.rating|floatformat:2 }} á
                    <a href="https://untappd.com/beer/{{ product_type.untappd_info.untappd_id }}" target="_blank">
                        Untappd</a>. Það er hærri einkunn en {{ lower_rated_percentage }}%
                    ({{ lower_rated_count }}/{{ total_count }}) af öllum vörum sem Bjórleitin veit af og hærri einkunn
                    en {{ style_lower_rated_percentage }}% ({{ style_lower_rated_count }}/{{ style_count }}) af vörum í
                    sama stíl.
                {% endif %}
            </div>
            <div class="col-md-6">
                {% if product_type.main_image %}
                    <img src="{{ product_type.main_image }}"
                         alt="Mynd af {{ product_type.alias }}"
                         class="main-product-image img-responsive center-block">
                {% endif %}
            </div>
        </div>

        <h3>Birgðastaða</h3>
        {% if product_type.available %}
            <div class="row">
                {% for product in product_type.product_set.all %}

                    {% if product.available_in_jog %}
                        <div class="col-md-6">
                            <p><strong>{{ product.volume }}ml {{ product.container.name|lower }}</strong> fæst á <a
                                    href="http://www.jarngler.is/serpantanir/">sérpöntunarlista Járns og Glers</a>
                                á {{ product.price }} krónur. Vöruauðkennið er
                                <code>{{ product.jog_id }}</code>.</p>
                        </div>
                    {% endif %}
                    {% if product.available_in_atvr %}
                        <div class="col-md-6">
                            <p><strong>{{ product.volume }}ml {{ product.container.name|lower }}</strong> fæst í
                                Vínbúðinni
                                á {{ product.price }}
                                krónur.
                                <a href="http://www.vinbudin.is/Heim/v%C3%B6rur/stoek-vara.aspx/?productid={{ product.atvr_id }}/"
                                   target="_blank">Sjá á síðu Vínbúðarinnar</a>.</p>
                            <table class="table table-condensed table-striped">
                                <thead>
                                <tr>
                                    <th>Vínbúð</th>
                                    <th>Staða</th>
                                </tr>
                                </thead>
                                <tbody>
                                {% for stock_entry in product.atvr_stock %}
                                    <tr>
                                        <td>{{ stock_entry.store }}</td>
                                        <td>{{ stock_entry.stock }}</td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    {% endif %}

                {% endfor %}
            </div>
        {% else %}
            <p>Bjórleitin finnur þessa vöru því miður hvergi.</p>
        {% endif %}
    </div>
{'fraction_non_alphanumeric': 0.12480063795853269, 'fraction_numerical': 0.003488835725677831, 'mean_word_length': 1.0836967808930427, 'pattern_counts': {'":': 2, '<': 135, '<?xml version=': 0, '>': 135, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '967478', 'n_tokens_mistral': 2944, 'n_tokens_neox': 2654, 'n_words': 478}