Commit bf17d976a7be3404e30a0211c4c9b5ef78bf5104
1 parent
163908b3
Exists in
master
and in
4 other branches
add api users filter and integrate users select2
Showing
7 changed files
with
28 additions
and
2 deletions
Show diff stats
app/assets/javascripts/application.js
app/assets/stylesheets/application.scss
app/assets/stylesheets/common.scss
| ... | ... | @@ -554,3 +554,18 @@ img.emoji { |
| 554 | 554 | .appear-data { |
| 555 | 555 | display: none; |
| 556 | 556 | } |
| 557 | + | |
| 558 | +.ajax-users-select { | |
| 559 | + width: 400px; | |
| 560 | +} | |
| 561 | + | |
| 562 | +.user-result { | |
| 563 | + .user-image { | |
| 564 | + float: left; | |
| 565 | + } | |
| 566 | + .user-name { | |
| 567 | + } | |
| 568 | + .user-username { | |
| 569 | + color: #999; | |
| 570 | + } | |
| 571 | +} | ... | ... |
app/controllers/application_controller.rb
| ... | ... | @@ -152,5 +152,7 @@ class ApplicationController < ActionController::Base |
| 152 | 152 | |
| 153 | 153 | def add_gon_variables |
| 154 | 154 | gon.default_issues_tracker = Project.issues_tracker.default_value |
| 155 | + gon.api_token = current_user.private_token | |
| 156 | + gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url | |
| 155 | 157 | end |
| 156 | 158 | end | ... | ... |
app/helpers/application_helper.rb
app/views/team_members/_form.html.haml
| ... | ... | @@ -11,7 +11,9 @@ |
| 11 | 11 | %h6 1. Choose people you want in the team |
| 12 | 12 | .clearfix |
| 13 | 13 | = f.label :user_ids, "People" |
| 14 | - .input= select_tag(:user_ids, options_from_collection_for_select(User.active.not_in_project(@project).alphabetically, :id, :name_with_username), {data: {placeholder: "Select users"}, class: "chosen xxlarge", multiple: true}) | |
| 14 | + .input | |
| 15 | + = users_select_tag(:user_ids) | |
| 16 | + -#= select_tag(:user_ids, options_from_collection_for_select(User.active.not_in_project(@project).alphabetically, :id, :name_with_username), {data: {placeholder: "Select users"}, class: "chosen xxlarge", multiple: true}) | |
| 15 | 17 | |
| 16 | 18 | %h6 2. Set access level for them |
| 17 | 19 | .clearfix | ... | ... |
lib/api/users.rb