Skip to content

Commit

Permalink
Display non field errors in dashboard for stock records
Browse files Browse the repository at this point in the history
On this form errors are raised globally and not by individual field.
This commit adds a errors line in the form table. It needs to be added
extra styling to this form.

Fixes #955
Fixes #918
  • Loading branch information
andrefsp authored and maiksprenger committed Nov 7, 2013
1 parent e579cf4 commit 75ef01a
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions oscar/templates/oscar/dashboard/catalogue/product_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,19 +333,28 @@ <h3>{% trans "Upload, change or remove images" %}</h3>
</thead>
<tbody>
{% for stockrecord_form in stockrecord_formset %}
{% if stockrecord_form.non_field_errors %}
<tr>
<td colspan="10">
{% for error in stockrecord_form.non_field_errors %}
<span class="help-block errorlist"><i class="icon-exclamation-sign"></i> {{ error }}</span>
{% endfor %}
</td>
</tr>
{% endif %}
<tr>
<td>{% include "partials/form_field.html" with field=stockrecord_form.partner nolabel=True %}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.partner_sku nolabel=True%}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.num_in_stock nolabel=True%}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.partner_sku nolabel=True %}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.num_in_stock nolabel=True %}</td>
<td>{{ stockrecord_form.instance.num_allocated|default:"-" }}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.low_stock_threshold nolabel=True%}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.price_currency nolabel=True%}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.cost_price nolabel=True%}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.price_excl_tax nolabel=True%}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.price_retail nolabel=True%}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.low_stock_threshold nolabel=True %}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.price_currency nolabel=True %}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.cost_price nolabel=True %}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.price_excl_tax nolabel=True %}</td>
<td>{% include "partials/form_field.html" with field=stockrecord_form.price_retail nolabel=True %}</td>
<td>
{% include "partials/form_field.html" with field=stockrecord_form.id nolabel=True%}
{% include "partials/form_field.html" with field=stockrecord_form.DELETE nolabel=True%}
{% include "partials/form_field.html" with field=stockrecord_form.id nolabel=True %}
{% include "partials/form_field.html" with field=stockrecord_form.DELETE nolabel=True %}
</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit 75ef01a

Please sign in to comment.