diff options
author | Valery Sizov <valery@gitlab.com> | 2016-04-19 13:00:38 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-04-20 15:07:06 +0300 |
commit | 1965ff3eb2def05e17b234b416f9c22633509661 (patch) | |
tree | 5b9927a75666f8351064d62b21de775246347661 /app/helpers | |
parent | 55380e69fcd070751a26e368da55968fa3f57419 (diff) | |
download | gitlab-ce-1965ff3eb2def05e17b234b416f9c22633509661.tar.gz |
Backport select_helper from EEbackport_changes_from_ee
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/selects_helper.rb | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/app/helpers/selects_helper.rb b/app/helpers/selects_helper.rb index 4fc6de59a8b..e951a87a212 100644 --- a/app/helpers/selects_helper.rb +++ b/app/helpers/selects_helper.rb @@ -2,32 +2,29 @@ module SelectsHelper def users_select_tag(id, opts = {}) css_class = "ajax-users-select " css_class << "multiselect " if opts[:multiple] + css_class << "skip_ldap " if opts[:skip_ldap] css_class << (opts[:class] || '') value = opts[:selected] || '' - placeholder = opts[:placeholder] || 'Search for a user' - null_user = opts[:null_user] || false - any_user = opts[:any_user] || false - email_user = opts[:email_user] || false - first_user = opts[:first_user] && current_user ? current_user.username : false - current_user = opts[:current_user] || false - author_id = opts[:author_id] || '' - project = opts[:project] || @project + first_user = opts[:first_user] && current_user ? current_user.username : false html = { class: css_class, data: { - placeholder: placeholder, - null_user: null_user, - any_user: any_user, - email_user: email_user, + placeholder: opts[:placeholder] || 'Search for a user', + null_user: opts[:null_user] || false, + any_user: opts[:any_user] || false, + email_user: opts[:email_user] || false, first_user: first_user, - current_user: current_user, - author_id: author_id + current_user: opts[:current_user] || false, + "push-code-to-protected-branches" => opts[:push_code_to_protected_branches], + author_id: opts[:author_id] || '' } } unless opts[:scope] == :all + project = opts[:project] || @project + if project html['data-project-id'] = project.id elsif @group |