<commit_before>{#-
Copyright 2015-2016 <NAME>

This file is part of AwesomeShop.

AwesomeShop is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

AwesomeShop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License
along with AwesomeShop. If not, see <http://www.gnu.org/licenses/>.
#}
<div ng-repeat-start="product in products" class="col-xs-6 col-md-4 col-lg-3" ng-controller="ProductInListCtrl" ng-cloak>
    <div class="thumbnail product-in-grid">
        <a href="[[ product.path ]]">
            <img ng-src="[[ product.main_photo.preview_url ]]" ng-show="product.main_photo">
            <div class="caption">
                <p class="text-center">[[ product.name ]]</p>
                <p class="text-center bottom-no-space">[[ product.net_price | currency:"{{ config.CURRENCY }}" ]]</p>
            </div>
        </a>
            <div class="caption">
                <button class="btn btn-success btn-block" ng-if="product.stock>0" ng-click="cart.add(product, 1)">{# XXX Deduce stock in cart #}
                    {{ _('Add to cart') }}
                </button>
                <button class="btn btn-danger btn-block disabled" ng-if="product.stock==0&&!product.on_demand">{# XXX Deduce stock in cart #}
                    {{ _('Out of stock') }}
                </button>
                <button class="btn btn-info btn-block" ng-if="product.stock==0&&product.on_demand" ng-click="cart.add(product, 1)">{# XXX Deduce stock in cart #}
                    {{ _('Add to cart') }}
                </button>
                <p class="text-center bottom-no-space" ng-if="product.stock==0&&product.on_demand">{# XXX Deduce stock in cart #}
                    {{ _('Available on demand, delay %(min)d-%(max)d days', min=config.ON_DEMAND_DELAY_MIN, max=config.ON_DEMAND_DELAY_MAX) }}<commit_msg>Simplify "add to cart" button in products list<commit_after>{#-
Copyright 2015-2016 <NAME>

This file is part of AwesomeShop.

AwesomeShop is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

AwesomeShop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.

You should have received a copy of the GNU Affero General Public License
along with AwesomeShop. If not, see <http://www.gnu.org/licenses/>.
#}
<div ng-repeat-start="product in products" class="col-xs-6 col-md-4 col-lg-3" ng-controller="ProductInListCtrl" ng-cloak>
    <div class="thumbnail product-in-grid">
        <a href="[[ product.path ]]">
            <img ng-src="[[ product.main_photo.preview_url ]]" ng-show="product.main_photo">
            <div class="caption">
                <p class="text-center">[[ product.name ]]</p>
                <p class="text-center bottom-no-space">[[ product.net_price | currency:"{{ config.CURRENCY }}" ]]</p>
            </div>
        </a>
            <div class="caption">
                <button class="btn btn-success btn-block" ng-if="product.stock || product.on_demand" ng-class="{ 'btn-success': product.stock, 'btn-info': product.on_demand && !product.stock }" ng-click="cart.add(product, 1)">{# XXX Deduce stock in cart #}
                    {{ _('Add to cart') }}
                </button>
                <button class="btn btn-danger btn-block disabled" ng-if="!(product.stock || product.on_demand)">{# XXX Deduce stock in cart #}
                    {{ _('Out of stock') }}
                </button>
                <p class="text-center bottom-no-space" ng-if="product.stock==0&&product.on_demand">{# XXX Deduce stock in cart #}
                    {{ _('Available on demand, delay %(min)d-%(max)d days', min=config.ON_DEMAND_DELAY_MIN, max=config.ON_DEMAND_DELAY_MAX) }}
{'fraction_non_alphanumeric': 0.13273931916838017, 'fraction_numerical': 0.00731094356865433, 'mean_word_length': 2.8471001757469243, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '403575', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1252, 'n_words': 417}