<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
- <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
+ <%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
@@ -63,17 +63,3 @@
<%= render :partial => 'users/homework_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id, :hw_status => hw_status, :is_teacher => is_teacher} %>
-
diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb
index a3d216ef2..716a860ce 100644
--- a/app/views/users/_homework_base_info.html.erb
+++ b/app/views/users/_homework_base_info.html.erb
@@ -14,8 +14,6 @@
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
- <% end %>
- <% if activity.anonymous_comment == 0%>
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
@@ -27,9 +25,7 @@
# <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
-<% end %>
-
-<% if activity.student_works.has_committed.count != 0 %>
+
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
<%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %>
@@ -42,13 +38,8 @@
- <% if activity.homework_type != 2 %>
- <% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %>
- <% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %>
- <% else %>
- <% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("score desc") %>
- <% end %>
- <% student_works.includes(:user).each_with_index do |sw, i| %>
+ <% student_works = activity.student_works.select("student_works.*,student_works.work_score as score").where("work_score is not null and work_status != 0").order("score desc").limit(5) %>
+ <% student_works.includes(:user).each do |sw| %>
- <% if i == 4 %>
- <% break %>
- <% end %>
<% end %>
- <% if student_works.count > 5 %>
+ <% if student_works.count == 5 %>
<%= link_to "更多>>", student_work_index_url_in_org(activity.id, 2),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%>
<% end %>
@@ -83,11 +71,11 @@
<% sort_projects = project_sort_update projects %>
- <%# first_pro = sort_projects.first %>
- <% first_pro = Project.find sort_projects.first.project_id %>
+ <% first_pro_act = sort_projects.first %>
+ <% first_pro = Project.find first_pro_act.project_id %>
<% commit_time = first_pro.project_score.commit_time %>
- <% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
- # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_forge_time) ? commit_time : one_forge_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目
+ <%# one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
+ # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(first_pro_act.updated_at) ? commit_time : first_pro_act.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目
diff --git a/app/views/users/_homework_opr.html.erb b/app/views/users/_homework_opr.html.erb
index 90acbf830..9105f7067 100644
--- a/app/views/users/_homework_opr.html.erb
+++ b/app/views/users/_homework_opr.html.erb
@@ -1,20 +1,19 @@
+<% work = cur_user_works_for_homework activity %>
<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%>
<% projects = cur_user_projects_for_homework activity %>
- <% works = cur_user_works_for_homework activity %>
- <% if works.nil? && projects.nil? %>
+ <% if work.nil? && projects.nil? %>
<%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
- <% elsif works.nil? %>
+ <% elsif work.nil? %>
<%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
<% end %>
<% end %>
- <%= user_for_homework_common activity,is_teacher %>
+ <%= user_for_homework_common activity,is_teacher,work %>
-<% work = cur_user_works_for_homework activity %>
<% if !is_teacher && !work.nil? && work.user == User.current && activity.end_time < Date.today %>
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
@@ -35,8 +34,7 @@
语言:
<%= activity.language_name%>
-<% end %>
-<% if activity.homework_type == 3 && activity.homework_detail_group%>
+<% elsif activity.homework_type == 3 && activity.homework_detail_group%>
<% if activity.homework_detail_group.base_on_project == 1 %>
项目(<%=activity.student_work_projects.where("is_leader = 1").count %>)
From 43e72813b4d46b05799484ea0869191f72d97fac Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 10 Nov 2016 11:11:28 +0800
Subject: [PATCH 06/40] =?UTF-8?q?=E5=BD=93=E6=8C=87=E6=B4=BE=E7=9D=80?=
=?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E5=AF=BC=E5=87=BA=E7=BB=9F?=
=?UTF-8?q?=E8=AE=A1=E4=B8=BA=E7=A9=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 8ba2ce20f..a137b7cd1 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -235,7 +235,9 @@ class IssuesController < ApplicationController
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
@issue.fixed_version_id = nil if @issue.fixed_version_id == 0
+ @issue.assigned_to_id = nil if @issue.assigned_to_id == 0
if @issue.save
+ #params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0
senduser = User.find(params[:issue][:assigned_to_id])
issue_id = @issue.id
issue_title = params[:issue][:subject]
@@ -282,15 +284,18 @@ class IssuesController < ApplicationController
# 用户编辑更改issue
def update
+ # params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0
if params[:issue_detail]
issue = Issue.find(params[:id])
issue = update_user_issue_detail(issue, params)
+ @issue.assigned_to_id = nil if @issue.assigned_to_id == 0
@saved = update_user_issue_detail(issue, params)
return
else
# 修改实例变量的值
return unless update_issue_from_params
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
+ @issue.assigned_to_id = nil if @issue.assigned_to_id == 0
saved = false
begin
@saved = @issue.save_issue_with_child_records(params, @time_entry)
From 4fc98308bcc5f3337055acf05ab47a29a7157f34 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 10 Nov 2016 13:34:43 +0800
Subject: [PATCH 07/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=80=E4=BB=8B?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/mailer/send_for_user_activities.html.erb | 2 +-
public/stylesheets/css/project.css | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index 7fdd737e3..53e20dab0 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -189,7 +189,7 @@
<% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first ||
@project_attachments.first %>
-
<%= l(:label_project_overview_new)%>
+
<%= l(:label_project_overview_new) %>
<% if !@issues.first.nil? || !@issues_journals.first.nil? %>
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 09dced2ad..3096afbab 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -880,7 +880,7 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
/*项目简介*/
.pro_new_info{ border:1px solid #ddd; background-color:#fff; width: 998px;}
.pro_new_info h2{ background: #fff; font-size: 14px; color: #333; height: 40px; line-height: 40px; padding-left: 15px; border-bottom:1px solid #e5e5e5;}
-.pro_new_info p{ padding:15px; color: #666;}
+.pro_new_info p{ padding:5px; color: #666;}
.pro_new_info_weight{ font-size: 16px; font-weight: bold;}
/* 新版项目配置*/
.pro_new_setting_leftnav{ width: 162px; border:1px solid #ddd; background-color:#fff; padding:3px; padding-bottom: 0;}
From 5bf519bbf7c29b4d3b0287376e2b18437ec7325d Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 10 Nov 2016 14:18:53 +0800
Subject: [PATCH 08/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=87=8C=E7=A8=8B?=
=?UTF-8?q?=E7=A2=91=EF=BC=8C=E6=96=B0=E5=BB=BA=E9=87=8C=E7=A8=8B=E7=A2=91?=
=?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/versions/_new_milestone.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/versions/_new_milestone.html.erb b/app/views/versions/_new_milestone.html.erb
index 47c1d2b39..40fff71f2 100644
--- a/app/views/versions/_new_milestone.html.erb
+++ b/app/views/versions/_new_milestone.html.erb
@@ -22,7 +22,7 @@
日期 :
-
+
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class => "issues_calendar_input fl ml3", :id => "version_index_create_name", :placeholder=>"结束日期", :style=>"height:28px;border-left:none;border-top:none;border-bottom:none;", :no_label => true %>
<%#= calendar_for('version_index_create_name') %>
From 590af4ff4a4be060617e75df2806d2d4e3373762 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 10 Nov 2016 15:19:13 +0800
Subject: [PATCH 09/40] =?UTF-8?q?=E7=BC=96=E8=BE=91issue=EF=BC=8C=E5=88=A0?=
=?UTF-8?q?=E9=99=A4=E4=B8=8A=E4=BC=A0issue=E4=B8=BA=E5=AE=9E=E6=97=B6?=
=?UTF-8?q?=E5=88=B7=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/attachments/destroy.js.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/attachments/destroy.js.erb b/app/views/attachments/destroy.js.erb
index 8bb2ab2cc..1e33d8e7a 100644
--- a/app/views/attachments/destroy.js.erb
+++ b/app/views/attachments/destroy.js.erb
@@ -12,8 +12,8 @@ $("#attachment_history_popub").html('<%= escape_javascript( render :partial => '
$("#attachment_history_popub").html('<%= escape_javascript( render :partial => 'files/attachment_history_popub') %>');
<% end %>
-<% if params[:attachment_id] %>
-$("#issue_upload_attachments").html('<%= escape_javascript( render :partial => 'attachments/form_attachments', :locals => { :container => @attachment.container }) %>');
+<% unless @attachment.container.nil? %>
+ $("#issue_upload_attachments").html('<%= escape_javascript( render :partial => 'attachments/form_attachments', :locals => { :container => @attachment.container }) %>');
<% end %>
<% if @is_destroy%>
From b1e0cc78848f0beb75026a39fdac547253e2dea0 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 10 Nov 2016 15:45:00 +0800
Subject: [PATCH 10/40] =?UTF-8?q?=E9=87=8C=E7=A8=8B=E7=A2=91=E6=89=80?=
=?UTF-8?q?=E6=9C=89ISSUE=20=E6=A0=87=E9=A2=98=E4=B8=8E=E6=8C=87=E6=B4=BE?=
=?UTF-8?q?=E7=9D=80=E5=8A=A0=E9=93=BE=E6=8E=A5=EF=BC=8C=E5=B9=B6=E5=AF=B9?=
=?UTF-8?q?=E6=8C=87=E6=B4=BE=E7=9D=80=E4=B8=BA=E7=A9=BA=E6=8A=A5500?=
=?UTF-8?q?=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/versions/show.html.erb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb
index beafc0456..8fd672a14 100644
--- a/app/views/versions/show.html.erb
+++ b/app/views/versions/show.html.erb
@@ -67,9 +67,11 @@
<% @issues.each do |issue| %>
#<%= issue.id %>
- <%= issue.subject %>
+ <%= issue.subject %>
<%= issue.tracker %>
- <%= User.find(issue.try(:assigned_to_id)).show_name %>
+ " class="new_roadmap_info_name" target="_blank">
+ <%= User.find(issue.try(:assigned_to_id)).nil? ? "" : User.find(issue.try(:assigned_to_id)).show_name %>
+
<%= format_time issue.updated_on %>
<%= issue.status.name %>
" ><%= issue.done_ratio %>%
From 6cc38ee51e3a69ae870b16f4f8d0a4f900099346 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 10 Nov 2016 17:12:04 +0800
Subject: [PATCH 11/40] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E5=9B=9E=E5=A4=8D=E4=B8=AD=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F?=
=?UTF-8?q?=E5=BB=BA=E8=AE=AE=E5=8A=A0=E9=93=BE=E6=8E=A5=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E8=AF=A5=E7=94=A8=E6=88=B7=E4=B8=BB=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/words/_journal_reply_items.html.erb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb
index cdfee3e9f..2e06c1fb1 100644
--- a/app/views/words/_journal_reply_items.html.erb
+++ b/app/views/words/_journal_reply_items.html.erb
@@ -4,14 +4,14 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
-
+
<% if show_name %>
- <%= image_tag url_to_avatar(reply.user),:width => '30',:height => '30' %>
+ <%= link_to image_tag(url_to_avatar(reply.user),:width => '30',:height => '30'), user_path(reply.user) %>
<% else %>
- <%= image_tag url_to_avatar(nil),:width => '30',:height => '30' %>
+ <%= link_to image_tag(url_to_avatar(nil),:width => '30',:height => '30'), user_path(reply.user) %>
<% end %>
-
+
<% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to reply.user.show_name, user_path(reply.user) %>
<%= l(:label_reply_to)%>
From ae84afe43efb163f013504434b4cae544f9888e5 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 10 Nov 2016 17:16:54 +0800
Subject: [PATCH 12/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=EF=BC=8C=E6=96=B0?=
=?UTF-8?q?=E5=BB=BA=E5=92=8C=E7=BC=96=E8=BE=91issue=E6=97=B6=EF=BC=8C?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E6=97=B6=EF=BC=8C=E4=BF=9D?=
=?UTF-8?q?=E5=AD=98=E6=8C=89=E9=92=AE=E4=B8=8D=E5=8F=AF=E7=82=B9=E5=87=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/attachments/upload.js.erb | 3 +++
app/views/issues/_form.html.erb | 3 ++-
public/javascripts/attachments.js | 4 ++++
public/stylesheets/css/project.css | 15 +++++++++++++++
4 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/app/views/attachments/upload.js.erb b/app/views/attachments/upload.js.erb
index 62db5ebfd..7a0a195ad 100644
--- a/app/views/attachments/upload.js.erb
+++ b/app/views/attachments/upload.js.erb
@@ -1,3 +1,6 @@
+$('#issue_confirm').removeAttr("disabled");
+$('#issue_confirm').css('background-color', '#3b94d6');
+$('#issue_confirm').css('cursor','pointer');
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
<% if(!@attachment.nil? && @attachment.new_record?) %>
fileSpan.hide();
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb
index 649965b97..390d1d6f5 100644
--- a/app/views/issues/_form.html.erb
+++ b/app/views/issues/_form.html.erb
@@ -62,7 +62,8 @@
取消
<% end %>
-
保存
+
+
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 7c3e513f7..27d03ab0b 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -91,6 +91,10 @@ function addFile_board(inputEl, file, eagerUpload, id,btnId) {
function addFile(inputEl, file, eagerUpload,btnId) {
var attachments_frame = '#attachments_fields';
+ // $("#issue_confirm").attr('href', '#');
+ $('#issue_confirm').attr("disabled",true);
+ $('#issue_confirm').css('background-color','#c1c1c1');
+ $('#issue_confirm').css('cursor','default');
if (true) {
deleteallfiles = $(inputEl).data('deleteAllFiles');
var attachmentId = addFile.nextAttachmentId++;
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 3096afbab..e82d524c7 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -704,6 +704,21 @@ a.sy_btn_blue{
-o-border-radius:3px;
border-radius:3px;
}
+input.sy_btn_blue{
+ display: inline-block;
+ color: #fff;
+ background: #3b94d6;
+ text-align: center;
+ font-size: 12px;
+ padding:0 15px;
+ height: 30px;
+ line-height: 30px;
+ -webkit-border-radius:3px;
+ -moz-border-radius:3px;
+ -o-border-radius:3px;
+ border-radius:3px;
+ cursor:pointer;
+}
a:hover.sy_btn_blue{ background: #2788d0;}
a.hw_btn_blue{
display: inline-block;
From 4a5e350615122752ad98c7c2fa9314daa5b2c72e Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 10 Nov 2016 17:24:00 +0800
Subject: [PATCH 13/40] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=EF=BC=9A=E5=88=A0=E9=99=A4=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=EF=BC=8C=E5=8D=B4=E8=B7=B3=E8=BD=AC=E5=88=B0?=
=?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2=E5=8E=BB?=
=?UTF-8?q?=E4=BA=86=EF=BC=8C=E4=B8=8D=E5=90=88=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/words_controller.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index de232a423..e4b480e2f 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -102,7 +102,11 @@ class WordsController < ApplicationController
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
@activity = JournalsForMessage.where("id = #{params[:activity_id].to_i}").first if params[:activity_id]
unless @activity
- redirect_to feedback_path(@user)
+ if params[:user_activity_id] == params[:activity_id]
+ redirect_to feedback_path(@user)
+ else
+ redirect_to user_path(@user)
+ end
return
end
elsif @journal_destroyed.jour_type == 'HomeworkCommon'
From 1e0c2e5d6ad17eed4744c464abf6643176269151 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 10 Nov 2016 17:28:14 +0800
Subject: [PATCH 14/40] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E9=A6=96=E9=A1=B5?=
=?UTF-8?q?=E7=9A=84=E6=B4=BB=E8=B7=83=E5=BA=A6=E5=92=8C=E8=8B=B1=E9=9B=84?=
=?UTF-8?q?=E6=A6=9C=E7=94=B13=E4=B8=AA=E5=A2=9E=E5=8A=A0=E5=88=B06?=
=?UTF-8?q?=E4=B8=AA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/courses_helper.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 37c4c037c..52dc9e5c4 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -895,7 +895,7 @@ module CoursesHelper
desc.html_safe
end
- # 学生按作业总分排序,取前3个
+ # 学生按作业总分排序,取前6个
def hero_homework_score(course, score_sort_by)
sql_select = "SELECT members.*,(
SELECT SUM(work_score)
@@ -907,14 +907,14 @@ module CoursesHelper
FROM members
JOIN students_for_courses
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
- WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 3"
+ WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 6"
homework_scores = Member.find_by_sql(sql_select)
end
def contributor_course_scor(course_id)
ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by
(message_num*2 + message_reply_num + news_reply_num + news_num +
- resource_num*5 + journal_num + homework_journal_num ) desc limit 3;")
+ resource_num*5 + journal_num + homework_journal_num ) desc limit 6;")
end
#用户在该课程是否具有某个角色
From 9bdc76b6e37bef00c23f470a5ac30f0ea48b57f8 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 10 Nov 2016 17:34:58 +0800
Subject: [PATCH 15/40] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8C=87=E6=B4=BE?=
=?UTF-8?q?=E7=BB=99=E8=B7=B3=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 4408f041b..5df730cdb 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -61,7 +61,7 @@
指派给
- <%= @issue.assigned_to ? @issue.assigned_to.show_name : "--" %>
+ " class="c_blue" ><%= @issue.assigned_to ? @issue.assigned_to.show_name : "--" %>
<% end %>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
From 0d8d2fbc90b2f1a68326be1e02bda8db1c772259 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 11 Nov 2016 09:29:29 +0800
Subject: [PATCH 16/40] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E6=B4=BB=E8=B7=83?=
=?UTF-8?q?=E5=BA=A6=E6=8E=92=E8=A1=8C=E5=8E=BB=E9=99=A4=E8=80=81=E5=B8=88?=
=?UTF-8?q?=E5=92=8C=E6=95=99=E8=BE=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/courses_helper.rb | 7 ++++---
app/views/courses/_course_activity_users.html.erb | 7 ++-----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 52dc9e5c4..e97d32523 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -912,9 +912,10 @@ module CoursesHelper
end
def contributor_course_scor(course_id)
- ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by
- (message_num*2 + message_reply_num + news_reply_num + news_num +
- resource_num*5 + journal_num + homework_journal_num ) desc limit 6;")
+ ccs = CourseContributorScore.find_by_sql("SELECT ccs.*, (message_num*2 + message_reply_num + news_reply_num + news_num +
+ resource_num*5 + journal_num + homework_journal_num ) as con_score FROM `course_contributor_scores` ccs JOIN students_for_courses sfs
+ ON sfs.student_id = ccs.user_id AND sfs.course_id = ccs.course_id where ccs.course_id = #{course_id} order by
+ con_score desc limit 6;")
end
#用户在该课程是否具有某个角色
diff --git a/app/views/courses/_course_activity_users.html.erb b/app/views/courses/_course_activity_users.html.erb
index 67ec2ede9..459f60f3d 100644
--- a/app/views/courses/_course_activity_users.html.erb
+++ b/app/views/courses/_course_activity_users.html.erb
@@ -23,11 +23,8 @@
总得分为以上得分之和
<% contributor_course_scor(course.id).each do |contributor_score| %>
- <% total_score = contributor_score.resource_num.to_i * 5 + contributor_score.message_num.to_i * 2 +
- contributor_score.message_reply_num.to_i * 1 + contributor_score.journal_num.to_i * 1 +
- + contributor_score.homework_journal_num.to_i * 1 + contributor_score.news_reply_num.to_i * 1 +
- contributor_score.news_num.to_i * 1 %>
- <% unless total_score ==0 %>
+ <% total_score = contributor_score.con_score %>
+ <% if !total_score.nil? && total_score !=0 %>
<%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "50", :height => "50", :class=> "rankPortrait"),user_path(contributor_score.user) %>
<%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %>
From aab24ea34a64504019a938165fcbe6721be6ff40 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 11 Nov 2016 10:37:20 +0800
Subject: [PATCH 17/40] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A1=B6=E9=83=A8fork?=
=?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=94=99=E8=AF=AF=EF=BC=8C=E5=B7=B2=E7=BB=8F?=
=?UTF-8?q?fork=E8=BF=87=E8=AF=A5=E9=A1=B9=E7=9B=AE=E7=9A=84=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E6=8F=90=E7=A4=BA?=
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 | 12 ++++++++++++
app/models/journals_for_message.rb | 2 +-
app/views/projects/_applied_status.html.erb | 2 +-
app/views/repositories/_forked_popbox.html.erb | 9 ++++++---
5 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 107f2ff88..a2a78fd9d 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -27,7 +27,7 @@ class ProjectsController < ApplicationController
menu_item :feedback, :only => :feedback
menu_item :share, :only => :share
- before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project, :forked_pop]
+ before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project]
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]
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c32f6c175..e8cb002a8 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -54,6 +54,18 @@ module ApplicationHelper
Project.find(forked_from_project_id)
end
+ # 判断当前用户是否已经fork过当前项目
+ # project: current_project
+ def has_forked_cur_project project
+ cur_user_projects = Project.where(:user_id => User.current.id)
+ if cur_user_projects.count == 0
+ false
+ else
+ has_forked = cur_user_projects.select{|cur_user_project| cur_user_project.forked_from_project_id == project.id}
+ has_forked.length > 0 ? true : false
+ end
+ end
+
# 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
def get_user_by_mail mail
user = User.find_by_mail(mail)
diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb
index 2a432d42f..4a9601d07 100644
--- a/app/models/journals_for_message.rb
+++ b/app/models/journals_for_message.rb
@@ -78,7 +78,7 @@ class JournalsForMessage < ActiveRecord::Base
:act_as_principal_activity, :act_as_student_score
after_create :reset_counters!
#after_update :update_activity
- after_destroy :reset_counters!
+ # after_destroy :reset_counters!
after_save :be_user_score
after_destroy :down_user_score, :down_course_score
diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb
index 17392f2c5..41bb08cbc 100644
--- a/app/views/projects/_applied_status.html.erb
+++ b/app/views/projects/_applied_status.html.erb
@@ -33,7 +33,7 @@
-->
- <%= link_to " ".html_safe+"Fork", {:controller => 'projects', :action => 'forked_pop'},
+ <%= link_to " ".html_safe+"Fork", forked_pop_project_path(@project),
:class=>"pro_new_topbtn_left fl", :remote => true %>
<%= @project.forked_count.to_i %>
diff --git a/app/views/repositories/_forked_popbox.html.erb b/app/views/repositories/_forked_popbox.html.erb
index bb277e46f..a8c249b3a 100644
--- a/app/views/repositories/_forked_popbox.html.erb
+++ b/app/views/repositories/_forked_popbox.html.erb
@@ -7,14 +7,17 @@