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/6] =?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/6] =?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' From f1b6e67e507304d787d0bcda335a838fd1844223 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 25 Nov 2016 17:10:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=B4=E9=83=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9=EF=BC=8Cfork=E6=95=B0?= =?UTF-8?q?=E7=9B=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 2 +- app/helpers/application_helper.rb | 6 ++++++ app/views/projects/_applied_status.html.erb | 6 +++--- app/views/projects/member.html.erb | 2 +- public/stylesheets/css/project.css | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 09cede45a..322c21f0a 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -603,7 +603,7 @@ class ProjectsController < ApplicationController @limit = 20 @is_remote = true - @forked_count = @project.forked_count + @forked_count = @forked_projects.count @forked_pages = Paginator.new @forked_count, @limit, params['page'] || 1 @offset ||= @forked_pages.offset @forked_projects = paginateHelper @forked_projects, @limit diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ad3d2c61d..a1a5ecacb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2837,6 +2837,12 @@ module ApplicationHelper tag_list end + # 获取项目fork成员数 + def project_fork_count + @forked_projects = Project.where(:forked_from_project_id => @project.id) + @forked_count = @forked_projects.count + end + def get_org_subfield_tag_list org_subfield all_attachments = org_subfield.attachments.select{|attachment| attachment.is_public? || (attachment.container_type == "OrgSubfield" && User.current.member_of_org?(org_subfield.organization))|| diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb index 55190c613..5b769927e 100644 --- a/app/views/projects/_applied_status.html.erb +++ b/app/views/projects/_applied_status.html.erb @@ -25,7 +25,7 @@ :id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
  • - 已加入 + 已加入 <%= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员列表" %>
  • @@ -42,7 +42,7 @@ <%= link_to "".html_safe+"Fork", forked_pop_project_path(@project), :class=>"pro_new_topbtn_left fl", :remote => true %> - <%= @project.forked_count.to_i %> + <%= project_fork_count %> <% else%> @@ -52,7 +52,7 @@ Fork - <%= @project.forked_count.to_i %> + <%= project_fork_count %> <% end %> diff --git a/app/views/projects/member.html.erb b/app/views/projects/member.html.erb index 49ab1ac68..83fcf7752 100644 --- a/app/views/projects/member.html.erb +++ b/app/views/projects/member.html.erb @@ -3,7 +3,7 @@

    <%= @subPage_title %> <% if is_project_manager?(User.current, @project) %> - <%=link_to "成员管理", {:controller => 'projects', :action => 'settings'}, :id => @project.id, :tab => 'members', :class => "sy_cblue", :style => "font-weight: normal;" %> + <%=link_to "成员管理", settings_project_url(@project, :tab => 'members'), :id => @project.id, :class => "sy_cblue", :style => "font-weight: normal;" %> <% end %>

    diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 5af60925c..530287ed4 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -865,9 +865,9 @@ a.pro_new_username_fork { font-size: 12px; color: #3b94d6; line-height: 24px;} a.pro_new_proname{ overflow: hidden;white-space: nowrap;text-overflow:ellipsis;display: inline-block;} a.pro_new_project_name{ width: 250px; overflow: hidden;white-space: nowrap;text-overflow:ellipsis;display: inline-block;} a.pro_new_topbtn{ padding: 3px 7px; font-size: 12px; line-height: 20px; color: #333;vertical-align: middle;background-color: #fff; border: 1px solid #ddd; border-left: 0; border-top-right-radius: 3px; border-bottom-right-radius: 3px; color: #333;} -a.pro_new_topbtn_left { padding: 3px 10px; font-size: 12px;line-height: 20px; background-image: linear-gradient(#fcfcfc, #eee); border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #333; } +a.pro_new_topbtn_left { padding: 3px 10px; font-size: 12px;line-height: 20px; background-image: linear-gradient(#fcfcfc, #eee); border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #333;} a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd);} -a.pro_new_grey_topbtn_left{padding: 3px 10px; font-size: 12px;line-height: 20px; background: #fff; border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #888888; } +a.pro_new_grey_topbtn_left{padding: 3px 10px; font-size: 12px;line-height: 20px; background: #fff; border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #888888; cursor:default;} .pro_new_topnav ul{border-bottom: 3px solid #fff; height: 30px; line-height: 30px;} .pro_new_topnav ul li{ float: left;padding:0 15px; height: 30px; line-height: 30px;text-align: center; } .pro_new_topnav_active{border-bottom: 3px solid #3b94d6; } From c640535cca86f166361bc1cda96b8da655d02da7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 25 Nov 2016 17:39:55 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=B4=E9=83=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_project_top.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index d6c704aa0..e1483eb3e 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -9,6 +9,7 @@
    <% unless @project.is_public? %><% end %> + <%=link_to "#{@project.owner.try(:show_name)}/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> <%=link_to @project.name, project_path(@project), :class => "pro_new_username break_word" %>
    From 248276d088890c82c1637b6d296e31e37fc46b8c Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 25 Nov 2016 17:43:52 +0800 Subject: [PATCH 5/6] =?UTF-8?q?KE=E5=B7=A5=E5=85=B7=E6=A0=8F=E4=B8=8D?= =?UTF-8?q?=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index c78fd430e..e584575dd 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -5067,9 +5067,9 @@ KEditor.prototype = { ] K.each(fullItems, function(i, name) { if (name == '|') { - htmlListFull.push(''); +// htmlListFull.push(''); } else if (name == '/') { - htmlListFull.push('
    '); +// htmlListFull.push('
    '); } else { htmlListFull.push(''); htmlListFull.push(''); From 9c12e774d174c20eb2b982c3a25ac49eedd6c376 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Nov 2016 17:50:37 +0800 Subject: [PATCH 6/6] =?UTF-8?q?pull=20request=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=AD=A3=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/pull_requests_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/pull_requests_helper.rb b/app/helpers/pull_requests_helper.rb index c89a3be0f..983ab848c 100644 --- a/app/helpers/pull_requests_helper.rb +++ b/app/helpers/pull_requests_helper.rb @@ -2,12 +2,12 @@ module PullRequestsHelper # 获取diff内容行号 def diff_line_num content - content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i + result = content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i end # 处理内容 def diff_content content - content.gsub!(/.*@@ -\d+,\d+ \+\d+,\d+ @@\n/m,'') + result = content.gsub!(/.*@@.*@@\n/m,'') end def get_user_name user_id