27 |
27 |
|
28 |
28 |
<% if @issue.safe_attribute? 'subject' %>
|
29 |
29 |
<p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true %></p>
|
|
30 |
<% if @issue.new_record? %>
|
|
31 |
<div class="notice">
|
|
32 |
<div id="similar_issues">
|
|
33 |
</div>
|
|
34 |
</div>
|
|
35 |
<% end %>
|
30 |
36 |
<% end %>
|
31 |
37 |
|
32 |
38 |
<% if @issue.safe_attribute? 'description' %>
|
... | ... | |
56 |
62 |
<% heads_for_wiki_formatter %>
|
57 |
63 |
|
58 |
64 |
<%= javascript_tag do %>
|
|
65 |
<% if @issue.new_record? %>
|
|
66 |
options = {
|
|
67 |
response: function(e,ui){
|
|
68 |
if(ui.content.length>0){
|
|
69 |
$('#similar_issues').html('<%= l(:text_following_issues_might_be_similar) %> <%= link_to_function l(:button_hide), "$('#similar_issues').html('');" %><ul></ul>');
|
|
70 |
$.each(ui.content, function(index,elm) { $('#similar_issues ul').append('<li><a href=\"/issues/' + elm.id + '\">' + elm.label + '</li>'); });
|
|
71 |
}else{
|
|
72 |
$('#similar_issues').html('');
|
|
73 |
}
|
|
74 |
},
|
|
75 |
open: function(e,ui){ $(".ui-autocomplete").hide(); }
|
|
76 |
}
|
|
77 |
observeAutocompleteField('issue_subject', '<%= "#{escape_javascript auto_complete_issues_path(:project_id => @issue.project, :scope => Setting.cross_project_subtasks, :status => @issue.closed? ? 'c' : 'o', :issue_id => @issue.id)}" %>', options);
|
|
78 |
<% end %>
|
59 |
79 |
$(document).ready(function(){
|
60 |
80 |
$("#issue_tracker_id, #issue_status_id").each(function(){
|
61 |
81 |
$(this).val($(this).find("option[selected=selected]").val());
|
62 |
82 |
});
|
|
83 |
<% if @issue.new_record? %>
|
|
84 |
$("#issue_subject").keyup(function(){if($(this).val().length<2){$('#similar_issues').html('');}});
|
|
85 |
$("#issue_subject").removeClass("autocomplete");
|
|
86 |
<% end %>
|
63 |
87 |
});
|
64 |
88 |
<% end %>
|