Commit ce1c8afe4e65e55efa1feadbb3d48eb20e92a24f
1 parent
82270a3f
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
@@ -40,6 +40,13 @@ | @@ -40,6 +40,13 @@ | ||
40 | <%= render :partial => partial_for_class(task.class, nil, :reject_details), :locals => {:task => task, :f => f} %> | 40 | <%= render :partial => partial_for_class(task.class, nil, :reject_details), :locals => {:task => task, :f => f} %> |
41 | </div> | 41 | </div> |
42 | <% end %> | 42 | <% end %> |
43 | + | ||
44 | + <div class="formfieldline"> | ||
45 | + <div class="formfield tag-list-fields"> | ||
46 | + <%= labelled_text_field(_('Tags'),"tasks[#{task.id}][task][tag_list]", '', :size => 36, :class => 'tag-list') %> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + | ||
43 | <% end %> | 50 | <% end %> |
44 | 51 | ||
45 | </div><!-- class="task_box" --> | 52 | </div><!-- class="task_box" --> |
app/views/tasks/index.html.erb
@@ -51,6 +51,13 @@ | @@ -51,6 +51,13 @@ | ||
51 | </p> | 51 | </p> |
52 | </ul> | 52 | </ul> |
53 | 53 | ||
54 | + <script> | ||
55 | + jQuery('.tag-list').inputosaurus({ | ||
56 | + autoCompleteSource: <%= "'/myprofile/#{profile.identifier}/cms/search_tags'," %> | ||
57 | + activateFinalResult : true | ||
58 | + }) | ||
59 | + </script> | ||
60 | + | ||
54 | <%= pagination_links(@tasks)%> | 61 | <%= pagination_links(@tasks)%> |
55 | 62 | ||
56 | <% button_bar do %> | 63 | <% button_bar do %> |
public/stylesheets/tasks.css
@@ -44,3 +44,23 @@ | @@ -44,3 +44,23 @@ | ||
44 | text-decoration: underline; | 44 | text-decoration: underline; |
45 | font-weight: bold; | 45 | font-weight: bold; |
46 | } | 46 | } |
47 | + | ||
48 | +/* Task tags list */ | ||
49 | + | ||
50 | +.formfieldline label { | ||
51 | + font-weight: bold; | ||
52 | + margin: 0 5px 0 10px; | ||
53 | +} | ||
54 | + | ||
55 | +.formfieldline .inputosaurus-container { | ||
56 | + vertical-align: middle; | ||
57 | +} | ||
58 | + | ||
59 | +.tag-list-fields input { | ||
60 | + background-color: #fff !important; | ||
61 | +} | ||
62 | + | ||
63 | +.formfield.tag-list-fields .ui-autocomplete-loading { | ||
64 | + background: url('/images/loading-small.gif') right center no-repeat !important; | ||
65 | + background-color: #fff !important; | ||
66 | +} |