aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/app/controller/contact.t2
-rw-r--r--templates/web/base/contact/index.html6
-rw-r--r--web/cobrands/sass/_base.scss15
3 files changed, 22 insertions, 1 deletions
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t
index d98d81868..0e87eb4cc 100644
--- a/t/app/controller/contact.t
+++ b/t/app/controller/contact.t
@@ -210,6 +210,7 @@ for my $test (
# we santise this when we submit so need to remove it
delete $test->{fields}->{id}
if $test->{fields}->{id} and $test->{fields}->{id} eq 'invalid';
+ $test->{fields}->{'extra.phone'} = '';
is_deeply $mech->visible_form_values, $test->{fields}, 'form values';
};
}
@@ -323,6 +324,7 @@ for my $test (
# we santise this when we submit so need to remove it
delete $test->{fields}->{id}
if $test->{fields}->{id} and $test->{fields}->{id} eq 'invalid';
+ $test->{fields}->{'extra.phone'} = '';
is_deeply $mech->visible_form_values, $test->{fields}, 'form values';
if ( $test->{fields}->{dest} and $test->{fields}->{dest} eq 'update' ) {
diff --git a/templates/web/base/contact/index.html b/templates/web/base/contact/index.html
index f24f8afea..c79091668 100644
--- a/templates/web/base/contact/index.html
+++ b/templates/web/base/contact/index.html
@@ -77,13 +77,17 @@
[% END %]
<input type="text" class="form-control required" name="name" id="form_name" value="[% form_name | html %]" size="30">
-
<label for="form_email">[% loc('Your email') %]</label>
[% IF field_errors.em %]
<div class="form-error">[% field_errors.em %]</div>
[% END %]
<input type="text" class="form-control required email" name="em" id="form_email" value="[% em | html %]" size="30">
+ <div class="form-group">
+ <label for="form_phone">[% loc('Your phone number') %]</label>
+ <span class="required-text required-text--optional">optional</span>
+ <input type="text" class="form-control extra.phone" name="extra.phone" id="form_phone" value="" size="30">
+ </div>
<label for="form_subject">[% loc('Subject') %]</label>
[% IF field_errors.subject %]
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index 5866ab986..8863487ba 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -294,6 +294,21 @@ select.form-control {
}
}
+.form-group {
+ position: relative;
+ max-width: 27em;
+}
+
+.required-text {
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.required-text--optional {
+ color: #666;
+}
+
.form-section-heading {
font-family: inherit;
color: inherit;