|
29 | 29 | <%= f.label_for_field :description, :required => @issue.required_attribute?('description') %> |
30 | 30 | <%= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> |
31 | 31 | <%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %> |
32 | | - <%= f.text_area :description, |
33 | | - :cols => 60, |
34 | | - :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), |
35 | | - :accesskey => accesskey(:edit), |
36 | | - :class => 'wiki-edit', |
| 32 | + <%= f.text_area :description, :cols => 60, :accesskey => accesskey(:edit), :class => 'wiki-edit', |
| 33 | + :rows => [[10, @issue.description.to_s.length / 50].max, 20].min, |
| 34 | + :data => { |
| 35 | + :auto_complete => true, |
| 36 | + }, |
37 | 37 | :no_label => true %> |
38 | 38 | <% end %> |
39 | 39 | </p> |
|
48 | 48 | <% end %> |
49 | 49 |
|
50 | 50 | <% heads_for_wiki_formatter %> |
| 51 | +<%= heads_for_auto_complete(@issue.project) %> |
| 52 | + |
| 53 | +<% if User.current.allowed_to?(:add_issue_watchers, @issue.project)%> |
| 54 | + <%= update_data_sources_for_auto_complete({users: watchers_autocomplete_for_mention_path(project_id: @issue.project, q: '', object_type: 'issue', |
| 55 | + object_id: @issue.id)}) %> |
| 56 | +<% end %> |
51 | 57 |
|
52 | 58 | <%= javascript_tag do %> |
53 | 59 | $(document).ready(function(){ |
54 | 60 | $("#issue_tracker_id, #issue_status_id").each(function(){ |
55 | 61 | $(this).val($(this).find("option[selected=selected]").val()); |
56 | 62 | }); |
| 63 | + $(".assign-to-me-link").click(function(event){ |
| 64 | + event.preventDefault(); |
| 65 | + var element = $(event.target); |
| 66 | + $('#issue_assigned_to_id').val(element.data('id')); |
| 67 | + element.hide(); |
| 68 | + }); |
| 69 | + $('#issue_assigned_to_id').change(function(event){ |
| 70 | + var assign_to_me_link = $(".assign-to-me-link"); |
| 71 | + |
| 72 | + if (assign_to_me_link.length > 0) { |
| 73 | + var user_id = $(event.target).val(); |
| 74 | + var current_user_id = assign_to_me_link.data('id'); |
| 75 | + |
| 76 | + if (user_id == current_user_id) { |
| 77 | + assign_to_me_link.hide(); |
| 78 | + } else { |
| 79 | + assign_to_me_link.show(); |
| 80 | + } |
| 81 | + } |
| 82 | + }); |
57 | 83 | }); |
58 | 84 | <% end %> |
0 commit comments