Commit 1c3997a7 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Merge branch 'replace_passwords_with_asterisk' into 'master'

Show asterisks instead of password in service edit form.

See merge request !1686
......@@ -265,4 +265,14 @@ def project_status_css_class(status)
"success"
end
end
def service_field_value(type, value)
return value unless type == 'password'
if value.present?
"***********"
else
nil
end
end
end
......@@ -75,7 +75,7 @@
- @service.fields.each do |field|
- name = field[:name]
- title = field[:title] || name.humanize
- value = @service.send(name) unless field[:type] == 'password'
- value = service_field_value(field[:type], @service.send(name))
- type = field[:type]
- placeholder = field[:placeholder]
- choices = field[:choices]
......@@ -94,7 +94,7 @@
- elsif type == 'select'
= f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
- elsif type == 'password'
= f.password_field name, class: 'form-control'
= f.password_field name, placeholder: value, class: 'form-control'
- if help
%span.help-block= help
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment