Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
89654431
Commit
89654431
authored
Oct 01, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group#ldap_cn selectbox with ajax autocomplete via api
parent
0f69c2f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
app/assets/javascripts/api.js.coffee
app/assets/javascripts/api.js.coffee
+19
-3
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+1
-1
No files found.
app/assets/javascripts/api.js.coffee
View file @
89654431
...
...
@@ -2,13 +2,14 @@
users_path
:
"/api/:version/users.json"
user_path
:
"/api/:version/users/:id.json"
notes_path
:
"/api/:version/projects/:id/notes.json"
ldap_groups_path
:
"/api/:version/ldap/groups.json"
# Get 20 (depends on api) recent notes
# Get 20 (depends on api) recent notes
# and sort the ascending from oldest to newest
notes
:
(
project_id
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
notes_path
)
url
=
url
.
replace
(
':id'
,
project_id
)
$
.
ajax
(
url
:
url
,
data
:
...
...
@@ -37,7 +38,7 @@
# Only active users retrieved
users
:
(
query
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
users_path
)
$
.
ajax
(
url
:
url
data
:
...
...
@@ -52,3 +53,18 @@
buildUrl
:
(
url
)
->
url
=
gon
.
relative_url_root
+
url
if
gon
.
relative_url_root
?
return
url
.
replace
(
':version'
,
gon
.
api_version
)
# Return LDAP groups list. Filtered by query
ldap_groups
:
(
query
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
ldap_groups_path
)
$
.
ajax
(
url
:
url
data
:
private_token
:
gon
.
api_token
search
:
query
per_page
:
20
active
:
true
dataType
:
"json"
).
done
(
groups
)
->
callback
(
groups
)
app/views/groups/edit.html.haml
View file @
89654431
...
...
@@ -76,7 +76,7 @@
=
f
.
label
:ldap_cn
do
LDAP Group cn
.controls
=
f
.
text_field
:ldap_cn
,
placeholder:
"Ex. QA group"
,
class:
"xxlarge lef
t"
=
f
.
hidden_field
:ldap_cn
,
placeholder:
"Ex. QA group"
,
class:
"xxlarge ajax-ldap-groups-selec
t"
.control-group
=
f
.
label
:ldap_access
do
...
...
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