Allow text_fields to have an optional status

Status is used for making the text greyed-out or red, etc.
This commit is contained in:
Chris Hill-Scott
2016-08-22 14:05:42 +01:00
parent fc93d9ff52
commit 036f2a8880
2 changed files with 6 additions and 3 deletions

View File

@@ -73,8 +73,8 @@
</td>
{% endmacro %}
{% macro text_field(text) -%}
{% call field() %}
{% macro text_field(text, status='') -%}
{% call field(status=status) %}
{{ text }}
{% endcall %}
{%- endmacro %}

View File

@@ -23,7 +23,10 @@
{% endcall %}
{% call row() %}
{{ text_field('Email reply to address')}}
{{ text_field(current_service.reply_to_email_address) }}
{{ text_field(
current_service.reply_to_email_address,
status='' if current_service.reply_to_email_address else 'default'
) }}
{{ edit_field('Change', url_for('.service_set_reply_to_email', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}