@@ -276,18 +276,27 class ProjectsController < ApplicationController | |||
|
276 | 276 | @versions = @project.versions |
|
277 | 277 | end |
|
278 | 278 | |
|
279 |
# Show changelog |
|
|
279 | # Show changelog for @project | |
|
280 | 280 | def changelog |
|
281 | @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true]) | |
|
282 | if request.get? | |
|
283 | @selected_tracker_ids = @trackers.collect {|t| t.id.to_s } | |
|
284 | else | |
|
285 | @selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array | |
|
286 | end | |
|
287 | @selected_tracker_ids ||= [] | |
|
281 | 288 | @fixed_issues = @project.issues.find(:all, |
|
282 |
|
|
|
283 |
|
|
|
284 | ) | |
|
289 | :include => [ :fixed_version, :status, :tracker ], | |
|
290 | :conditions => [ "issue_statuses.is_closed=? and issues.tracker_id in (#{@selected_tracker_ids.join(',')}) and issues.fixed_version_id is not null", true], | |
|
291 | :order => "versions.effective_date DESC, issues.id DESC" | |
|
292 | ) unless @selected_tracker_ids.empty? | |
|
293 | @fixed_issues ||= [] | |
|
285 | 294 | end |
|
286 | 295 | |
|
287 | 296 | private |
|
288 | 297 | # Find project of id params[:id] |
|
289 | 298 | # if not found, redirect to project list |
|
290 |
# |
|
|
299 | # Used as a before_filter | |
|
291 | 300 | def find_project |
|
292 | 301 | @project = Project.find(params[:id]) |
|
293 | 302 | rescue |
@@ -1,12 +1,25 | |||
|
1 | 1 | <h2><%=l(:label_change_log)%></h2> |
|
2 | 2 | |
|
3 | <% fixed_issues = @fixed_issues.group_by {|i| i.fixed_version } %> | |
|
4 | <% fixed_issues.each do |version, issues| %> | |
|
5 | <p><strong><%= version.name %></strong> - <%= format_date(version.effective_date) %><br /> | |
|
6 | <%=h version.description %></p> | |
|
7 | <ul> | |
|
8 | <% issues.each do |i| %> | |
|
9 | <li><%= link_to i.long_id, :controller => 'issues', :action => 'show', :id => i %> [<%= i.tracker.name %>]: <%= i.subject %></li> | |
|
10 | <% end %> | |
|
11 | </ul> | |
|
3 | ||
|
4 | <%= start_form_tag %> | |
|
5 | <% @trackers.each do |tracker| %> | |
|
6 | <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> | |
|
7 | <%= tracker.name %> | |
|
12 | 8 | <% end %> |
|
9 | <%= submit_tag l(:button_apply), :class => 'button-small' %> | |
|
10 | <%= end_form_tag %> | |
|
11 | ||
|
12 | <p> </p> | |
|
13 | ||
|
14 | <% ver_id = nil | |
|
15 | @fixed_issues.each do |issue| %> | |
|
16 | <% unless ver_id == issue.fixed_version_id %> | |
|
17 | <% if ver_id %></ul><% end %> | |
|
18 | <p><strong><%= issue.fixed_version.name %></strong> - <%= format_date(issue.fixed_version.effective_date) %><br /> | |
|
19 | <%=h issue.fixed_version.description %></p> | |
|
20 | <ul> | |
|
21 | <% ver_id = issue.fixed_version_id | |
|
22 | end %> | |
|
23 | <li><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %> [<%= issue.tracker.name %>]: <%= issue.subject %></li> | |
|
24 | <% end %> | |
|
25 |
General Comments 0
You need to be logged in to leave comments.
Login now