Project

General

Profile

Feature #5201 » add_tracker_description.diff

Akiko Takano, 2010-03-29 04:11

View differences:

redmine-0.9/app/controllers/issues_controller.rb (working copy)
21 21
  
22 22
  before_filter :find_issue, :only => [:show, :edit, :reply]
23 23
  before_filter :find_issues, :only => [:bulk_edit, :move, :destroy]
24
  before_filter :find_project, :only => [:new, :update_form, :preview]
25
  before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :context_menu]
24
  before_filter :find_project, :only => [:new, :update_form, :preview, :show_tracker_description]
25
  before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :context_menu, :show_tracker_description]
26 26
  before_filter :find_optional_project, :only => [:index, :changes, :gantt, :calendar]
27 27
  accept_key_auth :index, :show, :changes
28 28

  
......
73 73
                              :offset => @issue_pages.current.offset, 
74 74
                              :limit => limit)
75 75
      @issue_count_by_group = @query.issue_count_by_group
76
      
77 76
      respond_to do |format|
78 77
        format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? }
79 78
        format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
......
455 454
    
456 455
    render :partial => 'attributes'
457 456
  end
457

  
458
  def show_tracker_description
459
    if params[:issue_tracker_id].blank?
460
       tracker = Tracker.find_by_id(@issue.tracker_id)
461
    else
462
       tracker = Tracker.find_by_id(params[:issue_tracker_id])
463
    end
464
    render :partial => 'tracker_description', :locals => {:tracker => tracker }
465
  end
466

  
467

  
458 468
  
459 469
  def preview
460 470
    @issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?
redmine-0.9/app/views/trackers/list.rhtml (working copy)
14 14
  <tbody>
15 15
<% for tracker in @trackers %>
16 16
  <tr class="<%= cycle("odd", "even") %>">
17
  <td><%= link_to tracker.name, :action => 'edit', :id => tracker %></td>
17
  <td><%= link_to tracker.name, {:action => 'edit', :id => tracker}, {:title => tracker.description} %></td>
18 18
  <td align="center"><% unless tracker.workflows.count > 0 %><span class="icon icon-warning"><%= l(:text_tracker_no_workflow) %> (<%= link_to l(:button_edit), {:controller => 'workflows', :action => 'edit', :tracker_id => tracker} %>)</span><% end %></td>
19 19
  <td align="center" style="width:15%;"><%= reorder_links('tracker', {:action => 'edit', :id => tracker}) %></td>
20 20
  <td class="buttons">
redmine-0.9/app/views/trackers/_form.rhtml (working copy)
6 6
<p><%= f.text_field :name, :required => true %></p>
7 7
<p><%= f.check_box :is_in_roadmap %></p>
8 8

  
9
<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
10

  
11

  
9 12
<% if IssueCustomField.all.any? %>
10 13
<p>
11 14
	<label><%= l(:label_custom_field_plural) %></label>
redmine-0.9/app/views/projects/show.rhtml (working copy)
9 9
<div class="splitcontentleft">
10 10
	<%= textilizable @project.description %>	
11 11
	<ul>
12
	<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
12
	<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= link_to(h(@project.homepage), @project.homepage) %></li><% end %>
13 13
  <% if @subprojects.any? %>
14 14
 	<li><%=l(:label_subproject_plural)%>:
15 15
	    <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
......
25 25
  <div class="issues box">    
26 26
    <h3><%=l(:label_issue_tracking)%></h3>
27 27
    <ul>
28
    <% for tracker in @trackers %>    
29
      <li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project, 
28
    <% for tracker in @trackers %>
29
<li><%= link_to tracker.name, {:controller => 'issues', :action => 'index', :project_id => @project, 
30 30
                                                :set_filter => 1, 
31
                                                "tracker_id" => tracker.id %>:
31
                                                "tracker_id" => tracker.id}, {:title => tracker.description } %>:
32 32
					<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
33 33
																										:total => @total_issues_by_tracker[tracker].to_i) %>
34 34
			</li>
......
49 49
</div>
50 50

  
51 51
<div class="splitcontentright">
52
  <% if @users_by_role.any? %>
53
	<div class="members box">
54
		<h3><%=l(:label_member_plural)%></h3>	
55
		<p><% @users_by_role.keys.sort.each do |role| %>
56
		<%=h role %>: <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %><br />
57
		<% end %></p>
58
	</div>
59
	<% end %>
60 52
    
61 53
  <% if @news.any? && authorize_for('news', 'index') %>
62 54
  <div class="news box">
......
65 57
    <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
66 58
  </div>  
67 59
  <% end %>
60

  
61
  <% if @users_by_role.any? %>
62
        <div class="members box">
63
                <h3><%=l(:label_member_plural)%></h3>
64
                <p><% @users_by_role.keys.sort.each do |role| %>
65
                <%=h role %>: <br/>
66
                 <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ) %><br />
67
                <% end %></p>
68
        </div>
69
        <% end %>
70

  
68 71
  <%= call_hook(:view_projects_show_right, :project => @project) %>
69 72
</div>
70 73

  
redmine-0.9/app/views/issues/_tracker_description.rhtml (revision 0)
1
<p><b><%=l(:label_tracker)%> <%=l(:field_description)%>:</b> <br/><%= tracker.description %></p>
2

  
redmine-0.9/app/views/issues/_form.rhtml (working copy)
1 1
<div id="issue_descr_fields" <%= 'style="display:none"' unless @issue.new_record? || @issue.errors.any? %>>
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 => :update_form, :project_id => @project, :id => @issue },
2
<p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %>
3
</p>
4
<%= observe_field :issue_tracker_id, :url => { :action => :update_form, :project_id => @project, :id => @issue,  },
4 5
                                     :update => :attributes,
5 6
                                     :with => "Form.serialize('issue-form')" %>
7
<%= observe_field :issue_tracker_id, :url => { :action => :show_tracker_description, :project_id => @project, :id => @issue,},
8
                                     :update => :tracker_description_area,
9
                                     :with => "issue_tracker_id" %>
10
<div id="tracker_description_area">
11
   <%= render :partial => 'tracker_description', :action => :show_tracker_description, 
12
     :locals => {:tracker => @project.trackers[0]} %>
13
</div>
6 14

  
7 15
<p><%= f.text_field :subject, :size => 80, :required => true %></p>
8 16
<p><%= f.text_area :description,
redmine-0.9/app/views/issues/index.rhtml (working copy)
66 66
<% other_formats_links do |f| %>
67 67
	<%= f.link_to 'Atom', :url => { :project_id => @project, :query_id => (@query.new_record? ? nil : @query), :key => User.current.rss_key } %>
68 68
	<%= f.link_to 'CSV', :url => { :project_id => @project } %>
69
	<%= f.link_to 'CSV', :url => { :project_id => @project, :include_log => 1 } %> (Include Log)
69 70
	<%= f.link_to 'PDF', :url => { :project_id => @project } %>
70 71
<% end %>
71 72

  
redmine-0.9/db/migrate/20100326001905_add_trackers_description.rb (revision 0)
1
class AddTrackersDescription < ActiveRecord::Migration
2
  def self.up
3
    add_column :trackers, :description, :string
4
  end
5

  
6
  def self.down
7
    remove_column :trackers, :description
8
  end
9
end
(2-2/12)