Skip to content
Snippets Groups Projects
Commit bf17d976 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

add api users filter and integrate users select2

parent 163908b3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -17,6 +17,7 @@
//= require bootstrap
//= require modernizr
//= require chosen-jquery
//= require select2
//= require raphael
//= require g.raphael-min
//= require g.bar-min
Loading
Loading
Loading
Loading
@@ -5,6 +5,7 @@
*= require jquery.ui.gitlab
*= require jquery.atwho
*= require chosen
*= require select2
*= require_self
*/
 
Loading
Loading
Loading
Loading
@@ -554,3 +554,18 @@ img.emoji {
.appear-data {
display: none;
}
.ajax-users-select {
width: 400px;
}
.user-result {
.user-image {
float: left;
}
.user-name {
}
.user-username {
color: #999;
}
}
Loading
Loading
@@ -152,5 +152,7 @@ class ApplicationController < ActionController::Base
 
def add_gon_variables
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
Loading
Loading
@@ -169,4 +169,8 @@ module ApplicationHelper
end
 
alias_method :url_to_image, :image_url
def users_select_tag(id)
hidden_field_tag(id, '', class: "ajax-users-select")
end
end
Loading
Loading
@@ -11,7 +11,9 @@
%h6 1. Choose people you want in the team
.clearfix
= 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
.clearfix
Loading
Loading
Loading
Loading
@@ -9,7 +9,8 @@ module Gitlab
# Example Request:
# GET /users
get do
@users = paginate User
@users = User.scoped
@users = @users.search(params[:search]) if params[:search].present?
present @users, with: Entities::User
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment