Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
a5d285bdb131
Commit
a1f5ae98
authored
Mar 12, 2015
by
Marin Jankovski
Browse files
Show asterisks instead of password in service edit form.
parent
99ac4cf6bc64
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/helpers/projects_helper.rb
View file @
a5d285bd
...
...
@@ -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
app/views/projects/services/_form.html.haml
View file @
a5d285bd
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment