_form.rhtml

app\views\issues\_form.rhtml - Nanda P, 2009-04-17 21:09

Download (3.11 KB)

 
1
<% if @issue.new_record? %>
2
<p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p>
3
<%= observe_field :issue_tracker_id, :url => { :action => :new },
4
                                     :update => :content,
5
                                     :with => "Form.serialize('issue-form')" %>
6
<hr />
7
<% end %>
8

    
9
<div id="issue_descr_fields" <%= 'style="display:none"' unless @issue.new_record? || @issue.errors.any? %>>
10
<p><%= f.text_field :subject, :size => 80, :required => true %></p>
11
<p><%= f.text_area :description,
12
                   :cols => 60,
13
                   :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
14
                   :accesskey => accesskey(:edit),
15
                   :class => 'wiki-edit' %></p>
16
</div>
17

    
18
<div class="attributes">
19
<div class="splitcontentleft">
20
<% if @issue.new_record? || @allowed_statuses.any? %>
21
<p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %></p>
22
<% else %>
23
<p><label><%= l(:field_status) %></label> <%= @issue.status.name %></p>
24
<% end %>
25

    
26
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
27
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
28
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :required => true %>
29
<%= prompt_to_remote(l(:label_issue_category_new),
30
                     l(:label_issue_category_new), 'category[name]', 
31
                     {:controller => 'projects', :action => 'add_issue_category', :id => @project},
32
                     :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p>
33
<%= content_tag('p', f.select(:fixed_version_id, 
34
                              (@project.versions.sort.collect {|v| [v.name, v.id]}),
35
                              { :include_blank => true })) unless @project.versions.empty? %>
36
</div>
37

    
38
<div class="splitcontentright">
39
<p><%= f.text_field :start_date, :size => 10 %><%= calendar_for('issue_start_date') %></p>
40
<p><%= f.text_field :due_date, :size => 10 %><%= calendar_for('issue_due_date') %></p>
41
<p><%= f.text_field :estimated_hours, :size => 3 %> <%= l(:field_hours) %></p>
42
<p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p>
43
</div>
44

    
45
<div style="clear:both;"> </div>
46
<%= render :partial => 'form_custom_fields' %>
47
</div>
48

    
49
<% if @issue.new_record? %>
50
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
51
<% end %>
52

    
53
<% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%>
54
<p><label><%= l(:label_issue_watchers) %></label>
55
<% @issue.project.users.sort.each do |user| -%>
56
<label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watcher_user_ids.include?(user.id) %> <%=h user %></label>
57
<% end -%>
58
</p>
59
<% end %>
60

    
61
<%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
62

    
63
<%= wikitoolbar_for 'issue_description' %>