Skip to content
Snippets Groups Projects
Commit a1f5ae98 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Show asterisks instead of password in service edit form.

parent 5d27b23d
No related branches found
No related tags found
1 merge request!8686add "Uplaod" and "Replace" functionality
Loading
Loading
@@ -265,4 +265,14 @@ module ProjectsHelper
"success"
end
end
def service_field_value(type, value)
return value unless type == 'password'
if value.present?
"***********"
else
nil
end
end
end
Loading
Loading
@@ -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]
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment