Project

General

Profile

Feature #5201 » add_tracker_description.diff

Has error in projects/show.rhtml. - Akiko Takano, 2010-03-29 04:39

View differences:

redmine-0.9/app/controllers/issues_controller.rb (working copy)
before_filter :find_issue, :only => [:show, :edit, :reply]
before_filter :find_issues, :only => [:bulk_edit, :move, :destroy]
before_filter :find_project, :only => [:new, :update_form, :preview]
before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :context_menu]
before_filter :find_project, :only => [:new, :update_form, :preview, :show_tracker_description]
before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :context_menu, :show_tracker_description]
before_filter :find_optional_project, :only => [:index, :changes, :gantt, :calendar]
accept_key_auth :index, :show, :changes
......
:offset => @issue_pages.current.offset,
:limit => limit)
@issue_count_by_group = @query.issue_count_by_group
respond_to do |format|
format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? }
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
......
render :partial => 'attributes'
end
def show_tracker_description
if params[:issue_tracker_id].blank?
tracker = Tracker.find_by_id(@issue.tracker_id)
else
tracker = Tracker.find_by_id(params[:issue_tracker_id])
end
render :partial => 'tracker_description', :locals => {:tracker => tracker }
end
def preview
@issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?
redmine-0.9/app/views/trackers/list.rhtml (working copy)
<tbody>
<% for tracker in @trackers %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to tracker.name, :action => 'edit', :id => tracker %></td>
<td><%= link_to tracker.name, {:action => 'edit', :id => tracker}, {:title => tracker.description} %></td>
<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>
<td align="center" style="width:15%;"><%= reorder_links('tracker', {:action => 'edit', :id => tracker}) %></td>
<td class="buttons">
redmine-0.9/app/views/trackers/_form.rhtml (working copy)
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.check_box :is_in_roadmap %></p>
<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
<% if IssueCustomField.all.any? %>
<p>
<label><%= l(:label_custom_field_plural) %></label>
redmine-0.9/app/views/projects/show.rhtml (working copy)
<div class="splitcontentleft">
<%= textilizable @project.description %>
<ul>
<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= link_to(h(@project.homepage), @project.homepage) %></li><% end %>
<% if @subprojects.any? %>
<li><%=l(:label_subproject_plural)%>:
<%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
......
<div class="issues box">
<h3><%=l(:label_issue_tracking)%></h3>
<ul>
<% for tracker in @trackers %>
<li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project,
<% for tracker in @trackers %>
<li><%= link_to tracker.name, {:controller => 'issues', :action => 'index', :project_id => @project,
:set_filter => 1,
"tracker_id" => tracker.id %>:
"tracker_id" => tracker.id}, {:title => tracker.description } %>:
<%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i,
:total => @total_issues_by_tracker[tracker].to_i) %>
</li>
......
</div>
<div class="splitcontentright">
<% if @users_by_role.any? %>
<div class="members box">
<h3><%=l(:label_member_plural)%></h3>
<p><% @users_by_role.keys.sort.each do |role| %>
<%=h role %>: <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %><br />
<% end %></p>
</div>
<% end %>
<% if @news.any? && authorize_for('news', 'index') %>
<div class="news box">
......
<p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
</div>
<% end %>
<% if @users_by_role.any? %>
<div class="members box">
<h3><%=l(:label_member_plural)%></h3>
<p><% @users_by_role.keys.sort.each do |role| %>
<%=h role %>: <br/>
<%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %><br />
<% end %></p>
</div>
<% end %>
<%= call_hook(:view_projects_show_right, :project => @project) %>
</div>
redmine-0.9/app/views/issues/_tracker_description.rhtml (revision 0)
<p><b><%=l(:label_tracker)%> <%=l(:field_description)%>:</b> <br/><%= tracker.description %></p>
redmine-0.9/app/views/issues/_form.rhtml (working copy)
<div id="issue_descr_fields" <%= 'style="display:none"' unless @issue.new_record? || @issue.errors.any? %>>
<p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p>
<%= observe_field :issue_tracker_id, :url => { :action => :update_form, :project_id => @project, :id => @issue },
<p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %>
</p>
<%= observe_field :issue_tracker_id, :url => { :action => :update_form, :project_id => @project, :id => @issue, },
:update => :attributes,
:with => "Form.serialize('issue-form')" %>
<%= observe_field :issue_tracker_id, :url => { :action => :show_tracker_description, :project_id => @project, :id => @issue,},
:update => :tracker_description_area,
:with => "issue_tracker_id" %>
<div id="tracker_description_area">
<%= render :partial => 'tracker_description', :action => :show_tracker_description,
:locals => {:tracker => @project.trackers[0]} %>
</div>
<p><%= f.text_field :subject, :size => 80, :required => true %></p>
<p><%= f.text_area :description,
redmine-0.9/db/migrate/20100326001905_add_trackers_description.rb (revision 0)
class AddTrackersDescription < ActiveRecord::Migration
def self.up
add_column :trackers, :description, :string
end
def self.down
remove_column :trackers, :description
end
end
(3-3/12)