Skip to content

Commit

Permalink
Merge pull request #488 from bruecksen/481-bug-hide-fermented-dough-w…
Browse files Browse the repository at this point in the history
…hen-not-available

#481 hide figures if no value available
  • Loading branch information
bruecksen authored May 30, 2024
2 parents e78c6f8 + 799d11c commit 08aa3f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions bakeup/templates/workshop/product_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ <h5>Kennzahlen</h5>
</div>
</div>
</form>
{% if key_figures_form.dough_yield %}{% bootstrap_field key_figures_form.dough_yield size='sm' addon_before='TA' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
{% if key_figures_form.salt %}{% bootstrap_field key_figures_form.salt size='sm' addon_after='%' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
{% if key_figures_form.total_dough_weight %}{% bootstrap_field key_figures_form.total_dough_weight size='sm' addon_after='g' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
{% if key_figures_form.wheat %}{% bootstrap_field key_figures_form.wheat size='sm' wrapper_class='resize-none' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-6' %}{% endif %}
{% if key_figures_form.pre_ferment %}{% bootstrap_field key_figures_form.pre_ferment size='sm' addon_after='%' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
{% if key_figures_form.dough_yield and key_figures_form.dough_yield.value %}{% bootstrap_field key_figures_form.dough_yield size='sm' addon_before='TA' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
{% if key_figures_form.salt and key_figures_form.salt.value %}{% bootstrap_field key_figures_form.salt size='sm' addon_after='%' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
{% if key_figures_form.total_dough_weight and key_figures_form.total_dough_weight.value %}{% bootstrap_field key_figures_form.total_dough_weight size='sm' addon_after='g' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
{% if key_figures_form.wheat and key_figures_form.wheat.value %}{% bootstrap_field key_figures_form.wheat size='sm' wrapper_class='resize-none' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-6' %}{% endif %}
{% if key_figures_form.pre_ferment and key_figures_form.pre_ferment.value %}{% bootstrap_field key_figures_form.pre_ferment size='sm' addon_after='%' wrapper_class='' layout='horizontal' horizontal_label_class='col-6' horizontal_field_class='col-4' %}{% endif %}
</div>
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion bakeup/workshop/templatetags/workshop_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def baker_percentage(weight, flour_weight):

@register.filter
def clever_rounding(value):
if not value:
if value is None:
return None
if float(value) < 100:
return floatformat(round(value, 1), -1)
Expand Down

0 comments on commit 08aa3f7

Please sign in to comment.