Commit b647645d2beb4f0f6183d14e2ec52e8a10ec5a71

Added activity tab

Commit diff

app/controllers/projects_controller.rb

 
114114 end
115115 end
116116
117# def timeline
118# if load_tab_defaults(PRJ_TAB_EVENTS) then
119# @title, @url_suffix = Project.tab_settings(PRJ_TAB_EVENTS)
120# render :action => "ac_timeline"
121# end
122# end
117 def activity
118 if load_tab_defaults(PRJ_TAB_ACTIVITY) then
119 @title, @url_suffix = Project.tab_settings(PRJ_TAB_ACTIVITY)
120 render :action => "ac_activity"
121 end
122 end
123123
124124 def roadmap
125125 if load_tab_defaults(PRJ_TAB_ROADMAP) then
toggle raw diff

app/helpers/application_helper.rb

 
302302 end
303303 end
304304
305 def render_right_actionbox_default (flags = {})
305 def actionbox_default (flags = {})
306306 out = %Q{<ul>}
307307 if logged_in? then
308308 #
318318 out
319319 end
320320
321 def render_right_actionbox_basic (flags = {})
321 def actionbox_basic (flags = {})
322322 out = %Q{<table class='right_default_table'>}
323323 out << %Q{<tr><th>Actions</th></tr>}
324 out << %Q{<tr><td>#{render_right_actionbox_default(flags)}</td></tr>}
324 out << %Q{<tr><td>#{actionbox_default(flags)}</td></tr>}
325325 out << %Q{</table>}
326326 out
327327 end
328328
329 def render_right_actionbox_complex (flags = {})
329 def actionbox_complex (flags = {})
330330 out = %Q{<table class='right_default_table'>}
331331 out << %Q{<tr><th>Actions</th></tr>}
332332 #
342342 acts << %Q{<li>#{link_to("New Milestone", new_project_milestone_path(@project.slug))}</li>} if flags[:new_milestone] && is_member
343343 acts << %Q{<li>#{link_to("Clone Mainline", new_project_repository_path(@project.slug, @repository))}</li>} if flags[:clone_mainline] && logged_in?
344344 out << %Q{<tr><td><ul>#{acts}</ul></td></tr>} if acts != ""
345 out << %Q{<tr><td>#{render_right_actionbox_default(flags)}</td></tr>}
345 out << %Q{<tr><td>#{actionbox_default(flags)}</td></tr>}
346346 out << %Q{</table>}
347347 out
348348 end
toggle raw diff

app/helpers/projects_helper.rb

 
5252 out = ""
5353 out << "<ul id='tabmenu'>"
5454 out << project_tab(active_tab, PRJ_TAB_WIKI)
55 out << project_tab(active_tab, PRJ_TAB_ACTIVITY)
5556 out << project_tab(active_tab, PRJ_TAB_REPOS)
5657 out << project_tab(active_tab, PRJ_TAB_ROADMAP)
5758 out << project_tab(active_tab, PRJ_TAB_TICKETS)
6363 out << "</ul>"
6464 out
6565 end
66
67
66
6867 def breadcrumb_repos_tab(subtab)
6968 subtab == PRJ_TAB_SUBTAB_NONE ? out = "" : out = breadcrumb_repositories
7069 case subtab
9292 when PRJ_TAB_WIKI
9393 case subtab
9494 when PRJ_TAB_WIKI_EDIT, PRJ_TAB_WIKI_NEW
95 out << render_right_actionbox_basic(:allow_shortcuts => true)
95 out << actionbox_basic(:allow_shortcuts => true)
9696 when PRJ_TAB_WIKI_LIST
97 out << render_right_actionbox_complex(:allow_shortcuts => true, :new_project_wiki => true)
97 out << actionbox_complex(:allow_shortcuts => true, :new_project_wiki => true)
9898 else
99 out << render_right_actionbox_complex(:allow_shortcuts => true, :edit_project_wiki => true, :new_project_wiki => true, :list_project_wikis => true)
99 out << actionbox_complex(:allow_shortcuts => true, :edit_project_wiki => true, :new_project_wiki => true, :list_project_wikis => true)
100100 end
101101 out << render_right_project_extrainfo
102102 out << render_right_project_contributors
103 when PRJ_TAB_DOWNLOADS
104 out << render_right_actionbox_basic(:allow_shortcuts => true)
103 when PRJ_TAB_ACTIVITY
104 out << actionbox_basic(:allow_shortcuts => true)
105105 when PRJ_TAB_REPOS
106106 case subtab
107107 when PRJ_TAB_SUBTAB_NONE
108 out << render_right_actionbox_complex(:allow_shortcuts => true, :clone_mainline => true)
108 out << actionbox_complex(:allow_shortcuts => true, :clone_mainline => true)
109109 when PRJ_TAB_REPOS_SUMMARY
110110 out << render(:partial => "repositories/ac_right_actionbox_repos_summary")
111111 when PRJ_TAB_REPOS_LOGS
112 out << render_right_actionbox_basic(:allow_shortcuts => true)
112 out << actionbox_basic(:allow_shortcuts => true)
113113 out << render(:partial => "repositories/ac_right_branches")
114114 when PRJ_TAB_REPOS_COMMIT
115 out << render_right_actionbox_basic(:allow_shortcuts => true)
115 out << actionbox_basic(:allow_shortcuts => true)
116116 out << render(:partial => "commits/ac_right_diff_mode_selector")
117117 when PRJ_TAB_REPOS_TREE
118 out << render_right_actionbox_basic(:allow_shortcuts => true)
118 out << actionbox_basic(:allow_shortcuts => true)
119119 out << render(:partial => "trees/ac_right_branches")
120120 when PRJ_TAB_REPOS_MERGEREQUESTS
121 out << render_right_actionbox_basic(:allow_shortcuts => true)
121 out << actionbox_basic(:allow_shortcuts => true)
122122 end
123123 when PRJ_TAB_ROADMAP
124 out << render_right_actionbox_complex(:allow_shortcuts => true, :new_milestone => true)
124 out << actionbox_complex(:allow_shortcuts => true, :new_milestone => true)
125125 when PRJ_TAB_TICKETS
126 out << render_right_actionbox_complex(:allow_shortcuts => true, :new_ticket => true)
126 out << actionbox_complex(:allow_shortcuts => true, :new_ticket => true)
127 out << actionbox_ticket_filter
127128 when PRJ_TAB_ARTICLES
128 out << render_right_actionbox_complex(:allow_shortcuts => true, :new_article => true)
129 out << actionbox_complex(:allow_shortcuts => true, :new_article => true)
129130 when PRJ_TAB_FORUM
130 out << render_right_actionbox_basic(:allow_shortcuts => true)
131 out << actionbox_basic(:allow_shortcuts => true)
131132 when PRJ_TAB_EVENTS
132 out << render_right_actionbox_basic(:allow_shortcuts => true)
133 out << actionbox_basic(:allow_shortcuts => true)
133134 when PRJ_TAB_CONFIG
134 out << render_right_actionbox_basic(:allow_shortcuts => true)
135 out << actionbox_basic(:allow_shortcuts => true)
135136 end
136137 out
137 end
138 end
139
140 #TODO need to find a better place for these (partial?)
141 def actionbox_ticket_filter
142 out = ""
143 out << %Q{<table class='right_default_table' cellspacing=0px>}
144 out << %Q{<tr><th>Ticket Filter</th></tr>}
145
146 out << %Q{<tr><td>Type:</td></tr>}
147 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Defect</td></tr>}
148 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Enhancement</td></tr>}
149 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Task</td></tr>}
150
151 out << %Q{<tr><td>Status:</td></tr>}
152 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Proposed</td></tr>}
153 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Open</td></tr>}
154 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Closed</td></tr>}
155
156 out << %Q{<tr><td>Impact:</td></tr>}
157 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Low</td></tr>}
158 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>High</td></tr>}
159 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Security</td></tr>}
160
161 out << %Q{<tr><td>Priority:</td></tr>}
162 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>None</td></tr>}
163 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Low</td></tr>}
164 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>High</td></tr>}
165 out << %Q{<tr><td>&nbsp;&nbsp;<input type=checkbox>Critical</td></tr>}
166
167 out << %Q{</table>}
168 out
169 end
138170
139171 def format_life_cycle (ls)
140172 case ls
toggle raw diff

app/helpers/tickets_helper.rb

 
5757 out
5858 end
5959
60
6061end
toggle raw diff

app/models/project.rb

 
237237 when PRJ_TAB_WIKI
238238 title = "Wiki"
239239 url_suffix = ""
240 when PRJ_TAB_DOWNLOADS
241 title = "Downloads"
242 url_suffix = "/downloads"
240 when PRJ_TAB_ACTIVITY
241 title = "Activity"
242 url_suffix = "/activity"
243243 when PRJ_TAB_REPOS
244244 title = "Repositories"
245245 url_suffix = "/repos"
toggle raw diff

app/views/articles/ac_index.html.erb

 
77<%= div_breadcrumb_close %>
88
99<%= div_rightcolumn_open %>
10<%= render_right_actionbox_basic %>
10<%= actionbox_basic %>
1111<%= render_right_article_project_grid %>
1212<%= render_right_popular_authors %>
1313<%= render_right_categories %>
toggle raw diff

app/views/articles/ac_show.html.erb

 
66<%= div_breadcrumb_close %>
77
88<%= div_rightcolumn_open %>
9<%= render_right_actionbox_basic %>
9<%= actionbox_basic %>
1010<%= render_right_article_project_grid %>
1111<%= div_rightcolumn_close %>
1212
toggle raw diff

app/views/forums/ac_index.html.erb

 
66<%= div_breadcrumb_close %>
77
88<%= div_rightcolumn_open %>
9<%= render_right_actionbox_basic %>
9<%= actionbox_basic %>
1010<%= div_rightcolumn_close %>
1111
1212<%= div_content_open(STYLE_WITHRIGHTCOLUMN) %>
toggle raw diff

app/views/projects/ac_activity.html.erb

 
1
2<%= render :partial => "ac_project_header", :locals => { :tab => PRJ_TAB_ACTIVITY, :project => @project, :pagetitle => @title } %>
3
4<%= render :partial => "ac_project_footer" %>
toggle raw diff

app/views/projects/ac_list.html.erb

 
66<%= div_breadcrumb_close %>
77
88<%= div_rightcolumn_open %>
9<%= render_right_actionbox_basic %>
9<%= actionbox_basic %>
1010<%= div_rightcolumn_close %>
1111
1212<%= div_content_open(STYLE_WITHRIGHTCOLUMN) %>
toggle raw diff

app/views/projects/ac_roadmap.html.erb

 
11
22<%= render :partial => "ac_project_header", :locals => { :tab => PRJ_TAB_ROADMAP, :project => @project, :pagetitle => @title } %>
33
4<div id='todo'>
5<p>Show milestones and allow tickets to be dragged between them, show unmilestoned tickets, clicking ticket goes to ticket tab.</p>
6</div>
7
48<%= render :partial => "ac_project_footer" %>
toggle raw diff

app/views/repositories/_ac_right_actionbox_repos_summary.html.erb

 
3030 <br />
3131 <% end %>
3232
33 <%= render_right_actionbox_default(:allow_shortcuts => true) -%>
33 <%= actionbox_default(:allow_shortcuts => true) -%>
3434 </td></tr>
3535</table>
3636
toggle raw diff

app/views/searches/ac_search.html.erb

 
66<%= div_breadcrumb_close %>
77
88<%= div_rightcolumn_open %>
9<%= render_right_actionbox_basic %>
9<%= actionbox_basic %>
1010<%= div_rightcolumn_close %>
1111
1212<%= div_content_open(STYLE_WITHRIGHTCOLUMN) %>
toggle raw diff

app/views/site/ac_about.html.erb

 
66<%= div_breadcrumb_close %>
77
88<%= div_rightcolumn_open %>
9<%= render_right_actionbox_basic %>
9<%= actionbox_basic %>
1010<%= div_rightcolumn_close %>
1111
1212<%= div_content_open(STYLE_WITHRIGHTCOLUMN) %>
toggle raw diff

app/views/site/appcast_index.html.erb

 
55<%= div_breadcrumb_close %>
66
77<%= div_rightcolumn_open %>
8<%= render_right_actionbox_basic %>
8<%= actionbox_basic %>
99<%= render_right_article_project_grid %>
1010<%= div_rightcolumn_close %>
1111
toggle raw diff

app/views/tickets/ac_project_index.html.erb

 
11<%= render :partial => "projects/ac_project_header", :locals => { :tab => PRJ_TAB_TICKETS, :project => @project, :pagetitle => @title } %>
22
33<div id='todo'>
4<p>Mostly now obscelete, ticket system being redesigned</p>
4<p>Ticket management</p>
55</div>
66
77
toggle raw diff

app/views/users/ac_show.html.erb

 
66<%= div_breadcrumb_close %>
77
88<%= div_rightcolumn_open %>
9<%= render_right_actionbox_basic %>
9<%= actionbox_basic %>
1010<%= div_rightcolumn_close %>
1111
1212<%= div_content_open(STYLE_WITHRIGHTCOLUMN) %>
toggle raw diff

app/views/wikis/ac_index.html.erb

 
77<%= div_breadcrumb_close %>
88
99<%= div_rightcolumn_open %>
10<%= render_right_actionbox_basic %>
10<%= actionbox_basic %>
1111<%= div_rightcolumn_close %>
1212
1313<%= div_content_open(STYLE_WITHRIGHTCOLUMN) %>
toggle raw diff

config/initializers/appcast_config.rb

 
1010
1111# Tabs for project page
1212PRJ_TAB_WIKI = 1
13PRJ_TAB_DOWNLOADS = 2
13PRJ_TAB_ACTIVITY = 2
1414PRJ_TAB_REPOS = 3
1515PRJ_TAB_ROADMAP = 4
1616PRJ_TAB_TICKETS = 5
toggle raw diff

config/routes.rb

 
3434 project_cat.formatted_projects_category "projects/category/:id.:format"
3535 end
3636 #TODO Note the extra members :repository for Appcast tabs (should these be added to a function that checks $application_mode?)
37 map.resources :projects, :member => {:confirm_delete => :get, :forum => :get, :roadmap => :get, :config => :get} do |projects|
37 map.resources :projects, :member => {:confirm_delete => :get, :forum => :get, :activity => :get, :roadmap => :get, :config => :get} do |projects|
3838 projects.resources(:repositories, :member => {
3939 :new => :get, :create => :post,
4040 :writable_by => :get,
toggle raw diff

db/migrate/407_create_tickets.rb

 
6868 t.column :impact, :enum, :limit => [:low, :high, :security], :default => :low
6969 t.integer :impact_jid
7070 #
71 t.column :priority, :enum, :limit => [:none, :low, :medium, :high, :critical], :default => :none
71 t.column :priority, :enum, :limit => [:none, :low, :high, :critical], :default => :none
7272 t.integer :priority_jid
7373 #
7474 t.column :audience, :enum, :limit => [:public, :members], :default => :public
toggle raw diff