summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-13 21:37:50 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-13 23:19:09 +0200
commitbf17d976a7be3404e30a0211c4c9b5ef78bf5104 (patch)
treebab44ff553e83e359b0ebf9c3cf74fbe66479075 /app
parent163908b393bf69e4accbe22cbba1df50fa491649 (diff)
downloadgitlab-ce-bf17d976a7be3404e30a0211c4c9b5ef78bf5104.tar.gz
add api users filter and integrate users select2
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/application.js1
-rw-r--r--app/assets/stylesheets/application.scss1
-rw-r--r--app/assets/stylesheets/common.scss15
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--app/views/team_members/_form.html.haml4
6 files changed, 26 insertions, 1 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 49effdf9c15..adb4009fbc2 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -17,6 +17,7 @@
//= require bootstrap
//= require modernizr
//= require chosen-jquery
+//= require select2
//= require raphael
//= require g.raphael-min
//= require g.bar-min
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index 6b500b88823..f4afc354678 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -5,6 +5,7 @@
*= require jquery.ui.gitlab
*= require jquery.atwho
*= require chosen
+ *= require select2
*= require_self
*/
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index c967c2d1c17..2e7df61e0a9 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -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;
+ }
+}
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 6b72f325204..69d23477493 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -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
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 955dbc17254..45972612baf 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -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
diff --git a/app/views/team_members/_form.html.haml b/app/views/team_members/_form.html.haml
index 63bfbecdc28..e45c6f6fca9 100644
--- a/app/views/team_members/_form.html.haml
+++ b/app/views/team_members/_form.html.haml
@@ -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