From 036f2a88803f7dd78cf72a7c643ca5c98e8454c2 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 22 Aug 2016 14:05:42 +0100 Subject: [PATCH] Allow `text_field`s to have an optional status Status is used for making the text greyed-out or red, etc. --- app/templates/components/table.html | 4 ++-- app/templates/views/service-settings.html | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/templates/components/table.html b/app/templates/components/table.html index ba4266d0b..bf8893592 100644 --- a/app/templates/components/table.html +++ b/app/templates/components/table.html @@ -73,8 +73,8 @@ {% endmacro %} -{% macro text_field(text) -%} - {% call field() %} +{% macro text_field(text, status='') -%} + {% call field(status=status) %} {{ text }} {% endcall %} {%- endmacro %} diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index b66d838e4..14c5d28fd 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -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() %}