diff options
author | Dave Arter <davea@mysociety.org> | 2018-05-31 14:41:12 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-05-31 15:20:23 +0100 |
commit | 19b90689c1d2a9d8a496464820e6fbf9243cf8d4 (patch) | |
tree | b1cd4ab8be3c6df95faf8a87d52c4b23c5a539ff /templates | |
parent | 557d1137f10f481a8fe8c723532b410096c6d965 (diff) |
[Zurich] Don't delete extra fields when editing contact
Editing a contact with extra fields would cause those fields to be
deleted because they weren't included in the POST request when saving.
This change ensures they're present in the DOM, but hidden by default.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/zurich/admin/contact-form.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/templates/web/zurich/admin/contact-form.html b/templates/web/zurich/admin/contact-form.html index 8d8d184e6..3840d46a4 100644 --- a/templates/web/zurich/admin/contact-form.html +++ b/templates/web/zurich/admin/contact-form.html @@ -19,6 +19,16 @@ <input type="text" class="form-control" name="email" value="[% contact.email | html %]" size="30"> <p> + <strong>[% loc('Extra fields:') %]</strong> + [% IF contact.in_storage %] + <a href="#" class="js-show-extra-fields hidden-nojs">([% loc('show') %])</a> + [% END %] + </p> + <div class="js-extra-fields-ui[% IF contact.in_storage %] hidden-js[% END %]"> + [% INCLUDE 'admin/extra-metadata-form.html' metas=(contact.get_metadata_for_input OR []) %] + </div> + + <p> [% IF contact.in_storage %] <label for="state">[% loc('State') %]</label> <select name="state" id="state"> |