Commit fe89e84dd6c0c84e84d66e7ab62bd5c6b5b84855

Added new controllers for Components and Milestones

Commit diff

app/controllers/components_controller.rb

 
1class ComponentsController < ApplicationController
2end
toggle raw diff

app/controllers/milestones_controller.rb

 
1class MilestonesController < ApplicationController
2end
toggle raw diff

app/controllers/tickets_controller.rb

 
44
55 def index
66 @title, @url_suffix = Project.tab_settings(PRJ_TAB_TICKETS)
7 @tickets = Ticket.filtered(params[:ticket] ? params[:ticket] : "")
7 @tickets = Ticket.filtered(params[:ticketfilter] ? params[:ticketfilter] : "")
88 @current_milestone = Milestone.find_current_milestone(@project.id)
99 #@assignees = @project.tickets.assignees
1010 render :action => "ac_project_index"
toggle raw diff

app/helpers/application_helper.rb

 
339339 acts << %Q{<li>#{link_to("Close Ticket", root_path)}</li>} if flags[:close_ticket]
340340 acts << %Q{<li>#{link_to("List Tickets", project_tickets_path(@project.slug))}</li>} if flags[:list_tickets]
341341 acts << %Q{<li>#{link_to("New Milestone", new_project_milestone_path(@project.slug))}</li>} if flags[:new_milestone] && @is_member
342 acts << %Q{<li>#{link_to("List Active Milestones", root_path)}</li>} if flags[:list_active_milestones]
343 acts << %Q{<li>#{link_to("List Completed Milestones", root_path)}</li>} if flags[:list_completed_milestones]
344 acts << %Q{<li>#{link_to("Edit Milestones", root_path)}</li>} if flags[:edit_milestones] && @is_member
345 acts << %Q{<li>#{link_to("Edit Components", root_path)}</li>} if flags[:edit_components] && @is_member
342# acts << %Q{<li>#{link_to("List Active Milestones", root_path)}</li>} if flags[:list_active_milestones]
343# acts << %Q{<li>#{link_to("List Completed Milestones", root_path)}</li>} if flags[:list_completed_milestones]
344 acts << %Q{<li>#{link_to("Manage Milestones", project_milestones_path)}</li>} if flags[:manage_milestones] && @is_member
345 acts << %Q{<li>#{link_to("Manage Components", project_components_path)}</li>} if flags[:manage_components] && @is_member
346346 acts << %Q{<li>#{link_to("New Member", root_path)}</li>} if flags[:new_member] && @is_member
347347 acts << %Q{<li>#{link_to("List Members", root_path)}</li>} if flags[:list_members]
348348 acts << %Q{<li>#{link_to("Clone Mainline", new_project_repository_path(@project.slug, @repository))}</li>} if flags[:clone_mainline] && logged_in?
toggle raw diff

app/helpers/components_helper.rb

 
1module ComponentsHelper
2end
toggle raw diff

app/helpers/milestones_helper.rb

 
1module MilestonesHelper
2end
toggle raw diff

app/helpers/projects_helper.rb

 
132132 when PRJ_TAB_TICKETS
133133 case subtab
134134 when PRJ_TAB_SUBTAB_NONE
135 out << actionbox_complex(:allow_shortcuts => true, :new_ticket => true, :new_milestone => true,
136 :list_completed_milestones => true, :list_active_milestones => true, :edit_milestones => true,
137 :edit_components => true)
135 out << actionbox_complex(:allow_shortcuts => true, :new_ticket => true, :manage_milestones => true, :manage_components => true)
138136 out << render(:partial => "ac_right_ticket_filter")
139137 when PRJ_TAB_TICKETS_SHOW
140138 out << actionbox_complex(:allow_shortcuts => true, :list_tickets => true, :edit_ticket => true, :close_ticket => true)
146146 when PRJ_TAB_WIKI_LIST
147147 out << actionbox_complex(:allow_shortcuts => true, :new_project_wiki => true)
148148 else
149 out << actionbox_complex(:allow_shortcuts => true, :edit_project_wiki => true, :new_project_wiki => true, :list_project_wikis => true)
149 out << actionbox_complex(:allow_shortcuts => true, :edit_project_wiki => true, :new_project_wiki => true,
150 :list_project_wikis => true)
150151 end
151152 when PRJ_TAB_ARTICLES
152153 case subtab
toggle raw diff

app/helpers/tickets_helper.rb

 
33 include ProjectsHelper
44
55 def ticket_value_checked? (v)
6 params[:ticket][v] == "1" ? "checked" : "" if params[:ticket]
6 params[:ticketfilter][v] == "1" ? "checked" : "" if params[:ticketfilter]
77 end
88
99
toggle raw diff

app/views/tickets/_ac_right_ticket_filter.html.erb

 
11
22<table class='right_default_table' cellspacing=0px>
33
4<% form_for :ticket, :url => project_tickets_path(@project.slug), :method => :get, :html => {:name => 'ticketfilter'} do |f| %>
5
4<% form_for :ticketfilter, :url => project_tickets_path(@project.slug), :html => {:method => :get, :name => 'ticketfilter', :id => 'input'} do |f| %>
5
66<tr><th colspan=2>Ticket Filter</th></tr>
77
88<tr>
99
1010<td><small>
1111<br />
12<%= check_box(:ticket, :ttype_defect, {:checked => ticket_value_checked?(:ttype_defect)}, "1", "0") %>Defect<br />
13<%= check_box(:ticket, :ttype_enhancement, {:checked => ticket_value_checked?(:ttype_enhancement)}, "1", "0") %>Enhancement<br />
14<%= check_box(:ticket, :ttype_task, {:checked => ticket_value_checked?(:ttype_task)}, "1", "0") %>Task<br />
12<%= check_box(:ticketfilter, :ttype_defect, {:checked => ticket_value_checked?(:ttype_defect)}, "1", "0") %>Defect<br />
13<%= check_box(:ticketfilter, :ttype_enhancement, {:checked => ticket_value_checked?(:ttype_enhancement)}, "1", "0") %>Enhancement<br />
14<%= check_box(:ticketfilter, :ttype_task, {:checked => ticket_value_checked?(:ttype_task)}, "1", "0") %>Task<br />
1515<br />
16<%= check_box(:ticket, :status_proposed, {:checked => ticket_value_checked?(:status_proposed)}, "1", "0") %>Proposed<br />
17<%= check_box(:ticket, :status_open, {:checked => ticket_value_checked?(:status_open)}, "1", "0") %>Open<br />
18<%= check_box(:ticket, :status_closed, {:checked => ticket_value_checked?(:status_closed)}, "1", "0") %>Closed<br />
16<%= check_box(:ticketfilter, :status_proposed, {:checked => ticket_value_checked?(:status_proposed)}, "1", "0") %>Proposed<br />
17<%= check_box(:ticketfilter, :status_open, {:checked => ticket_value_checked?(:status_open)}, "1", "0") %>Open<br />
18<%= check_box(:ticketfilter, :status_closed, {:checked => ticket_value_checked?(:status_closed)}, "1", "0") %>Closed<br />
1919<br />
2020</small></td>
2121
2222<td><small>
2323<br />
24<%= check_box(:ticket, :impact_low, {:checked => ticket_value_checked?(:impact_low)}, "1", "0") %>Low Impact<br />
25<%= check_box(:ticket, :impact_high, {:checked => ticket_value_checked?(:impact_high)}, "1", "0") %>High Impact<br />
26<%= check_box(:ticket, :impact_security, {:checked => ticket_value_checked?(:impact_security)}, "1", "0") %>Security Impact<br />
24<%= check_box(:ticketfilter, :impact_low, {:checked => ticket_value_checked?(:impact_low)}, "1", "0") %>Low Impact<br />
25<%= check_box(:ticketfilter, :impact_high, {:checked => ticket_value_checked?(:impact_high)}, "1", "0") %>High Impact<br />
26<%= check_box(:ticketfilter, :impact_security, {:checked => ticket_value_checked?(:impact_security)}, "1", "0") %>Security Impact<br />
2727<br />
28<%= check_box(:ticket, :priority_none, {:checked => ticket_value_checked?(:priority_none)}, "1", "0") %>No Priority<br />
29<%= check_box(:ticket, :priority_low, {:checked => ticket_value_checked?(:priority_low)}, "1", "0") %>Low Priority<br />
30<%= check_box(:ticket, :priority_high, {:checked => ticket_value_checked?(:priority_high)}, "1", "0") %>High Priority<br />
31<%= check_box(:ticket, :priority_critical, {:checked => ticket_value_checked?(:priority_critical)}, "1", "0") %>Critical<br />
28<%= check_box(:ticketfilter, :priority_none, {:checked => ticket_value_checked?(:priority_none)}, "1", "0") %>No Priority<br />
29<%= check_box(:ticketfilter, :priority_low, {:checked => ticket_value_checked?(:priority_low)}, "1", "0") %>Low Priority<br />
30<%= check_box(:ticketfilter, :priority_high, {:checked => ticket_value_checked?(:priority_high)}, "1", "0") %>High Priority<br />
31<%= check_box(:ticketfilter, :priority_critical, {:checked => ticket_value_checked?(:priority_critical)}, "1", "0") %>Critical<br />
3232<br />
3333</small></td>
3434
toggle raw diff

config/routes.rb

 
2222 :team => :get,
2323 :log => :get,
2424 :config => :get
25 } do |projects|
25 } do |projects|
2626 projects.resources(:repositories, :member => {
2727 :new => :get, :create => :post,
2828 :writable_by => :get,
3131 repo.resources :committers, :name_prefix => nil, :collection => {:auto_complete_for_user_login => :post, :list => :get, :create => :post}
3232 repo.resources :comments, :member => { :commmit => :get }
3333 repo.resources :merge_requests, :member => { :resolve => :put }, :collection => { :create => :post }
34 repo.commit_comment "comments/commit/:sha", :controller => "comments",
35 :action => "commit", :conditions => { :method => :get }
36
34 repo.commit_comment "comments/commit/:sha", :controller => "comments", :action => "commit", :conditions => { :method => :get }
3735 repo.resources :logs, :requirements => { :id => VALID_SHA }#, :member => { :feed => :get }
38 repo.formatted_log_feed "logs/:id/feed.:format", :controller => "logs", :action => "feed",
39 :conditions => {:feed => :get}, :requirements => {:id => VALID_SHA}
36 repo.formatted_log_feed "logs/:id/feed.:format", :controller => "logs", :action => "feed", :conditions => {:feed => :get}, :requirements => {:id => VALID_SHA}
4037 repo.resources :commits
41 repo.trees "trees/", :controller => "trees", :action => "index"
38 repo.trees "trees/", :controller => "trees", :action => "index"
4239 repo.with_options(:requirements => { :id => VALID_SHA }) do |r|
4340 r.tree "trees/:id/*path", :controller => "trees", :action => "show"
4441 r.formatted_tree "trees/:id/*path.:format", :controller => "trees", :action => "show"
4343 r.raw_blob "blobs/raw/:id/*path", :controller => "blobs", :action => "raw"
4444 r.blob "blobs/:id/*path", :controller => "blobs", :action => "show"
4545 end
46 #FIXME these maybe should be down a level
47 projects.resources(:articles)
48 projects.resources(:members)
49 projects.resources(:messages)
50 projects.resources(:wikis)
51 projects.resources(:milestones)
52 projects.resources(:tickets, :member => {:close => :get})
53 #projects.resources(:members)
5446 end
55 #projects.resource :respository
47 projects.resources(:articles)
48 projects.resources(:members)
49 projects.resources(:messages)
50 projects.resources(:wikis)
51 projects.resources(:milestones)
52 projects.resources(:tickets, :member => {:close => :get})
53 projects.resources(:components)
5654 end
5755
5856 map.resource :search
toggle raw diff

test/functional/components_controller_test.rb

 
1require File.dirname(__FILE__) + '/../test_helper'
2
3class ComponentsControllerTest < ActionController::TestCase
4 # Replace this with your real tests.
5 def test_truth
6 assert true
7 end
8end
toggle raw diff

test/functional/milestones_controller_test.rb

 
1require File.dirname(__FILE__) + '/../test_helper'
2
3class MilestonesControllerTest < ActionController::TestCase
4 # Replace this with your real tests.
5 def test_truth
6 assert true
7 end
8end
toggle raw diff