diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-02 17:03:15 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-02 17:03:15 +0300 |
commit | dab266219441144a74b86fa27f4e0528810482d1 (patch) | |
tree | 1ac4d6a649cc568c38a1fff2a999811d432c5378 /app/views/shared | |
parent | 84b9aae9cfb8c319d06bcce1e93c2b1bc6f44877 (diff) | |
parent | 6838c16c49185fb72aa58a9c6591da4ec0fc7acb (diff) |
Merge branch '31511-jira-settings' into 'master'
Simplify test&save actions when setting a service integration
Closes #31511
See merge request !11599
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/_field.html.haml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/views/shared/_field.html.haml b/app/views/shared/_field.html.haml index d74b0043949..795447a9ca6 100644 --- a/app/views/shared/_field.html.haml +++ b/app/views/shared/_field.html.haml @@ -3,6 +3,7 @@ - value = @service.send(name) - type = field[:type] - placeholder = field[:placeholder] +- required = field[:required] - choices = field[:choices] - default_choice = field[:default_choice] - help = field[:help] @@ -14,14 +15,14 @@ = form.label name, title, class: "control-label" .col-sm-10 - if type == 'text' - = form.text_field name, class: "form-control", placeholder: placeholder + = form.text_field name, class: "form-control", placeholder: placeholder, required: required - elsif type == 'textarea' - = form.text_area name, rows: 5, class: "form-control", placeholder: placeholder + = form.text_area name, rows: 5, class: "form-control", placeholder: placeholder, required: required - elsif type == 'checkbox' = form.check_box name - elsif type == 'select' = form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" } - elsif type == 'password' - = form.password_field name, autocomplete: "new-password", class: "form-control" + = form.password_field name, autocomplete: "new-password", class: "form-control", required: value.blank? && :required - if help %span.help-block= help |