From 0cc9fafddb8e738c8dac61946261d428c0ee58b9 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 9 Aug 2016 17:21:11 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E2=80=9C=E5=85=B3=E6=B3=A8=E3=80=81?= =?UTF-8?q?=E7=B2=89=E4=B8=9D=E2=80=9D=E9=A1=B5=E9=9D=A2=E4=B8=AD=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=98=BE=E7=A4=BA=E8=A6=81=E7=B4=A7=E8=B7=9F=E4=B8=8A?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_fanslist.html.erb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb index fb7abdd01..47bdc9126 100644 --- a/app/views/users/user_fanslist.html.erb +++ b/app/views/users/user_fanslist.html.erb @@ -27,9 +27,19 @@ <%# end %>

<%= l(:label_no_data) %>

+ +
+
+
    + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%> +
+
+
+
+ + + + + - -
From a50ac2d79d6b91b8b42b52ee711bd6771df1a18c Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 10 Aug 2016 14:22:05 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E7=A6=81=E7=94=A8=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E6=98=BE=E7=A4=BA=E2=80=9C=E6=8F=90=E7=A4=BA=EF=BC=9A?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=90=8D=E7=A7=B0=E5=92=8C=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=B8=AD=E4=B8=8D=E8=A6=81=E5=87=BA=E7=8E=B0=E7=9C=9F=E5=AE=9E?= =?UTF-8?q?=E7=9A=84=E5=A7=93=E5=90=8D=E4=BF=A1=E6=81=AF=E2=80=9D=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/edit.html.erb | 8 +++++--- app/views/student_work/new.html.erb | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index ed0b369e8..931cdc1de 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -31,9 +31,11 @@
<%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%> -
- 提示:作品名称和描述中不要出现真实的姓名信息 -
+ <% if @homework.anonymous_comment == 0 %> +
+ 提示:作品名称和描述中不要出现真实的姓名信息 +
+ <% end %>
<% if @homework.homework_type == 3 %> diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index dfddea306..ec028c743 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -235,9 +235,11 @@ :action => 'create', :homework => @homework.id },:remote=>true ) do |f| %> -
- 提示:作品名称和描述中不要出现真实的姓名信息 -
+ <% if @homework.anonymous_comment == 0 %> +
+ 提示:作品名称和描述中不要出现真实的姓名信息 +
+ <% end %>
<% if @homework.homework_type == 3 %> From 71326c901d0d101721ac96309d1045062e03e306 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 10 Aug 2016 16:09:13 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=9C=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=8C=BF=E8=AF=84=E5=90=8E=E5=86=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BD=9C=E5=93=81=EF=BC=8C=E6=AD=A4=E6=97=B6=E8=AF=A5=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E5=8F=8A=E8=AF=A5=E5=AD=A6=E7=94=9F=E7=9A=84=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E6=98=AF=E4=B8=8D=E8=A2=AB=E5=8C=BF=E8=AF=84=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E8=AF=A5=E6=98=AF=E2=80=9C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 319ff921a..0eaa10a5d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2720,7 +2720,7 @@ module ApplicationHelper link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red' end else - if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前 + if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前 link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品" elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束" From 7edb30754b7748595107b2e1c7f7863ed1e2136f Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 10 Aug 2016 16:50:27 +0800 Subject: [PATCH 04/16] =?UTF-8?q?student=5Fworks=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5commit=5Ftime=EF=BC=8C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BD=9C=E5=93=81=E5=AE=9E=E9=99=85=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 5 +++-- app/controllers/users_controller.rb | 1 + app/models/student_work.rb | 2 +- app/views/users/_course_homework.html.erb | 4 ++-- app/views/users/_user_homework_detail.html.erb | 4 ++-- ...0810080942_add_commit_time_to_student_work.rb | 16 ++++++++++++++++ db/schema.rb | 3 ++- 7 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 db/migrate/20160810080942_add_commit_time_to_student_work.rb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index adfcd6263..8f3ebff98 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -597,6 +597,7 @@ class StudentWorkController < ApplicationController student_work.description = params[:student_work][:description] student_work.homework_common_id = @homework.id student_work.user_id = User.current.id + student_work.commit_time = Time.now student_work.save_attachments(params[:attachments]) render_attachment_warning_if_needed(student_work) if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 @@ -791,7 +792,7 @@ class StudentWorkController < ApplicationController end end elsif @homework.homework_type == 1 - @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0) + @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil) end @student_work = StudentWork.new respond_to do |format| @@ -826,7 +827,7 @@ class StudentWorkController < ApplicationController @new_score.user_id = User.current.id @new_score.student_work_id = @work.id if @is_teacher && @work.work_status == 0 - @work.update_column('work_status', 1) + @work.update_attributes(:work_status => 1, :commit_time => Time.now) end if User.current.admin? @new_score.reviewer_role = 1 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 54d43c891..3b9324d6a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1004,6 +1004,7 @@ class UsersController < ApplicationController student_work.work_status = 1 end + student_work.commit_time = Time.now student_work.save send_message_to_teacher(student_work) homework.update_column(:updated_at, Time.now) diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 3ba3ee2b2..09ef15583 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -1,6 +1,6 @@ #学生提交作品表 class StudentWork < ActiveRecord::Base - attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :project_id, :is_test, :simi_id, :simi_value, :work_status + attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time belongs_to :homework_common belongs_to :user diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index ded407f8c..1b55b08f6 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -135,9 +135,9 @@
<% if activity.student_works.has_committed.count != 0 %> - <% sw = activity.student_works.has_committed.reorder("created_at desc").first %> + <% sw = activity.student_works.has_committed.reorder("commit_time desc").first %>
- # <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 + # <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
<% end %>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 990a193cc..aee307963 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -146,9 +146,9 @@
<% if homework_common.student_works.has_committed.count != 0 %> - <% sw = homework_common.student_works.has_committed.reorder("created_at desc").first %> + <% sw = homework_common.student_works.has_committed.reorder("commit_time desc").first %>
- # <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品 + # <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
<% end %>
diff --git a/db/migrate/20160810080942_add_commit_time_to_student_work.rb b/db/migrate/20160810080942_add_commit_time_to_student_work.rb new file mode 100644 index 000000000..2301d7db8 --- /dev/null +++ b/db/migrate/20160810080942_add_commit_time_to_student_work.rb @@ -0,0 +1,16 @@ +class AddCommitTimeToStudentWork < ActiveRecord::Migration + def change + add_column :student_works, :commit_time, :datetime + + count = StudentWork.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + StudentWork.page(i).per(30).each do |work| + if work.work_status != 0 + work.update_column("commit_time", work.created_at) + end + end + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index d8b93da88..3b812eb3d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160729124833) do +ActiveRecord::Schema.define(:version => 20160810080942) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1840,6 +1840,7 @@ ActiveRecord::Schema.define(:version => 20160729124833) do t.integer "simi_value" t.float "work_score" t.integer "work_status", :default => 0 + t.datetime "commit_time" end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" From d99348c245b18891ddb94fe7a52ce46044711e03 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 09:46:41 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E6=B5=8B=E9=AA=8C=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E8=B6=85=E5=87=BA=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_show_head.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/exercise/_show_head.html.erb b/app/views/exercise/_show_head.html.erb index cfa814c2e..8a0c182ce 100644 --- a/app/views/exercise/_show_head.html.erb +++ b/app/views/exercise/_show_head.html.erb @@ -11,6 +11,8 @@ 测验时长:<%= exercise.time %>分钟 <% end %> -
<%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%>
+
+    <%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%>
+  
\ No newline at end of file From 9b8470b813de9bee1f7084a52c9e6183f272c3b4 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 10:23:44 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=88=86=E7=BB=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=90=8E=E7=82=B9=E7=A1=AE=E5=AE=9A=EF=BC=8C?= =?UTF-8?q?=E5=8E=9F=E6=9D=A5=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=9F=BA=E4=BA=8E?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AE=9E=E6=96=BD=E4=BC=9A=E8=A2=AB=E5=8F=96?= =?UTF-8?q?=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_group_attr.html.erb | 9 +-------- app/views/users/_user_homework_form.html.erb | 3 +++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index 6ce635a9b..6d09f6896 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -24,11 +24,4 @@ -
- \ No newline at end of file +
\ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 3f6836614..99b9812cc 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -10,6 +10,9 @@ } else { $("#anonymous_comment").attr('checked',false); } + if($.trim($("#base_on_project").val()) == 1) { + $("#base_on_project").attr('checked','checked'); + } <% if edit_mode && homework.is_program_homework? %> $("#BluePopupBox a.BlueCirBtn").click(); <% end %> From bae0562b9761a5ef9a3f240566266093e2cbf343 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 10:32:57 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E9=80=82=E7=94=A8=E4=B8=93=E4=B8=9A?= =?UTF-8?q?=E5=92=8C=E5=85=88=E4=BF=AE=E8=AF=BE=E7=A8=8B=E7=9A=84=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_syllabus_base_info.html.erb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/_syllabus_base_info.html.erb b/app/views/layouts/_syllabus_base_info.html.erb index 335dc3335..0cc88dcf1 100644 --- a/app/views/layouts/_syllabus_base_info.html.erb +++ b/app/views/layouts/_syllabus_base_info.html.erb @@ -5,27 +5,27 @@
    -
  • <%=syllabus.user.show_name %>
  • +
  • <%=syllabus.user.show_name %>
  • <% unless syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %> -
  • <%=syllabus.syllabus_type_str %>
  • +
  • <%=syllabus.syllabus_type_str %>
  • <% end %> <% unless syllabus.credit.nil? || syllabus.credit == '' %> -
  • <%=syllabus.credit %>学分
  • +
  • <%=syllabus.credit %>学分
  • <% end %> <% unless syllabus.hours.nil? || syllabus.hours == '' %> -
  • <%=syllabus.hours %>学时
  • +
  • <%=syllabus.hours %>学时
  • <% end %> <% unless syllabus.theory_hours.nil? || syllabus.theory_hours == '' %> -
  • <%=syllabus.theory_hours %>学时
  • +
  • <%=syllabus.theory_hours %>学时
  • <% end %> <% unless syllabus.practice_hours.nil? || syllabus.practice_hours == '' %> -
  • <%=syllabus.practice_hours %>学时
  • +
  • <%=syllabus.practice_hours %>学时
  • <% end %> <% unless syllabus.applicable_major.nil? || syllabus.applicable_major == '' %> -
  • <%=syllabus.applicable_major %>
  • +
  • <%=syllabus.applicable_major %>
  • <% end %> <% unless syllabus.pre_course.nil? || syllabus.pre_course == '' %> -
  • <%=syllabus.pre_course %>
  • +
  • <%=syllabus.pre_course %>
  • <% end %> <% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %> From 80b8fc4444de90c3c8a3ba64ed7f32c106324161 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 14:44:43 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E2=80=9C=E6=88=91=E7=9A=84=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E2=80=9D=E4=B8=AD=E6=9C=89=E6=8C=82=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E4=BC=9A=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3b9324d6a..5dc736c48 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1534,7 +1534,7 @@ class UsersController < ApplicationController stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)} stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")" @receive_homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc").limit(5) - if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.publish_time > @receive_homeworks.first.publish_time) + if (@manage_homeworks.empty? && @receive_homeworks.empty?) || (@receive_homeworks.empty?) || (!@manage_homeworks.empty? && !@receive_homeworks.empty? && @manage_homeworks.first.created_at > @receive_homeworks.first.created_at) @manage_pre = true else @manage_pre = false From 03c093fb138b5fab528c949080c0ab048ca25dc4 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 11 Aug 2016 16:34:00 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E2=80=9C=E8=B5=9E=E2=80=9D=E5=92=8C?= =?UTF-8?q?=E2=80=9C=E5=8F=96=E6=B6=88=E7=82=B9=E8=B5=9E=E2=80=9D=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_detail.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index aee307963..3f73f3b9d 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -302,7 +302,7 @@ <% count=homework_common.journals_for_messages.count %>
    - <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => -1, :is_in_course => is_in_course,:course_activity=>-1} %> + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => homework_common.id, :is_in_course => is_in_course,:course_activity=>-1} %> <% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %> <% if count > 0 %> From 083d5453d4cbebe1b1868109c1565b538eb07629 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 13 Aug 2016 10:00:31 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E3=80=81=E9=A1=B9=E7=9B=AE=E5=BC=B9=E6=A1=86=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E9=83=A8=E5=88=86=E4=B8=8D=E8=83=BD=E6=8B=96?= =?UTF-8?q?=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 632e4ab49..504fea3cb 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1552,7 +1552,10 @@ function pop_box_new(value, Width, Height){ document.onmousemove = null; } - new Drag("popupWrap"); + $(".sy_popup_con").mousedown(function(event){ + event.stopPropagation(); + new Drag("popupWrap"); + }); } // 公共提示弹框样式 From f67336fbe559061a15beb8cdad9dc41232cf6b45 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 13 Aug 2016 16:27:29 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8D=95=E8=AF=8D=E6=8A=98=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/_syllabus_base_info.html.erb | 4 +- config/initializers/configuration.yml | 241 ++++++++++++++++++ 2 files changed, 243 insertions(+), 2 deletions(-) create mode 100644 config/initializers/configuration.yml diff --git a/app/views/layouts/_syllabus_base_info.html.erb b/app/views/layouts/_syllabus_base_info.html.erb index 0cc88dcf1..22139b550 100644 --- a/app/views/layouts/_syllabus_base_info.html.erb +++ b/app/views/layouts/_syllabus_base_info.html.erb @@ -22,10 +22,10 @@
  • <%=syllabus.practice_hours %>学时
  • <% end %> <% unless syllabus.applicable_major.nil? || syllabus.applicable_major == '' %> -
  • <%=syllabus.applicable_major %>
  • +
  • <%=syllabus.applicable_major %>
  • <% end %> <% unless syllabus.pre_course.nil? || syllabus.pre_course == '' %> -
  • <%=syllabus.pre_course %>
  • +
  • <%=syllabus.pre_course %>
  • <% end %> <% if syllabus.syllabus_type.nil? || syllabus.syllabus_type == 0 || syllabus.syllabus_type == '' %> diff --git a/config/initializers/configuration.yml b/config/initializers/configuration.yml new file mode 100644 index 000000000..38cb9b927 --- /dev/null +++ b/config/initializers/configuration.yml @@ -0,0 +1,241 @@ +# = Redmine configuration file +# +# Each environment has it's own configuration options. If you are only +# running in production, only the production block needs to be configured. +# Environment specific configuration options override the default ones. +# +# Note that this file needs to be a valid YAML file. +# DO NOT USE TABS! Use 2 spaces instead of tabs for identation. +# +# == Outgoing email settings (email_delivery setting) +# +# === Common configurations +# +# ==== Sendmail command +# +# production: +# email_delivery: +# delivery_method: :sendmail +# +# ==== Simple SMTP server at localhost +# +# production: +# email_delivery: +# delivery_method: :smtp +# smtp_settings: +# address: smtp.163.com +# port: 25 +# +# ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com +# +# production: +# email_delivery: +# delivery_method: :smtp +# smtp_settings: +# address: smtp.gmail.com +# port: 587 +# authentication: :login +# domain: 'foo.com' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja +# +# ==== SMTP server at example.com using PLAIN authentication +# +# production: +# email_delivery: +# delivery_method: :smtp +# smtp_settings: +# address: smtp.gmail.com +# port: 587 +# authentication: :plain +# domain: 'example.com' +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja +# +# ==== SMTP server at using TLS (GMail) +# +# This might require some additional configuration. See the guides at: +# http://www.redmine.org/projects/redmine/wiki/EmailConfiguration +# +# production: +# email_delivery: +# delivery_method: :smtp +# smtp_settings: +# enable_starttls_auto: true +# address: smtp.gmail.com +# port: 587 +# domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps +# authentication: :plain +# user_name: senluowanxiangt@gmail.com +# password: 1913TXBja +# +# +# === More configuration options +# +# See the "Configuration options" at the following website for a list of the +# full options allowed: +# +# http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer + + + +default: + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" + + # Absolute path to the directory where attachments are stored. + # The default is the 'files' directory in your Redmine instance. + # Your Redmine instance needs to have write permission on this + # directory. + # Examples: + # attachments_storage_path: /var/redmine/files + # attachments_storage_path: D:/redmine/files + attachments_storage_path: + + # Configuration of the autologin cookie. + # autologin_cookie_name: the name of the cookie (default: autologin) + # autologin_cookie_path: the cookie path (default: /) + # autologin_cookie_secure: true sets the cookie secure flag (default: false) + autologin_cookie_name: "autologin_trustie" + autologin_cookie_path: + autologin_cookie_secure: + + # Configuration of SCM executable command. + # + # Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe) + # On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work. + # + # On Windows + JRuby 1.6.2, path which contains spaces does not work. + # For example, "C:\Program Files\TortoiseHg\hg.exe". + # If you want to this feature, you need to install to the path which does not contains spaces. + # For example, "C:\TortoiseHg\hg.exe". + # + # Examples: + # scm_subversion_command: svn # (default: svn) + # scm_mercurial_command: C:\Program Files\TortoiseHg\hg.exe # (default: hg) + # scm_git_command: /usr/local/bin/git # (default: git) + # scm_cvs_command: cvs # (default: cvs) + # scm_bazaar_command: bzr.exe # (default: bzr) + # scm_darcs_command: darcs-1.0.9-i386-linux # (default: darcs) + # + scm_subversion_command: + scm_mercurial_command: + scm_git_command: + scm_cvs_command: + scm_bazaar_command: + scm_darcs_command: + + # Absolute path to the SCM commands errors (stderr) log file. + # The default is to log in the 'log' directory of your Redmine instance. + # Example: + # scm_stderr_log_file: /var/log/redmine_scm_stderr.log + scm_stderr_log_file: + + # Key used to encrypt sensitive data in the database (SCM and LDAP passwords). + # If you don't want to enable data encryption, just leave it blank. + # WARNING: losing/changing this key will make encrypted data unreadable. + # + # If you want to encrypt existing passwords in your database: + # * set the cipher key here in your configuration file + # * encrypt data using 'rake db:encrypt RAILS_ENV=production' + # + # If you have encrypted data and want to change this key, you have to: + # * decrypt data using 'rake db:decrypt RAILS_ENV=production' first + # * change the cipher key here in your configuration file + # * encrypt data using 'rake db:encrypt RAILS_ENV=production' + database_cipher_key: + + # Set this to false to disable plugins' assets mirroring on startup. + # You can use `rake redmine:plugins:assets` to manually mirror assets + # to public/plugin_assets when you install/upgrade a Redmine plugin. + # + #mirror_plugins_assets_on_startup: false + + # Your secret key for verifying cookie session data integrity. If you + # change this key, all old sessions will become invalid! Make sure the + # secret is at least 30 characters and all random, no regular words or + # you'll be exposed to dictionary attacks. + # + # If you have a load-balancing Redmine cluster, you have to use the + # same secret token on each machine. + #secret_token: 'change it to a long random string' + + # Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to + # the ImageMagick's `convert` binary. Used to generate attachment thumbnails. + imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert' + + # Configuration of RMagcik font. + # + # Redmine uses RMagcik in order to export gantt png. + # You don't need this setting if you don't install RMagcik. + # + # In CJK (Chinese, Japanese and Korean), + # in order to show CJK characters correctly, + # you need to set this configuration. + # + # Because there is no standard font across platforms in CJK, + # you need to set a font installed in your server. + # + # This setting is not necessary in non CJK. + # + # Examples for Japanese: + # Windows: + # rmagick_font_path: C:\windows\fonts\msgothic.ttc + # Linux: + # rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf + # + rmagick_font_path: + + # Maximum number of simultaneous AJAX uploads + #max_concurrent_ajax_uploads: 2 + #pic_types: "bmp,jpeg,jpg,png,gif" + + repository_root_path: '/tmp/htdocs' + judge_server: 'http://judge.trustie.net/' + + # Gitlab url + gitlab_address: 'https://git.trustie.net' + # Sonar url + sonar_address: 'http://sonar.trustie.net' + #Jenkins url + jenkins_address: 'http://jenins.trustie.net' + jenkins_username: 'temp' + jenkins_password: '123123' + +# specific configuration options for production environment +# that overrides the default ones +production: + # CJK support + rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf + judge_server: 'http://192.168.80.21:8080/' + repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs' + cookie_domain: ".trustie.net" + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" + +# specific configuration options for development environment +# that overrides the default ones +development: + email_delivery: + delivery_method: :smtp + smtp_settings: + address: mail.trustie.net + port: 25 + domain: mail.trustie.net + authentication: :login + user_name: "mail@trustie.net" + password: "loong2010" From 966722b920c0e48b939f396c3d580cadda8bd28f Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 13 Aug 2016 16:43:00 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=92=8C=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BAroot?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/pull_requests_controller.rb | 2 +- lib/gitlab-cli/lib/gitlab/client/merge_requests.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 56dc0839f..5e21f9af0 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -144,7 +144,7 @@ class PullRequestsController < ApplicationController # @return [Gitlab::ObjectifiedHash] Information about updated merge request. def update_pull_request begin - @g.update_merge_request(@project.gpid, params[:id], :state_event => params[:state]) + @g.update_merge_request(@project.gpid, params[:id], User.current.gid, :state_event => params[:state]) respond_to do |format| format.html{redirect_to project_pull_request_path(params[:id], :project_id => @project.id)} end diff --git a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb index b6a9ed051..0ac95b391 100644 --- a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb +++ b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb @@ -64,8 +64,8 @@ class Gitlab::Client # @option options [Integer] :assignee_id The ID of a user to assign merge request. # @option options [String] :state_event New state (close|reopen|merge). # @return [Gitlab::ObjectifiedHash] Information about updated merge request. - def update_merge_request(project, id, options={}) - put("/projects/#{project}/merge_request/#{id}", :body => options) + def update_merge_request(project, id, gid, options={}) + put("/projects/#{project}/merge_request/#{id}?user_id=#{gid}", :body => options) end # Adds a comment to a merge request. From 3ce088002a191bc7bd4d7c3112b719a0a4ddd030 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 13 Aug 2016 16:53:56 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=92=8C=E5=B7=B2?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=B5=81=E7=A8=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/pull_requests/_pull_request_comments.html.erb | 2 +- app/views/pull_requests/_show.html.erb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/pull_requests/_pull_request_comments.html.erb b/app/views/pull_requests/_pull_request_comments.html.erb index 9208a13ad..dfc1dda05 100644 --- a/app/views/pull_requests/_pull_request_comments.html.erb +++ b/app/views/pull_requests/_pull_request_comments.html.erb @@ -2,7 +2,7 @@ <%= form_tag(url_for(:controller => 'pull_requests', :action => 'create_pull_request_comment', :project_id => @project.id), :id => 'pull_request_comment_form', :method => "post", :remote => true) do %> - 提交请求 + 留言 <% end %>
    <% @comments.each do |comment| %> diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index 3edb9c874..b750728a4 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -33,7 +33,11 @@ <% else %> <% if is_project_manager?(User.current.id, @project.id) %>
    - <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %> + <% if @request.state == "closed" %> + 该请求已被关闭 + <% else %> + <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %> + <% end %>
    <% end %> <% end %> From 1374444ec193a6959564a5ceabc4c0ce829b8df1 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 13 Aug 2016 17:04:09 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_user_projects.html.erb | 10 +++++----- app/views/layouts/new_base_user.html.erb | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/layouts/_user_projects.html.erb b/app/views/layouts/_user_projects.html.erb index 37760b17e..caaaaf031 100644 --- a/app/views/layouts/_user_projects.html.erb +++ b/app/views/layouts/_user_projects.html.erb @@ -2,7 +2,7 @@
  • <% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %> - <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "course_list_menu hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%> + <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "project_list_menu hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
      @@ -60,16 +60,16 @@ <% if all_count > (page.to_i+1) * 10%> - + <% end%>