Commit 8ec956421c5e94bc2a51e30414d85417c10404b8

Authored by Dmitriy Zaporozhets
2 parents 6667f3db 9c75fcbe

Merge pull request #1539 from NARKOZ/front-end

auto-complete for mentions in notes
Gemfile
... ... @@ -96,6 +96,7 @@ group :assets do
96 96 gem "therubyracer"
97 97  
98 98 gem 'chosen-rails'
  99 + gem 'jquery-atwho-rails', '0.1.6'
99 100 gem "jquery-rails", "2.0.2"
100 101 gem "jquery-ui-rails", "0.5.0"
101 102 gem "modernizr", "2.5.3"
... ...
Gemfile.lock
... ... @@ -199,6 +199,7 @@ GEM
199 199 httpauth (0.1)
200 200 i18n (0.6.1)
201 201 journey (1.0.4)
  202 + jquery-atwho-rails (0.1.6)
202 203 jquery-rails (2.0.2)
203 204 railties (>= 3.2.0, < 5.0)
204 205 thor (~> 0.14)
... ... @@ -440,6 +441,7 @@ DEPENDENCIES
440 441 haml-rails
441 442 headless
442 443 httparty
  444 + jquery-atwho-rails (= 0.1.6)
443 445 jquery-rails (= 2.0.2)
444 446 jquery-ui-rails (= 0.5.0)
445 447 kaminari
... ...
app/assets/javascripts/application.js
... ... @@ -11,6 +11,7 @@
11 11 //= require jquery.endless-scroll
12 12 //= require jquery.highlight
13 13 //= require jquery.waitforimages
  14 +//= require jquery.atwho
14 15 //= require bootstrap
15 16 //= require modernizr
16 17 //= require chosen-jquery
... ...
app/assets/stylesheets/application.css
... ... @@ -4,6 +4,7 @@
4 4 * the top of the compiled file, but it's generally better to create a new file per style scope.
5 5 *= require jquery.ui.all
6 6 *= require jquery.ui.aristo
  7 + *= require jquery.atwho
7 8 *= require chosen
8 9 *= require_self
9 10 *= require main
... ...
app/views/notes/_common_form.html.haml
... ... @@ -37,3 +37,8 @@
37 37 = f.file_field :attachment, class: "input-file"
38 38 %span.hint Any file less than 10 MB
39 39  
  40 +:javascript
  41 + $(function(){
  42 + var names = #{@project.users.pluck(:name)};
  43 + $('.note-text').atWho('@', { data: names });
  44 + });
... ...