Commits

Kai Diefenbach committed 47ebb79

Cleaned up criteria; Fixed issue #28

Comments (0)

Files changed (11)

lfs/templates/manage/criteria/combinedlengthandgirth_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">
+<tr class="criterion" id="criterion-{{ id }}">
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}" />
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
     </td>
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth" selected="selected">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>
     </td>    
     <td>
         <input class="criterion-value"
-               id="text-{{id}}"
+               id="text-{{ id }}"
                type="text" 
-               name="value-{{id}}" 
-               value="{{value}}"/>
+               name="value-{{ id }}" 
+               value="{{ value }}"/>
     </td>           
     <td>
         <a class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
                  alt="Delete" />        
         </a>
     </td>

lfs/templates/manage/criteria/country_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">    
+<tr class="criterion" id="criterion-{{ id }}">
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}" />
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
     </td>
-    
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country" selected="selected">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>
         {% include "manage/criteria/selection_operators.html" %}
     </td>
     <td>
-        <select name="value-{{id}}"
+        <select name="value-{{ id }}"
                 multiple="multiple"
                 size="5">
             {% for country in countries %}
-                <option value="{{country.id}}" {% if country.selected %}selected="selected"{% endif %}>{{country.name}}</option>
-            {% endfor %}    
+                <option value="{{ country.id }}" {% if country.selected %}selected="selected"{% endif %}>{{ country.name }}</option>
+            {% endfor %}
         </select>
     </td>
     <td>
         <a class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
-                 alt="Delete" />        
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
+                 alt="Delete" />
         </a>
     </td>
 </tr>

lfs/templates/manage/criteria/distance_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">
-    
+<tr class="criterion" id="criterion-{{ id }}">
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}">
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}">
     </td>
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance" selected="selected">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>
     </td>
     <td>
         <input class="criterion-value"
-               id="text-{{id}}"
-               type="text" 
-               name="value-{{id}}" 
-               value="{{value}}"/>
+               id="text-{{ id }}"
+               type="text"
+               name="value-{{ id }}"
+               value="{{ value }}"/>
     </td>
     <td>
-        <a class="criterion-add-button"
+        <a   }}class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
-                 alt="Delete" />        
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
+                 alt="Delete" />
         </a>
     </td>
-
 </tr>

lfs/templates/manage/criteria/height_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">
-    
+<tr class="criterion" id="criterion-{{ id }}">
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}">
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}">
     </td>
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height" selected="selected">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height" selected="selected">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>
     </td>
     <td>
         <input class="criterion-value"
-               id="text-{{id}}"
-               type="text" 
-               name="value-{{id}}" 
-               value="{{value}}"/>
+               id="text-{{ id }}"
+               type="text"
+               name="value-{{ id }}"
+               value="{{ value }}"/>
     </td>
     <td>
         <a class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
-                 alt="Delete" />        
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
+                 alt="Delete" />
         </a>
     </td>
-
 </tr>

lfs/templates/manage/criteria/length_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">
+<tr class="criterion" id="criterion-{{ id }}">
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}" />
-    </td>    
-
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
+    </td>
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>
         </select>
     </td>
-    
     <td>
         {% include "manage/criteria/number_operators.html" %}
-    </td>    
-    <td>    
+    </td>
+    <td>
         <input class="criterion-value"
-               id="text-{{id}}"
-               type="text" 
-               name="value-{{id}}" 
-               value="{{value}}"/>           
-    </td>    
+               id="text-{{ id }}"
+               type="text"
+               name="value-{{ id }}"
+               value="{{ value }}"/>
+    </td>
     <td>
         <a class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
-                 alt="Delete" />        
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
+                 alt="Delete" />
         </a>
     </td>
 </tr>

lfs/templates/manage/criteria/payment_method_criterion.html

     <td>
         <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
     </td>
-    
     <td>
         <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method" selected="selected">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>

lfs/templates/manage/criteria/price_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">    
+<tr class="criterion" id="criterion-{{ id }}">
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}" />
-    </td>    
-    
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
+    </td>
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
-            <option value="price" selected="selected">{% trans 'Price' %}</option>
             <option value="height">{% trans 'Height' %}</option>
             <option value="length">{% trans 'Length' %}</option>
+            <option value="payment_method">{% trans 'Payment method' %}</option>
+            <option value="price" selected="selected">{% trans 'Price' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>
         </select>
     </td>
-    
     <td>
         {% include "manage/criteria/number_operators.html" %}
-    </td>    
+    </td>
     <td>
         <input class="criterion-value"
-               type="text" 
-               name="value-{{id}}" 
-               value="{{value}}"/>
+               type="text"
+               name="value-{{ id }}"
+               value="{{ value }}"/>
     </td>
     <td>
         <a class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
-                 alt="Delete" />        
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
+                 alt="Delete" />
         </a>
     </td>
 </tr>

lfs/templates/manage/criteria/shipping_method_criterion.html

     <td>
         <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
     </td>
-    
     <td>
         <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method" selected="selected">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>

lfs/templates/manage/criteria/user_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">
-    
+<tr class="criterion" id="criterion-{{ id }}">    
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}" />
-    </td>
-    
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
+    </td>    
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length" selected="selected">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length" selected="selected">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>
         </select>
-    </td>
-    
+    </td>    
     <td>
         <input class="criterion-value"
-               id="text-{{id}}"
+               id="text-{{ id }}"
                type="text" 
-               name="value-{{id}}" />
-    </td>
-    
+               name="value-{{ id }}" />
+    </td>    
     <td>
         <a class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
                  alt="Delete" />        
         </a>
     </td>

lfs/templates/manage/criteria/weight_criterion.html

 {% load i18n %}
-<tr class="criterion" id="criterion-{{id}}">    
+<tr class="criterion" id="criterion-{{ id }}">
     <td>
-        <input type="text" size="2" class="position" name="position-{{id}}" value="{{position}}" />
+        <input type="text" size="2" class="position" name="position-{{ id }}" value="{{ position }}" />
     </td>
-    
     <td>
-        <select class="criterion-type" name="type-{{id}}">
+        <select class="criterion-type" name="type-{{ id }}">
             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width">{% trans 'Width' %}</option>
             <option value="weight" selected="selected">{% trans 'Weight' %}</option>
         </select>
     </td>
-    
     <td>
         {% include "manage/criteria/number_operators.html" %}
     </td>
-    <td>    
+    <td>
         <input class="criterion-value"
-               id="text-{{id}}"
-               type="text" 
-               name="value-{{id}}" 
-               value="{{value}}"/>
-    </td>           
+               id="text-{{ id }}"
+               type="text"
+               name="value-{{ id }}"
+               value="{{ value }}"/>
+    </td>
     <td>
         <a class="criterion-add-button"
            href="{% url lfs_add_criterion %}">
-            <img src="{{MEDIA_URL}}lfs/icons/add.png"
+            <img src="{{ MEDIA_URL }}lfs/icons/add.png"
                  alt="Add" />
         </a>
         <a class="criterion-delete-button">
-            <img src="{{MEDIA_URL}}lfs/icons/delete.png"
-                 alt="Delete" />        
+            <img src="{{ MEDIA_URL }}lfs/icons/delete.png"
+                 alt="Delete" />
         </a>
     </td>
 </div>

lfs/templates/manage/criteria/width_criterion.html

             <option value="country">{% trans 'Country' %}</option>
             <option value="combinedlengthandgirth">{% trans 'Combined length and girth' %}</option>
             <option value="distance">{% trans 'Distance' %}</option>
+            <option value="height">{% trans 'Height' %}</option>
+            <option value="length">{% trans 'Length' %}</option>
             <option value="payment_method">{% trans 'Payment method' %}</option>
             <option value="price">{% trans 'Price' %}</option>
-            <option value="height">{% trans 'Height' %}</option>
-            <option value="length">{% trans 'Length' %}</option>
             <option value="shipping_method">{% trans 'Shipping method' %}</option>
             <option value="width" selected="selected">{% trans 'Width' %}</option>
             <option value="weight">{% trans 'Weight' %}</option>