Sfoglia il codice sorgente

Adjust how the "action" param is submitted in order list page

Before this change, the "download as CSV" button wasn't working as there
were two hidden "action" inputs and only the value of the "change order
status" button was being picked up.

This change uses button name attributes to determine which button was
submitted.
master
David Winterbottom 11 anni fa
parent
commit
06c2441e91
1 ha cambiato i file con 2 aggiunte e 5 eliminazioni
  1. 2
    5
      oscar/templates/oscar/dashboard/orders/order_list.html

+ 2
- 5
oscar/templates/oscar/dashboard/orders/order_list.html Vedi File

@@ -82,8 +82,7 @@
82 82
                     <div class="pull-right">
83 83
                         <div class="form-inline">
84 84
                             <label>{% trans "Download selected orders as a CSV" %}</label>
85
-                            <input type="hidden" name="action" value="download_selected_orders" />
86
-                            <button type="submit" class="btn btn-primary" name="download_selected">{% trans "Download" %}</button>
85
+                            <button type="submit" class="btn btn-primary" name="action" value="download_selected_orders">{% trans "Download" %}</button>
87 86
                         </div>
88 87
                     </div>
89 88
                 </caption>
@@ -147,9 +146,7 @@
147 146
                                 
148 147
                             </div>
149 148
                         </div>
150
-                        
151
-                        <input type="hidden" value="change_order_statuses" name="action" />
152
-                        <input type="submit" value="{% trans "Change status" %}" class="btn btn-primary" />
149
+                        <button type="submit" name="action" value="change_order_statuses" class="btn btn-primary">{% trans "Change status" %}</button>
153 150
                     {% else %}
154 151
                         {% trans "This order can't have its status changed." %}
155 152
                     {% endif %}

Loading…
Annulla
Salva