From b1ae697c3d393067cb19aaea9d26811c84110d16 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 25 Nov 2016 16:00:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BC=A9=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=E9=A1=B5=E9=9D=A2=E4=B8=8B=E6=96=B9=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E5=B7=A6=E5=8F=B3=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css/public.css | 2 +- public/stylesheets/css/structure.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 96abaf93d..28934b0c5 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -117,7 +117,7 @@ a.resourcesTypeUser {background:url(../images/homepage_icon.png) -178px -453px n .softwareIcon {background:url(/images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;} /*意见反馈*/ -html{ overflow-x:hidden;} +html{ overflow-x:auto;} .scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; } .side_content{width:180px; height:auto; overflow:hidden; float:left;} .side_content .side_list {width:180px;overflow:hidden;} diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index dffa0f97b..c350da05c 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -455,7 +455,7 @@ a.topnav_login_box:hover {color:#a1ebff;} .portraitRadius {border-radius: 3px;} /*底部*/ -#Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;} /*margin-bottom:10px;*/ +#Footer{background-color:#ffffff; padding-bottom:15px; color:#666666;min-width: 1000px;} /*margin-bottom:10px;*/ .footerAboutContainer {width:auto; border-bottom:1px solid #efefef; text-align:center;} .footerAbout{margin:0 auto;height:35px; line-height:35px; padding-top: 10px; display:inline-block;} .languageBox {width:55px; height:20px; margin-left:5px; outline:none; color:#666666; border:1px solid #d9d9d9;} From 8393679c9c5572912eb1378303918f849a33adc4 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Nov 2016 17:08:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E8=BD=A6=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=A2=B3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 37 ++++++++++--------- app/views/projects/_applied_status.html.erb | 4 +- .../projects/project_watcherlist.html.erb | 29 +++++++++++++++ config/routes.rb | 1 + 4 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 app/views/projects/project_watcherlist.html.erb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 09cede45a..bcbfaf176 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -32,7 +32,7 @@ class ProjectsController < ApplicationController before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course] before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar] - before_filter :file, :statistics #:watcherlist + before_filter :file # 除非项目内人员,不可查看成员, TODO: 完了写报表里去 # before_filter :memberAccess, only: :member @@ -535,6 +535,23 @@ class ProjectsController < ApplicationController end end + def project_watcherlist + unless @project.nil? + if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin? + render_403 + else + @users -= watched.watcher_users if @watched + end + @watchers = @project.watcher_users + @limit = 20 + @is_remote = true + @watchers_count = @watchers.count + @watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1 + @offset ||= @watcher_pages.offset + @watchers = paginateHelper @watchers, 20 + end + end + # include CoursesHelper def member # 消息"同意加入项目" @@ -671,13 +688,7 @@ class ProjectsController < ApplicationController end def statistics - @watchers = @project.watcher_users - @limit = 20 - @is_remote = true - @watchers_count = @watchers.count - @watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1 - @offset ||= @watcher_pages.offset - @watchers = paginateHelper @watchers, 20 + end #end @@ -978,16 +989,6 @@ class ProjectsController < ApplicationController true end - def watcherlist - unless @project.nil? - if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin? - render_403 - else - @users -= watched.watcher_users if @watched - end - end - end - #gcm def desc_sort_course_by_avtivity(activity_count,projects) return projects if activity_count.size<2 diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb index 55190c613..c5af17587 100644 --- a/app/views/projects/_applied_status.html.erb +++ b/app/views/projects/_applied_status.html.erb @@ -3,7 +3,7 @@
  • <%= watcher_link_for_project(@project, User.current) %> - <%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "watcherlist", + <%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "project_watcherlist", :id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
  • @@ -21,7 +21,7 @@ <% if User.current.login? %>
  • <%= watcher_link_for_project(@project, User.current) %> - <%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "watcherlist", + <%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "project_watcherlist", :id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
  • diff --git a/app/views/projects/project_watcherlist.html.erb b/app/views/projects/project_watcherlist.html.erb new file mode 100644 index 000000000..440975e68 --- /dev/null +++ b/app/views/projects/project_watcherlist.html.erb @@ -0,0 +1,29 @@ +
    +

    成员 本页面展示关注了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户

    +
      + <% @watchers.each do |user| %> +
    • + <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像", :class => "pro_new_users fl mr5" %> +
      + <%= link_to user.try(:show_name), user_path(user), :class => "pro_new_users mt5 fl" %> + +
      + <%=h time_tag(user.created_on) %> +
      +
    • + <% end %> +
    +
    +
    +
      + <%= pagination_links_full @watcher_pages, @watchers_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %> +
    +
    +
    +
    +
    +
    + + + diff --git a/config/routes.rb b/config/routes.rb index 2ff100196..fc18e6e59 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -780,6 +780,7 @@ RedmineApp::Application.routes.draw do get 'settings(/:tab)', :action => 'settings', :as => 'settings' #by young get 'member', :to => 'projects#member', :as => 'member' + match 'project_watcherlist', :to => 'projects#project_watcherlist', :as => 'project_watcherlist' match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine' match 'enshrine', :to => 'projects#enshrine', :as => 'enshrine' match 'member_forked', :to => 'projects#member_forked', :as => 'member_forked'