##// END OF EJS Templates
Optimize issue edit description link (#21085)....
Jean-Philippe Lang -
r14371:a399924b4947
parent child
Show More
@@ -1,55 +1,55
1 1 <%= labelled_fields_for :issue, @issue do |f| %>
2 2 <%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %>
3 3
4 4 <% if @issue.safe_attribute? 'is_private' %>
5 5 <p style="float:right; margin-right:1em;">
6 6 <%= f.check_box :is_private, :no_label => true %><label class="inline" for="issue_is_private" id="issue_is_private_label"><%= l(:field_is_private) %></label>
7 7 </p>
8 8 <% end %>
9 9
10 10 <% if @issue.safe_attribute?('project_id') && (!@issue.new_record? || @project.nil? || @issue.copy?) %>
11 11 <p><%= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), {:required => true},
12 12 :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}')" %></p>
13 13 <% end %>
14 14
15 15 <% if @issue.safe_attribute? 'tracker_id' %>
16 16 <p><%= f.select :tracker_id, @issue.project.trackers.collect {|t| [t.name, t.id]}, {:required => true},
17 17 :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}')" %></p>
18 18 <% end %>
19 19
20 20 <% if @issue.safe_attribute? 'subject' %>
21 21 <p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true %></p>
22 22 <% end %>
23 23
24 24 <% if @issue.safe_attribute? 'description' %>
25 25 <p>
26 26 <%= f.label_for_field :description, :required => @issue.required_attribute?('description') %>
27 <%= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
27 <%= link_to_function content_tag(:span, l(:button_edit), :class => 'icon icon-edit'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
28 28 <%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %>
29 29 <%= f.text_area :description,
30 30 :cols => 60,
31 31 :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
32 32 :accesskey => accesskey(:edit),
33 33 :class => 'wiki-edit',
34 34 :no_label => true %>
35 35 <% end %>
36 36 </p>
37 37 <%= wikitoolbar_for 'issue_description' %>
38 38 <% end %>
39 39
40 40 <div id="attributes" class="attributes">
41 41 <%= render :partial => 'issues/attributes' %>
42 42 </div>
43 43
44 44 <%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
45 45 <% end %>
46 46
47 47 <% heads_for_wiki_formatter %>
48 48
49 49 <%= javascript_tag do %>
50 50 $(document).ready(function(){
51 51 $("#issue_tracker_id, #issue_status_id").each(function(){
52 52 $(this).val($(this).find("option[selected=selected]").val());
53 53 });
54 54 });
55 55 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now