Commit 9db9c4b8496840e2db21b7f45dc5e3025eee7071
Committed by
Leandro Santos
1 parent
b4000b01
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Added tags widget on tasks list using inputosaurus jquery plugin
Showing
3 changed files
with
34 additions
and
0 deletions
Show diff stats
app/views/tasks/_task.html.erb
... | ... | @@ -61,6 +61,13 @@ |
61 | 61 | <%= render :partial => partial_for_class(task.class, nil, :reject_details), :locals => {:task => task, :f => f} %> |
62 | 62 | </div> |
63 | 63 | <% end %> |
64 | + | |
65 | + <div class="formfieldline"> | |
66 | + <div class="formfield tag-list-fields"> | |
67 | + <%= labelled_text_field(_('Tags'),"tasks[#{task.id}][task][tag_list]", '', :size => 36, :class => 'tag-list') %> | |
68 | + </div> | |
69 | + </div> | |
70 | + | |
64 | 71 | <% end %> |
65 | 72 | |
66 | 73 | </div><!-- class="task_box" --> | ... | ... |
app/views/tasks/index.html.erb
... | ... | @@ -72,6 +72,13 @@ |
72 | 72 | <% end %> |
73 | 73 | </ul> |
74 | 74 | |
75 | + <script> | |
76 | + jQuery('.tag-list').inputosaurus({ | |
77 | + autoCompleteSource: <%= "'/myprofile/#{profile.identifier}/cms/search_tags'," %> | |
78 | + activateFinalResult : true | |
79 | + }) | |
80 | + </script> | |
81 | + | |
75 | 82 | <%= pagination_links(@tasks)%> |
76 | 83 | |
77 | 84 | <% button_bar(:class => 'task-actions') do %> | ... | ... |
public/stylesheets/tasks.css
... | ... | @@ -53,3 +53,23 @@ |
53 | 53 | .task_responsible { |
54 | 54 | text-align: right; |
55 | 55 | } |
56 | + | |
57 | +/* Task tags list */ | |
58 | + | |
59 | +.formfieldline label { | |
60 | + font-weight: bold; | |
61 | + margin: 0 5px 0 10px; | |
62 | +} | |
63 | + | |
64 | +.formfieldline .inputosaurus-container { | |
65 | + vertical-align: middle; | |
66 | +} | |
67 | + | |
68 | +.tag-list-fields input { | |
69 | + background-color: #fff !important; | |
70 | +} | |
71 | + | |
72 | +.formfield.tag-list-fields .ui-autocomplete-loading { | |
73 | + background: url('/images/loading-small.gif') right center no-repeat !important; | |
74 | + background-color: #fff !important; | |
75 | +} | ... | ... |