]> git.parisson.com Git - diggersdigest.git/commitdiff
simplify price display management
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 14:47:34 +0000 (16:47 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 14:47:34 +0000 (16:47 +0200)
app/records/static/css/dig2.css
app/templates/pages/category.html
app/templates/shop/includes/price.html
app/templates/shop/product.html

index 6278061138f8af7caa81415bcf535eea96db6a1b..be25ba5cb2c08cdeffd8a30a3d75627e0b54d332 100644 (file)
@@ -62,6 +62,12 @@ hr {
     margin-top: 2em;
 }
 
-.error-msg {
-    font-size: 85%;
+.placeholder {
+        display:block;
+        height:148px;
+        background: white;
+}
+
+.unavailable-msg {
+    font-weight: bold;
 }
index 683b3d13b1f21712734429883e0eab9ac5b6c282..d20803500f28e310aeb1066660cb9fab91eca802 100644 (file)
           <div class="price-info">
             {% if product.variations.all %}
             {% with product.variations.all as variations and True as category %}
-            {% if product.available  %}
             {% include "shop/includes/price.html" %}
-            {% else %}
-            <span class="error-msg">{% trans "This product is currently unavailable." %}</span>
-            {% endif %}
             {% endwith %}
             {% endif %}
           </div>
index bf8de99dd6dac2b583855d0c92b58eb673e6f35b..75ebf7564962ca72030babf4c280886c5dfaa442 100644 (file)
@@ -3,6 +3,7 @@
 <ul id="variations" class="list-unstyled">
     {% for variation in variations %}
     <li id="variation-{{ variation.sku }}" {% if not variation.default %}style="display:none;"{% endif %}>
+      {% if product.available  %}
         {% if variation.has_price %}
             {% if product.available %}
              {% if not variation.unit_price and not category %}
@@ -20,6 +21,9 @@
             </span>
             {% endif %}
         {% endif %}
+      {% else %}
+      <span {% if not category %}class="error-msg"{% else %}class="unavailable-msg"{% endif %}>{% trans "Currently unavailable" %}</span>
+      {% endif %}
     </li>
     {% endfor %}
 </ul>
index 79a221dcfa3c203a708c5e22707d711327caca06..62b0fecd1b926ae4bd45d129d832021ba4cdebf2 100644 (file)
@@ -130,10 +130,8 @@ $(function () {
     {{ product.record.vinyl_condition.abbr }}
     </a>
   </li>
-  {% if product.available and has_available_variations %}
+  {% if has_available_variations %}
   <li>{% include "shop/includes/price.html" %}</li>
-  {% else %}
-  <li><span class="error-msg">{% trans "This product is currently unavailable." %}</span></li>
   {% endif %}
 </ul>