BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a1f5ae98
Commit
a1f5ae98
authored
Mar 12, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show asterisks instead of password in service edit form.
parent
5d27b23d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
projects_helper.rb
app/helpers/projects_helper.rb
+10
-0
_form.html.haml
app/views/projects/services/_form.html.haml
+2
-2
No files found.
app/helpers/projects_helper.rb
View file @
a1f5ae98
...
...
@@ -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
app/views/projects/services/_form.html.haml
View file @
a1f5ae98
...
...
@@ -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