Commit bf17d976 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

add api users filter and integrate users select2

parent 163908b3
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
//= require bootstrap //= require bootstrap
//= require modernizr //= require modernizr
//= require chosen-jquery //= require chosen-jquery
//= require select2
//= require raphael //= require raphael
//= require g.raphael-min //= require g.raphael-min
//= require g.bar-min //= require g.bar-min
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*= require jquery.ui.gitlab *= require jquery.ui.gitlab
*= require jquery.atwho *= require jquery.atwho
*= require chosen *= require chosen
*= require select2
*= require_self *= require_self
*/ */
......
...@@ -554,3 +554,18 @@ img.emoji { ...@@ -554,3 +554,18 @@ img.emoji {
.appear-data { .appear-data {
display: none; display: none;
} }
.ajax-users-select {
width: 400px;
}
.user-result {
.user-image {
float: left;
}
.user-name {
}
.user-username {
color: #999;
}
}
...@@ -152,5 +152,7 @@ class ApplicationController < ActionController::Base ...@@ -152,5 +152,7 @@ class ApplicationController < ActionController::Base
def add_gon_variables def add_gon_variables
gon.default_issues_tracker = Project.issues_tracker.default_value gon.default_issues_tracker = Project.issues_tracker.default_value
gon.api_token = current_user.private_token
gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
end end
end end
...@@ -169,4 +169,8 @@ module ApplicationHelper ...@@ -169,4 +169,8 @@ module ApplicationHelper
end end
alias_method :url_to_image, :image_url alias_method :url_to_image, :image_url
def users_select_tag(id)
hidden_field_tag(id, '', class: "ajax-users-select")
end
end end
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
%h6 1. Choose people you want in the team %h6 1. Choose people you want in the team
.clearfix .clearfix
= f.label :user_ids, "People" = f.label :user_ids, "People"
.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}) .input
= users_select_tag(:user_ids)
-#= 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})
%h6 2. Set access level for them %h6 2. Set access level for them
.clearfix .clearfix
......
...@@ -9,7 +9,8 @@ module Gitlab ...@@ -9,7 +9,8 @@ module Gitlab
# Example Request: # Example Request:
# GET /users # GET /users
get do get do
@users = paginate User @users = User.scoped
@users = @users.search(params[:search]) if params[:search].present?
present @users, with: Entities::User present @users, with: Entities::User
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment