diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 9a3e2d70f..a31fd18aa 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -19,14 +19,14 @@ class ProjectsController < ApplicationController layout 'base_projects'# by young menu_item :overview menu_item :roadmap, :only => :roadmap -# menu_item :settings, :only => :settings + menu_item :settings, :only => :settings before_filter :find_project, :except => [ :index, :list, :new, :create, :copy ] - before_filter :authorize, :except => [ :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback] + before_filter :authorize, :except => [:watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback] before_filter :authorize_global, :only => [:new, :create] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ] #by young - before_filter :member, :file, :statistics + before_filter :member, :file, :statistics, :watcherlist # accept_rss_auth :index accept_api_auth :index, :show, :create, :update, :destroy @@ -51,6 +51,7 @@ class ProjectsController < ApplicationController helper :activities helper :documents helper :watchers +# helper :watcherlist ### added by william include ActsAsTaggableOn::TagsHelper @@ -392,3 +393,12 @@ class ProjectsController < ApplicationController true end end + +# added by huang +def watcherlist + if @watched + @users -= watched.watcher_users + end + +end +# end diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index c0cd755a8..f4165bdba 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -45,7 +45,7 @@ - +
@@ -56,12 +56,16 @@ <% end %> + + - - - + + + + +
<%=link_to "#{@project.members.count}", project_member_path(@project) %><%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist" %> <%=link_to "#{@project.issues.count}", project_issues_path(@project) %> <%=link_to files_count, project_files_path(@project) %>
<%= l(:label_member) %> <%= l(:label_project_issues) %><%= l(:label_attachment) %> <%= l(:label_member) %><%= l(:label_user_watcher) %> <%= l(:label_project_issues) %><%= l(:label_attachment) %>
diff --git a/app/views/projects/watcherlist.html.erb b/app/views/projects/watcherlist.html.erb new file mode 100644 index 000000000..491dd7205 --- /dev/null +++ b/app/views/projects/watcherlist.html.erb @@ -0,0 +1,33 @@ + +

<%= l(:label_user_watcher)%>

+
+ <% for user in @project.watcher_users %> + +<% end %> +
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index c95489187..c8594e27c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -138,6 +138,8 @@ RedmineApp::Application.routes.draw do get 'file', :action => 'file', :as => 'file' get 'statistics', :action => 'statistics', :as => 'statistics' get 'feedback', :action => 'feedback' + get 'watcherlist', :action=> 'watcherlist' + match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang #end post 'modules' @@ -166,7 +168,7 @@ RedmineApp::Application.routes.draw do # get 'projects/:project_id/repository', :to => 'repositories#show', :as => 'project_repository' # match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get - + match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang #end resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 25a2940ad..de4cbb192 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -11,6 +11,12 @@ h4 {border-bottom: 1px dotted #bbb;} /*new by huang*/ /**/ +.project_avatar_name { + position: relative; + font-size: 16px; + display:block; +} + a.bids_user { font-family:微软雅黑; color:#15bccf; @@ -45,9 +51,11 @@ a.bids_user { margin-top: 10px; } -ul.list_watch{list-style-type:none; - height:auto; - border-bottom: 1px dashed rgb(204, 204, 204); +ul.list_watch{ + padding-left: 0px; + list-style-type:none; + height:auto; + border-bottom: 1px dashed rgb(204, 204, 204); } .new_creat{