| |   |
| 1 | class ActivitiesController < ApplicationController |
| 2 | |
| 3 | before_filter :find_project |
| 4 | |
| 5 | def index |
| 6 | @title, @url_suffix = Project.tab_settings(PRJ_TAB_ACTIVITIES) |
| 7 | @members = Member.find_by_project_alpha(@project.id) |
| 8 | if @is_member |
| 9 | @messages = Message.find_by_project_user(@project.id, current_user.id, 40) |
| 10 | else |
| 11 | @messages = Message.find_by_project(@project.id, 40) |
| 12 | end |
| 13 | render :action => "ac_index" |
| 14 | end |
| 15 | |
| 16 | |
| 17 | end |
| toggle raw diff |
--- /dev/null
+++ b/app/controllers/activities_controller.rb
@@ -0,0 +1,17 @@
+class ActivitiesController < ApplicationController
+
+ before_filter :find_project
+
+ def index
+ @title, @url_suffix = Project.tab_settings(PRJ_TAB_ACTIVITIES)
+ @members = Member.find_by_project_alpha(@project.id)
+ if @is_member
+ @messages = Message.find_by_project_user(@project.id, current_user.id, 40)
+ else
+ @messages = Message.find_by_project(@project.id, 40)
+ end
+ render :action => "ac_index"
+ end
+
+
+end |
| |   |
| 103 | 103 | render :action => "ac_forum" |
| 104 | 104 | end |
| 105 | 105 | |
| 106 | | def activity |
| 107 | | @title, @url_suffix = Project.tab_settings(PRJ_TAB_ACTIVITY) |
| 108 | | @members = Member.find_by_project_alpha(@project.id) |
| 109 | | if @is_member |
| 110 | | @messages = Message.find_by_project_user(@project.id, current_user.id, 40) |
| 111 | | else |
| 112 | | @messages = Message.find_by_project(@project.id, 40) |
| 113 | | end |
| 114 | | render :action => "ac_activity_index" |
| 115 | | end |
| 116 | | |
| 117 | 106 | def roadmap |
| 118 | 107 | @title, @url_suffix = Project.tab_settings(PRJ_TAB_ROADMAP) |
| 119 | 108 | render :action => "ac_roadmap" |
| toggle raw diff |
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -103,17 +103,6 @@ class ProjectsController < ApplicationController
render :action => "ac_forum"
end
- def activity
- @title, @url_suffix = Project.tab_settings(PRJ_TAB_ACTIVITY)
- @members = Member.find_by_project_alpha(@project.id)
- if @is_member
- @messages = Message.find_by_project_user(@project.id, current_user.id, 40)
- else
- @messages = Message.find_by_project(@project.id, 40)
- end
- render :action => "ac_activity_index"
- end
-
def roadmap
@title, @url_suffix = Project.tab_settings(PRJ_TAB_ROADMAP)
render :action => "ac_roadmap" |
| |   |
| 53 | 53 | out << "<ul id='tabmenu'>" |
| 54 | 54 | out << project_tab(active_tab, PRJ_TAB_WIKI) |
| 55 | 55 | out << project_tab(active_tab, PRJ_TAB_REPOS) |
| 56 | | out << project_tab(active_tab, PRJ_TAB_ACTIVITY) |
| 56 | out << project_tab(active_tab, PRJ_TAB_ACTIVITIES) |
| 57 | 57 | out << project_tab(active_tab, PRJ_TAB_ROADMAP) |
| 58 | 58 | out << project_tab(active_tab, PRJ_TAB_TICKETS) |
| 59 | 59 | out << project_tab(active_tab, PRJ_TAB_ARTICLES) |
| … | … | |
| 100 | 100 | end |
| 101 | 101 | out << render_right_project_extrainfo |
| 102 | 102 | out << render_right_project_contributors |
| 103 | | when PRJ_TAB_ACTIVITY |
| 103 | when PRJ_TAB_ACTIVITIES |
| 104 | 104 | out << actionbox_basic(:allow_shortcuts => true) |
| 105 | 105 | out << render(:partial => "ac_right_actionbox_post_message") if @is_member |
| 106 | 106 | when PRJ_TAB_REPOS |
| toggle raw diff |
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -53,7 +53,7 @@ module ProjectsHelper
out << "<ul id='tabmenu'>"
out << project_tab(active_tab, PRJ_TAB_WIKI)
out << project_tab(active_tab, PRJ_TAB_REPOS)
- out << project_tab(active_tab, PRJ_TAB_ACTIVITY)
+ out << project_tab(active_tab, PRJ_TAB_ACTIVITIES)
out << project_tab(active_tab, PRJ_TAB_ROADMAP)
out << project_tab(active_tab, PRJ_TAB_TICKETS)
out << project_tab(active_tab, PRJ_TAB_ARTICLES)
@@ -100,7 +100,7 @@ module ProjectsHelper
end
out << render_right_project_extrainfo
out << render_right_project_contributors
- when PRJ_TAB_ACTIVITY
+ when PRJ_TAB_ACTIVITIES
out << actionbox_basic(:allow_shortcuts => true)
out << render(:partial => "ac_right_actionbox_post_message") if @is_member
when PRJ_TAB_REPOS |
| |   |
| 1 | <%= render :partial => "projects/ac_project_header", :locals => { :tab => PRJ_TAB_ACTIVITIES, |
| 2 | :subtab => PRJ_TAB_SUBTAB_NONE, |
| 3 | :project => @project, |
| 4 | :pagetitle => @title } %> |
| 5 | |
| 6 | <% if @is_member && @members.size > 1 %> |
| 7 | <div id='projectmembers'> |
| 8 | <ul> |
| 9 | <% @members.each do |m| %> |
| 10 | <% if m.user != current_user %> |
| 11 | <li><%= m.user.fullname %></li> |
| 12 | <% end %> |
| 13 | <% end %> |
| 14 | </ul> |
| 15 | </div> |
| 16 | <% end %> |
| 17 | |
| 18 | <%= div_formattedtext_open %> |
| 19 | |
| 20 | <ul> |
| 21 | <% @messages.each do |m| %> |
| 22 | <li> |
| 23 | <% unless @is_member %> |
| 24 | <strong><%= m.user.fullname %></strong> |
| 25 | <% end %> |
| 26 | <%= m.activity %> |
| 27 | <small>(<%= time_ago_in_words(m.created_at) %>)</small> |
| 28 | </li> |
| 29 | <% end %> |
| 30 | </ul> |
| 31 | |
| 32 | <%= div_formattedtext_close %> |
| 33 | |
| 34 | <%= render :partial => "projects/ac_project_footer" %> |
| toggle raw diff |
--- /dev/null
+++ b/app/views/activities/ac_index.html.erb
@@ -0,0 +1,34 @@
+<%= render :partial => "projects/ac_project_header", :locals => { :tab => PRJ_TAB_ACTIVITIES,
+ :subtab => PRJ_TAB_SUBTAB_NONE,
+ :project => @project,
+ :pagetitle => @title } %>
+
+<% if @is_member && @members.size > 1 %>
+<div id='projectmembers'>
+<ul>
+<% @members.each do |m| %>
+ <% if m.user != current_user %>
+ <li><%= m.user.fullname %></li>
+ <% end %>
+<% end %>
+</ul>
+</div>
+<% end %>
+
+<%= div_formattedtext_open %>
+
+<ul>
+<% @messages.each do |m| %>
+ <li>
+ <% unless @is_member %>
+ <strong><%= m.user.fullname %></strong>
+ <% end %>
+ <%= m.activity %>
+ <small>(<%= time_ago_in_words(m.created_at) %>)</small>
+ </li>
+<% end %>
+</ul>
+
+<%= div_formattedtext_close %>
+
+<%= render :partial => "projects/ac_project_footer" %> |
| |   |
| 0 | | <%= render :partial => "ac_project_header", :locals => { :tab => PRJ_TAB_ACTIVITY, |
| 1 | | :subtab => PRJ_TAB_SUBTAB_NONE, |
| 2 | | :project => @project, |
| 3 | | :pagetitle => @title } %> |
| 4 | | |
| 5 | | <% if @is_member && @members.size > 1 %> |
| 6 | | <div id='projectmembers'> |
| 7 | | <ul> |
| 8 | | <% @members.each do |m| %> |
| 9 | | <% if m.user != current_user %> |
| 10 | | <li><%= m.user.fullname %></li> |
| 11 | | <% end %> |
| 12 | | <% end %> |
| 13 | | </ul> |
| 14 | | </div> |
| 15 | | <% end %> |
| 16 | | |
| 17 | | <%= div_formattedtext_open %> |
| 18 | | |
| 19 | | <ul> |
| 20 | | <% @messages.each do |m| %> |
| 21 | | <li> |
| 22 | | <% unless @is_member %> |
| 23 | | <strong><%= m.user.fullname %></strong> |
| 24 | | <% end %> |
| 25 | | <%= m.activity %> |
| 26 | | <small>(<%= time_ago_in_words(m.created_at) %>)</small> |
| 27 | | </li> |
| 28 | | <% end %> |
| 29 | | </ul> |
| 30 | | |
| 31 | | <%= div_formattedtext_close %> |
| 32 | | |
| 33 | | <%= render :partial => "ac_project_footer" %> |
| toggle raw diff |
--- a/app/views/projects/ac_activity_index.html.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-<%= render :partial => "ac_project_header", :locals => { :tab => PRJ_TAB_ACTIVITY,
- :subtab => PRJ_TAB_SUBTAB_NONE,
- :project => @project,
- :pagetitle => @title } %>
-
-<% if @is_member && @members.size > 1 %>
-<div id='projectmembers'>
-<ul>
-<% @members.each do |m| %>
- <% if m.user != current_user %>
- <li><%= m.user.fullname %></li>
- <% end %>
-<% end %>
-</ul>
-</div>
-<% end %>
-
-<%= div_formattedtext_open %>
-
-<ul>
-<% @messages.each do |m| %>
- <li>
- <% unless @is_member %>
- <strong><%= m.user.fullname %></strong>
- <% end %>
- <%= m.activity %>
- <small>(<%= time_ago_in_words(m.created_at) %>)</small>
- </li>
-<% end %>
-</ul>
-
-<%= div_formattedtext_close %>
-
-<%= render :partial => "ac_project_footer" %> |
| |   |
| 1 | 1 | ActionController::Routing::Routes.draw do |map| |
| 2 | 2 | |
| 3 | | # The priority is based upon order of creation: first created -> highest priority. |
| 4 | | |
| 5 | | # Sample of regular route: |
| 6 | | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' |
| 7 | | # Keep in mind you can assign values other than :controller and :action |
| 8 | | |
| 9 | | # Sample of named route: |
| 10 | | # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' |
| 11 | | # This route can be invoked with purchase_url(:id => product.id) |
| 12 | | |
| 13 | | # You can have the root of your site routed by hooking up '' |
| 14 | | # -- just remember to delete public/index.html. |
| 15 | | # map.connect '', :controller => "welcome" |
| 16 | | |
| 17 | | # Allow downloading Web Service WSDL as a file with an extension |
| 18 | | # instead of a file named 'wsdl' |
| 19 | | #map.connect ':controller/service.wsdl', :action => 'wsdl' |
| 20 | 3 | VALID_SHA = /[a-zA-Z0-9~\{\}\^\.\-_]+/ |
| 21 | 4 | map.root :controller => "site", :action => "index" |
| 22 | 5 | |
| … | … | |
| 19 | 19 | #TODO Note the extra members :repository for Gitlab tabs (should these be added to a function that checks $application_mode?) |
| 20 | 20 | map.resources :projects, :member => {:confirm_delete => :get, |
| 21 | 21 | :forum => :get, |
| 22 | | :activity => :get, |
| 23 | 22 | :roadmap => :get, |
| 24 | 23 | :log => :get, |
| 25 | 24 | :config => :get |
| … | … | |
| 48 | 48 | end |
| 49 | 49 | #FIXME these maybe should be down a level |
| 50 | 50 | projects.resources(:articles) |
| 51 | projects.resources(:activities) |
| 51 | 52 | projects.resources(:wikis) |
| 52 | 53 | projects.resources(:milestones) |
| 53 | 54 | projects.resources(:tickets) |
| 54 | | #projects.resources(:events) |
| 55 | 55 | #projects.resources(:members) |
| 56 | 56 | end |
| 57 | 57 | #projects.resource :respository |
| … | … | |
| 68 | 68 | map.about "about", :controller => "site", :action => "about" |
| 69 | 69 | map.faq "about/faq", :controller => "site", :action => "faq" |
| 70 | 70 | |
| 71 | | # |
| 72 | | # Gitlab specific routes |
| 73 | | # |
| 74 | 71 | map.resources :articles, :has_many => [:comments], :has_one => [:category, :project] |
| 75 | 72 | #map.articles 'archives', :controller => 'articles', :action => 'index' |
| 76 | 73 | # Date based archive article links |
| … | … | |
| 96 | 96 | # Install the default route as the lowest priority. |
| 97 | 97 | map.connect ':controller/:action/:id.:format' |
| 98 | 98 | map.connect ':controller/:action/:id' |
| 99 | |
| 99 | 100 | end |
| 101 | |
| toggle raw diff |
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,22 +1,5 @@
ActionController::Routing::Routes.draw do |map|
- # The priority is based upon order of creation: first created -> highest priority.
-
- # Sample of regular route:
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
- # This route can be invoked with purchase_url(:id => product.id)
-
- # You can have the root of your site routed by hooking up ''
- # -- just remember to delete public/index.html.
- # map.connect '', :controller => "welcome"
-
- # Allow downloading Web Service WSDL as a file with an extension
- # instead of a file named 'wsdl'
- #map.connect ':controller/service.wsdl', :action => 'wsdl'
VALID_SHA = /[a-zA-Z0-9~\{\}\^\.\-_]+/
map.root :controller => "site", :action => "index"
@@ -36,7 +19,6 @@ ActionController::Routing::Routes.draw do |map|
#TODO Note the extra members :repository for Gitlab tabs (should these be added to a function that checks $application_mode?)
map.resources :projects, :member => {:confirm_delete => :get,
:forum => :get,
- :activity => :get,
:roadmap => :get,
:log => :get,
:config => :get
@@ -66,10 +48,10 @@ ActionController::Routing::Routes.draw do |map|
end
#FIXME these maybe should be down a level
projects.resources(:articles)
+ projects.resources(:activities)
projects.resources(:wikis)
projects.resources(:milestones)
projects.resources(:tickets)
- #projects.resources(:events)
#projects.resources(:members)
end
#projects.resource :respository
@@ -86,9 +68,6 @@ ActionController::Routing::Routes.draw do |map|
map.about "about", :controller => "site", :action => "about"
map.faq "about/faq", :controller => "site", :action => "faq"
- #
- # Gitlab specific routes
- #
map.resources :articles, :has_many => [:comments], :has_one => [:category, :project]
#map.articles 'archives', :controller => 'articles', :action => 'index'
# Date based archive article links
@@ -117,4 +96,6 @@ ActionController::Routing::Routes.draw do |map|
# Install the default route as the lowest priority.
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action/:id'
+
end
+ |