Commit 8ec956421c5e94bc2a51e30414d85417c10404b8
Exists in
master
and in
4 other branches
Merge pull request #1539 from NARKOZ/front-end
auto-complete for mentions in notes
Showing
5 changed files
with
10 additions
and
0 deletions
Show diff stats
Gemfile
@@ -96,6 +96,7 @@ group :assets do | @@ -96,6 +96,7 @@ group :assets do | ||
96 | gem "therubyracer" | 96 | gem "therubyracer" |
97 | 97 | ||
98 | gem 'chosen-rails' | 98 | gem 'chosen-rails' |
99 | + gem 'jquery-atwho-rails', '0.1.6' | ||
99 | gem "jquery-rails", "2.0.2" | 100 | gem "jquery-rails", "2.0.2" |
100 | gem "jquery-ui-rails", "0.5.0" | 101 | gem "jquery-ui-rails", "0.5.0" |
101 | gem "modernizr", "2.5.3" | 102 | gem "modernizr", "2.5.3" |
Gemfile.lock
@@ -199,6 +199,7 @@ GEM | @@ -199,6 +199,7 @@ GEM | ||
199 | httpauth (0.1) | 199 | httpauth (0.1) |
200 | i18n (0.6.1) | 200 | i18n (0.6.1) |
201 | journey (1.0.4) | 201 | journey (1.0.4) |
202 | + jquery-atwho-rails (0.1.6) | ||
202 | jquery-rails (2.0.2) | 203 | jquery-rails (2.0.2) |
203 | railties (>= 3.2.0, < 5.0) | 204 | railties (>= 3.2.0, < 5.0) |
204 | thor (~> 0.14) | 205 | thor (~> 0.14) |
@@ -440,6 +441,7 @@ DEPENDENCIES | @@ -440,6 +441,7 @@ DEPENDENCIES | ||
440 | haml-rails | 441 | haml-rails |
441 | headless | 442 | headless |
442 | httparty | 443 | httparty |
444 | + jquery-atwho-rails (= 0.1.6) | ||
443 | jquery-rails (= 2.0.2) | 445 | jquery-rails (= 2.0.2) |
444 | jquery-ui-rails (= 0.5.0) | 446 | jquery-ui-rails (= 0.5.0) |
445 | kaminari | 447 | kaminari |
app/assets/javascripts/application.js
@@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
11 | //= require jquery.endless-scroll | 11 | //= require jquery.endless-scroll |
12 | //= require jquery.highlight | 12 | //= require jquery.highlight |
13 | //= require jquery.waitforimages | 13 | //= require jquery.waitforimages |
14 | +//= require jquery.atwho | ||
14 | //= require bootstrap | 15 | //= require bootstrap |
15 | //= require modernizr | 16 | //= require modernizr |
16 | //= require chosen-jquery | 17 | //= require chosen-jquery |
app/assets/stylesheets/application.css
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | * the top of the compiled file, but it's generally better to create a new file per style scope. | 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. |
5 | *= require jquery.ui.all | 5 | *= require jquery.ui.all |
6 | *= require jquery.ui.aristo | 6 | *= require jquery.ui.aristo |
7 | + *= require jquery.atwho | ||
7 | *= require chosen | 8 | *= require chosen |
8 | *= require_self | 9 | *= require_self |
9 | *= require main | 10 | *= require main |
app/views/notes/_common_form.html.haml
@@ -37,3 +37,8 @@ | @@ -37,3 +37,8 @@ | ||
37 | = f.file_field :attachment, class: "input-file" | 37 | = f.file_field :attachment, class: "input-file" |
38 | %span.hint Any file less than 10 MB | 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 | + }); |