From 4930e36503d9ee6e3313d7407eced6d433dd1d68 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 13 Feb 2017 11:00:33 +0800 Subject: [PATCH 001/118] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=94=B3=E8=AF=89?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E6=A1=86=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E4=BD=8D=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_score_appeal_box.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_score_appeal_box.html.erb b/app/views/student_work/_score_appeal_box.html.erb index 874da4fd5..52ef67e91 100644 --- a/app/views/student_work/_score_appeal_box.html.erb +++ b/app/views/student_work/_score_appeal_box.html.erb @@ -8,7 +8,7 @@ :method => "post", :remote => true) do |f|%>
- + *申诉理由: <%= f.text_area 'comment', :id => 'appeal_comment', :style => 'height: 70px; width: 414px;', :placeholder => "请输入你的申诉理由,最多250个字符。",:maxlength => 250 %>

请输入申诉理由

From 6ea90fb74fcb90374a6df55b6995eded76d148c4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 13 Feb 2017 13:54:13 +0800 Subject: [PATCH 002/118] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=87=8C=E7=A8=8B?= =?UTF-8?q?=E7=A2=91=EF=BC=8Cpullrequest=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=88tab=E4=B8=8B=E6=A0=B7=E5=BC=8F=E8=BE=B9?= =?UTF-8?q?=E7=AA=84=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/pull_requests/_show.html.erb | 6 +++--- public/stylesheets/css/project.css | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index 3dd3483a5..4b9bd6b88 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -57,14 +57,14 @@ <% if @type == nil || @type == "1" %> -
+
<%= render :partial => "pull_requests/pull_request_comments" %>
<% end %> -
+
<%= render :partial => "pull_requests/pull_request_commits" %>
-
+
<%= render :partial => "pull_requests/pull_request_changes" %>
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index bbf5b2f14..e97751817 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -431,7 +431,7 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;} .table-td-w180{display:inline-block;with:180px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;} .table-td-w380{display:inline-block;with:380px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;} /*项目简介*/ -.pro_new_info{ border:1px solid #ddd; background-color:#fff;} +.pro_new_info{ border:1px solid #ddd; background-color:#fff; width:100%;} .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_description_new_info{ border:1px solid #ddd; background-color:#fff;} /*.pro_new_info p{ padding-bottom:2px; padding-left: 15px; color: #666; padding-right: 5px}*/ @@ -485,7 +485,7 @@ p.pro_new_grey{ line-height: 1.9; } .new_roadmap_type_hover{color: #fff;} .new_roadmap_nav_tagnomal{ background-color:#eaeaea; padding:0px 5px;-webkit-border-radius:15px;-moz-border-radius:15px;-o-border-radius:15px;border-radius:15px; font-size:12px;} .new_roadmap_nav_taghover{ padding:0px 5px;-webkit-border-radius:15px;-moz-border-radius:15px;-o-border-radius:15px;border-radius:15px; font-size:12px;background: #6bb1e5; color: #fff;} -.new_roadmap_listbox{ padding:15px;border-bottom:1px solid #dbdbdb;} +.new_roadmap_listbox{width: 970px; padding:15px;border-bottom:1px solid #dbdbdb;} .new_roadmap_listbox_commit{ padding:15px;} .new_roadmap_listtitle a{ color: #333;display:block;max-width:800px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} .new_roadmap_listtitle a:hover{ color:#3498db;} From 4cd573efe695ded71f87a4ece5cdbd3296822146 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 13 Feb 2017 14:12:46 +0800 Subject: [PATCH 003/118] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=94=B3=E8=AF=89?= =?UTF-8?q?=E4=B8=BA=E8=A2=AB=E5=A4=84=E7=90=86=E6=97=B6=EF=BC=8C=E4=BB=85?= =?UTF-8?q?=E7=94=B3=E8=AF=89=E4=BA=BA=E7=9C=8B=E5=88=B0=E7=9A=84=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=B0=91=E4=BA=86=E5=88=86=E9=9A=94?= =?UTF-8?q?=E7=BA=BF=EF=BC=88=E5=85=B6=E5=AE=83=E7=94=A8=E6=88=B7=E7=9A=84?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=AD=A3=E5=B8=B8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index c27eade85..1e1745adf 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1253,7 +1253,7 @@ class StudentWorkController < ApplicationController def appeal_anonymous_score @student_work_score = StudentWorksScore.where("id = #{params[:score_id].to_i}").first - @is_last = params[:is_last] + @is_last = params[:is_last] == "true" ? true : false if @student_work_score @student_work_score.update_column('appeal_status', 1) score_appeal = StudentWorksScoresAppeal.create(:user_id => User.current.id, :student_works_score_id => @student_work_score.id, :comment => params[:appeal][:comment], :appeal_status => 1) From 8756bd7061ddf4cd8b50f0d562e9b5b77bbeee17 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 13 Feb 2017 14:34:14 +0800 Subject: [PATCH 004/118] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E7=9A=84=E5=8C=BF=E8=AF=84=E7=94=B3=E8=AF=89=E8=A2=AB=E6=8E=A5?= =?UTF-8?q?=E5=8F=97=E4=B8=80=E6=AC=A1=EF=BC=8C=E4=BD=86=E6=98=AF=E8=BF=9D?= =?UTF-8?q?=E8=A7=84=E5=8C=BF=E8=AF=84=E6=89=A3=E5=88=86=E5=8D=B4=E6=89=A3?= =?UTF-8?q?=E4=BA=86=E4=B8=A4=E6=AC=A1=E3=80=81=20=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E7=94=B3=E8=AF=89=E8=A2=AB=E5=A4=84=E7=90=86=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E8=AE=BA=E6=98=AF=E7=94=B3=E8=AF=89=E4=BA=BA=E8=BF=98?= =?UTF-8?q?=E6=98=AF=E8=A2=AB=E7=94=B3=E8=AF=89=E4=BA=BA=EF=BC=8C=E9=83=BD?= =?UTF-8?q?=E6=94=B6=E5=88=B0=E4=BA=862=E6=9D=A1=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 12 ++++++------ app/views/student_work/_student_work_score.html.erb | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 1e1745adf..8d70980c8 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1274,8 +1274,8 @@ class StudentWorkController < ApplicationController def deal_appeal_score @student_work_score = StudentWorksScore.where("id = #{params[:score_id].to_i}").first - @is_last = params[:is_last] - if @student_work_score + @is_last = params[:is_last] == "true" ? true : false + if @student_work_score && @student_work_score.appeal_status == 1 @student_work_score.update_column('appeal_status', params[:status].to_i) score_appeal = @student_work_score.student_works_scores_appeal score_appeal.applied_messages.update_all(:status => params[:status].to_i == 2 ? 3 : (params[:status].to_i == 3 ? 1 : 2)) @@ -1306,11 +1306,11 @@ class StudentWorkController < ApplicationController CourseMessage.create(:user_id => @student_work_score.user_id, :course_id => course.id, :viewed => false,:course_message_id=> score_appeal.id,:course_message_type=>'StudentWorksScoresAppeal',:status=>params[:status].to_i,:apply_result =>User.current.id) CourseMessage.create(:user_id => score_appeal.user_id, :course_id => course.id, :viewed => false,:course_message_id=> score_appeal.id,:course_message_type=>'StudentWorksScoresAppeal',:status=>params[:status].to_i,:apply_result =>User.current.id) end - @homework = @student_work_score.student_work.homework_common - @is_teacher = User.current.allowed_to?(:as_teacher, course) || User.current.admin? - @work = @student_work_score.student_work - @is_group_leader = !@work.student_work_projects.empty? end + @homework = @student_work_score.student_work.homework_common + @is_teacher = User.current.allowed_to?(:as_teacher, course) || User.current.admin? + @work = @student_work_score.student_work + @is_group_leader = !@work.student_work_projects.empty? end def forbidden_anonymous_comment diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index decc093c8..1b36503e7 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -23,7 +23,7 @@ 回复 <% if @homework.anonymous_appeal == 1 %> <% if score.student_work.user == User.current && score.reviewer_role == 3 && score.appeal_status == 0 %> - 申诉 + 申诉 <% elsif score.reviewer_role == 3 && score.appeal_status == 1 %> 申诉中 <% elsif score.reviewer_role == 3 && score.appeal_status == 2 %> @@ -55,10 +55,10 @@
申诉 <% if score.appeal_status == 1 && score.student_work.user == User.current %> - 撤销申诉 + 撤销申诉 <% elsif @is_teacher && score.appeal_status == 1 %> - 接受 - 拒绝 + 接受 + 拒绝 <% end %> <%=format_time score.student_works_scores_appeal.updated_at %> From 52834f4b215c95303402656bfc55dd4cc31fcabe Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 13 Feb 2017 14:49:06 +0800 Subject: [PATCH 005/118] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AF=84=E5=88=86?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=BC=B9=E6=A1=86=EF=BC=8C=E5=A6=82=E5=9B=BE?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E4=B8=8D=E8=83=BD=E7=A7=BB=E5=8A=A8=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/score_rule_set.js.erb | 4 ++-- public/stylesheets/css/public.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb index 54079b0cf..c6adaf5bd 100644 --- a/app/views/homework_common/score_rule_set.js.erb +++ b/app/views/homework_common/score_rule_set.js.erb @@ -1,7 +1,7 @@ <% if @homework.homework_type == 2 %> <% if @homework.anonymous_comment == 0 %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; - pop_box_new(htmlvalue, 630, 914); + pop_box_new(htmlvalue, 630, 772); <% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; pop_box_new(htmlvalue, 530, 404); @@ -9,7 +9,7 @@ <% else %> <% if @homework.anonymous_comment == 0 %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; - pop_box_new(htmlvalue, 630, 885); + pop_box_new(htmlvalue, 630, 742); <% else %> var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>"; pop_box_new(htmlvalue, 530, 332); diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 670721683..7b2f4413c 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -918,6 +918,7 @@ a.syllabusbox_a_blue{ color:#3b94d6;} .popup_tip_box { position: relative; padding: 5px 10px; white-space: nowrap; background-color: #FFFEF4; border:1px solid #F3DDB3;} .popup_tip_box em { display: block; border-width: 9px; position: absolute; top: 5px; left: -18px; border-style: dashed solid dashed dashed; border-color: transparent #F3DDB3 transparent transparent; font-size: 0; line-height: 0;} .popup_tip_box span { display: block; border-width: 9px;position: absolute; top: 5px; left: -17px; border-style: dashed solid dashed dashed;border-color: transparent #FFFEF4 transparent transparent; font-size: 0; line-height: 0; } +.popup_tip_box>p{ line-height: 20px !important;} /*模拟title*/ .simulation-title {position:absolute; background-color:#fff; padding:5px 10px; z-index:99; white-space:nowrap; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none; color:#666; border:1px solid #666; line-height:1;} /*项目创建*/ From 4a04d1c271142ac0bbb857ae4e5ca3f805a74a55 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 13 Feb 2017 15:58:33 +0800 Subject: [PATCH 006/118] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=EF=BC=8C=E8=B5=84?= =?UTF-8?q?=E6=BA=90=EF=BC=8C=E9=97=AE=E5=8D=B7=EF=BC=8C=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E6=B5=8B=E9=AA=8C=E6=A8=A1=E5=9D=97=E6=B2=A1=E6=9C=89=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=BE=E7=A4=BA=E6=97=B6=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=AC=91=E8=84=B8=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_exercises_list.html.erb | 24 ++++++++------- app/views/files/_course_file.html.erb | 2 +- app/views/files/_course_list.html.erb | 30 ++++++++++++------- .../_homework_index_list.html.erb | 24 ++++++++++----- app/views/poll/_polls_list.html.erb | 23 ++++++++------ 5 files changed, 64 insertions(+), 39 deletions(-) diff --git a/app/views/exercise/_exercises_list.html.erb b/app/views/exercise/_exercises_list.html.erb index b39d3d947..5fdd2d082 100644 --- a/app/views/exercise/_exercises_list.html.erb +++ b/app/views/exercise/_exercises_list.html.erb @@ -9,17 +9,21 @@
+ <% if @exercises.count != 0 %> + <% @exercises.each_with_index do |exercise,index|%> +
    + <%= render :partial => 'exercise', :locals => {:exercise => exercise,:index => index} %> +
+
+ <% end%> - <% @exercises.each_with_index do |exercise,index|%> -
    - <%= render :partial => 'exercise', :locals => {:exercise => exercise,:index => index} %> +
      + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
    +
    - <% end%> - -
      - <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> -
    - -
    + <% else %> +
    +

    没有数据可以显示!

    + <% end %>
\ No newline at end of file diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 1157961fe..e6917b587 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -133,7 +133,7 @@
<% end %>
-
+
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index be7da4732..b3b747f0d 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -1,14 +1,22 @@ -<% curse_attachments.each do |file| %> - <% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %> -
- <%=render :partial=>'files/resource_detail',:locals => {:file => file} %> -
- <% else %> -
<%= file.filename %>是私有资源
+<% if curse_attachments.count != 0 %> + <% curse_attachments.each do |file| %> + <% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %> +
+ <%=render :partial=>'files/resource_detail',:locals => {:file => file} %> +
+ <% else %> +
<%= file.filename %>是私有资源
+ <% end %> <% end %> + +
    + <%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true%> +
+<% else %> +
+
+
+

没有数据可以显示!

+
<% end %> -
    - <%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true%> -
- diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb index 6c8145e58..f4f35f0f3 100644 --- a/app/views/homework_common/_homework_index_list.html.erb +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -1,10 +1,18 @@ -<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:course_id => course_id} %> +<% if homework_commons.count != 0 %> + <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:course_id => course_id} %> -
-
-
    - <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%> -
+
+
+
    + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%> +
+
+
+
+<% else %>
-
-
\ No newline at end of file +
+
+

没有数据可以显示!

+
+<% end %> \ No newline at end of file diff --git a/app/views/poll/_polls_list.html.erb b/app/views/poll/_polls_list.html.erb index a23af8e73..e22e8fbdf 100644 --- a/app/views/poll/_polls_list.html.erb +++ b/app/views/poll/_polls_list.html.erb @@ -1,10 +1,15 @@ -<% polls.each_with_index do |poll, i|%> -
    - <%= render :partial => 'poll', :locals => {:poll => poll, :index => i} %> -
-
-<% end%> +<% if polls.count != 0 %> + <% polls.each_with_index do |poll, i|%> +
    + <%= render :partial => 'poll', :locals => {:poll => poll, :index => i} %> +
+
+ <% end%> -
    - <%= pagination_links_full obj_pages, obj_count, :per_page_links => false, :remote => false, :flag => true%> -
\ No newline at end of file +
    + <%= pagination_links_full obj_pages, obj_count, :per_page_links => false, :remote => false, :flag => true%> +
+<% else %> +
+

没有数据可以显示!

+<% end %> \ No newline at end of file From 649f87a43fa4ce5085ddc13daa6e0adb4baea671 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 13 Feb 2017 16:02:11 +0800 Subject: [PATCH 007/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E7=9A=84=E6=B4=BB=E8=B7=83=E5=BA=A6?= =?UTF-8?q?=E5=92=8C=E8=8B=B1=E9=9B=84=E6=A6=9C=E9=93=BE=E6=8E=A5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_activity_users.html.erb | 2 +- app/views/courses/_course_heroes.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_course_activity_users.html.erb b/app/views/courses/_course_activity_users.html.erb index 525a9ce85..6bc049ebd 100644 --- a/app/views/courses/_course_activity_users.html.erb +++ b/app/views/courses/_course_activity_users.html.erb @@ -4,7 +4,7 @@

    <% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %> - <%= link_to "活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %> + <%= link_to "活跃度", course_statistics_course_path(@course), :class => 'fontGrey3' %> <% else %> 活跃度 <% end %> diff --git a/app/views/courses/_course_heroes.html.erb b/app/views/courses/_course_heroes.html.erb index 7ea52165e..60258b42f 100644 --- a/app/views/courses/_course_heroes.html.erb +++ b/app/views/courses/_course_heroes.html.erb @@ -3,7 +3,7 @@

      <% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %> - <%= link_to "英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %> + <%= link_to "英雄榜", course_statistics_course_path(@course, :tab => 2), :class => 'fontGrey3' %> <% else %> 英雄榜 <% end %> From 7c0042b70dbe418222a02a35287948d9d04551ba Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 14 Feb 2017 09:15:58 +0800 Subject: [PATCH 008/118] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8F=98=E6=88=90=E7=B2=97=E4=BD=93=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_unfinished_homework_list.html.erb | 20 ++++++++-------- .../users/_unfinished_poll_list.html.erb | 12 +++++----- .../users/_unfinished_test_list.html.erb | 20 ++++++++-------- .../users/_unsolved_issues_list.html.erb | 24 +++++++++---------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/app/views/users/_unfinished_homework_list.html.erb b/app/views/users/_unfinished_homework_list.html.erb index f153f9f03..3cb0b111c 100644 --- a/app/views/users/_unfinished_homework_list.html.erb +++ b/app/views/users/_unfinished_homework_list.html.erb @@ -13,25 +13,25 @@ <% @unfinished_homeworks.each do |uh| %> - + <%= link_to image_tag(url_to_avatar(uh.user), :width => "30", :height => "30"), user_path(uh.user), :target => '_blank' %> - - + +
    • <%= link_to uh.name.to_s, student_work_index_path( :homework => uh.id, :tab => 1), :target => "_blank", :class => "homepageTabTitle fl ml5", :title => "#{uh.name.to_s}" %>
    • - - + +
    • <%= link_to uh.course.try(:name), course_path(uh.course_id), :target => "_blank", :class => "homepageTabTitle ml5", :target => "_blank", :title => "#{uh.course.try(:name)}" %>
    • - - + +
    • <%= homework_type_tip(uh.homework_type) %>
    • - - + +
    • <% end_time = uh.end_time.to_time.to_i + 24*60*60 - 1 %> <% if end_time > Time.now.to_i %> @@ -42,7 +42,7 @@ 已截止 <% end %>
    • - + <% end %> diff --git a/app/views/users/_unfinished_poll_list.html.erb b/app/views/users/_unfinished_poll_list.html.erb index 704909a8e..8dc828125 100644 --- a/app/views/users/_unfinished_poll_list.html.erb +++ b/app/views/users/_unfinished_poll_list.html.erb @@ -11,21 +11,21 @@ <% @unfinished_poll.each do |up| %> - + <%= link_to image_tag(url_to_avatar(up.user), :width => "30", :height => "30"), user_path(up.user), :target => '_blank' %> - - + +
    • <%= link_to up.polls_name.to_s, poll_path(up.id), :target => "_blank", :class => "homepageTabPollTitle fl ml5", :title => "#{up.polls_name.to_s}" %>
    • - - + +
    • <% if up.polls_type == "Course" %> <%= link_to Course.find(up.polls_group_id).name, course_path(Course.find(up.polls_group_id)), :target => "_blank", :title => "#{Course.find(up.polls_group_id).name}" %> <% end %>
    • - + <% end %> diff --git a/app/views/users/_unfinished_test_list.html.erb b/app/views/users/_unfinished_test_list.html.erb index c6d38d26a..09903704b 100644 --- a/app/views/users/_unfinished_test_list.html.erb +++ b/app/views/users/_unfinished_test_list.html.erb @@ -13,20 +13,20 @@ <% @unfinished_test.each do |ut| %> - + <%= link_to image_tag(url_to_avatar(ut.user), :width => "30", :height => "30"), user_path(ut.user), :target => '_blank' %> - - + +
    • <%= link_to ut.exercise_name.to_s, exercise_index_path(:course_id => ut.course_id), :target => "_blank", :class => "homepageTabTitle fl ml5", :title => "#{ut.exercise_name.to_s}" %>
    • - - + +
    • <%= link_to ut.course.try(:name), course_path(ut.course_id), :target => "_blank", :class => "homepageTabTitle ml5", :title => "#{ut.course.try(:name)}" %>
    • - - + +
    • <% if ut.time.to_i == -1 %> 不限时 @@ -34,8 +34,8 @@ <%= ut.time %> <% end %>
    • - - + +
    • <% if ut.end_time > Time.now %> <%= (ut.end_time.to_i - Time.now.to_i) / (24*60*60) %> 天 @@ -45,7 +45,7 @@ 已截止 <% end %>
    • - + <% end %> diff --git a/app/views/users/_unsolved_issues_list.html.erb b/app/views/users/_unsolved_issues_list.html.erb index 09835cad6..b9a98f623 100644 --- a/app/views/users/_unsolved_issues_list.html.erb +++ b/app/views/users/_unsolved_issues_list.html.erb @@ -14,20 +14,20 @@ <% @unsolved_issues.each do |ui| %> - + <%= link_to image_tag(url_to_avatar(ui.author), :width => "30", :height => "30"), user_path(ui.author), :target => '_blank' %> - - + +
    • <%= link_to ui.subject.to_s, issue_path(ui), :target => "_blank", :class => "homepageTabTitle fl ml5", :title => "#{ui.subject.to_s}" %>
    • - - + +
    • <%= link_to ui.project.try(:name), project_path(ui.project_id), :target => "_blank", :title => "#{ui.project.try(:name)}" %>
    • - - + +
    • <% if ui.author.show_name == ' ' %> <%= link_to ui.try(:author), user_path(ui.author_id), :target => "_blank", :title => "#{ui.try(:author)}" %> @@ -35,17 +35,17 @@ <%= link_to ui.author.show_name, user_path(ui.author_id), :target => "_blank", :title => "#{ui.author.show_name}" %> <% end %>
    • - - + +
    • <%= ui.priority.name %>
    • - - + +
    • <%= ui.status.name %>
    • - + <% end %> From 0d76162d9396b8252059e5e46bc65b3a574893b7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 14 Feb 2017 09:48:26 +0800 Subject: [PATCH 009/118] =?UTF-8?q?Issue=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=92=8C=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=82=AC=E6=B5=AE=E6=95=88=E6=9E=9C=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css/project.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index e97751817..4cae2e3c4 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -373,7 +373,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .issues_form_filter select::-ms-expand { display: none; } input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;} .issues_data_img{ display:block; width:25px; height:28px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; } -.issues_list_box{ padding:15px; padding-right: 0px; border-bottom:1px dashed #c8c8c8;} +.issues_list_box{ padding:15px; padding-right: 0px; border-bottom:1px dashed #c8c8c8; position: relative;} .issues_list_titlebox{ font-size:14px; font-weight:bold; margin-bottom:8px;} a.issues_list_title{ color:#444; max-width:380px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap; } a:hover.issues_list_title{color:#3b94d6;} From 603d5d5703835161c636926efcd50d3dc26e1187 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 14 Feb 2017 09:59:06 +0800 Subject: [PATCH 010/118] =?UTF-8?q?=E5=BA=95=E9=83=A8=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E7=9A=84=E7=89=88=E6=9D=83=E9=99=90=E5=88=B6=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E5=A4=AA=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_footer.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index e8634bed1..5923817cc 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -39,7 +39,7 @@

    -->

From bc0be4c8909c9b17979982b6dd7bd9b60f69abbd Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 14 Feb 2017 10:03:38 +0800 Subject: [PATCH 011/118] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E5=B7=A6=E4=BE=A7=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E6=A0=8F=EF=BC=8C=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/layouts/base_project_community.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_project_community.html.erb b/app/views/layouts/base_project_community.html.erb index 357cfddb3..a9caebcdb 100644 --- a/app/views/layouts/base_project_community.html.erb +++ b/app/views/layouts/base_project_community.html.erb @@ -58,7 +58,7 @@
  • <%= link_to "新建项目", new_project_path(:host=> Setting.host_name), :target => "_blank", :style => "font-size:14px;" %>
  • -
  • +
  • <%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :style => "font-size:14px;" %>
  • From 89eab427aa5811545322593262d796628678d7ac Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 14 Feb 2017 15:07:38 +0800 Subject: [PATCH 012/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=A1=B9=E7=9B=AE=E6=B4=BB=E8=B7=83=E5=BA=A6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=89=E4=BD=9C=E4=B8=9A=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 10 ++++++- app/helpers/courses_helper.rb | 6 ++++ app/views/courses/course_statistics.html.erb | 31 ++++++++++++++------ app/views/student_work/index.html.erb | 18 ++++++++++-- 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 2f47fb808..d84649ce2 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1388,11 +1388,19 @@ class CoursesController < ApplicationController @members = @course.course_homework_statisticss.reorder("#{@type} #{@order}, total_score #{@order}") elsif params[:tab] == "3" + @homework_id = params[:homework_id] ? params[:homework_id].to_i : 0 @type = params[:type] ? params[:type] : 'project_act_score' - sql = "SELECT (IFNULL(changeset_num, 0)*4 + issue_num*4 + issue_journal_num*1 + attach_num*5 + board_num*2 + board_message_num*1) AS project_act_score, + if @homework_id == 0 + sql = "SELECT (IFNULL(changeset_num, 0)*4 + issue_num*4 + issue_journal_num*1 + attach_num*5 + board_num*2 + board_message_num*1) AS project_act_score, changeset_num, issue_num, issue_journal_num, attach_num, board_num, board_message_num, pss.project_id FROM project_scores pss JOIN student_work_projects ON student_work_projects.project_id = pss.project_id AND student_work_projects.course_id = #{@course.id} GROUP BY pss.project_id ORDER BY #{@type} #{@order}, project_act_score #{@order}" + else + sql = "SELECT (IFNULL(changeset_num, 0)*4 + issue_num*4 + issue_journal_num*1 + attach_num*5 + board_num*2 + board_message_num*1) AS project_act_score, + changeset_num, issue_num, issue_journal_num, attach_num, board_num, board_message_num, pss.project_id FROM project_scores pss + JOIN student_work_projects ON student_work_projects.project_id = pss.project_id AND student_work_projects.course_id = #{@course.id} AND student_work_projects.homework_common_id = #{@homework_id} + GROUP BY pss.project_id ORDER BY #{@type} #{@order}, project_act_score #{@order}" + end @members = ProjectScore.find_by_sql(sql) end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index e97d32523..63b0c2c27 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -928,5 +928,11 @@ module CoursesHelper result = !m_roles.blank? result end + + #获取该班级下已关联项目的分组作业 + def select_group_homeworks course + student_work_pros = course.student_work_projects.where("project_id != -1 && project_id != 0") + homeworks = @course.homework_commons.where(:id => student_work_pros.map(&:homework_common_id)) + end end diff --git a/app/views/courses/course_statistics.html.erb b/app/views/courses/course_statistics.html.erb index c4f495c75..e93ca00e9 100644 --- a/app/views/courses/course_statistics.html.erb +++ b/app/views/courses/course_statistics.html.erb @@ -42,14 +42,17 @@
  • - - - - - - - - +
    + + <% homeworks = select_group_homeworks @course %> + <% is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? %> + +
    <% if @tab == 3 %> @@ -71,6 +74,9 @@ g('game-setting-content-<%= @tab %>').className='dis'; g('game-setting-tab-nav-<%= @tab %>').className='game-setting-nav-hover'; <% end %> + <% if @homework_id != 0 %> + $("#homework_select option[value='<%= @homework_id %>']").attr("selected",true); + <% end %> }); function g(o){ @@ -83,6 +89,13 @@ } g('game-setting-content-'+n).className='dis'; g('game-setting-tab-nav-'+n).className='game-setting-nav-hover'; - $.get('<%= course_statistics_course_path() %>'+'?tab='+n); + if(n == 3){ + $("#homework_select option[value='0']").attr("selected",true); + } + $.get('<%= course_statistics_course_path(@course) %>'+'?tab='+n); + } + + function select_homework_projects(){ + $.get('<%= course_statistics_course_path(@course) %>'+'?tab=3&homework_id='+$("#homework_select").val()); } \ No newline at end of file diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index a6a2c9a95..1837b66a9 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -15,6 +15,7 @@ $("#student_work_tab2").click(); <% elsif @tab == 3 %> $("#student_work_tab3").click(); + $("#project_activities").show(); <% end %> sd_create_editor_from_data(<%= @homework.id %>, null, "100%", "<%= @homework.class.to_s %>"); }); @@ -26,6 +27,11 @@ } $('#student_work_tab'+n).addClass('selected'); $('#student_work_con'+n).removeClass('undis'); + if (n == 3){ + $("#project_activities").show(); + } else{ + $("#project_activities").hide(); + } } $("#moreProject_<%=@homework.id %>").click(function(){ @@ -160,11 +166,19 @@
  • 关联项目列表
  • -
  •  
  • + <% if !@homework.student_work_projects.empty? %> +
  •   + <%= link_to '项目活跃度', course_statistics_course_path(@homework.course, :tab => 3, :homework_id => @homework.id), + :id => 'project_activities', :class => 'fr fontBlue2 none', :style => 'font-weight: normal;', :target => '_blank' %> +
  • + <% else %> +
  •  
  • + <% end %> <% else %>
  •  
  • <% end %> +
    @@ -184,7 +198,7 @@
    - <% if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> + <% if is_group_project_homework %>
    <% student_work_ids = @homework.student_works.has_committed.blank? ? "(-1)" : "(" + @homework.student_works.has_committed.map{|st| st.id}.join(",") + ")" %> <% student_work_projects = @homework.student_work_projects.where("student_work_id in #{student_work_ids} or student_work_id is null") %> From 10b7063791ec2a1571004cea04454d8d9e283d90 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 14 Feb 2017 15:22:12 +0800 Subject: [PATCH 013/118] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=AF=BE=E7=A8=8B=E5=90=8E=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=90=8D=E7=A7=B0=E4=B8=AD=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=B8=A6=E5=85=A5=E8=AF=BE=E7=A8=8B=E5=90=8D=E7=A7=B0=EF=BC=8C?= =?UTF-8?q?=E5=87=8F=E5=B0=91=E7=94=A8=E6=88=B7=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 07b6e5606..7a9e72d0d 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -7,7 +7,7 @@
  • <% if @syllabus.nil? %> - <%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input w300 h28"} %> + <%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input w300 h28", :onchange => "change_course_name();"} %> <% else %> <%=@syllabus.title %> @@ -117,4 +117,9 @@ document.getElementById("new_end_term").options[document.getElementById("new_term").selectedIndex].selected = true; }); }); + function change_course_name(){ + if($("#new_syllabus_id").val() != '0') { + $("#new_course_name").val($("#new_syllabus_id").find("option:selected").text()); + } + } \ No newline at end of file From 11eba7637f0be36899703852488f423be1f6eea7 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 14 Feb 2017 16:29:28 +0800 Subject: [PATCH 014/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=A4=B4=E9=83=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA=E7=94=B1=E4=B8=89=E8=A1=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=88=90=E4=B8=A4=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_course_base_info.html.erb | 12 +++++------- public/stylesheets/css/common.css | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 8bc06e1e9..174e8e3c1 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -74,7 +74,7 @@

  • -
    +

    <%=@course.name %> @@ -82,13 +82,11 @@

    -

    - 学期:<%= current_time_and_term @course %> +

    教师:<%= course_teacher_link teacher_num %> 学生:<%= course_student_link student_num %> -

    -

    - 单位:<%= get_occupation_from_user(@course.teacher).blank? ? '无' : get_occupation_from_user(@course.teacher) %> + <%= current_time_and_term @course %> + <%= get_occupation_from_user(@course.teacher).blank? ? '无' : get_occupation_from_user(@course.teacher) %>

    <% is_TA = get_user_member_roles_course @course, User.current, 7 %> <% is_TE = get_user_member_roles_course @course, User.current, 9 %> @@ -101,7 +99,7 @@ <%= link_to '学生身份', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : 9), :tar_role => 10), :class => "sy_btn_orange mr10 fl", :title => "由教师身份切换至学生身份" %> <% end %> <% unless (is_teacher || is_TA || is_TE || is_ST) %> -
    <%= join_in_course_header(@course, User.current) %>
    +
    <%= join_in_course_header(@course, User.current) %>
    <% end %>
    diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index febc642d7..a0ee39245 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -101,7 +101,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .mw380 {max-width: 380px !important;}.mw400 {max-width: 400px !important;}.mw450 {max-width: 450px !important;}.mw550 {max-width: 550px !important;} .mt-20 {margin-top:-20px;}.mt-10 {margin-top:-10px;}.mt-4 {margin-top:-4px;}.mt-5 {margin-top:-5px;}.mt-2 {margin-top:-2px;}.mt0 {margin-top: 0px !important;} .mt1{margin-top: 1px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt4{ margin-top:4px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7 {margin-top:7px;} -.mt8{ margin-top:8px !important;}.mt9{ margin-top:9px !important;}.mt10{ margin-top:10px !important;}.mt12 { margin-top:12px !important;} +.mt8{ margin-top:8px !important;}.mt9{ margin-top:9px !important;}.mt10{ margin-top:10px !important;}.mt12 { margin-top:12px !important;}.mt14 {margin-top:14px;} .mt15 {margin-top:15px;}.mt16{ margin-top:16px !important;}.mt19 {margin-top:19px !important;}.mt20{margin-top: 20px;}.mt28 {margin-top:28px;}.mt30{ margin-top: 30px;} .mt35 {margin-top:35px;}.mt40{ margin-top: 40px;}.mt45{ margin-top: 45px;}.mt50{ margin-top:50px;}.mt100{ margin-top:100px;}.mb0 {margin-bottom: 0px !important;}.mb4{ margin-bottom:4px;} .mb5{ margin-bottom:5px;}.mb8 {margin-bottom:8px !important;}.pb5{ padding-bottom: 5px;}.mb10{ margin-bottom:10px !important;}.mb12 {margin-bottom:12px !important;} From 1f2fadc9f62be5e828a70d9ac65932e3b660c148 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 15 Feb 2017 10:03:09 +0800 Subject: [PATCH 015/118] =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 3 +++ app/helpers/application_helper.rb | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 2f47fb808..93eacc978 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -9,6 +9,7 @@ class CoursesController < ApplicationController helper :attachments helper :files helper :activity_notifys + include ApplicationHelper before_filter :auth_login1, :only => [:show, :course_activity, :feedback] menu_item :overview @@ -454,6 +455,8 @@ class CoursesController < ApplicationController end def member + # 当前用户查看班级消息时,设置消息为已读 + update_messsages_to_viewed("CourseMessage", "JoinCourse", @course) ## 有角色参数的才是课程,没有的就是项目 if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) @render_file = 'new_member_list' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7315d7630..9d57712a6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1036,6 +1036,17 @@ module ApplicationHelper return @result end + # 更新各类消息为已读 + def update_messsages_to_viewed(message_type, forge_message_type, forge_message_id) + if( message_type == "CourseMessage") + query = CourseMessage.where(:course_message_type => forge_message_type, + :user_id => User.current, + :course_id => forge_message_id, + :viewed => false).first + query.update_attribute(:viewed, true) unless query.nil? + end + end + def show_attachment_tip container_id, container_type atts = Attachment.where(:container_id => container_id, :container_type => container_type, :is_public => 0) atts.count > 0 ? true :false From 2cad08614fb405d4178842bc9ecf35624080f3a9 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 15 Feb 2017 10:54:09 +0800 Subject: [PATCH 016/118] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=8F=91=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E5=8A=A0=E5=85=A5=E7=8F=AD=E7=BA=A7\=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE\=E7=AB=9E=E8=B5=9B=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5,=E7=82=B9=E5=87=BB=E5=90=8E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=98=E4=B8=BA=E5=B7=B2=E8=AF=BB=EF=BC=88=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=B6=88=E6=81=AF=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 6 +++--- app/controllers/courses_controller.rb | 2 +- app/controllers/projects_controller.rb | 3 ++- app/helpers/application_helper.rb | 20 +++++++++++++++----- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index e6fb49ec7..30072bc2d 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -7,7 +7,8 @@ class ContestsController < ApplicationController helper :attachments helper :files include AvatarHelper - + include ApplicationHelper + before_filter :find_contest, :only => [:show, :settings, :update, :destroy, :contest_activities, :private_or_public, :switch_role, :set_invite_code_halt, :renew, :member, :export_all_members, :feedback] before_filter :is_logged, :only => [:index, :new, :create] @@ -18,8 +19,7 @@ class ContestsController < ApplicationController def show #更新创建课程消息状态 - contest_request_messages = ContestMessage.where("user_id = #{User.current.id} and contest_id = #{@contest.id} and contest_message_type in ('ContestRequestDealResult', 'JoinContest', 'RemoveFromContest') and viewed = 0") - contest_request_messages.update_all(:viewed => true) + update_messsages_to_viewed("ContestMessage", @contest) @left_nav_type = 1 respond_to do |format| diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 93eacc978..19d50493d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -456,7 +456,7 @@ class CoursesController < ApplicationController def member # 当前用户查看班级消息时,设置消息为已读 - update_messsages_to_viewed("CourseMessage", "JoinCourse", @course) + update_messsages_to_viewed("CourseMessage", @course) ## 有角色参数的才是课程,没有的就是项目 if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) @render_file = 'new_member_list' diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7d69e3a6f..43923f6bb 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -72,6 +72,7 @@ class ProjectsController < ApplicationController include UsersHelper ### added by william include ActsAsTaggableOn::TagsHelper + include ApplicationHelper # 仅仅为了转换Gitlab地址 def project_home @@ -575,7 +576,7 @@ class ProjectsController < ApplicationController if params[:message_id] message_invite(params[:message_id], params[:key]) end - update_message_status(User.current, @project) + update_messsages_to_viewed("ForgeMessage", @project) # params[:login]为邮箱邀请用户加入,主要功能: # 1、自动注册 # 2、加入项目、创建角色 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9d57712a6..12b668f22 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1037,14 +1037,24 @@ module ApplicationHelper end # 更新各类消息为已读 - def update_messsages_to_viewed(message_type, forge_message_type, forge_message_id) - if( message_type == "CourseMessage") - query = CourseMessage.where(:course_message_type => forge_message_type, + def update_messsages_to_viewed(message_type, forge_message_id) + if(message_type == "CourseMessage") + query = CourseMessage.where(:course_message_type => ["JoinCourse", "RemoveFromCourse"], :user_id => User.current, :course_id => forge_message_id, - :viewed => false).first - query.update_attribute(:viewed, true) unless query.nil? + :viewed => false) + elsif(message_type == "ForgeMessage") + query = ForgeMessage.where(:forge_message_type => ["ProjectInvite", "JoinProject", "RemoveFromProject"], + :user_id => User.current, + :project_id => forge_message_id, + :viewed => false) + elsif(message_type == "ContestMessage") + query = ContestMessage.where(:contest_message_type => ["ContestRequestDealResult", "JoinContest", "RemoveFromContest"], + :user_id => User.current, + :contest_id => forge_message_id, + :viewed => false) end + query.update_all(:viewed => true) unless query.blank? end def show_attachment_tip container_id, container_type From 9af54a9288050f21f300feb8498dd0bfb6a27fff Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 16 Feb 2017 14:09:15 +0800 Subject: [PATCH 017/118] =?UTF-8?q?=E6=88=91=E5=8F=91=E5=B8=83=E7=9A=84iss?= =?UTF-8?q?ue=E5=88=97=E8=A1=A8=EF=BC=8C=E6=A0=87=E9=A2=98=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=B1=85=E4=B8=AD=E5=AF=B9=E9=BD=90=EF=BC=8C=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E4=B8=8A=E6=9C=89=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 2 +- app/views/users/user_manage_issues.html.erb | 25 ++++++++++++--------- public/stylesheets/css/project.css | 11 ++++----- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 6e91035d0..9d8a5ecc5 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -42,7 +42,7 @@ class AccountController < ApplicationController redirect_to user_path(User.current) end else - render :layout => 'login' + render :layout => 'login' end else authenticate_user diff --git a/app/views/users/user_manage_issues.html.erb b/app/views/users/user_manage_issues.html.erb index 10f10db68..c66b18948 100644 --- a/app/views/users/user_manage_issues.html.erb +++ b/app/views/users/user_manage_issues.html.erb @@ -213,6 +213,12 @@ add_class("reorder_turnover_time"); }); }); + $(document).ready(function(){ + if($.browser.webkit){ + $("#issues_filter_por").css("padding-left","5px"); + $("#issue_filter_status").css("padding-left","15px"); + } + }); @@ -258,36 +264,33 @@
    -
    +
    <%= select( :project, :project_id, options_for_issue_project_list(@issues_filter), { :include_blank => false,:selected => @project_id ? @project_id : 0 }, - { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style=>"width: 80px; margin-right:20px;"} + { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style => "margin: 0 15px;text-align: left;"} )%> - - <%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["指派给",0]), { :include_blank => false, :selected => @assigned_to ? @assigned_to : 0}, {:onchange=>"remote_function();add_style();",:id => "assigned_to_id",:name => "assigned_to_id", :class => "fl", :style => "visibility:hidden; width:0px;margin:0px;padding:0px;"} ) %> - - - - -
    diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 4cae2e3c4..92b372bb7 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -363,7 +363,12 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .issues_nav_hover{border-bottom:3px solid #3498db; font-weight:bold; } .issues_nav_nomall {border-bottom:none; } .issues_nav_tag{ background-color:#eaeaea; padding:2px 8px;-webkit-border-radius:15px;-moz-border-radius:15px;-o-border-radius:15px;border-radius:15px; font-size:12px;} -.issues_form_filter{ position: absolute; top:0; right: 0;} +.my_issues_form_filter{ position: absolute; top:0; right: 0; width:520px} +.my_issues_form_filter select{ width:70px; height:30px; border:none; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; text-align:center} +.my_issues_form_filter select:focus,.issues_form_filter input:focus{border:none; } +.my_issues_form_filter select.my_issues_filter{ background:none; width:50px; padding: 0px} +.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("/images/new_project/arrow.png") no-repeat scroll right center transparent;}.issues_form_filter{ position: absolute; top:0; right: 0;} + .issues_form_filter select{ width:70px; height:30px; border:none; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; padding-right:10px; background-color:#fff; margin-bottom: 10px; color: #888;} .issues_form_filter select.issues_filter_select_min{width:50px; } .issues_form_filter select:focus,.issues_form_filter input:focus{border:none; } @@ -582,10 +587,6 @@ select.issues_filter_active { font-weight: bold; color: #333;} .issues_list_txt li.issues_list_max{ width:90px } .btn_newpro_grey{display: inline-block;color: #7b7b7b; border:1px solid #dbdbdb;background:#fff;text-align: center;font-size: 12px; padding:0 15px; height:24px; line-height: 24px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px;} a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;} -.my_issues_form_filter{ position: absolute; top:0; right: 0;} -.my_issues_form_filter select{ width:70px; height:30px; border:none; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; text-align:center} -.my_issues_form_filter select.issues_filter_select_min{width:50px; } -.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none;} /* 版本库分析20170103byLB*/ #conbox {font-size: 12px; width:100%;} #tags {padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; height: 30px} From 0d1738cf917334e6df14bc6b88df77cda6600a8e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 16 Feb 2017 14:54:56 +0800 Subject: [PATCH 018/118] =?UTF-8?q?=E6=88=91=E6=94=B6=E5=88=B0=E7=9A=84iss?= =?UTF-8?q?ue=EF=BC=8C=E6=A0=87=E9=A2=98=E6=B2=A1=E6=9C=89=E5=B1=85?= =?UTF-8?q?=E4=B8=AD=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=9C=89=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_manage_issues.html.erb | 2 +- app/views/users/user_receive_issues.html.erb | 24 +++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/views/users/user_manage_issues.html.erb b/app/views/users/user_manage_issues.html.erb index c66b18948..7227e02b3 100644 --- a/app/views/users/user_manage_issues.html.erb +++ b/app/views/users/user_manage_issues.html.erb @@ -216,7 +216,7 @@ $(document).ready(function(){ if($.browser.webkit){ $("#issues_filter_por").css("padding-left","5px"); - $("#issue_filter_status").css("padding-left","15px"); + $("#issue_filter_status").css("padding-left","10px"); } }); diff --git a/app/views/users/user_receive_issues.html.erb b/app/views/users/user_receive_issues.html.erb index f5815d470..20bdfdbfd 100644 --- a/app/views/users/user_receive_issues.html.erb +++ b/app/views/users/user_receive_issues.html.erb @@ -213,6 +213,11 @@ add_class("reorder_turnover_time"); }); }); + $(document).ready(function(){ + if($.browser.webkit){ + $("#issue_filter_status").css("padding-left","10px"); + } + }); @@ -258,12 +263,12 @@
    -
    +
    <%= select( :project, :project_id, options_for_issue_project_list(@issues_filter), { :include_blank => false,:selected => @project_id ? @project_id : 0 }, - { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style=>"width: 80px; margin-right:20px;"} + { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style => "margin: 0 15px;text-align: left;"} )%> - <%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["发布人",0]), @@ -271,24 +276,21 @@ {:onchange => "remote_function();add_style();",:id => "author_id", :name => "author_id", :class => "fl", :style => "visibility:hidden;width: 0px;margin:0px;padding:0px;"} ) %> - - - - - > -
    From cb5548c8536c3f5b7e943bcdb1ddd06db6878750 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 16 Feb 2017 15:18:35 +0800 Subject: [PATCH 019/118] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=E7=9A=84=E6=B6=88=E6=81=AF=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=B9=8B=E5=90=8E=E6=B2=A1=E6=9C=89=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=BA=E5=B7=B2=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/blog_comments_controller.rb | 3 +++ app/helpers/application_helper.rb | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index b2dd971bb..88d4c4d53 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -39,6 +39,9 @@ class BlogCommentsController < ApplicationController end end def show + # 更新博客消息为已读 + update_messsages_to_viewed("BlogMessage", params[:blog_id]) + @article = BlogComment.find(params[:id]) @replies = BlogComment.where("root_id = #{@article.id}").reorder("created_on desc") @reply_count = @replies.count diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 12b668f22..f479432ca 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1053,6 +1053,11 @@ module ApplicationHelper :user_id => User.current, :contest_id => forge_message_id, :viewed => false) + elsif(message_type == "BlogMessage") + query = BlogMessage.where(:blog_message_type => "BlogComment", + :user_id => User.current, + :blog_id => forge_message_id, + :viewed => false) end query.update_all(:viewed => true) unless query.blank? end From 2c42a5119547865bcd963253831063772ab2cf7e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 17 Feb 2017 09:00:35 +0800 Subject: [PATCH 020/118] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E7=9A=84=E9=A6=96=E9=A1=B5=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 4 +- ...ser_message_applied_school_action.html.erb | 2 +- ...17004513_update_applied_messages_status.rb | 9 + db/schema.rb | 5246 +++++++++-------- 4 files changed, 2644 insertions(+), 2617 deletions(-) create mode 100644 db/migrate/20170217004513_update_applied_messages_status.rb diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index ece68733b..c2499e824 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -783,8 +783,8 @@ class AdminController < ApplicationController begin #更新消息表的status applied_message_id = aas.school_id - applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools") - applied_message.update_all(:status => 2) + #applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools") + #applied_message.update_all(:status => 2) aas.update_attribute(:status, 2) AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name ) users = UserExtensions.where("school_id = #{aas.school_id}") diff --git a/app/views/users/_user_message_applied_school_action.html.erb b/app/views/users/_user_message_applied_school_action.html.erb index b4b0cdb6d..d08601d64 100644 --- a/app/views/users/_user_message_applied_school_action.html.erb +++ b/app/views/users/_user_message_applied_school_action.html.erb @@ -3,7 +3,7 @@ “<%= ma.name %>”的申请,已通过审核。谢谢! <% elsif ma.status == 2 %> - + “<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢! <% elsif ma.status == 3 %> diff --git a/db/migrate/20170217004513_update_applied_messages_status.rb b/db/migrate/20170217004513_update_applied_messages_status.rb new file mode 100644 index 000000000..a9100ac09 --- /dev/null +++ b/db/migrate/20170217004513_update_applied_messages_status.rb @@ -0,0 +1,9 @@ +class UpdateAppliedMessagesStatus < ActiveRecord::Migration + def up + sql = "update applied_messages set status = 1 where applied_id in(2495, 2496, 2497)" + execute(sql) + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 96c27b9cc..ec969b8c3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,2614 +1,2632 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20170209020934) do - - create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false - t.integer "activity_container_id" - t.string "activity_container_type", :default => "" - t.datetime "created_at" - end - - add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" - add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" - add_index "activities", ["user_id"], :name => "index_activities_on_user_id" - - create_table "activity_notifies", :force => true do |t| - t.integer "activity_container_id" - t.string "activity_container_type" - t.integer "activity_id" - t.string "activity_type" - t.integer "notify_to" - t.datetime "created_on" - t.integer "is_read" - end - - add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" - add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" - add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" - - create_table "api_keys", :force => true do |t| - t.string "access_token" - t.datetime "expires_at" - t.integer "user_id" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" - add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - - create_table "applied_contests", :force => true do |t| - t.integer "contest_id" - t.integer "user_id" - t.string "role" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" - add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" - - create_table "applied_messages", :force => true do |t| - t.integer "user_id" - t.integer "applied_id" - t.string "applied_type" - t.integer "viewed", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "name" - t.integer "applied_user_id" - t.integer "role" - t.integer "project_id" - end - - create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "role", :default => 0 - end - - create_table "apply_add_schools", :force => true do |t| - t.string "name" - t.string "province" - t.string "city" - t.string "address" - t.string "remarks" - t.integer "school_id" - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - create_table "apply_homeworks", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" - add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" - - create_table "apply_project_masters", :force => true do |t| - t.integer "user_id" - t.string "apply_type" - t.integer "apply_id" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "apply_resources", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "attachment_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id" - t.string "container_type" - t.text "content" - t.integer "apply_user_id" - end - - create_table "article_homepages", :force => true do |t| - t.string "title" - t.text "content" - t.integer "user_id" - t.integer "homepage_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" - add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" - - create_table "at_messages", :force => true do |t| - t.integer "user_id" - t.integer "at_message_id" - t.string "at_message_type" - t.boolean "viewed", :default => false - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sender_id" - end - - add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" - - create_table "attachment_histories", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.string "filename", :default => "" - t.string "disk_filename", :default => "" - t.integer "filesize", :default => 0 - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "" - t.integer "downloads", :default => 0 - t.integer "author_id" - t.datetime "created_on" - t.text "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.integer "copy_from" - t.integer "quotes" - t.integer "version" - t.integer "attachment_id" - t.integer "is_publish", :default => 1 - t.date "publish_time" - end - - create_table "attachments", :force => true do |t| - t.integer "container_id" - t.string "container_type", :limit => 30 - t.string "filename", :default => "", :null => false - t.string "disk_filename", :default => "", :null => false - t.integer "filesize", :default => 0, :null => false - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "", :null => false - t.integer "downloads", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.text "description" - t.string "disk_directory" - t.integer "attachtype", :default => 1 - t.integer "is_public", :default => 1 - t.integer "copy_from" - t.integer "quotes" - t.integer "is_publish", :default => 1 - t.datetime "publish_time" - end - - add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" - add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" - add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" - - create_table "attachmentstypes", :force => true do |t| - t.integer "typeId", :null => false - t.string "typeName", :limit => 50 - end - - create_table "auth_sources", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 60, :default => "", :null => false - t.string "host", :limit => 60 - t.integer "port" - t.string "account" - t.string "account_password", :default => "" - t.string "base_dn" - t.string "attr_login", :limit => 30 - t.string "attr_firstname", :limit => 30 - t.string "attr_lastname", :limit => 30 - t.string "attr_mail", :limit => 30 - t.boolean "onthefly_register", :default => false, :null => false - t.boolean "tls", :default => false, :null => false - t.string "filter" - t.integer "timeout" - end - - add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" - - create_table "biding_projects", :force => true do |t| - t.integer "project_id" - t.integer "bid_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "bids", :force => true do |t| - t.string "name" - t.string "budget", :null => false - t.integer "author_id" - t.date "deadline" - t.text "description" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "commit" - t.integer "reward_type" - t.integer "homework_type" - t.integer "parent_id" - t.string "password" - t.integer "is_evaluation" - t.integer "proportion", :default => 60 - t.integer "comment_status", :default => 0 - t.integer "evaluation_num", :default => 3 - t.integer "open_anonymous_evaluation", :default => 1 - end - - create_table "blog_comments", :force => true do |t| - t.integer "blog_id", :null => false - t.integer "parent_id" - t.string "title", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comment_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "root_id" - end - - add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" - - create_table "blog_messages", :force => true do |t| - t.integer "user_id" - t.integer "blog_message_id" - t.integer "blog_id" - t.string "blog_message_type" - t.boolean "viewed", :default => false - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_operator_id" - end - - create_table "blogs", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.integer "position", :default => 1 - t.integer "article_count", :default => 0, :null => false - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comments_id" - t.integer "parent_id" - t.integer "author_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "homepage_id" - end - - create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false - t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false - t.integer "last_message_id" - t.integer "parent_id" - t.integer "course_id" - t.integer "org_subfield_id" - t.integer "contest_id" - end - - add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" - add_index "boards", ["project_id"], :name => "boards_project_id" - - create_table "bug_to_osps", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "changes", :force => true do |t| - t.integer "changeset_id", :null => false - t.string "action", :limit => 1, :default => "", :null => false - t.text "path", :null => false - t.text "from_path" - t.string "from_revision" - t.string "revision" - t.string "branch" - end - - add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" - - create_table "changeset_parents", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "parent_id", :null => false - end - - add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" - add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" - - create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false - t.string "committer" - t.datetime "committed_on", :null => false - t.text "comments" - t.date "commit_date" - t.string "scmid" - t.integer "user_id" - end - - add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" - add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true - add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" - add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" - add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" - - create_table "changesets_issues", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "issue_id", :null => false - end - - add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - - create_table "code_tests", :force => true do |t| - t.integer "homework_id" - t.integer "wait_time", :default => 0 - t.integer "language" - t.integer "status" - t.integer "time_used", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "student_work_id", :default => 0 - end - - create_table "comments", :force => true do |t| - t.string "commented_type", :limit => 30, :default => "", :null => false - t.integer "commented_id", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.text "comments" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "comments", ["author_id"], :name => "index_comments_on_author_id" - add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" - - create_table "commit_issues", :force => true do |t| - t.string "commit_id" - t.integer "issue_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "commits", :force => true do |t| - t.integer "repository_id" - t.string "version" - t.string "committer" - t.text "comments" - t.datetime "committed_on" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contest_activities", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_act_id" - t.string "contest_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" - add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" - - create_table "contest_member_roles", :force => true do |t| - t.integer "contest_member_id" - t.integer "role_id" - t.boolean "is_current", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" - add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" - - create_table "contest_members", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.boolean "is_collect", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" - add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" - - create_table "contest_messages", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_message_id" - t.string "contest_message_type" - t.boolean "viewed", :default => false - t.text "content" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" - add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" - - create_table "contestant_for_contests", :force => true do |t| - t.integer "student_id" - t.integer "contest_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" - add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" - - create_table "contestant_work_evaluation_distributions", :force => true do |t| - t.integer "user_id" - t.integer "contestant_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" - - create_table "contestant_work_projects", :force => true do |t| - t.integer "contest_id" - t.integer "work_id" - t.integer "contestant_work_id" - t.integer "project_id" - t.integer "user_id" - t.boolean "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" - add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" - add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" - add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" - - create_table "contestant_work_scores", :force => true do |t| - t.integer "contestant_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" - add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" - - create_table "contestant_works", :force => true do |t| - t.string "name" - t.text "description" - t.integer "work_id" - t.integer "user_id" - t.float "work_score" - t.integer "project_id" - t.integer "work_status" - t.datetime "commit_time" - t.boolean "is_delete", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "judge_score" - end - - add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" - add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" - add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" - - create_table "contests", :force => true do |t| - t.integer "user_id" - t.string "name" - t.text "description" - t.boolean "is_public" - t.boolean "is_delete", :default => false - t.integer "visits", :default => 0 - t.string "invite_code" - t.integer "invite_code_halt", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_activities", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_act_id" - t.string "course_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" - - create_table "course_attachments", :force => true do |t| - t.string "filename" - t.string "disk_filename" - t.integer "filesize" - t.string "content_type" - t.string "digest" - t.integer "downloads" - t.string "author_id" - t.string "integer" - t.string "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id", :default => 0 - end - - create_table "course_class_post", :id => false, :force => true do |t| - t.integer "班级id", :default => 0, :null => false - t.string "班级名" - t.integer "帖子id", :default => 0, :null => false - t.integer "主贴id" - t.string "帖子标题", :default => "", :null => false - t.text "帖子内容" - t.integer "帖子用户id" - t.integer "帖子回复数", :default => 0, :null => false - t.integer "最后回帖id" - t.datetime "发帖时间", :null => false - t.datetime "帖子更新时间", :null => false - end - - create_table "course_contributor_scores", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.integer "message_num", :default => 0 - t.integer "message_reply_num", :default => 0 - t.integer "news_reply_num", :default => 0 - t.integer "resource_num", :default => 0 - t.integer "journal_num", :default => 0 - t.integer "journal_reply_num", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "total_score", :default => 0 - t.integer "homework_journal_num", :default => 0 - t.integer "news_num", :default => 0 - end - - add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" - - create_table "course_groups", :force => true do |t| - t.string "name" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" - - create_table "course_homework_statistics", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "committed_work_num", :default => 0 - t.integer "un_commit_work_num", :default => 0 - t.integer "late_commit_work_num", :default => 0 - t.integer "absence_evaluation_work_num", :default => 0 - t.integer "un_evaluation_work_num", :default => 0 - t.integer "appeal_num", :default => 0 - t.float "average_score", :default => 0.0 - t.float "total_score", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_infos", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_messages", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_message_id" - t.string "course_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "content" - t.integer "status" - t.integer "apply_user_id" - t.integer "apply_result" - end - - add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" - add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" - - create_table "course_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "course_id" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "courses", :force => true do |t| - t.integer "tea_id" - t.string "name" - t.integer "state" - t.string "code" - t.integer "time" - t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "location" - t.string "term" - t.string "string" - t.string "password" - t.string "setup_time" - t.string "endup_time" - t.string "class_period" - t.integer "school_id" - t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 - t.integer "lft" - t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 - t.integer "end_time" - t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 - t.integer "syllabus_id" - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.integer "invite_code_halt", :limit => 1, :default => 0 - t.integer "os_allow", :default => 0 - end - - add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true - add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" - - create_table "custom_fields", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.string "field_format", :limit => 30, :default => "", :null => false - t.text "possible_values" - t.string "regexp", :default => "" - t.integer "min_length", :default => 0, :null => false - t.integer "max_length", :default => 0, :null => false - t.boolean "is_required", :default => false, :null => false - t.boolean "is_for_all", :default => false, :null => false - t.boolean "is_filter", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "searchable", :default => false - t.text "default_value" - t.boolean "editable", :default => true - t.boolean "visible", :default => true, :null => false - t.boolean "multiple", :default => false - end - - add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" - - create_table "custom_fields_projects", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "project_id", :default => 0, :null => false - end - - add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true - - create_table "custom_fields_trackers", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true - - create_table "custom_values", :force => true do |t| - t.string "customized_type", :limit => 30, :default => "", :null => false - t.integer "customized_id", :default => 0, :null => false - t.integer "custom_field_id", :default => 0, :null => false - t.text "value" - end - - add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" - add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - - create_table "data_exceptions", :force => true do |t| - t.string "message" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "delayed_jobs", :force => true do |t| - t.integer "priority", :default => 0, :null => false - t.integer "attempts", :default => 0, :null => false - t.text "handler", :null => false - t.text "last_error" - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" - t.string "locked_by" - t.string "queue" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "documents", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "category_id", :default => 0, :null => false - t.string "title", :limit => 60, :default => "", :null => false - t.text "description" - t.datetime "created_on" - t.integer "user_id", :default => 0 - t.integer "is_public", :default => 1 - end - - add_index "documents", ["category_id"], :name => "index_documents_on_category_id" - add_index "documents", ["created_on"], :name => "index_documents_on_created_on" - add_index "documents", ["project_id"], :name => "documents_project_id" - - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 - t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false - end - - create_table "editor_of_documents", :force => true do |t| - t.integer "editor_id" - t.integer "org_document_comment_id" - t.datetime "created_at" - end - - create_table "enabled_modules", :force => true do |t| - t.integer "project_id" - t.string "name", :null => false - t.integer "course_id" - end - - add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" - - create_table "enumerations", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "is_default", :default => false, :null => false - t.string "type" - t.boolean "active", :default => true, :null => false - t.integer "project_id" - t.integer "parent_id" - t.string "position_name", :limit => 30 - end - - add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" - add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - - create_table "exercise_answers", :force => true do |t| - t.integer "user_id" - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_choices", :force => true do |t| - t.integer "exercise_question_id" - t.text "choice_text" - t.integer "choice_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_questions", :force => true do |t| - t.text "question_title" - t.integer "question_type" - t.integer "question_number" - t.integer "exercise_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_score" - end - - create_table "exercise_standard_answers", :force => true do |t| - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_users", :force => true do |t| - t.integer "user_id" - t.integer "exercise_id" - t.integer "score" - t.datetime "start_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "end_at" - t.integer "status" - t.integer "commit_status", :default => 0 - end - - create_table "exercises", :force => true do |t| - t.text "exercise_name" - t.text "exercise_description" - t.integer "course_id" - t.integer "exercise_status" - t.integer "user_id" - t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "publish_time" - t.datetime "end_time" - t.integer "show_result" - t.integer "question_random", :default => 0 - t.integer "choice_random", :default => 0 - end - - create_table "first_pages", :force => true do |t| - t.string "web_title" - t.string "title" - t.text "description" - t.string "page_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sort_type" - t.integer "image_width", :default => 107 - t.integer "image_height", :default => 63 - t.integer "show_course", :default => 1 - t.integer "show_contest", :default => 1 - end - - create_table "forge_activities", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_act_id" - t.string "forge_act_type" - t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" - add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" - - create_table "forge_messages", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_message_id" - t.string "forge_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "secret_key" - t.integer "status" - t.integer "operate_user_id" - end - - add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" - add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" - - create_table "forums", :force => true do |t| - t.string "name", :null => false - t.text "description" - t.integer "topic_count", :default => 0 - t.integer "memo_count", :default => 0 - t.integer "last_memo_id", :default => 0 - t.integer "creator_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sticky" - t.integer "locked" - end - - create_table "forwards", :force => true do |t| - t.integer "from_id" - t.string "from_type" - t.integer "to_id" - t.string "to_type" - t.datetime "created_at" - end - - create_table "groups_users", :id => false, :force => true do |t| - t.integer "group_id", :null => false - t.integer "user_id", :null => false - end - - add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - - create_table "homepages", :force => true do |t| - t.string "name" - t.integer "article_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" - - create_table "homework_attaches", :force => true do |t| - t.integer "bid_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - t.string "name" - t.text "description" - t.integer "state" - t.integer "project_id", :default => 0 - t.float "score", :default => 0.0 - t.integer "is_teacher_score", :default => 0 - end - - add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" - - create_table "homework_commons", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "homework_type", :default => 1 - t.string "late_penalty" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 - t.integer "anonymous_comment", :default => 0 - t.integer "quotes", :default => 0 - t.integer "is_open", :default => 0 - t.datetime "simi_time" - t.integer "score_open", :default => 1 - t.integer "anonymous_appeal", :default => 0 - end - - add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" - - create_table "homework_detail_groups", :force => true do |t| - t.integer "homework_common_id" - t.integer "min_num" - t.integer "max_num" - t.integer "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" - - create_table "homework_detail_manuals", :force => true do |t| - t.float "ta_proportion" - t.integer "comment_status" - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "absence_penalty", :default => 1 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "no_anon_penalty", :default => 1 - t.integer "appeal_penalty", :default => 0 - t.integer "ta_mode", :default => 1 - end - - create_table "homework_detail_programings", :force => true do |t| - t.string "language" - t.text "standard_code", :limit => 2147483647 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "ta_proportion", :default => 0.1 - t.integer "question_id" - end - - create_table "homework_evaluations", :force => true do |t| - t.string "user_id" - t.string "homework_attach_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "homework_for_courses", :force => true do |t| - t.integer "course_id" - t.integer "bid_id" - end - - add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" - add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" - - create_table "homework_tests", :force => true do |t| - t.text "input" - t.text "output" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "result" - t.text "error_msg" - end - - create_table "homework_users", :force => true do |t| - t.string "homework_attach_id" - t.string "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "invite_lists", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "mail" - end - - create_table "issue_categories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.integer "assigned_to_id" - end - - add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" - add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" - - create_table "issue_relations", :force => true do |t| - t.integer "issue_from_id", :null => false - t.integer "issue_to_id", :null => false - t.string "relation_type", :default => "", :null => false - t.integer "delay" - end - - add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true - add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" - add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" - - create_table "issue_statuses", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_closed", :default => false, :null => false - t.boolean "is_default", :default => false, :null => false - t.integer "position", :default => 1 - t.integer "default_done_ratio" - end - - add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" - add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" - add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" - - create_table "issues", :force => true do |t| - t.integer "tracker_id", :null => false - t.integer "project_id", :null => false - t.string "subject", :default => "", :null => false - t.text "description" - t.date "due_date" - t.integer "category_id" - t.integer "status_id", :null => false - t.integer "assigned_to_id" - t.integer "priority_id", :null => false - t.integer "fixed_version_id" - t.integer "author_id", :null => false - t.integer "lock_version", :default => 0, :null => false - t.datetime "created_on" - t.datetime "updated_on" - t.date "start_date" - t.integer "done_ratio", :default => 0, :null => false - t.float "estimated_hours" - t.integer "parent_id" - t.integer "root_id" - t.integer "lft" - t.integer "rgt" - t.boolean "is_private", :default => false, :null => false - t.datetime "closed_on" - t.integer "project_issues_index" - end - - add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" - add_index "issues", ["author_id"], :name => "index_issues_on_author_id" - add_index "issues", ["category_id"], :name => "index_issues_on_category_id" - add_index "issues", ["created_on"], :name => "index_issues_on_created_on" - add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" - add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" - add_index "issues", ["project_id"], :name => "issues_project_id" - add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" - add_index "issues", ["status_id"], :name => "index_issues_on_status_id" - add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" - - create_table "join_in_competitions", :force => true do |t| - t.integer "user_id" - t.integer "competition_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "join_in_contests", :force => true do |t| - t.integer "user_id" - t.integer "bid_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "journal_details", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - - create_table "journal_replies", :id => false, :force => true do |t| - t.integer "journal_id" - t.integer "user_id" - t.integer "reply_id" - end - - add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" - add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" - add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" - - create_table "journals", :force => true do |t| - t.integer "journalized_id", :default => 0, :null => false - t.string "journalized_type", :limit => 30, :default => "", :null => false - t.integer "user_id", :default => 0, :null => false - t.text "notes" - t.datetime "created_on", :null => false - t.boolean "private_notes", :default => false, :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "journals", ["created_on"], :name => "index_journals_on_created_on" - add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" - add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" - add_index "journals", ["user_id"], :name => "index_journals_on_user_id" - - create_table "journals_for_messages", :force => true do |t| - t.integer "jour_id" - t.string "jour_type" - t.integer "user_id" - t.text "notes" - t.integer "status" - t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.string "m_parent_id" - t.boolean "is_readed" - t.integer "m_reply_count" - t.integer "m_reply_id" - t.integer "is_comprehensive_evaluation" - t.integer "private", :default => 0 - t.integer "root_id" - end - - add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" - - create_table "kindeditor_assets", :force => true do |t| - t.string "asset" - t.integer "file_size" - t.string "file_type" - t.integer "owner_id" - t.string "asset_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "owner_type", :default => 0 - end - - create_table "member_roles", :force => true do |t| - t.integer "member_id", :null => false - t.integer "role_id", :null => false - t.integer "inherited_from" - t.integer "is_current", :default => 1 - end - - add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" - add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" - - create_table "members", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "project_id", :default => 0 - t.datetime "created_on" - t.boolean "mail_notification", :default => false, :null => false - t.integer "course_id", :default => -1 - t.integer "course_group_id", :default => 0 - t.integer "is_collect", :default => 1 - end - - add_index "members", ["course_id"], :name => "index_members_on_course_id" - add_index "members", ["project_id"], :name => "index_members_on_project_id" - add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true - add_index "members", ["user_id"], :name => "index_members_on_user_id" - - create_table "memo_messages", :force => true do |t| - t.integer "user_id" - t.integer "forum_id" - t.integer "memo_id" - t.string "memo_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" - add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" - - create_table "memos", :force => true do |t| - t.integer "forum_id", :null => false - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false - t.integer "author_id", :null => false - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count", :default => 0 - t.integer "root_id" - end - - add_index "memos", ["root_id"], :name => "index_memos_on_root_id" - - create_table "message_alls", :force => true do |t| - t.integer "user_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" - add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" - - create_table "messages", :force => true do |t| - t.integer "board_id", :null => false - t.integer "parent_id" - t.string "subject", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "replies_count", :default => 0, :null => false - t.integer "last_reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.integer "quotes" - t.integer "status", :default => 0 - t.integer "root_id" - end - - add_index "messages", ["author_id"], :name => "index_messages_on_author_id" - add_index "messages", ["board_id"], :name => "messages_board_id" - add_index "messages", ["created_on"], :name => "index_messages_on_created_on" - add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" - add_index "messages", ["parent_id"], :name => "messages_parent_id" - add_index "messages", ["root_id"], :name => "index_messages_on_root_id" - - create_table "news", :force => true do |t| - t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" - t.text "description" - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false - t.integer "course_id" - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "contest_id" - end - - add_index "news", ["author_id"], :name => "index_news_on_author_id" - add_index "news", ["created_on"], :name => "index_news_on_created_on" - add_index "news", ["project_id"], :name => "news_project_id" - - create_table "no_uses", :force => true do |t| - t.integer "user_id", :null => false - t.string "no_use_type" - t.integer "no_use_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "notificationcomments", :force => true do |t| - t.string "notificationcommented_type" - t.integer "notificationcommented_id" - t.integer "author_id" - t.text "notificationcomments" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "onclick_times", :force => true do |t| - t.integer "user_id" - t.datetime "onclick_time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "open_id_authentication_associations", :force => true do |t| - t.integer "issued" - t.integer "lifetime" - t.string "handle" - t.string "assoc_type" - t.binary "server_url" - t.binary "secret" - end - - create_table "open_id_authentication_nonces", :force => true do |t| - t.integer "timestamp", :null => false - t.string "server_url" - t.string "salt", :null => false - end - - create_table "open_source_projects", :force => true do |t| - t.string "name" - t.text "description" - t.integer "commit_count", :default => 0 - t.integer "code_line", :default => 0 - t.integer "users_count", :default => 0 - t.date "last_commit_time" - t.string "url" - t.date "date_collected" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "option_numbers", :force => true do |t| - t.integer "user_id" - t.integer "memo" - t.integer "messages_for_issues" - t.integer "issues_status" - t.integer "replay_for_message" - t.integer "replay_for_memo" - t.integer "follow" - t.integer "tread" - t.integer "praise_by_one" - t.integer "praise_by_two" - t.integer "praise_by_three" - t.integer "tread_by_one" - t.integer "tread_by_two" - t.integer "tread_by_three" - t.integer "changeset" - t.integer "document" - t.integer "attachment" - t.integer "issue_done_ratio" - t.integer "post_issue" - t.integer "score_type" - t.integer "total_score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - end - - create_table "org_activities", :force => true do |t| - t.integer "user_id" - t.integer "org_act_id" - t.string "org_act_type" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_courses", :force => true do |t| - t.integer "organization_id" - t.integer "course_id" - t.datetime "created_at" - end - - create_table "org_document_comments", :force => true do |t| - t.text "title" - t.text "content" - t.integer "organization_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "status", :default => 0 - t.integer "root_id" - end - - add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" - - create_table "org_member_roles", :force => true do |t| - t.integer "org_member_id" - t.integer "role_id" - end - - create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_messages", :force => true do |t| - t.integer "user_id" - t.integer "sender_id" - t.integer "organization_id" - t.string "message_type" - t.integer "message_id" - t.integer "viewed" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - end - - create_table "org_projects", :force => true do |t| - t.integer "organization_id" - t.integer "project_id" - t.datetime "created_at" - end - - create_table "org_subfield_messages", :force => true do |t| - t.integer "org_subfield_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_subfields", :force => true do |t| - t.integer "organization_id" - t.integer "priority" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 1 - end - - create_table "organizations", :force => true do |t| - t.string "name" - t.text "description" - t.integer "creator_id" - t.integer "home_id" - t.boolean "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "allow_guest_download", :default => true - t.integer "visits", :default => 0 - t.integer "show_mode", :default => 0 - t.integer "allow_teacher", :default => 0 - end - - create_table "phone_app_versions", :force => true do |t| - t.string "version" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_answers", :force => true do |t| - t.integer "poll_question_id" - t.text "answer_text" - t.integer "answer_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_questions", :force => true do |t| - t.string "question_title" - t.integer "question_type" - t.integer "is_necessary" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_number" - t.integer "max_choices", :default => 0 - t.integer "min_choices", :default => 0 - end - - create_table "poll_users", :force => true do |t| - t.integer "user_id" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_votes", :force => true do |t| - t.integer "user_id" - t.integer "poll_question_id" - t.integer "poll_answer_id" - t.text "vote_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "polls", :force => true do |t| - t.string "polls_name" - t.string "polls_type" - t.integer "polls_group_id" - t.integer "polls_status" - t.integer "user_id" - t.datetime "published_at" - t.datetime "closed_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "polls_description" - t.integer "show_result", :default => 1 - end - - create_table "praise_tread_caches", :force => true do |t| - t.integer "object_id", :null => false - t.string "object_type" - t.integer "praise_num" - t.integer "tread_num" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "praise_treads", :force => true do |t| - t.integer "user_id", :null => false - t.integer "praise_tread_object_id" - t.string "praise_tread_object_type" - t.integer "praise_or_tread" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "principal_activities", :force => true do |t| - t.integer "user_id" - t.integer "principal_id" - t.integer "principal_act_id" - t.string "principal_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "professional_levels", :force => true do |t| - t.string "level" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_infos", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_scores", :force => true do |t| - t.string "project_id" - t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 - t.datetime "commit_time" - t.integer "pull_request_num", :default => 0 - end - - create_table "project_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "project_id" - t.integer "project_type" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - end - - add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" - - create_table "projecting_softapplictions", :force => true do |t| - t.integer "user_id" - t.integer "softapplication_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "identifier" - t.integer "status", :default => 1, :null => false - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - end - - add_index "projects", ["lft"], :name => "index_projects_on_lft" - add_index "projects", ["rgt"], :name => "index_projects_on_rgt" - - create_table "projects_trackers", :id => false, :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true - add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - - create_table "pull_requests", :force => true do |t| - t.integer "pull_request_id" - t.integer "gpid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - t.integer "project_id" - t.string "title" - end - - create_table "quality_analyses", :force => true do |t| - t.integer "project_id" - t.string "author_login" - t.string "rep_identifier" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sonar_version", :default => 0 - t.string "path" - t.string "branch" - t.string "language" - t.string "sonar_name" - end - - create_table "queries", :force => true do |t| - t.integer "project_id" - t.string "name", :default => "", :null => false - t.text "filters" - t.integer "user_id", :default => 0, :null => false - t.boolean "is_public", :default => false, :null => false - t.text "column_names" - t.text "sort_criteria" - t.string "group_by" - t.string "type" - end - - add_index "queries", ["project_id"], :name => "index_queries_on_project_id" - add_index "queries", ["user_id"], :name => "index_queries_on_user_id" - - create_table "relative_memo_to_open_source_projects", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "relative_memos", :force => true do |t| - t.integer "osp_id" - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false - t.integer "author_id" - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 - t.string "url" - t.string "username" - t.string "userhomeurl" - t.date "date_collected" - t.string "topic_resource" - end - - create_table "rep_statics", :force => true do |t| - t.integer "project_id" - t.integer "commits_num" - t.string "uname" - t.string "email" - t.integer "add" - t.integer "del" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "changeset" - end - - create_table "repositories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "url", :default => "", :null => false - t.string "login", :limit => 60, :default => "" - t.string "password", :default => "" - t.string "root_url", :default => "" - t.string "type" - t.string "path_encoding", :limit => 64 - t.string "log_encoding", :limit => 64 - t.text "extra_info" - t.string "identifier" - t.boolean "is_default", :default => false - t.boolean "hidden", :default => false - end - - add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - - create_table "roles", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "assignable", :default => true - t.integer "builtin", :default => 0, :null => false - t.text "permissions" - t.string "issues_visibility", :limit => 30, :default => "default", :null => false - end - - create_table "schools", :force => true do |t| - t.string "name" - t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "logo_link" - t.string "pinyin" - t.integer "school_type", :default => 0 - end - - create_table "secdomains", :force => true do |t| - t.integer "sub_type" - t.string "subname" - t.integer "pid", :default => 0 - t.string "desc" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_cached_ratings", :force => true do |t| - t.integer "cacheable_id", :limit => 8 - t.string "cacheable_type" - t.float "avg", :null => false - t.integer "cnt", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_rates", :force => true do |t| - t.integer "rater_id", :limit => 8 - t.integer "rateable_id" - t.string "rateable_type" - t.float "stars", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "is_teacher_score", :default => 0 - end - - create_table "settings", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "value" - t.datetime "updated_on" - end - - add_index "settings", ["name"], :name => "index_settings_on_name" - - create_table "shares", :force => true do |t| - t.date "created_on" - t.string "url" - t.string "title" - t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - t.integer "user_id" - t.string "description" - end - - create_table "shield_activities", :force => true do |t| - t.string "container_type" - t.integer "container_id" - t.string "shield_type" - t.integer "shield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "shield_wechat_messages", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.integer "shield_id" - t.string "shield_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "softapplications", :force => true do |t| - t.string "name" - t.text "description" - t.integer "app_type_id" - t.string "app_type_name" - t.string "android_min_version_available" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "contest_id" - t.integer "softapplication_id" - t.integer "is_public" - t.string "application_developers" - t.string "deposit_project_url" - t.string "deposit_project" - t.integer "project_id" - end - - create_table "sonar_errors", :force => true do |t| - t.integer "project_id" - t.string "jenkins_job_name" - t.text "output" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "ssos", :force => true do |t| - t.integer "user_id" - t.string "openid" - t.string "name" - t.string "password" - t.string "email" - t.integer "sex" - t.string "school" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" - - create_table "student_work_projects", :force => true do |t| - t.integer "homework_common_id" - t.integer "student_work_id" - t.integer "project_id" - t.integer "user_id" - t.integer "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "course_id" - end - - add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" - add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" - add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" - add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" - - create_table "student_work_tests", :force => true do |t| - t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 - t.text "results" - t.text "src" - end - - add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" - - create_table "student_works", :force => true do |t| - t.string "name" - t.text "description", :limit => 2147483647 - t.integer "homework_common_id" - t.integer "user_id" - t.float "final_score" - t.float "teacher_score" - t.float "student_score" - t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "late_penalty", :default => 0 - t.integer "absence_penalty", :default => 0 - t.float "system_score", :default => 0.0 - t.boolean "is_test", :default => false - t.integer "simi_id" - t.integer "simi_value" - t.float "work_score" - t.integer "work_status", :default => 0 - t.datetime "commit_time" - t.integer "is_delete", :default => 0 - t.integer "appeal_penalty", :default => 0 - end - - add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" - - create_table "student_works_evaluation_distributions", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "student_works_scores", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "appeal_status", :default => 0 - t.boolean "is_hidden", :default => false - end - - add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" - add_index "student_works_scores", ["user_id"], :name => "user_id" - - create_table "student_works_scores_appeals", :force => true do |t| - t.integer "student_works_score_id" - t.integer "user_id" - t.text "comment" - t.integer "appeal_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "students_for_courses", :force => true do |t| - t.integer "student_id" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" - add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" - - create_table "sub_document_comments", :force => true do |t| - t.text "content" - t.text "title" - t.integer "sub_domain_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.integer "locked" - t.integer "sticky" - t.integer "org_subfield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "sub_domains", :force => true do |t| - t.integer "org_subfield_id" - t.integer "priority", :default => 0 - t.string "name" - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "subfield_subdomain_dirs", :force => true do |t| - t.integer "org_subfield_id" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "syllabus_members", :force => true do |t| - t.integer "rank" - t.integer "syllabus_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" - add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" - add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" - - create_table "syllabuses", :force => true do |t| - t.string "title" - t.text "description" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "eng_name" - t.integer "syllabus_type" - t.integer "credit" - t.integer "hours" - t.integer "theory_hours" - t.integer "practice_hours" - t.string "applicable_major" - t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 - end - - add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" - end - - create_table "taggings", :force => true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context", :limit => 128 - t.datetime "created_at" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" - add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" - - create_table "tags", :force => true do |t| - t.string "name" - end - - create_table "teachers", :force => true do |t| - t.string "tea_name" - t.string "location" - t.integer "couurse_time" - t.integer "course_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "extra" - end - - create_table "time_entries", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "issue_id" - t.float "hours", :null => false - t.string "comments" - t.integer "activity_id", :null => false - t.date "spent_on", :null => false - t.integer "tyear", :null => false - t.integer "tmonth", :null => false - t.integer "tweek", :null => false - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" - add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" - add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" - add_index "time_entries", ["project_id"], :name => "time_entries_project_id" - add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - - create_table "tokens", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "value", :limit => 40, :default => "", :null => false - t.datetime "created_on", :null => false - end - - add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" - add_index "tokens", ["value"], :name => "tokens_value", :unique => true - - create_table "trackers", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_in_chlog", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "is_in_roadmap", :default => true, :null => false - t.integer "fields_bits", :default => 0 - end - - create_table "user_actions", :force => true do |t| - t.integer "user_id" - t.string "action_type" - t.integer "action_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_activities", :force => true do |t| - t.string "act_type" - t.integer "act_id" - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" - - create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false - t.date "birthday" - t.string "brief_introduction" - t.integer "gender" - t.string "location" - t.string "occupation" - t.integer "work_experience" - t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "technical_title" - t.integer "identity" - t.string "student_id" - t.string "teacher_realname" - t.string "student_realname" - t.string "location_city" - t.integer "school_id" - t.string "description", :default => "" - end - - add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" - - create_table "user_feedback_messages", :force => true do |t| - t.integer "user_id" - t.integer "journals_for_message_id" - t.string "journals_for_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" - add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" - - create_table "user_grades", :force => true do |t| - t.integer "user_id", :null => false - t.integer "project_id", :null => false - t.float "grade", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" - add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" - add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" - - create_table "user_levels", :force => true do |t| - t.integer "user_id" - t.integer "level" - end - - create_table "user_preferences", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.text "others" - t.boolean "hide_mail", :default => false - t.string "time_zone" - end - - add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" - - create_table "user_score_details", :force => true do |t| - t.integer "current_user_id" - t.integer "target_user_id" - t.string "score_type" - t.string "score_action" - t.integer "user_id" - t.integer "old_score" - t.integer "new_score" - t.integer "current_user_level" - t.integer "target_user_level" - t.integer "score_changeable_obj_id" - t.string "score_changeable_obj_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "grade", :default => 0.0 - end - - add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" - add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" - add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "bindtype", :default => 0 - end - - create_table "users", :force => true do |t| - t.string "login", :default => "", :null => false - t.string "hashed_password", :limit => 40, :default => "", :null => false - t.string "firstname", :limit => 30, :default => "", :null => false - t.string "lastname", :default => "", :null => false - t.string "mail", :limit => 60, :default => "", :null => false - t.boolean "admin", :default => false, :null => false - t.integer "status", :default => 1, :null => false - t.datetime "last_login_on" - t.string "language", :limit => 5, :default => "" - t.integer "auth_source_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "type" - t.string "identity_url" - t.string "mail_notification", :default => "", :null => false - t.string "salt", :limit => 64 - t.integer "gid" - t.integer "visits", :default => 0 - t.integer "excellent_teacher", :default => 0 - t.integer "excellent_student", :default => 0 - end - - add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" - add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" - add_index "users", ["type"], :name => "index_users_on_type" - - create_table "versions", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :default => "", :null => false - t.string "description", :default => "" - t.date "effective_date" - t.datetime "created_on" - t.datetime "updated_on" - t.string "wiki_page_title" - t.string "status", :default => "open" - t.string "sharing", :default => "none", :null => false - t.integer "user_id" - end - - add_index "versions", ["project_id"], :name => "versions_project_id" - add_index "versions", ["sharing"], :name => "index_versions_on_sharing" - - create_table "visitors", :force => true do |t| - t.integer "user_id" - t.integer "master_id" - t.datetime "updated_on" - t.datetime "created_on" - end - - add_index "visitors", ["master_id"], :name => "index_visitors_master_id" - add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" - add_index "visitors", ["user_id"], :name => "index_visitors_user_id" - - create_table "watchers", :force => true do |t| - t.string "watchable_type", :default => "", :null => false - t.integer "watchable_id", :default => 0, :null => false - t.integer "user_id" - end - - add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" - add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" - add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" - - create_table "web_footer_companies", :force => true do |t| - t.string "name" - t.string "logo_size" - t.string "url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "web_footer_oranizers", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - - add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" - - create_table "wiki_content_versions", :force => true do |t| - t.integer "wiki_content_id", :null => false - t.integer "page_id", :null => false - t.integer "author_id" - t.binary "data", :limit => 2147483647 - t.string "compression", :limit => 6, :default => "" - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" - add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" - - create_table "wiki_contents", :force => true do |t| - t.integer "page_id", :null => false - t.integer "author_id" - t.text "text", :limit => 2147483647 - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" - add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" - - create_table "wiki_pages", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title", :null => false - t.datetime "created_on", :null => false - t.boolean "protected", :default => false, :null => false - t.integer "parent_id" - end - - add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" - add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" - add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" - - create_table "wiki_redirects", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title" - t.string "redirects_to" - t.datetime "created_on", :null => false - end - - add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" - add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" - - create_table "wikis", :force => true do |t| - t.integer "project_id", :null => false - t.string "start_page", :null => false - t.integer "status", :default => 1, :null => false - end - - add_index "wikis", ["project_id"], :name => "wikis_project_id" - - create_table "work_detail_groups", :force => true do |t| - t.integer "work_id" - t.integer "min_num" - t.integer "max_num" - t.boolean "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" - - create_table "work_detail_manuals", :force => true do |t| - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" - - create_table "workflows", :force => true do |t| - t.integer "tracker_id", :default => 0, :null => false - t.integer "old_status_id", :default => 0, :null => false - t.integer "new_status_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - t.boolean "assignee", :default => false, :null => false - t.boolean "author", :default => false, :null => false - t.string "type", :limit => 30 - t.string "field_name", :limit => 30 - t.string "rule", :limit => 30 - end - - add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" - add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" - add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" - add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - - create_table "works", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "work_type" - t.integer "contest_id" - t.boolean "is_delete", :default => false - t.boolean "score_open", :default => false - t.boolean "is_open", :default => false - t.integer "work_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "online_evaluation", :default => false - t.boolean "score_valid", :default => true - end - - add_index "works", ["contest_id"], :name => "index_works_on_contest_id" - add_index "works", ["user_id"], :name => "index_works_on_user_id" - - create_table "works_categories", :force => true do |t| - t.string "category" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "zip_packs", :force => true do |t| - t.integer "user_id" - t.integer "homework_id" - t.string "file_digest" - t.string "file_path" - t.integer "pack_times", :default => 1 - t.integer "pack_size", :default => 0 - t.text "file_digests" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - -end +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20170217004513) do + + create_table "activities", :force => true do |t| + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false + t.integer "activity_container_id" + t.string "activity_container_type", :default => "" + t.datetime "created_at" + end + + add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" + add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" + add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + + create_table "activity_notifies", :force => true do |t| + t.integer "activity_container_id" + t.string "activity_container_type" + t.integer "activity_id" + t.string "activity_type" + t.integer "notify_to" + t.datetime "created_on" + t.integer "is_read" + end + + add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" + add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" + add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" + + create_table "api_keys", :force => true do |t| + t.string "access_token" + t.datetime "expires_at" + t.integer "user_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" + add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + + create_table "applied_contests", :force => true do |t| + t.integer "contest_id" + t.integer "user_id" + t.string "role" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" + add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" + + create_table "applied_messages", :force => true do |t| + t.integer "user_id" + t.integer "applied_id" + t.string "applied_type" + t.integer "viewed", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "name" + t.integer "applied_user_id" + t.integer "role" + t.integer "project_id" + end + + create_table "applied_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "role", :default => 0 + end + + create_table "apply_add_schools", :force => true do |t| + t.string "name" + t.string "province" + t.string "city" + t.string "address" + t.string "remarks" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + create_table "apply_homeworks", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" + add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" + + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "apply_resources", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "attachment_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id" + t.string "container_type" + t.text "content" + t.integer "apply_user_id" + end + + create_table "article_homepages", :force => true do |t| + t.string "title" + t.text "content" + t.integer "user_id" + t.integer "homepage_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" + add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" + + create_table "at_messages", :force => true do |t| + t.integer "user_id" + t.integer "at_message_id" + t.string "at_message_type" + t.boolean "viewed", :default => false + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sender_id" + end + + add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" + + create_table "attachment_histories", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.string "filename", :default => "" + t.string "disk_filename", :default => "" + t.integer "filesize", :default => 0 + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "" + t.integer "downloads", :default => 0 + t.integer "author_id" + t.datetime "created_on" + t.text "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.integer "copy_from" + t.integer "quotes" + t.integer "version" + t.integer "attachment_id" + t.integer "is_publish", :default => 1 + t.date "publish_time" + end + + create_table "attachments", :force => true do |t| + t.integer "container_id" + t.string "container_type", :limit => 30 + t.string "filename", :default => "", :null => false + t.string "disk_filename", :default => "", :null => false + t.integer "filesize", :default => 0, :null => false + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "", :null => false + t.integer "downloads", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.text "description" + t.string "disk_directory" + t.integer "attachtype", :default => 1 + t.integer "is_public", :default => 1 + t.integer "copy_from" + t.integer "quotes" + t.integer "is_publish", :default => 1 + t.datetime "publish_time" + end + + add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" + add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" + add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" + + create_table "attachmentstypes", :force => true do |t| + t.integer "typeId", :null => false + t.string "typeName", :limit => 50 + end + + create_table "auth_sources", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 60, :default => "", :null => false + t.string "host", :limit => 60 + t.integer "port" + t.string "account" + t.string "account_password", :default => "" + t.string "base_dn" + t.string "attr_login", :limit => 30 + t.string "attr_firstname", :limit => 30 + t.string "attr_lastname", :limit => 30 + t.string "attr_mail", :limit => 30 + t.boolean "onthefly_register", :default => false, :null => false + t.boolean "tls", :default => false, :null => false + t.string "filter" + t.integer "timeout" + end + + add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" + + create_table "biding_projects", :force => true do |t| + t.integer "project_id" + t.integer "bid_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "bids", :force => true do |t| + t.string "name" + t.string "budget", :null => false + t.integer "author_id" + t.date "deadline" + t.text "description" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "commit" + t.integer "reward_type" + t.integer "homework_type" + t.integer "parent_id" + t.string "password" + t.integer "is_evaluation" + t.integer "proportion", :default => 60 + t.integer "comment_status", :default => 0 + t.integer "evaluation_num", :default => 3 + t.integer "open_anonymous_evaluation", :default => 1 + end + + create_table "blog_comments", :force => true do |t| + t.integer "blog_id", :null => false + t.integer "parent_id" + t.string "title", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comment_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "root_id" + end + + add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" + + create_table "blog_messages", :force => true do |t| + t.integer "user_id" + t.integer "blog_message_id" + t.integer "blog_id" + t.string "blog_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_operator_id" + end + + create_table "blogs", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.integer "position", :default => 1 + t.integer "article_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comments_id" + t.integer "parent_id" + t.integer "author_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "homepage_id" + end + + create_table "boards", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false + t.string "description" + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false + t.integer "last_message_id" + t.integer "parent_id" + t.integer "course_id" + t.integer "org_subfield_id" + t.integer "contest_id" + end + + add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" + add_index "boards", ["project_id"], :name => "boards_project_id" + + create_table "bug_to_osps", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "changes", :force => true do |t| + t.integer "changeset_id", :null => false + t.string "action", :limit => 1, :default => "", :null => false + t.text "path", :null => false + t.text "from_path" + t.string "from_revision" + t.string "revision" + t.string "branch" + end + + add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" + + create_table "changeset_parents", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "parent_id", :null => false + end + + add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" + add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" + + create_table "changesets", :force => true do |t| + t.integer "repository_id", :null => false + t.string "revision", :null => false + t.string "committer" + t.datetime "committed_on", :null => false + t.text "comments" + t.date "commit_date" + t.string "scmid" + t.integer "user_id" + t.integer "project_id" + t.integer "type", :default => 0 + end + + add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" + add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true + add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" + add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" + add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" + + create_table "changesets_issues", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "issue_id", :null => false + end + + add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + + create_table "code_tests", :force => true do |t| + t.integer "homework_id" + t.integer "wait_time", :default => 0 + t.integer "language" + t.integer "status" + t.integer "time_used", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "student_work_id", :default => 0 + end + + create_table "comments", :force => true do |t| + t.string "commented_type", :limit => 30, :default => "", :null => false + t.integer "commented_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.text "comments" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "comments", ["author_id"], :name => "index_comments_on_author_id" + add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" + + create_table "commit_issues", :force => true do |t| + t.string "commit_id" + t.integer "issue_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "commits", :force => true do |t| + t.integer "repository_id" + t.string "version" + t.string "committer" + t.text "comments" + t.datetime "committed_on" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contest_activities", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_act_id" + t.string "contest_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" + add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" + + create_table "contest_member_roles", :force => true do |t| + t.integer "contest_member_id" + t.integer "role_id" + t.boolean "is_current", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" + add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" + + create_table "contest_members", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.boolean "is_collect", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" + add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" + + create_table "contest_messages", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_message_id" + t.string "contest_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" + add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" + + create_table "contestant_for_contests", :force => true do |t| + t.integer "student_id" + t.integer "contest_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" + add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" + + create_table "contestant_work_evaluation_distributions", :force => true do |t| + t.integer "user_id" + t.integer "contestant_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" + + create_table "contestant_work_projects", :force => true do |t| + t.integer "contest_id" + t.integer "work_id" + t.integer "contestant_work_id" + t.integer "project_id" + t.integer "user_id" + t.boolean "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" + add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" + add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" + add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" + + create_table "contestant_work_scores", :force => true do |t| + t.integer "contestant_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" + add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" + + create_table "contestant_works", :force => true do |t| + t.string "name" + t.text "description" + t.integer "work_id" + t.integer "user_id" + t.float "work_score" + t.integer "project_id" + t.integer "work_status" + t.datetime "commit_time" + t.boolean "is_delete", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "judge_score" + end + + add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" + add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" + add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" + + create_table "contests", :force => true do |t| + t.integer "user_id" + t.string "name" + t.text "description" + t.boolean "is_public" + t.boolean "is_delete", :default => false + t.integer "visits", :default => 0 + t.string "invite_code" + t.integer "invite_code_halt", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_activities", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_act_id" + t.string "course_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" + + create_table "course_attachments", :force => true do |t| + t.string "filename" + t.string "disk_filename" + t.integer "filesize" + t.string "content_type" + t.string "digest" + t.integer "downloads" + t.string "author_id" + t.string "integer" + t.string "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id", :default => 0 + end + + create_table "course_contributor_scores", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.integer "message_num", :default => 0 + t.integer "message_reply_num", :default => 0 + t.integer "news_reply_num", :default => 0 + t.integer "resource_num", :default => 0 + t.integer "journal_num", :default => 0 + t.integer "journal_reply_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "total_score", :default => 0 + t.integer "homework_journal_num", :default => 0 + t.integer "news_num", :default => 0 + end + + add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" + + create_table "course_groups", :force => true do |t| + t.string "name" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" + + create_table "course_homework_statistics", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "committed_work_num", :default => 0 + t.integer "un_commit_work_num", :default => 0 + t.integer "late_commit_work_num", :default => 0 + t.integer "absence_evaluation_work_num", :default => 0 + t.integer "un_evaluation_work_num", :default => 0 + t.integer "appeal_num", :default => 0 + t.float "average_score", :default => 0.0 + t.float "total_score", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_infos", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_messages", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_message_id" + t.string "course_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "content" + t.integer "status" + t.integer "apply_user_id" + t.integer "apply_result" + end + + add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" + add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" + + create_table "course_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "course_id" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "courses", :force => true do |t| + t.integer "tea_id" + t.string "name" + t.integer "state" + t.string "code" + t.integer "time" + t.string "extra" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "location" + t.string "term" + t.string "string" + t.string "password" + t.string "setup_time" + t.string "endup_time" + t.string "class_period" + t.integer "school_id" + t.text "description" + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 + t.integer "lft" + t.integer "rgt" + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 + t.integer "end_time" + t.string "end_term" + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 + t.integer "syllabus_id" + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 + end + + add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true + add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" + + create_table "custom_fields", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.string "field_format", :limit => 30, :default => "", :null => false + t.text "possible_values" + t.string "regexp", :default => "" + t.integer "min_length", :default => 0, :null => false + t.integer "max_length", :default => 0, :null => false + t.boolean "is_required", :default => false, :null => false + t.boolean "is_for_all", :default => false, :null => false + t.boolean "is_filter", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "searchable", :default => false + t.text "default_value" + t.boolean "editable", :default => true + t.boolean "visible", :default => true, :null => false + t.boolean "multiple", :default => false + end + + add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" + + create_table "custom_fields_projects", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "project_id", :default => 0, :null => false + end + + add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true + + create_table "custom_fields_trackers", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true + + create_table "custom_values", :force => true do |t| + t.string "customized_type", :limit => 30, :default => "", :null => false + t.integer "customized_id", :default => 0, :null => false + t.integer "custom_field_id", :default => 0, :null => false + t.text "value" + end + + add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" + add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + + create_table "data_exceptions", :force => true do |t| + t.string "message" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "delayed_jobs", :force => true do |t| + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + + create_table "delayed_jobs_20161218", :id => false, :force => true do |t| + t.integer "id", :default => 0, :null => false + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "documents", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "category_id", :default => 0, :null => false + t.string "title", :limit => 60, :default => "", :null => false + t.text "description" + t.datetime "created_on" + t.integer "user_id", :default => 0 + t.integer "is_public", :default => 1 + end + + add_index "documents", ["category_id"], :name => "index_documents_on_category_id" + add_index "documents", ["created_on"], :name => "index_documents_on_created_on" + add_index "documents", ["project_id"], :name => "documents_project_id" + + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 + t.string "File" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false + end + + create_table "editor_of_documents", :force => true do |t| + t.integer "editor_id" + t.integer "org_document_comment_id" + t.datetime "created_at" + end + + create_table "enabled_modules", :force => true do |t| + t.integer "project_id" + t.string "name", :null => false + t.integer "course_id" + end + + add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" + + create_table "enumerations", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "is_default", :default => false, :null => false + t.string "type" + t.boolean "active", :default => true, :null => false + t.integer "project_id" + t.integer "parent_id" + t.string "position_name", :limit => 30 + end + + add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" + add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + + create_table "exercise_answers", :force => true do |t| + t.integer "user_id" + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_choices", :force => true do |t| + t.integer "exercise_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "exercise_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_score" + end + + create_table "exercise_standard_answers", :force => true do |t| + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_users", :force => true do |t| + t.integer "user_id" + t.integer "exercise_id" + t.integer "score" + t.datetime "start_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "end_at" + t.integer "status" + t.integer "commit_status", :default => 0 + end + + create_table "exercises", :force => true do |t| + t.text "exercise_name" + t.text "exercise_description" + t.integer "course_id" + t.integer "exercise_status" + t.integer "user_id" + t.integer "time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "publish_time" + t.datetime "end_time" + t.integer "show_result" + end + + create_table "first_pages", :force => true do |t| + t.string "web_title" + t.string "title" + t.text "description" + t.string "page_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sort_type" + t.integer "image_width", :default => 107 + t.integer "image_height", :default => 63 + t.integer "show_course", :default => 1 + t.integer "show_contest", :default => 1 + end + + create_table "forge_activities", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_act_id" + t.string "forge_act_type" + t.integer "org_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" + add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" + + create_table "forge_messages", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_message_id" + t.string "forge_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "secret_key" + t.integer "status" + t.integer "operate_user_id" + end + + add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" + add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + + create_table "forums", :force => true do |t| + t.string "name", :null => false + t.text "description" + t.integer "topic_count", :default => 0 + t.integer "memo_count", :default => 0 + t.integer "last_memo_id", :default => 0 + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sticky" + t.integer "locked" + end + + create_table "forwards", :force => true do |t| + t.integer "from_id" + t.string "from_type" + t.integer "to_id" + t.string "to_type" + t.datetime "created_at" + end + + create_table "groups_users", :id => false, :force => true do |t| + t.integer "group_id", :null => false + t.integer "user_id", :null => false + end + + add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true + + create_table "homepages", :force => true do |t| + t.string "name" + t.integer "article_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" + + create_table "homework_attaches", :force => true do |t| + t.integer "bid_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + t.string "name" + t.text "description" + t.integer "state" + t.integer "project_id", :default => 0 + t.float "score", :default => 0.0 + t.integer "is_teacher_score", :default => 0 + end + + add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + + create_table "homework_commons", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "homework_type", :default => 1 + t.string "late_penalty" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 + t.integer "quotes", :default => 0 + t.integer "is_open", :default => 0 + t.datetime "simi_time" + t.integer "score_open", :default => 1 + t.integer "anonymous_appeal", :default => 0 + end + + add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + + create_table "homework_detail_groups", :force => true do |t| + t.integer "homework_common_id" + t.integer "min_num" + t.integer "max_num" + t.integer "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" + + create_table "homework_detail_manuals", :force => true do |t| + t.float "ta_proportion" + t.integer "comment_status" + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "absence_penalty", :default => 1 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "no_anon_penalty", :default => 1 + t.integer "appeal_penalty", :default => 0 + t.integer "ta_mode", :default => 1 + end + + create_table "homework_detail_programings", :force => true do |t| + t.string "language" + t.text "standard_code", :limit => 2147483647 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "ta_proportion", :default => 0.1 + t.integer "question_id" + end + + create_table "homework_evaluations", :force => true do |t| + t.string "user_id" + t.string "homework_attach_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_for_courses", :force => true do |t| + t.integer "course_id" + t.integer "bid_id" + end + + add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" + add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + + create_table "homework_tests", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "result" + t.text "error_msg" + end + + create_table "homework_users", :force => true do |t| + t.string "homework_attach_id" + t.string "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "ii", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + + create_table "innodb_monitor", :id => false, :force => true do |t| + t.integer "a" + end + + create_table "invite_lists", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "mail" + end + + create_table "issue_categories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.integer "assigned_to_id" + end + + add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" + add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" + + create_table "issue_relations", :force => true do |t| + t.integer "issue_from_id", :null => false + t.integer "issue_to_id", :null => false + t.string "relation_type", :default => "", :null => false + t.integer "delay" + end + + add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true + add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" + add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" + + create_table "issue_statuses", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_closed", :default => false, :null => false + t.boolean "is_default", :default => false, :null => false + t.integer "position", :default => 1 + t.integer "default_done_ratio" + end + + add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" + add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" + add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" + + create_table "issues", :force => true do |t| + t.integer "tracker_id", :null => false + t.integer "project_id", :null => false + t.string "subject", :default => "", :null => false + t.text "description" + t.date "due_date" + t.integer "category_id" + t.integer "status_id", :null => false + t.integer "assigned_to_id" + t.integer "priority_id", :null => false + t.integer "fixed_version_id" + t.integer "author_id", :null => false + t.integer "lock_version", :default => 0, :null => false + t.datetime "created_on" + t.datetime "updated_on" + t.date "start_date" + t.integer "done_ratio", :default => 0, :null => false + t.float "estimated_hours" + t.integer "parent_id" + t.integer "root_id" + t.integer "lft" + t.integer "rgt" + t.boolean "is_private", :default => false, :null => false + t.datetime "closed_on" + t.integer "project_issues_index" + end + + add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" + add_index "issues", ["author_id"], :name => "index_issues_on_author_id" + add_index "issues", ["category_id"], :name => "index_issues_on_category_id" + add_index "issues", ["created_on"], :name => "index_issues_on_created_on" + add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" + add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" + add_index "issues", ["project_id"], :name => "issues_project_id" + add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" + add_index "issues", ["status_id"], :name => "index_issues_on_status_id" + add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" + + create_table "join_in_competitions", :force => true do |t| + t.integer "user_id" + t.integer "competition_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "join_in_contests", :force => true do |t| + t.integer "user_id" + t.integer "bid_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "journal_details", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + + create_table "journal_replies", :id => false, :force => true do |t| + t.integer "journal_id" + t.integer "user_id" + t.integer "reply_id" + end + + add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" + add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" + add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" + + create_table "journals", :force => true do |t| + t.integer "journalized_id", :default => 0, :null => false + t.string "journalized_type", :limit => 30, :default => "", :null => false + t.integer "user_id", :default => 0, :null => false + t.text "notes" + t.datetime "created_on", :null => false + t.boolean "private_notes", :default => false, :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "journals", ["created_on"], :name => "index_journals_on_created_on" + add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" + add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" + add_index "journals", ["user_id"], :name => "index_journals_on_user_id" + + create_table "journals_for_messages", :force => true do |t| + t.integer "jour_id" + t.string "jour_type" + t.integer "user_id" + t.text "notes" + t.integer "status" + t.integer "reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.string "m_parent_id" + t.boolean "is_readed" + t.integer "m_reply_count" + t.integer "m_reply_id" + t.integer "is_comprehensive_evaluation" + t.integer "private", :default => 0 + t.integer "root_id" + end + + add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" + + create_table "kindeditor_assets", :force => true do |t| + t.string "asset" + t.integer "file_size" + t.string "file_type" + t.integer "owner_id" + t.string "asset_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "owner_type", :default => 0 + end + + create_table "member_roles", :force => true do |t| + t.integer "member_id", :null => false + t.integer "role_id", :null => false + t.integer "inherited_from" + t.integer "is_current", :default => 1 + end + + add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" + add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" + + create_table "members", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "project_id", :default => 0 + t.datetime "created_on" + t.boolean "mail_notification", :default => false, :null => false + t.integer "course_id", :default => -1 + t.integer "course_group_id", :default => 0 + t.integer "is_collect", :default => 1 + end + + add_index "members", ["course_id"], :name => "index_members_on_course_id" + add_index "members", ["project_id"], :name => "index_members_on_project_id" + add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true + add_index "members", ["user_id"], :name => "index_members_on_user_id" + + create_table "memo_messages", :force => true do |t| + t.integer "user_id" + t.integer "forum_id" + t.integer "memo_id" + t.string "memo_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" + add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" + + create_table "memos", :force => true do |t| + t.integer "forum_id", :null => false + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :null => false + t.integer "author_id", :null => false + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count", :default => 0 + t.integer "root_id" + end + + add_index "memos", ["root_id"], :name => "index_memos_on_root_id" + + create_table "message_alls", :force => true do |t| + t.integer "user_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" + add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" + + create_table "messages", :force => true do |t| + t.integer "board_id", :null => false + t.integer "parent_id" + t.string "subject", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "replies_count", :default => 0, :null => false + t.integer "last_reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.integer "quotes" + t.integer "status", :default => 0 + t.integer "root_id" + end + + add_index "messages", ["author_id"], :name => "index_messages_on_author_id" + add_index "messages", ["board_id"], :name => "messages_board_id" + add_index "messages", ["created_on"], :name => "index_messages_on_created_on" + add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" + add_index "messages", ["parent_id"], :name => "messages_parent_id" + add_index "messages", ["root_id"], :name => "index_messages_on_root_id" + + create_table "news", :force => true do |t| + t.integer "project_id" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" + t.text "description" + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.integer "comments_count", :default => 0, :null => false + t.integer "course_id" + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "contest_id" + end + + add_index "news", ["author_id"], :name => "index_news_on_author_id" + add_index "news", ["created_on"], :name => "index_news_on_created_on" + add_index "news", ["project_id"], :name => "news_project_id" + + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "notificationcomments", :force => true do |t| + t.string "notificationcommented_type" + t.integer "notificationcommented_id" + t.integer "author_id" + t.text "notificationcomments" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "open_id_authentication_associations", :force => true do |t| + t.integer "issued" + t.integer "lifetime" + t.string "handle" + t.string "assoc_type" + t.binary "server_url" + t.binary "secret" + end + + create_table "open_id_authentication_nonces", :force => true do |t| + t.integer "timestamp", :null => false + t.string "server_url" + t.string "salt", :null => false + end + + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "option_numbers", :force => true do |t| + t.integer "user_id" + t.integer "memo" + t.integer "messages_for_issues" + t.integer "issues_status" + t.integer "replay_for_message" + t.integer "replay_for_memo" + t.integer "follow" + t.integer "tread" + t.integer "praise_by_one" + t.integer "praise_by_two" + t.integer "praise_by_three" + t.integer "tread_by_one" + t.integer "tread_by_two" + t.integer "tread_by_three" + t.integer "changeset" + t.integer "document" + t.integer "attachment" + t.integer "issue_done_ratio" + t.integer "post_issue" + t.integer "score_type" + t.integer "total_score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + end + + create_table "org_activities", :force => true do |t| + t.integer "user_id" + t.integer "org_act_id" + t.string "org_act_type" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_courses", :force => true do |t| + t.integer "organization_id" + t.integer "course_id" + t.datetime "created_at" + end + + create_table "org_document_comments", :force => true do |t| + t.text "title" + t.text "content" + t.integer "organization_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "status", :default => 0 + t.integer "root_id" + end + + add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" + + create_table "org_member_roles", :force => true do |t| + t.integer "org_member_id" + t.integer "role_id" + end + + create_table "org_members", :force => true do |t| + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_messages", :force => true do |t| + t.integer "user_id" + t.integer "sender_id" + t.integer "organization_id" + t.string "message_type" + t.integer "message_id" + t.integer "viewed" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + end + + create_table "org_projects", :force => true do |t| + t.integer "organization_id" + t.integer "project_id" + t.datetime "created_at" + end + + create_table "org_subfield_messages", :force => true do |t| + t.integer "org_subfield_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_subfields", :force => true do |t| + t.integer "organization_id" + t.integer "priority" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 1 + end + + create_table "organizations", :force => true do |t| + t.string "name" + t.text "description" + t.integer "creator_id" + t.integer "home_id" + t.boolean "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "allow_guest_download", :default => true + t.integer "visits", :default => 0 + t.integer "show_mode", :default => 0 + t.integer "allow_teacher", :default => 0 + end + + create_table "phone_app_versions", :force => true do |t| + t.string "version" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_answers", :force => true do |t| + t.integer "poll_question_id" + t.text "answer_text" + t.integer "answer_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_questions", :force => true do |t| + t.string "question_title" + t.integer "question_type" + t.integer "is_necessary" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_number" + t.integer "max_choices", :default => 0 + t.integer "min_choices", :default => 0 + end + + create_table "poll_users", :force => true do |t| + t.integer "user_id" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_votes", :force => true do |t| + t.integer "user_id" + t.integer "poll_question_id" + t.integer "poll_answer_id" + t.text "vote_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "polls", :force => true do |t| + t.string "polls_name" + t.string "polls_type" + t.integer "polls_group_id" + t.integer "polls_status" + t.integer "user_id" + t.datetime "published_at" + t.datetime "closed_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "polls_description" + t.integer "show_result", :default => 1 + end + + create_table "praise_tread_caches", :force => true do |t| + t.integer "object_id", :null => false + t.string "object_type" + t.integer "praise_num" + t.integer "tread_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "praise_treads", :force => true do |t| + t.integer "user_id", :null => false + t.integer "praise_tread_object_id" + t.string "praise_tread_object_type" + t.integer "praise_or_tread" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "principal_activities", :force => true do |t| + t.integer "user_id" + t.integer "principal_id" + t.integer "principal_act_id" + t.string "principal_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "professional_levels", :force => true do |t| + t.string "level" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_infos", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_scores", :force => true do |t| + t.string "project_id" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 + t.datetime "commit_time" + t.integer "pull_request_num", :default => 0 + end + + create_table "project_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "project_id" + t.integer "project_type" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + end + + add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" + + create_table "projecting_softapplictions", :force => true do |t| + t.integer "user_id" + t.integer "softapplication_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "projects", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false + t.integer "parent_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "identifier" + t.integer "status", :default => 1, :null => false + t.integer "lft" + t.integer "rgt" + t.boolean "inherit_members", :default => false, :null => false + t.integer "project_type" + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 + t.integer "user_id" + t.integer "dts_test", :default => 0 + t.string "enterprise_name" + t.integer "organization_id" + t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "publish_resource", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + end + + add_index "projects", ["lft"], :name => "index_projects_on_lft" + add_index "projects", ["rgt"], :name => "index_projects_on_rgt" + + create_table "projects_trackers", :id => false, :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true + add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + + create_table "pull_requests", :force => true do |t| + t.integer "pull_request_id" + t.integer "gpid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + t.integer "project_id" + t.string "title" + end + + create_table "quality_analyses", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + + create_table "queries", :force => true do |t| + t.integer "project_id" + t.string "name", :default => "", :null => false + t.text "filters" + t.integer "user_id", :default => 0, :null => false + t.boolean "is_public", :default => false, :null => false + t.text "column_names" + t.text "sort_criteria" + t.string "group_by" + t.string "type" + end + + add_index "queries", ["project_id"], :name => "index_queries_on_project_id" + add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + + create_table "relative_memo_to_open_source_projects", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "relative_memos", :force => true do |t| + t.integer "osp_id" + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + t.string "username" + t.string "userhomeurl" + t.date "date_collected" + t.string "topic_resource" + end + + create_table "rep_statics", :force => true do |t| + t.integer "project_id" + t.integer "commits_num" + t.string "uname" + t.string "email" + t.integer "add" + t.integer "del" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "changeset" + end + + create_table "repositories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "url", :default => "", :null => false + t.string "login", :limit => 60, :default => "" + t.string "password", :default => "" + t.string "root_url", :default => "" + t.string "type" + t.string "path_encoding", :limit => 64 + t.string "log_encoding", :limit => 64 + t.text "extra_info" + t.string "identifier" + t.boolean "is_default", :default => false + t.boolean "hidden", :default => false + end + + add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + + create_table "roles", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "assignable", :default => true + t.integer "builtin", :default => 0, :null => false + t.text "permissions" + t.string "issues_visibility", :limit => 30, :default => "default", :null => false + end + + create_table "schools", :force => true do |t| + t.string "name" + t.string "province" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "logo_link" + t.string "pinyin" + t.integer "school_type", :default => 0 + end + + create_table "secdomains", :force => true do |t| + t.integer "sub_type" + t.string "subname" + t.integer "pid", :default => 0 + t.string "desc" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_cached_ratings", :force => true do |t| + t.integer "cacheable_id", :limit => 8 + t.string "cacheable_type" + t.float "avg", :null => false + t.integer "cnt", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_rates", :force => true do |t| + t.integer "rater_id", :limit => 8 + t.integer "rateable_id" + t.string "rateable_type" + t.float "stars", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "is_teacher_score", :default => 0 + end + + create_table "settings", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "value" + t.datetime "updated_on" + end + + add_index "settings", ["name"], :name => "index_settings_on_name" + + create_table "shares", :force => true do |t| + t.date "created_on" + t.string "url" + t.string "title" + t.integer "share_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + t.integer "user_id" + t.string "description" + end + + create_table "shield_activities", :force => true do |t| + t.string "container_type" + t.integer "container_id" + t.string "shield_type" + t.integer "shield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "shield_wechat_messages", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.integer "shield_id" + t.string "shield_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "softapplications", :force => true do |t| + t.string "name" + t.text "description" + t.integer "app_type_id" + t.string "app_type_name" + t.string "android_min_version_available" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "contest_id" + t.integer "softapplication_id" + t.integer "is_public" + t.string "application_developers" + t.string "deposit_project_url" + t.string "deposit_project" + t.integer "project_id" + end + + create_table "sonar_errors", :force => true do |t| + t.integer "project_id" + t.string "jenkins_job_name" + t.text "output" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "ssos", :force => true do |t| + t.integer "user_id" + t.string "openid" + t.string "name" + t.string "password" + t.string "email" + t.integer "sex" + t.string "school" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" + + create_table "student_work_projects", :force => true do |t| + t.integer "homework_common_id" + t.integer "student_work_id" + t.integer "project_id" + t.integer "user_id" + t.integer "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "course_id" + end + + add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" + add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" + add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" + add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" + + create_table "student_work_tests", :force => true do |t| + t.integer "student_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 + t.text "results" + t.text "src" + end + + add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" + + create_table "student_works", :force => true do |t| + t.string "name" + t.text "description", :limit => 2147483647 + t.integer "homework_common_id" + t.integer "user_id" + t.float "final_score" + t.float "teacher_score" + t.float "student_score" + t.float "teaching_asistant_score" + t.integer "project_id", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "late_penalty", :default => 0 + t.integer "absence_penalty", :default => 0 + t.float "system_score", :default => 0.0 + t.boolean "is_test", :default => false + t.integer "simi_id" + t.integer "simi_value" + t.float "work_score" + t.integer "work_status", :default => 0 + t.datetime "commit_time" + t.integer "is_delete", :default => 0 + t.integer "appeal_penalty", :default => 0 + end + + add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + + create_table "student_works_evaluation_distributions", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "student_works_scores", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "appeal_status", :default => 0 + t.boolean "is_hidden", :default => false + end + + add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" + add_index "student_works_scores", ["user_id"], :name => "user_id" + + create_table "student_works_scores_appeals", :force => true do |t| + t.integer "student_works_score_id" + t.integer "user_id" + t.text "comment" + t.integer "appeal_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "students_for_courses", :force => true do |t| + t.integer "student_id" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" + add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" + + create_table "sub_document_comments", :force => true do |t| + t.text "content" + t.text "title" + t.integer "sub_domain_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.integer "locked" + t.integer "sticky" + t.integer "org_subfield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "sub_domains", :force => true do |t| + t.integer "org_subfield_id" + t.integer "priority", :default => 0 + t.string "name" + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "subfield_subdomain_dirs", :force => true do |t| + t.integer "org_subfield_id" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "syllabus_members", :force => true do |t| + t.integer "rank" + t.integer "syllabus_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" + add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" + add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" + + create_table "syllabuses", :force => true do |t| + t.string "title" + t.text "description" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "eng_name" + t.integer "syllabus_type" + t.integer "credit" + t.integer "hours" + t.integer "theory_hours" + t.integer "practice_hours" + t.string "applicable_major" + t.string "pre_course" + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 + end + + add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" + + create_table "system_messages", :force => true do |t| + t.integer "user_id" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "description" + t.string "subject" + end + + create_table "taggings", :force => true do |t| + t.integer "tag_id" + t.integer "taggable_id" + t.string "taggable_type" + t.integer "tagger_id" + t.string "tagger_type" + t.string "context", :limit => 128 + t.datetime "created_at" + end + + add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" + add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" + + create_table "tags", :force => true do |t| + t.string "name" + end + + create_table "teachers", :force => true do |t| + t.string "tea_name" + t.string "location" + t.integer "couurse_time" + t.integer "course_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "extra" + end + + create_table "time_entries", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "issue_id" + t.float "hours", :null => false + t.string "comments" + t.integer "activity_id", :null => false + t.date "spent_on", :null => false + t.integer "tyear", :null => false + t.integer "tmonth", :null => false + t.integer "tweek", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" + add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" + add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" + add_index "time_entries", ["project_id"], :name => "time_entries_project_id" + add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" + + create_table "tokens", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "value", :limit => 40, :default => "", :null => false + t.datetime "created_on", :null => false + end + + add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" + add_index "tokens", ["value"], :name => "tokens_value", :unique => true + + create_table "trackers", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_in_chlog", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "is_in_roadmap", :default => true, :null => false + t.integer "fields_bits", :default => 0 + end + + create_table "user_actions", :force => true do |t| + t.integer "user_id" + t.string "action_type" + t.integer "action_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_activities", :force => true do |t| + t.string "act_type" + t.integer "act_id" + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" + + create_table "user_extensions", :force => true do |t| + t.integer "user_id", :null => false + t.date "birthday" + t.string "brief_introduction" + t.integer "gender" + t.string "location" + t.string "occupation" + t.integer "work_experience" + t.integer "zip_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "technical_title" + t.integer "identity" + t.string "student_id" + t.string "teacher_realname" + t.string "student_realname" + t.string "location_city" + t.integer "school_id" + t.string "description", :default => "" + end + + add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" + + create_table "user_feedback_messages", :force => true do |t| + t.integer "user_id" + t.integer "journals_for_message_id" + t.string "journals_for_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" + add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" + + create_table "user_grades", :force => true do |t| + t.integer "user_id", :null => false + t.integer "project_id", :null => false + t.float "grade", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" + add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" + add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" + + create_table "user_levels", :force => true do |t| + t.integer "user_id" + t.integer "level" + end + + create_table "user_preferences", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.text "others" + t.boolean "hide_mail", :default => false + t.string "time_zone" + end + + add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" + + create_table "user_score_details", :force => true do |t| + t.integer "current_user_id" + t.integer "target_user_id" + t.string "score_type" + t.string "score_action" + t.integer "user_id" + t.integer "old_score" + t.integer "new_score" + t.integer "current_user_level" + t.integer "target_user_level" + t.integer "score_changeable_obj_id" + t.string "score_changeable_obj_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_scores", :force => true do |t| + t.integer "user_id", :null => false + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "active" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "grade", :default => 0.0 + end + + add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" + add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" + add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" + + create_table "user_wechats", :force => true do |t| + t.integer "subscribe" + t.string "openid" + t.string "nickname" + t.integer "sex" + t.string "language" + t.string "city" + t.string "province" + t.string "country" + t.string "headimgurl" + t.string "subscribe_time" + t.string "unionid" + t.string "remark" + t.integer "groupid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "bindtype", :default => 0 + end + + create_table "users", :force => true do |t| + t.string "login", :default => "", :null => false + t.string "hashed_password", :limit => 40, :default => "", :null => false + t.string "firstname", :limit => 30, :default => "", :null => false + t.string "lastname", :default => "", :null => false + t.string "mail", :limit => 60, :default => "", :null => false + t.boolean "admin", :default => false, :null => false + t.integer "status", :default => 1, :null => false + t.datetime "last_login_on" + t.string "language", :limit => 5, :default => "" + t.integer "auth_source_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "type" + t.string "identity_url" + t.string "mail_notification", :default => "", :null => false + t.string "salt", :limit => 64 + t.integer "gid" + t.integer "visits", :default => 0 + t.integer "excellent_teacher", :default => 0 + t.integer "excellent_student", :default => 0 + end + + add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" + add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" + add_index "users", ["type"], :name => "index_users_on_type" + + create_table "versions", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :default => "", :null => false + t.string "description", :default => "" + t.date "effective_date" + t.datetime "created_on" + t.datetime "updated_on" + t.string "wiki_page_title" + t.string "status", :default => "open" + t.string "sharing", :default => "none", :null => false + t.integer "user_id" + end + + add_index "versions", ["project_id"], :name => "versions_project_id" + add_index "versions", ["sharing"], :name => "index_versions_on_sharing" + + create_table "visitors", :force => true do |t| + t.integer "user_id" + t.integer "master_id" + t.datetime "updated_on" + t.datetime "created_on" + end + + add_index "visitors", ["master_id"], :name => "index_visitors_master_id" + add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" + add_index "visitors", ["user_id"], :name => "index_visitors_user_id" + + create_table "watchers", :force => true do |t| + t.string "watchable_type", :default => "", :null => false + t.integer "watchable_id", :default => 0, :null => false + t.integer "user_id" + end + + add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" + add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" + add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" + + create_table "web_footer_companies", :force => true do |t| + t.string "name" + t.string "logo_size" + t.string "url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "web_footer_oranizers", :force => true do |t| + t.string "name" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "wechat_logs", :force => true do |t| + t.string "openid", :null => false + t.text "request_raw" + t.text "response_raw" + t.text "session_raw" + t.datetime "created_at", :null => false + end + + add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" + + create_table "wiki_content_versions", :force => true do |t| + t.integer "wiki_content_id", :null => false + t.integer "page_id", :null => false + t.integer "author_id" + t.binary "data", :limit => 2147483647 + t.string "compression", :limit => 6, :default => "" + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" + add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" + + create_table "wiki_contents", :force => true do |t| + t.integer "page_id", :null => false + t.integer "author_id" + t.text "text", :limit => 2147483647 + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" + add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" + + create_table "wiki_pages", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title", :null => false + t.datetime "created_on", :null => false + t.boolean "protected", :default => false, :null => false + t.integer "parent_id" + end + + add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" + add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" + add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" + + create_table "wiki_redirects", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title" + t.string "redirects_to" + t.datetime "created_on", :null => false + end + + add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" + add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" + + create_table "wikis", :force => true do |t| + t.integer "project_id", :null => false + t.string "start_page", :null => false + t.integer "status", :default => 1, :null => false + end + + add_index "wikis", ["project_id"], :name => "wikis_project_id" + + create_table "work_detail_groups", :force => true do |t| + t.integer "work_id" + t.integer "min_num" + t.integer "max_num" + t.boolean "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" + + create_table "work_detail_manuals", :force => true do |t| + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" + + create_table "workflows", :force => true do |t| + t.integer "tracker_id", :default => 0, :null => false + t.integer "old_status_id", :default => 0, :null => false + t.integer "new_status_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + t.boolean "assignee", :default => false, :null => false + t.boolean "author", :default => false, :null => false + t.string "type", :limit => 30 + t.string "field_name", :limit => 30 + t.string "rule", :limit => 30 + end + + add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" + add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" + add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" + add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" + + create_table "works", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "work_type" + t.integer "contest_id" + t.boolean "is_delete", :default => false + t.boolean "score_open", :default => false + t.boolean "is_open", :default => false + t.integer "work_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "online_evaluation", :default => false + t.boolean "score_valid", :default => true + end + + add_index "works", ["contest_id"], :name => "index_works_on_contest_id" + add_index "works", ["user_id"], :name => "index_works_on_user_id" + + create_table "works_categories", :force => true do |t| + t.string "category" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "zip_packs", :force => true do |t| + t.integer "user_id" + t.integer "homework_id" + t.string "file_digest" + t.string "file_path" + t.integer "pack_times", :default => 1 + t.integer "pack_size", :default => 0 + t.text "file_digests" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + +end From 3cad78a9919d218a47efc62e2cf3bd1f90d00246 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 17 Feb 2017 10:09:10 +0800 Subject: [PATCH 021/118] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=88=E4=BD=9C?= =?UTF-8?q?=E4=BC=99=E4=BC=B4=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/cooperation/index.html.erb | 6 ++++++ public/images/footer_logo/p-nju.png | Bin 0 -> 23288 bytes public/images/footer_logo/p-xtu.png | Bin 0 -> 25616 bytes 3 files changed, 6 insertions(+) create mode 100644 public/images/footer_logo/p-nju.png create mode 100644 public/images/footer_logo/p-xtu.png diff --git a/app/views/cooperation/index.html.erb b/app/views/cooperation/index.html.erb index c3a102788..2a3a7a430 100644 --- a/app/views/cooperation/index.html.erb +++ b/app/views/cooperation/index.html.erb @@ -34,6 +34,12 @@
  • ucloud
  • +
  • + 南京大学 +
  • +
  • + 湘潭大学 +
  • diff --git a/public/images/footer_logo/p-nju.png b/public/images/footer_logo/p-nju.png new file mode 100644 index 0000000000000000000000000000000000000000..42f7ab686f4e1fe62b994e472f29cfa9b3bf072d GIT binary patch literal 23288 zcmeI4bySqw*Z3boLJ<{^l#npcVdxkEDJkhjau|k&A%>QaPys0^kq`-y4nbNFLAp~y zknRpie~)_a)yutK)_1Mn`~LGTX2Hztv(Mh=IiIu7KIc4ZJ>#b!Cvo;PU)-smIn1K(Ow(+&X65P$#20G`K^1HfrnQ&CX`1rrn+WoLr2rjrsC zrL(q08JSuj0l;Y>PT5f-Y@1YYWE*)-O{9M%FUsNpK+lkgSASkJ@%&Q&?sJ|&^HWXL#;0n*K43XJxubJ$?_=bk08GHT zhlP=-?#nmtQiUt(09`0BN>4O>1|viXsAo~BCjsiofn4P`hNppW0I+brFG3Hbp9K~+ zqy$d^{b^xCWI%u7r8GPs5Ce$5Cc%g)R0im)K2W-eSyc@rWD3!P}LOC5_PwegQPg3 zozih_WpwQFShYo-2%PNtc_aJ@`q-!#24cx+ESXjU0HECIcz?)yJ7jul;>(oLw8ip9 zZQ`N%3W{Fv^6JQ8`4dcR;JjSh@_^ptWG|L=9Y(HwrFohbFrWsQjO^%e4B{u;JKgTG z6X49dFGLgnQlXxo`qJq$XBL?ZURJP<2MB)S_<|Y@aNh#8hl4IFfX#EE=&Y(F?*kjS zl|!~t&~y{F2%FXRG{a$?ug5{q^^P&lJnfqo{Z}>oiWTT(>zqrJLd7mOM2r#5da$q3 zMjqgYIi3YFAIewBy~QnTvZ!)j!oUn5)aY~ogxuF5PbklX0_Tl6*`2omAgppHSm*`@ z&=QqA4glpdX}S8`r88c19EL2C5VGUwS!WXD5v>P&5Psi@R z?_Vy#7XBb#5vv>1UZ~_XEv5g*1iKD2=Q$nE$VBrF$^sez&$o%G9d~E!(SVzO5W=&A zjnL@HC%E>LM|br7G$^msks>BFxYUBV5Y!qx4i~Aa;^E79jFBuOT*%v#*eNgAMWPeZ62T4s8QUM zO$!F$$Gp)MzE82zt(RNRwz@*FAh#iTy=GZPS?*ap115U5I(-S^Uk$O~TpX4v9_6jigPox#iyF4q6^oPCV`q z3JW$~#7c7rV#fTLX>rGj&zIL1noLSVYfO?lq>`={Us-x&JkI4rCTNt2x@3^a`58H6 z&JQ;*WgkqgNv@rEcfBRt{JBwSM?n|5xw-!4P-cH-!$J^WPpo-7{N1PW!TmtrlsmDt z(gEB7b&&&+_nS^d%0_NyK2sA^b5`3_>&ukt)tG!a?)!?)zCAS96-r71CXPQ|kSs)f-iam?diyt^W z`g&(IiU>{2h`;DJQPW=|;5TlEIc@QrBX;7sN+cSQJvo$ELN+zq+7$1|ugRqua-Y}t z8BtXJ?MZJs5d|o@{A8+?EH&|(PmHhpop*_WiHdne#nSvwr{dHiws?ncxry$YJd_u= z|Hy$auXMvXl;UX#!@8`RSnub|wof*nAbjDm;ju|dXH6puZuGGhT`Q6|x^W}y?1b}_ zWg}JCqsHwCh8?^0!HX8YG95_;O4$m8q%zRgH=MM{wVaA2DYADJ&{~j^ zcV|k9=nXG*&WN<|h9;}*je8}Ci|`0T)n&7&9xXKwX0iyqOzX_o*Joa<@9>) zZ#r8J41AU@YFwO`oKK#&%G}nh%#p4z6Ygn$xNhle&4u z9k)%Z&LywmU`hk3(#k3K;bI9#`P%qk*A!RWtvk!}W@wbfP)=oKKE9*MklP&J`<8;nIQ18 zVtM9CQXI7|wZyxkZ|=)%;|TjYu3+`}gt%)0t2+~3VdJTWsqt}gw*|VRhn%-%_M^>p z6m=?$Mcd+UlcASniuAS{);~`N>#USpZ_sZW3^Enn%@W8KkZ`v?_#&C3g_=ihH!Z63 zXQMY{=Wlf^cX{lZRrT2QeeGk>dEs2K{BeP*$m+`QrDCSi&94qyi)4t+sPV^Fh`>443NgARs!_PWtH@FriKFa>Rhs{ zveu$V6H`eSTcom!oC?Cl9KmNue_QZ0zY`2}V2MP->6|Prtn6S;0`x!p!ocs}i=p&% zKdPY31?YvpH%O-;t3W4;vPIHyv2a5WtlT_wJbWx{Ts%CSJU8jsS=qRttQ=4dRtP%> zjFT0{$xipji(c?F_>JGz&(Vf<{}zpioCgM;1p87L=_ql#P#%56a38 zWoL(gH6V7*R%o~r#LAB0r;|VZh#~C|wx-r-Q z-f=)$p&9<|A`B6K`LVXQwfMou5CKJ6AT2=?JMiM!{`C^9|2%*EW&XFz_)GmCdyh6X z`ZYLzv;D65k7h_G)Bj-hUGvlIM=1OpA$~CaV4}82I2vWEfna5Pd7wB&)XvP0OoRoJ*;Ts$y#)*Gz6Fjm&zocyeL z#D^>x`-X5d{J-(?x4K9DpbSlooc}8?ziR&7hpa42%E}H6w?ZJL#00^52o7!p7blX7jmL=VM<@So{twq;D1`m@KmuL=ocM+) z1nB;+@PHxNc{$lQ4LKo3oa|f>HZ~+T#DIg19fIWLAd=LX}Rt|`v0XH`r(!j`o56<~#6aV7o zA5BS`+JVvJ{9BZPvGybLC?jqDUizoP!t_T5v4-2)A-_*d0s22@=3go2uZ;5D=Enqw z!4cnck09cE_#zGYp?@p=byufkt#^8d;~ zq9_ZLtt`qADagSO{kP(OwF2+EDg3Q(8sD>qh5e8EJnXFC3(EHW{SVXM)kjS=k2n2Yebn@qrK*)F zT9EyZ){YeaX7zm~hW&u53~m~cf?(H<79FjvVCsal&=4~P*9yDuIggza?9>mVqndxU z)cj@ncf;Qle;EFZr{DH=KN7{yQgG)8Zd###?OOklL;gy&|C3*S_2_@n>k(fkjT`}T zym*4^cs@t8C%BFPIbJ-$bv&OV+7nzyfE+KL;5weq5$y@CBS4N9PjDU2=ZN+M*AXDc zizm2_=W|4Rg6jy7j;qJ#S>h|^EskD!F2@4@!|=t13za0z@8NV=JdgbOP>J%8S1HCtvCQ&oRJa} zR&g3w(00@&=^GFn+{^b(QJ)i+G?Sf|C*vaK+4m+;tg}C!t8dO!v4m zfWG1ly5AT1U>MnC5w~+l4&~{?#$8Kal? zlsGxQrOyR%k!{uXX&d%4O^0%X}HlA+dKTpyqf1QVD_XTF$y}sHW@Hu{#Y_rQ* zx=G9KdW7!?0nc!~FyC4)`EidIPJA!v13j#p50f+e0Ki7ot|nfh;$YUg%wch^BI)*} z`$A00*9S@PFmrh`g^d-YNvi3ESDVJ3+%mNNd9J`!@_|4^G&QZNdRDE!DjJ5w94--xtM!+6a zBhmkf|G)wz0E9|YZbXl)hq1|T-|ht;%20N5g)*&F?AmkY=|{s>zNX!GXMSOhN`K0% zN|Yj(WISknQyXGxk*<_Tv>LpsilX|Xkk%_jhb~S$Ljs5h}uKeoGM)4`%-I@(Vqgri##*Irju)~&5 z#OhpFz(W>tZbY9k01yRY1FVj3XL`bChJB_6Y}``MZNv#GWOPO{MeMecOTG&8Q%NN4 zB>hNA!r!!g4xfCrR+4};N!64~+FnO@xE_jSgMA60gRmx^=Y*NZg&GocPsHRqdn>BGe+2%J9n}%to+o+bTGB`$3v@CCthZJoUXxbj0q4(`Sm@}cX7}%P9we^a&y-YmKPw1xgr^7Z6-Kk?J| zxNz(zQkP@#8|b1X(@hkwF-ZeL!8Z$Dk7cQ8qFtm$8xuwxeI=+}%mzoSEWf%$GR;@? zG(DC6;3)W7CI|d^BEP{YSoPuuni3tx4`Vh)a#J%ez}cF1CERK^>VwGs8=AQErnH^0 z&ZrjE7NlPaLM_<$Y;MULzPd>BailrphQvb|#y24Sy%nuOZ5{HMHcp;2$(#g|GuH_G zqu)g5%QlR%HHI~DG6$AY+ip2_T;uvoT#kVQPKz@JYh`ISWa@OeL z6$q3 z)J%|Xwu_Fl!2nx?7(VcIY|VCL77LYmcqgMXNSo#vnhB$DC@`hE6)(<(VKVBXdV7A8 zbzfkI){0npuGm*bPI``oi*a{HLi1wG>lPmj3RN?(61g$5?^-j)Ki0eNFq@$1KAcAG z#+c5^ecO7{gbF$+C>oogtFGy+;cIyih^T7`XlCNL-XW2wU-97MODf2QgeWe9eY>6y zfq>U;WDQy6xZ-S2X^|W`&iZGu4|C1wVO=Bn&T2EUp0ywJ;)637tC;6$HJ@zB36|sc!TA7FV`ileqVw`(p@`dK+-qJ?Hu+TJ#bwhq5nK1k zv3F!3vX~lBICw=_(e2R)5XB8?GJxS}cdiu|sKOzC5L(l;YRaR$HTCVj`EVfo@}Zut z)~C2Si)<34Z>6)%R!M>4X#j8EY$H)Qz!j#ht;GUVxqDVbhn2LE(6;GA14XEvSJLM3 zc%miMqO{C=`X~c)H_SGc>`gAw1kmAi6TaVd6lK(QRb~!od~5Knu4^n8R!I2Z!Uj_4 zOx%OMI*X23CWa{7{F|D+ZdrCT#xL}&Ndaream#*So(olpuSTP`Ol^!vTcKJ?U)0s2 z23Hhq2i{pTk-5!@r%|<8_E|dJPr0QLK@xhpw(!)p;B!Tf;JN)JkEXBy?MG!yI%T-belIb+b3-%{tBaj3Rx3TCM{L8HmosPTE~7(=3#Z zz3XO)bE;;f#ZAJ&)zgZa%iD9-*s-LY{>)-MsPs!Xe4mG{sen-qd!WZ>;0^>CLvJx( zL3mJc*_NZ5aCl@bCaWmx@d(;rt^=`|Iy1B+txNCAtN$DdB)rW1vYT$+6RkSJzu#-z z=sCj>3T8<{T^^eIMBpkauJ0qs00y`4V*9N*=h0^2nZ6zS{*1MWe8MwXeU#+ASh8{A49|@A9jTl@X6r7yOJ%FmtwCoe?! zubVNO6KG#B{IbjKE^HLiK*0V$2Eg;8lXSe4zaW9?M5V%QG;Y!EHRI-BMLwz0XLZTK z2&hfey*^x^#l6;Ke#2<_#VzDu_lV=8jLA7c@3>M@e$=Ln-u$BJZAW;L%eZ1KCG?hpm~h;u?Auwc6Sg?7G~W#NpEyt|tX z#WC;NJk(7^q^6(XY!`jL#p~kX=3bFiw8(R=*Ee?mk{gpoF zZ?hA?1Q@-2YB9m`BB65t;9XZARPRzS{(jz-BC8OR#`Dx;(CI3axv!=g8yMwor0)Fy z?m!Tx3_|Dq@l(uSEX>r1`jeLUmEhxeOI5}-%0r^?7y&>M=cTivAhtUK7yvl|j(2TwAbJlQZ+Jdxac*sH0T(9i`*gH$ zoP8;oN!x#U!H7A4GS|sTQTuXRs5-e;Rlec3NlS34Vh-uwgT=-=sO0p>kMP+|tX0Vp z&eJa5f1EwJ(@I|dRh|6Q(~Lr9Nc`7$)9!0r7hGv-PCh&n1TEbIha4Duj+iq^ zSDx1w80u|*WfF=7^a^UXjk3iwQh}R)xL+}xK%tkYHeG49*|fEmrYH|=ciY!7Z7Wo~NNq`sKuZ&>1O^ATHAv1QbiEiRfR zyhl?=KeNtpcL}uv`C`i-|5$<`*Ec35;q}Wm+o#PQ(HuHea=xsAv?G)kwk^!%Qo~q{ zCCLVjO)Pf7J#(a0q>0321G4T4ZLj%;x6#h29BMMhD_e)#+c+&W&3RwQ)%gxDkXO1J zbiYgm_mVgPQYG=6X3nF**KgsrQPYp{^i1}OEVlauhHXvwtnIEaEA2Q4ZtZirYZ}ZJ zFJD170)%HP?s*0_6Tss~BTg3jUwk_GAT zv?g#Q?7GhSA_u$N*W%c6-^^jX+Ocw8{V?|CZkhhND}3IvY(FX@tVoVY$xk!*bL=x0 zm7I>UK=e0ouQ|hhA(Lll#CAI@ulXv@iI zNO#znM|8D`*PzUq0}bM51S;_=u%s7D@UF_q@uXl+{^K9;Mak* z8=KDd3b(|PiQ1%CFaVlEa&fkoG6U=>0S;z%W};XQA8@_~52hFdNpQ$e9KJaB?M2Hu z3r~)v2q|kK9K<4pjbAsv7D|!> zvv_4-zkYZ7HxleDO2m}m)`CfRN?FRt!h3MPWX7kWr_kqEFr9nq19K+F1MG&0pcD4ZzZtyM!N_P0}`GoI2bQxx#*l~NN^vo zcubNg{fdYbU!Pox0G>-RYq2%+Mly1b8_z~mP z1{e=yMmO1%3z!oe9?M(>4{Z@LcV2}7RVLwP%DC~mNn|8vWNylU%L;f-2~%w;9Cz^H z7>F6VoaS$i^7lu?-BaI5uO6!PvaGc-H}O8p8X=`9t%^r5E`^bf*}X4k))kVXZr1o4_;C1-57fT+QR*$M3eHJMTuz-~*xKYQtNTGt}3KeqX zi#dpPbH0E#G)A13?d;^w_+x`75B=wC9my{`YltpX;!9KoezWo_PTw)8=UbLK5Ww8S z1i+kp9!mz<1!hgWC*ZJTQ#(%ND?;1qm~^C`6(Ic!Q#U7>$m$8!MoUCrEytQp89sEU zk)?KWi31Nv(YIn;aa=WvHNoWodh^0z{@NUP#A-cc;gr;ncn~dw{M)-cEY_ZtQ^$7(&be>0L9_2fI%W zU2euTwO`|WKmQTejmxOpKcSeT4LsSV9!WSf<4kofJ^AsDC*O03nk7xRZP^}?>ZEuG( z*3CP6u=|0#K1!Sjjwuav9geQI+PV3&Gab73B(VVf=N#J;K9Nk}+Pe22z#9P|WX5o# zCO6N#Zg|+bjHRfzcH|=ULtSG9DOD9xRoq#bMcEII{O#!lqGSX~`6eTRpW8Khoh)}E z-ah2U3HDT(*625q1QOf{ZV3_G2@I~m-C@w6gAA@ASa45phY%zJ!QCxrkl?|COMu{S z=bU?waPQ^2RquO$yeg&&W_qt)t9So;b@%EuwdbXRoCNyqySD)VK$nsfRRZ6)!9RKw zMDV}7)@&g7hH5LR=>PzCaDV+F0Ex*&0B~E@Ttq}c;Ta4Lb9e@`rIZp8p|rJ!nVMUf z0D#MQin6mt%pn0}=FkLFO?Yhk!z-)j05we^N(Yu^CRQ{6^~1suZ1oSit%iq>oh+%^ z;yZj>G9_p(oxZ|MC^$$fL{*1-lVUROlc(F(#>UC$NzHQd@@cPYAEpmB&b_FmObdWV z$)AsRj3Po_vZb@u2N7R#7MT)jsk_PSMl09{Bv%(N_f~1Z6Fo^tXw^Wse!lX!1@m<$PHjDKW35; z7|SHhM*+eRfCPF8T13HWz(Do6(qqJiCLp~~keU&>p%}qOvy4>&(WmwX;1sSAi799R z_#_BF?g1#d5djf$+|NjqGDzvngY~od`nLWRk_bRUciiV!PY2oXD&qR@I`3}J&QZ-Z zS$z)x?YT0(zN~I`Ks?NAMobTSOI~4I}s4>pyKw*G< zgIw9IPu*4xUYiJrAs8BiPJp1-9z*EeJ5d0Z89S@%AppeGA4Ld0LI6I$%AN;+niV3Q zH?f2=Z72XBn*RLZd!busjd+C(7|D%fH4TJ_(3_%yXtWJ{Si(0Kd`NF+5XB1-t2FSA zA%A+0bT=J4@f%iYBMUeB@+^+d^EF$-n+8OwO++;TsK`PcD7a86-XLtl@GwMe5cL`)tH~VT&kTNt#^-dpw>n9l_(si4IEE;M3q536|LB9~F_l zAUXU zDs@N7QgT9)AzL{cGKgiKEOT!y(z(JG=^Y>IJ#jtNvGmmMgcuFMogW!x;@d0R2U~q#-@AC9ykk9#J_lQ-VzH zjiFZw9V*PDtRx9$uQ6Z4R5czRJoLbi>cWZRjZ=&Bid%lGqUxY3FzovFj!JKB57;e0aH>U_@PUL|Lx2!%dH{j56uGv8w)^p64l;^_gBSt>^5ZNyz4#9hRIv!6Jjum#Uhw}_4Tc$$mzSc~fhWY1+CAUh4aE7$UkH>p- z--wruKP-H$22pcW+gBSclp4`ld%R{nqHd)?qMn47#GBMz_NFMQsKqJCdIoO}FXF-A zgMDS2ahCPd_1o)->o+%e4xk5g2i6CDWId!fWFt@DPdx15jy+CRwl!ZHk{uhw6tdiYyC z3r=JilSn#soB6kderz9V%-QwKr{pE&HSI+%GwC_$Y3iNSlFOGQ-%A}~w(gi{(VngC zb~oUK@S7a>en*0|K@ij2(gN#p>!@e=>u9`2yb`=_ou-~VIqp7-_*wtWb(dgA?uG$E zBf=s=?en|OOOPy)D3BA7b8d0m2)j{zlL-xiFN}tYu1R4Z18X4MB{?!;n>2fzIDp@U zl7g>Aa?IRwPlkL1J3OEdWd_R&mU|@gy{8N%XjZ~1sDi?rIDzoU6Ys%8*0+qSilxeM zJNV(_k-`Pd6SLazorwI<$|n;RW%f>Hg%(yyRz~Yd6+RVjE1tUq{uJAJg#*W>McsJ0 z&@$G-|8m{|aoH-7EqNhPB_3{6yf~RzNx1aAw>#CDPm@D4(u3RoHO{M#0*fywg%y~H zOKFSssQcag*db{#Iz969Vw z;9L323}lrm6)Rv6$S}QmpR_a$Q$E}A>D z)b(Q31T-PagwBjCx=K~XF6P^Vp54#7KgORa%xNg8?pnA`?uIM97|h8LdE~3k9+w~6 z*=5%t;-BxuE0*Te<@AR=_Fb*V$ET&syEfJ& z*Rt1a3J*2w-$~b62o3iKY@-*E?1U|n=vzxq!!z70_QOAye(w5=!~x~l(C#TKoY>9a z%sOyO@z(8DJ1Z(Eulss$e58KL*?kY=1sVR6>8;rHnoo~h)GcepJojw|H+`of?i!L* z)h~HXRY*9?x28t8=eXZG5ZhX_fWxdN-__TDM737p3?rB1wOvf|fsH3^Bszbx)q050 zB(&IgeE#IB?Hb!3)Q5%>bmdQr_>1`^yll_DNxsvDt(hElZ>aMX!+*%GJsH><@;nBNw~jGay-UwO zm^4_={xoPX=xf%*+`>Q&Og)di7z+G0DA6M^Oe0Pc7Lh_hL4tm_cGtK!=3Cy!Jlwu6 zFSQHTHHU)bnX|c*r+pfyW7~I*Li*~9UGw+sw+iy#@wU^nQ`Gdj^6%uH7WGbeZdGhm z&9v82B+#DRg^~)bZmOai-nGXH-PUr^H*Z_c++FV5gt|2SKYXq}qgc`#P zO&DFQZNV@U0Qdx4Y@tS$CU8na6Ekxge(J62dTL5@V}5FN4q0YdTM?6I=8|sqCdzJd zDn@RWMm)yU0+8E$F1(-tYZEw>(#6`!#(~#`pZYhuyx`|wmzk(3f2#twDlR6EhnV8#4nd8!tOEFFPycKVH<3 z+u$cYdt*~xB~kHzGzXUWsh`2&w!BPC&d$z^&TNb@dov~$9v&VhW>zLvRtB&JgM+IL z9O}Yg<3RJfk$>6|HE}SqH@AhG!)z#j*@YUy9O3-b)V~_~wl~102gxt@8lmn`?n1`sJPmiFe#Zhz#Q$3OvIc_Y~VEi z?k0?l{;*@~Xm9l!A7djX6Dt#IP{jefd6s{B3%36}fBd2Tx7+wb{2zM{H#hxraQ>$I zOY$GpOkB+WgW502?`prf!tW!*2l^kch`k9E4zpK*!K@&^d)c3-C-Cs}%d05q)y-{; zVa^T@_?RxM{5jr#S~C%a!c8EcCKm%UD+3Fs3JWJM2iGHJZeC{QzgYOa+9d8!otqRY{2DmthW=vgUmB9P2SZ{T zsMTNU{OXG_*cb=Y(9nq8(3F9jna!Ai)tDXZ5SuY80|yT)2MaSZ3p)!3=RceHH)j5& zDM@n&(1~3C;#{DM{kGsJo7nyR>OTcm=D#f*worQqlV9_ZpZcE@@{g6~kA>uy&TsRY z7i#ot$$=RC@>&yPKBm82{qwf|(ENv*`M(b5e}~|A`+rgY&uutAGqL%PUjMtD->Up) z3l1<-xHHt=M92(ukN;*i{%-Z}YM0IPG5uPft<3))jDiEy>HlsF{<|sl|Nj{L>AyzL zpf+YE#t^1|y6!(O{CC6l`(XZkPW^M9{_7m%GdAKih1pv};Sh6csF?|qt&JHU)1Mdr zY?JTL)kg$o1+$lh8Jj@Z_?Z6P<$tRMCfXE!&$B@slq7^HrNl%yS$H@(8CV%v{%Yng z_5Nb#*RIA3t}~$9Lw}p!pw7QsyIf!6*Lq>)_*;E0R%YuNriq}RAE0lB((jq7SYm!#LYE&;i^ zc#Z37K9{7|xGn*?x_FK2YCe~w*SIbLxw?3b>uNriq}RAE0lB((jq7SYm!#LYE&;i^ zc#Z37K9{7|xGn*?x_FK2YCe~w*SIbLxw?3b>uNriq}RAE0lB((jq7SYm!#LYE&;i^ zc#Z37K9{7|xGn*?x_FK2YCe~w*SIbLxw?3b>uNriq}RAE0lB((jq7SYm!#LYE&;i^ zc#Z37K9{7|xGn*?x_FK2YCe~w*SIbLxw?3b>uNriq}RAE0lB((jq7SYm!#LYE&;i^ zcqOjee?ItWVgo+y=?p&B8R3$x06r2*X(Xv63jl6(0O0ci0FExe_wNAU$P56h2H?}A zuK|D%7OmeZ4geIGQldgCF5~OE&K`Kf2LeM*Ww5e)UuEytMj{KNkfo{!nGcF)2L+8` zRrmScz*pckL{NN8UmL8H?Jp>dh>D6eDD|=P-h_Kf!VCpcRKyJ&kNU$ocOLK0y>gq= zm3t`;^~>(PwL(Mz&o6G@;U+~BLkONjMDWe*H@UEQH)^Dw=>0oH_5cvRb`Z z+6l<9%u?>zEx5oL8n6>W(B)=wMh0ErAi_fa*0FeTo|db_7~3pln|$_0AVvGfm~Se@ zJ5>zwFE>`|Egbbdrz$-2YG7#?RNj1eoaWSAw4y|~xcl28 zQ9~4u6YFOuzkDYyfXoH>otnY&jv6AyJx^%O%?EpA#4hT}y%x(Sw8Kd`lDmeH>RcRDXCB=VeTjNtiBI48G8s~|xWZBfL&z&BK{$rZW|-I4Z%4VJ z2>lrUK@6~OOuU;aVRG2-iYC+_N#nz3wfC!$56^llO@v!S%vEMT)$S+Rf{yC+8v_G;VZ8LU)szpTN$zTWun2SNn@)z6Z8x!#tsplO^)Bqt&>Ve()+a=rsjca@ zq{yCN>bQMZJ>YihE%aL^WMQ{vtm=PnU46dr-KQA=$W|f-JN-@h{ybu%x9uqt-;T=K zPRu%s#9h%!{>&C+=PWfW+>{TyG~uNV56H*nT0@@jq~BSFv_(m~+i0|VeL3@JiF8)u za7iy8PA47H=WtQzcn|G*jzpXP044m<@j=wVI+e6!B=}!WZkIUhV_|Ar$x*;iCA}1m zp<+kSHx%Fax?}mzKX-^CCZ=C?EkEHmwQ4>f`?#)Gqdhxu+`W_8p1QpP7vg9Apj~l7 zCL4>@7bX3me4=19DTI;!7CL-HS3qD5yM8!vcWDhAACb+3(1`f_&7(lj+2oaR<+Hwz zrStR7I4uU(z$lP~&gXur7wW|PY;uS$Rq=8mTHJ9-bR^fkvuJPPS@k?`)8jVIP~}FK zI|W{kn;*Z;WJ#YHCmY((dn2>2Bq2yP&J!k^OQsHXFTd&3eVDDus#+Q$@E~~Fm@JXx z4e{7N%Mr-Q)|P%s98g(izyI}?89beWUH7E*RbccW23-!v`q)>eDrmdhf$>q`qs_TZ z`iQ_Yho|NVeWs7JPs2a0voiCfANlDoukSLKzq?35SGTQm@`f0P!~NdIp?aZ~^1-p8v$DgavOECz z;sQP)evKDI_G^pabX$*81)bG!{L6%~>#kYPlD~PC_jW2R#|_{yArmLXDU0c}&U^x& zVB`u<$$p-kb~j@?{~0a3Wx!2a3meUdewE1{KdsYaaf8nHO~>hXOb26Dk?F6q8Hb|$ zrwWZdJbYof&CdW~-khsR@E-x=|x&Y0dATPKPzd+^{xyiW9CZ<~Kp zVjtHhQvQ3PVX6_t3{p=mX&eyphBUQDOSc4%K4RV&P<+Y67ZKt&=jZ1q);EZ!dbmhX zKYTAZVyo`QSxHQue<%_87yhCY-QWZ+b; zFd42cgm-$}!xd5VU7;^ij}K|pi+S)f)f@f;+tyeqmXiM6sGj13wYXMfMDmngJ;ly` z_-8XN`$xJyHt$r6HSbGF#UFMe02{^pxtVtWEEY%mpRt{>-KyZ&n0b00@8*C2^=A+w z2!8SE1O*RhT>~zf?kFv@|P@?gwaa{$KVhLH~BYp1m=PhWh$eF zkc*bqql@;b`GdA)Bp`Smn0-^6uTiNreP1GVsM@BR3-p!D<({hZ4Yl#LocxBgw~_ib zFH_k1HyxOVm^&;E9SI$t-notlcfM zzU32&-z_2@zCurd&Yc1-m>1K!6&i5E4(6wJFLNsV^3;%gs`K-4n{s0i$IZ%!?DyQf zK9U1(1&(@L7-#epi8;M=z;2_->bvX`n^_mpL+V!N(O2CiK2Up4z0!U=0*f>`l=eK4 z4cFPM($oL+O&PG|u;`OZN-fzZfy&7A)Ko%3#IVS8cLus5qiCqflgB+)?khLCYC63; zIFudaFS2s+&bv!o$qRo9V~7(GdD2LwX}eAXJoVc77=}NvS|;`?I1D4fG_Ldlibz! z8z{(7+_tAxc{n(o38?0lZ%KN&62P z(TQ_x3ACM^>eFsqvv5Sg?S6L)E-&aq?yd5#8ZTct8f~{62gbuRQ^G)q{zWy<)S73m#1C9wvnuft!HL(GA8Twd7>KXxe-w&dtfi za*ZJYt@Ee#&lTCsC{f-DI3^yPkf{y>k-H;F2!TU-il~5IEySZM`?agXqtRmJ2$HoC zi+6S9?ADzVa|_0h1NHiQ&nY%kRkM|-y1V8A1J~qJqYu~I z2}RT^y^sI{53e8V3E=&eny79y{lxw@^0C`bgKxGUA)Nh<$JandeH+CH;wjIsCn>l* zDcJp~OQv1(ia)+10g!@E>z}y9cI;~FkAhK=@0M*y>K`C1+9LqcSfw+V0Jwok+uOW{ zB;Lf!;M40`qidN<8mMA%YCNrZ8B=8PiZ1`bfP?9%_0hN)tL9V28<-T*U5iV5{u}va z58RDd#OnNy z4+}6CJ+JYOV!I85lpchTDC@^ErQr6@s$^oZk?kEiaVMOiSp?l12@l$+r)_ z^2Xxxc#~IIc|6oN;j0d8-wiuf&eNplwzQZhgcRLnM*$S(FmThI`XCarVJo@CuRa*M z4nAT+KRq%ySPDDsKoPOg0}luRH6`?c6-G0sPPepGf((e-=08wpZS2Mk8MSd*&3w(+ zf$`eD2ltFug!N=#2#t+r{DAR+)^_ZSg?07p_{RwQEeieJrl+pB)xJ#!2#GnK2f@-( zS`U3QNb}KvQ_d$R>z?<(AD8q^C&d9y3GOhXxyziK`A|X#(ovdNaXCrx?%xA^v9FG48( zfDa(-UJLZAC26r=ye#8dbwbdY<_XuqKoLGUYb#k!#2~eTY#U9KPra(cb=&GVh|oUG z^k09BZOgmJQ;Xn3ayRkQ&d^@TvRa{*Q4f=(3p9$GWhZ>YFO<}#&K8>xMbvHwXo!*$ zLq&~kcR<>d&Y|Vtfq$V_w5OIY`i}S`C2ZGaBAjisFq@A&?Q74Sp;-?IHZAmdZ?H6) zEP{_j9unRSWQ{M>+`ZwD`}9F3_YjiK0z_I-N2>2o(?nk!1%LOTs>X@(6d7kJny_9R zwXd5(1jP0Tnejg77FMoeDJo^|=$!lCPgBHLk&vX_6ldsmvI$%&Std#(XcI*eTw`hv zN%JHJ{OmrkL_h{hVf9p85rpF(?y3i5f?NBW^942_$bIR-L3WL^(_jIUt|u&iXT7op zH3sw@EMAN3LgxeP@t3bTi}qU{gf37LS%8t)`A^)bZ!|=&9!bl*$9p9?sN`O#J!Sr) zsTbv$4!uFt!>x&Bwb)zh81-Lef<#kC)Z(SGkQ>PrY`C=NWFE%(Nv;fh0)TXSfcd$P zx;M>gX02YabgQ2D!#FP1=2p6mLf8Jy@#d(TFLCD9%Fi2m%fJPHy%cM||Ak{xy~WvL z#rZ-$XYRLwPm?G&y)JAtiqvQHZv*rZ?Waa7ltF#Z zN_A^Z>ufW;)-WFr$?Dg|hB0Y|cs%3n`leE>xy+V8QnvAItn39%Oh716F*)1uNT_EL z716lmeBSX;C0$?b7#P#U_ZfR0ykurPSlCuPj=6uP_J}0hIiGZcHC1b){=2gG;yWE2 ztQObW^U=KTn3O~TIDXm_3&U%Q7=epaUIk%A_XCm|gqcYJ`tk`gP6zMhgB3xaA;?|p zI$IXw7F(d=U_jc=Ug^TK`m0Ki#Ap*bIyyNgUgHkceQzo7hHFz7H@(rGC4~+5z8F+O z5X2&jt2CtxS>lvi9QbZCLovP#=1o4u(1;WECh4Dbnt2s)xcuz*sxH5%TY-4&W_!6i zwJ~YYcW<_0V(v|>qfa?w z4Z~i<8N{7gRN4!AkFSZ@CKu%zwWl=w7 zRjuWfWQ;DrS2Ma4wizJKxqZx5Gu=pH#|<9A=x<>(h*9IUyWah5y*rUDjLqgO*E7ij zVA*mjL>n)c3zW1FriQ%c{pwgNG|q-QzfD$wFY@UUTzTyE45xdyj1eDQQ-c6lX0#XYnqoji~P& zM0^ZI<*8QuUQK4~(n`w3jIMoCU(kT*5rVXVj{efD+%_}TTkB4M?TGFzU?Q#nn0@=s zOiZwAzDTRSQN>n|ZS#EQBDtijIOToNYt9>lsG5VMZYA~%U_7IZx+c3)5QlVYav$aW z+T3`I{LvwiZwCM9J1Sa3BQFHtbZG$Yy7J@%lbZg`Vn>v= zGC~w?)&~IE>32$i5~Yctu9c6M%l`NUnk*H4n;!FQgI;J~{dS9Tw(vlyb3JpJ_V#=I zlF9XBTPdw-=}hpLc;;lowXk?2$GN`t@T`D0Vq)q**olC=V;PeVKHK%=>D{s|926$lDHR_o&8=wrP`d05$6`BHEibz6~R*_ zB}xCei~R%Q`WY=Pg7XHyi_y{CX0N+qsvk}I5cBUc$z*fZ>JavrC2MUxMRvcC?{a&y7L4~8^JFOP=&FI1H{MIKE2X+ zuuKAcc3pZ18O1-pp8jg1&*o)S&;MljaAp*hB8;2orOJb9KKQK^gm5R?D z`M!QOzHABE&MH)w2ajaK^P8wXky=n;NcW_eOIq7TN!P7Sw-E}*B6tlBC4YG|DVO42xt({h~@6=RY zv$0S@C&xSMSl8Edf#Xr(eY_)?;y4Os^**1khA?8Ca%tvGKWo#{Qe*cP>OGtR16%Eg zG%FrA@VM}#T<_QMPu&x#xxY}0@ck2JNE%iMf{@GIPsepEzAJCE-*FM@g7Gc>{rfl8 z58g%yY;bz(o!kir*V&E37<(SdAc?%@8^Skh zYfwZyCYferM6aZ<4Eph{e&51sdNTdql` zdO}=UY(v{?kIx6we{7EPpP-rb(jOlPDP;dxR7W@KeR~rVF<@YGOtsP?%=DCd{;NZq z!_mi7{?MZv3=-kDs~rn8Y6%E$+eN)`+Ed>YFIqJGuxQ8vW>`8pK5|VDQV3)mw_|}x zvQK%2i>qMnD|C4`%+)N1pA{Pq!Dl3^{)=a&7>_Yl*S9a;)p4lEScn1wmc=zNjJEk< zkK;wMI(bsv9yoW3Y8+r!_ps)~}egv0_i|EST7p zU3r5|FQihaK_?}9^r#zp9_ZV|8RGVn%H+Z;Z|e-{jEE2=yY}Py;$l@AX1AN!qg$9b zZ7ro6UHG<@J^o@#nRm)|?dw~c;+;RL{TM@(khK=SbqK+`PZtnMs&}??pP}6gHHkSj zPc4fm;0`iMz;O=&HGPMoE}1Pi7GB&z*KO`!>Ej?}CE89YucRWIJ@wTS@et+ctmPhI zspx}>EVIuGZ&gqN#6BlBMoB#=Cn3B|s;a8@0s)Jbo`#Gl*KU~+Duc$v7wXstMwZ=R zkfciVGYXqDA+|t8YEbE}*I4)+P% zvDe;^oz`WVT-l?~`jy3_G151)}*XR{17h+qt(dNgy%;012V9 zZxiABROK`TCQZ-*qCimvJS@?1nv(r7yRLa5sb~h=bkcAzhbFUp=W8NuXx}IqzY}=e zr8R$mjVTxAek@i0S&!M>W^D&|um>$5mnad3ju!m>W&V)uIlzb&6oZ4SuL1X5J1lAs z4@9FFp_`b>$$9L>Z#C!FBth}+V$&S}kg;3aU*h0ea9M-Fc)=FQ*)5&mz8I6k;8eCp zrqh!x>UubIEhKw)cJIki#RY>|9aF+%=P&D{#bSKiVFyQ6>fH!HBMU*lUM)El3RI@_ z!z`bB4kfR&=gjL>^t79#ayF7EPj?U+%vix3P$M!TAjl&+p*8|3@rS+!XFoWz*NMGE zUB+5ahbg?9iYcn0c*7%jB8n)%RP@p(9^aJjeM;r-%-z94H2Xl#d#vX!W->JGX@$;? z=o78;x#C1bBJ9WNK0@^iTs&I2Ag+Za)U2$^#>Vi~#Lzg3+{a$cSwpIYdQXE|*QXEw zVXThNO_(;%-tgsd$&&>eXb`4vO=nUhq=4t-`Qj=6J#wx^Li*!F-1~Hyq^w4*y8@G_ z$@Z1tbTAensBg7*-I-9Iab+?bUzqWW+u#z}B;MGp{T6diy!W-<>H1!8)tX*bC#*#C zY4@`<{c##Lw@n%_;|rb*yh2*xbqe5Ddva1X{9eLX_z$F>7U$7^eq9<0`8Jgb^kjK$h=9wTwy01Y+i zY0?F~v>O>o=p!`Lv0165`8st+2R*E}iWitQ|AHn$2sZD7^9K6KG4oYyeSH<8TaG+Z z#fwP$(+ZUAvX#VUNaddv$iKUff7^A-N{Q+gFupwRZ|=v!f)I#=i-H`5UD_uhX_BoI zzHR97V{ra1iz6YtwaNlJb~a{J?qlcezcYH867>tQ!iYHF*pPtOk^{}gIU%A zNLrp$J2GO1(Pqx1jhq6O04pMmRNL0FgeVF%%@`_zkfN6ck$?=6x2xsQ1;f|PzR+El zq=QY4)JKBMcnYy3q&;^~sYHD3AZZ6jd_`{MYHQZ!8I$B)%Q5@w*sO*>b=OILFmX8% zcFIA@oHuEk;liXBwFpzDV2ChuBuXvlB7z?!w~!E+i~OECl1c~HJ(w}R b-~!qU@Ue^nT_%71w6c_#oM^GIf$#qTF$(f> literal 0 HcmV?d00001 From 49c6b3be12324ce6d60bdd7c71cd635ae0137973 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 17 Feb 2017 10:32:27 +0800 Subject: [PATCH 022/118] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=9A=84=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E6=B5=8B=E9=AA=8C=EF=BC=8C=E8=BF=9B=E5=85=A5=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=A1=AB?= =?UTF-8?q?=E5=86=99=E6=97=A5=E6=9C=9F=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=B9=9F?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=8F=90=E4=BA=A4=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_exercise_submit.html.erb | 5 ++++- app/views/exercise/_show_head.html.erb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/exercise/_exercise_submit.html.erb b/app/views/exercise/_exercise_submit.html.erb index 02a5b7b2c..720cc0432 100644 --- a/app/views/exercise/_exercise_submit.html.erb +++ b/app/views/exercise/_exercise_submit.html.erb @@ -20,7 +20,10 @@ var question_form = $("form.new_exercise_question"); if($("#polls_head_edit").is(":visible")){ alert("请先保存测验标题及测验基本信息。"); - } else if(question_form.length > 0) { + } else if($("#show_exercise_time").html().trim() == ""){ + notice_box("请先设置测验的截止时间"); + } + else if(question_form.length > 0) { alert("请先保存正在编辑的题目。"); } else{ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'exercise_submit_info', locals: { :exercise => exercise}) %>'); diff --git a/app/views/exercise/_show_head.html.erb b/app/views/exercise/_show_head.html.erb index 4cc5a6cf8..6c05d8d5e 100644 --- a/app/views/exercise/_show_head.html.erb +++ b/app/views/exercise/_show_head.html.erb @@ -6,7 +6,7 @@ <% unless exercise.publish_time.nil? %> 发布时间:<%=Time.parse(h(exercise.publish_time)).strftime("%Y-%m-%d %H:%M:%S") if exercise.publish_time%> <% end %> - 截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") if exercise.end_time %> + 截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") if exercise.end_time %> <% if exercise.time != -1 %> 测验时长:<%= exercise.time %>分钟 <% end %> From b81d9b86c49ead820887ed4c272ee6cc966dcf66 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 17 Feb 2017 15:00:14 +0800 Subject: [PATCH 023/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2=EF=BC=8C=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9C=E6=9B=B4=E6=8D=A2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E2=80=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 35 +++++++++ app/helpers/courses_helper.rb | 8 ++ app/views/courses/change_manager.js.erb | 1 + .../courses/search_course_teacher_list.js.erb | 1 + .../courses/settings/_change_manager.html.erb | 76 +++++++++++++++++++ .../courses/settings/_course_member.html.erb | 12 ++- .../settings/_search_teacher_list.html.erb | 12 +++ config/routes.rb | 2 + 8 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 app/views/courses/change_manager.js.erb create mode 100644 app/views/courses/search_course_teacher_list.js.erb create mode 100644 app/views/courses/settings/_change_manager.html.erb create mode 100644 app/views/courses/settings/_search_teacher_list.html.erb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index d84649ce2..3682a6959 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -354,6 +354,41 @@ class CoursesController < ApplicationController #search_group_members group end + def change_manager + if params[:chooseteacher] + man_member = Member.where(:course_id => @course.id, :user_id => @course.tea_id).first + cha_member = Member.find params[:chooseteacher] + if man_member && cha_member + cha_member.member_roles.where("role_id = 9 || role_id = 7").first.update_attributes(:role_id => 3, :is_current => 1) + if cha_member.member_roles.where("role_id = 10").count > 0 + cha_member.member_roles.where("role_id = 10").first.destroy + StudentsForCourse.where(:course_id => @course.id, :student_id => cha_member.user_id).destroy_all + end + @course.update_attributes(:tea_id => cha_member.user_id) + man_member.member_roles.first.update_attributes(:role_id => 9) + course_act = CourseActivity.where(:course_id => @course.id, :course_act_id => @course.id, :course_act_type => 'Course').first + course_act.update_column('user_id', cha_member.user_id) + UserActivity.where(:act_id => @course.id, :container_type => 'Course', :act_type => 'Course', :container_id => @course.id).first.update_column('user_id', cha_member.user_id) + end + end + end + + def search_course_teacher_list + q = params[:search] ? "#{params[:search].strip}" : "" + @members = searchTeacherAndAssistantNoManager(@course) + if q.nil? || q == "" + else + members = [] + @members.each do |m| + username = m.user[:lastname].to_s.downcase + m.user[:firstname].to_s.downcase + if m && m.user && (m.user[:login].to_s.downcase.include?(q) || m.user[:mail].to_s.downcase.include?(q) || username.include?(q)) + members << m + end + end + @members = members + end + end + #查找未分班的学生 def search_not_group_member @group = CourseGroup.find params[:group_id] diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 63b0c2c27..559160d60 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -257,6 +257,14 @@ module CoursesHelper count.to_s << '+' end + def searchTeacherAndAssistantNoManager course + members = [] + course.members.includes(:user).each do |m| + members << m if m && m.user && m.user != course.teacher && m.user.has_teacher_role(course) + end + members + end + # ===================================================================================== # return people list def searchTeacherAndAssistant project diff --git a/app/views/courses/change_manager.js.erb b/app/views/courses/change_manager.js.erb new file mode 100644 index 000000000..83124fa7b --- /dev/null +++ b/app/views/courses/change_manager.js.erb @@ -0,0 +1 @@ +window.location.href = "<%= settings_course_path(@course.id, :tab => 'member') %>"; \ No newline at end of file diff --git a/app/views/courses/search_course_teacher_list.js.erb b/app/views/courses/search_course_teacher_list.js.erb new file mode 100644 index 000000000..34d2543a3 --- /dev/null +++ b/app/views/courses/search_course_teacher_list.js.erb @@ -0,0 +1 @@ +$("#search_member_list").html("<%= escape_javascript(render :partial => 'courses/settings/search_teacher_list', :locals => {:members => @members}) %>"); diff --git a/app/views/courses/settings/_change_manager.html.erb b/app/views/courses/settings/_change_manager.html.erb new file mode 100644 index 000000000..d6d78485d --- /dev/null +++ b/app/views/courses/settings/_change_manager.html.erb @@ -0,0 +1,76 @@ +
    +
    +

    更换管理员

    + +
    +
    +
    +
    +
    + 选择的成员将会成为新的管理员,您的角色将变更为“教师” +
    +
    + +
    + <%= form_tag(change_manager_course_path(@course), method: 'post', :remote => true, :class => "",:id => "change_manager_form") do %> +
    + <%=render :partial => 'courses/settings/search_teacher_list', :locals => {:members => nil} %> +
    + <% end %> +
    +
    +
    +
    + + + 确定 + 取消 +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/app/views/courses/settings/_course_member.html.erb b/app/views/courses/settings/_course_member.html.erb index a0ce3724b..b2712645e 100644 --- a/app/views/courses/settings/_course_member.html.erb +++ b/app/views/courses/settings/_course_member.html.erb @@ -59,12 +59,16 @@ <% end %> - <% unless member.user == @course.teacher %> + <% if member.user == @course.teacher %> + <% if User.current == @course.teacher %> + 更换管理员 + <% end %> + <% else %> 编辑 删除 - <% end %> + <% end %> <% end %> @@ -87,4 +91,8 @@ $('#delete_member_' + id).show(); $(div).hide(); } + function change_manager(){ + var htmlvalue = "<%= escape_javascript(render :partial => 'courses/settings/change_manager') %>"; + pop_box_new(htmlvalue, 424, 366); + } \ No newline at end of file diff --git a/app/views/courses/settings/_search_teacher_list.html.erb b/app/views/courses/settings/_search_teacher_list.html.erb new file mode 100644 index 000000000..bcfa8da14 --- /dev/null +++ b/app/views/courses/settings/_search_teacher_list.html.erb @@ -0,0 +1,12 @@ +
      + <% unless members.nil? || members.empty? %> + <% members.each do |mem| %> +
    • + + <%=mem.user.show_name %>(<%= mem.user.login %>) +
    • + <% end %> + <% end %> +
    + +
    \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index b679c9b1b..30d3e442c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1362,6 +1362,8 @@ RedmineApp::Application.routes.draw do get "switch_role" get 'search_not_group_member' post 'add_members' + get 'search_course_teacher_list' + post 'change_manager' get 'delete_member' get 'archive_course' get 'set_invite_code_halt' From 24f766d0a5f19c54784ec4cb0f699e0f41c43a58 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 17 Feb 2017 16:19:49 +0800 Subject: [PATCH 024/118] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=8F=91=E9=80=81=E5=BE=AE=E4=BF=A1=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index b0a1e971f..b5b405d02 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -370,6 +370,9 @@ class CoursesController < ApplicationController course_act = CourseActivity.where(:course_id => @course.id, :course_act_id => @course.id, :course_act_type => 'Course').first course_act.update_column('user_id', cha_member.user_id) UserActivity.where(:act_id => @course.id, :container_type => 'Course', :act_type => 'Course', :container_id => @course.id).first.update_column('user_id', cha_member.user_id) + ws = WechatService.new + title = "您已成为班级管理员" + ws.create_class_notice cha_member.user_id, "create_course_notice", @course.id,title, @course.name, man_member.user.show_name, @course.members.count, "点击查看班级详情。" end end end From de7b29c26038333659597357610c3c34d5ac7a04 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 17 Feb 2017 16:33:01 +0800 Subject: [PATCH 025/118] =?UTF-8?q?=E4=BB=8E=E8=AF=BE=E7=A8=8B=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=BF=9B=E5=85=A5=E7=9A=84=E6=96=B0=E5=BB=BA=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E9=A1=B5=E9=9D=A2=EF=BC=8C=E7=8F=AD=E7=BA=A7=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=9C=AA=E8=87=AA=E5=8A=A8=E6=B7=BB=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 7a9e72d0d..41fec1fa0 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -28,7 +28,7 @@
  • - +
  • @@ -116,10 +116,15 @@ $("#new_term").change(function(){ document.getElementById("new_end_term").options[document.getElementById("new_term").selectedIndex].selected = true; }); + <% unless @syllabus.nil? %> + $("#new_course_name").val('<%= @syllabus.title %>'); + $("#new_course_name").focus(); + <% end %> }); function change_course_name(){ if($("#new_syllabus_id").val() != '0') { $("#new_course_name").val($("#new_syllabus_id").find("option:selected").text()); + $("#new_course_name").focus(); } } \ No newline at end of file From c6ae00c6bed4e459581cebd854a3e0407d2dd4c4 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 17 Feb 2017 18:54:15 +0800 Subject: [PATCH 026/118] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E9=87=8D=E5=A4=8D=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 1 + app/models/students_for_course.rb | 4 +- ...70217104309_delete_excess_student_works.rb | 23 ++++++++ db/schema.rb | 53 ++++++++++++++----- 4 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20170217104309_delete_excess_student_works.rb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index d5511cb44..7d6539e8d 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -150,6 +150,7 @@ class HomeworkCommonController < ApplicationController end elsif @homework.publish_time <= Date.today && homework_detail_manual.comment_status == 0 homework_detail_manual.comment_status = 1 + create_works_list @homework status = true #更新CourseHomeworkStatistics中每个学生的未交作品数 @homework.course.student.each do |student| diff --git a/app/models/students_for_course.rb b/app/models/students_for_course.rb index 5ef2922b0..ec35642cb 100644 --- a/app/models/students_for_course.rb +++ b/app/models/students_for_course.rb @@ -31,7 +31,7 @@ class StudentsForCourse < ActiveRecord::Base #加入班级时创建已发布作业的作品 def create_student_works course = self.course - course.homework_commons.each do |hw| + course.homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status > 0").each do |hw| if hw.homework_type != 3 && hw.student_works.where("user_id = #{self.student_id}").count == 0 hw.student_works << StudentWork.new(:user_id => self.student_id, :name => hw.name.to_s+"的作品提交", :work_status => 0) end @@ -39,7 +39,7 @@ class StudentsForCourse < ActiveRecord::Base end #加入班级时创建一条记录 - def create_course_homework_statistic + def create_course_homework_statisticd if CourseHomeworkStatistics.where(:user_id => self.student_id, :course_id => self.course_id).count == 0 course = self.course user = self.student diff --git a/db/migrate/20170217104309_delete_excess_student_works.rb b/db/migrate/20170217104309_delete_excess_student_works.rb new file mode 100644 index 000000000..d4cee6f7d --- /dev/null +++ b/db/migrate/20170217104309_delete_excess_student_works.rb @@ -0,0 +1,23 @@ +class DeleteExcessStudentWorks < ActiveRecord::Migration + def up + homework = HomeworkCommon.where(:id => 4818) + unless homework.empty? + homework = homework.first + homework.course.student.each do |student| + student_works = homework.student_works.where(:user_id => student.student_id).reorder("created_at asc") + if student_works.count > 1 + if student_works.first.work_status != 0 + student_works.last.destroy + elsif student_works.last.work_status != 0 + student_works.first.destroy + else + student_works.first.destroy + end + end + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index ec969b8c3..6b7ab2ef1 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 => 20170217004513) do +ActiveRecord::Schema.define(:version => 20170217104309) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -521,6 +521,13 @@ ActiveRecord::Schema.define(:version => 20170217004513) do add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" + create_table "contest_notifications", :force => true do |t| + t.text "title" + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "contestant_for_contests", :force => true do |t| t.integer "student_id" t.integer "contest_id" @@ -588,6 +595,37 @@ ActiveRecord::Schema.define(:version => 20170217004513) do add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" + create_table "contesting_projects", :force => true do |t| + t.integer "project_id" + t.string "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contesting_softapplications", :force => true do |t| + t.integer "softapplication_id" + t.integer "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contestnotifications", :force => true do |t| + t.integer "contest_id" + t.string "title" + t.string "summary" + t.text "description" + t.integer "author_id" + t.integer "notificationcomments_count" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "contests", :force => true do |t| t.integer "user_id" t.string "name" @@ -1154,19 +1192,6 @@ ActiveRecord::Schema.define(:version => 20170217004513) do t.datetime "updated_at", :null => false end - create_table "ii", :force => true do |t| - t.integer "project_id" - t.string "author_login" - t.string "rep_identifier" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sonar_version", :default => 0 - t.string "path" - t.string "branch" - t.string "language" - t.string "sonar_name" - end - create_table "innodb_monitor", :id => false, :force => true do |t| t.integer "a" end From 78614e18cac0c87c8d2190ddcf4391f46985465b Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 17 Feb 2017 19:01:53 +0800 Subject: [PATCH 027/118] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/students_for_course.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/students_for_course.rb b/app/models/students_for_course.rb index ec35642cb..f3e0cb530 100644 --- a/app/models/students_for_course.rb +++ b/app/models/students_for_course.rb @@ -39,7 +39,7 @@ class StudentsForCourse < ActiveRecord::Base end #加入班级时创建一条记录 - def create_course_homework_statisticd + def create_course_homework_statistic if CourseHomeworkStatistics.where(:user_id => self.student_id, :course_id => self.course_id).count == 0 course = self.course user = self.student From d4eb4c0d56bf933f70db239651d176d282a1ae70 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 17 Feb 2017 19:29:00 +0800 Subject: [PATCH 028/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascripts/training_tasks.js.coffee | 3 + .../stylesheets/training_tasks.css.scss | 3 + app/controllers/training_tasks_controller.rb | 1011 +++++++++++++++++ app/helpers/training_tasks_helper.rb | 2 + app/models/project.rb | 1 + app/models/training_task.rb | 4 + app/views/layouts/_base_project_top.html.erb | 6 + app/views/training_tasks/_form.html.erb | 55 + app/views/training_tasks/new.html.erb | 27 + config/locales/projects/zh.yml | 4 +- config/routes.rb | 12 + config/settings.yml | 1 + .../20170217092541_create_training_tasks.rb | 12 + ...7092859_add_author_id_to_training_tasks.rb | 6 + db/schema.rb | 188 +-- lib/redmine.rb | 5 + .../training_tasks_controller_spec.rb | 5 + spec/factories/training_tasks.rb | 9 + spec/models/training_task_spec.rb | 5 + 19 files changed, 1293 insertions(+), 66 deletions(-) create mode 100644 app/assets/javascripts/training_tasks.js.coffee create mode 100644 app/assets/stylesheets/training_tasks.css.scss create mode 100644 app/controllers/training_tasks_controller.rb create mode 100644 app/helpers/training_tasks_helper.rb create mode 100644 app/models/training_task.rb create mode 100644 app/views/training_tasks/_form.html.erb create mode 100644 app/views/training_tasks/new.html.erb create mode 100644 db/migrate/20170217092541_create_training_tasks.rb create mode 100644 db/migrate/20170217092859_add_author_id_to_training_tasks.rb create mode 100644 spec/controllers/training_tasks_controller_spec.rb create mode 100644 spec/factories/training_tasks.rb create mode 100644 spec/models/training_task_spec.rb diff --git a/app/assets/javascripts/training_tasks.js.coffee b/app/assets/javascripts/training_tasks.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/training_tasks.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/training_tasks.css.scss b/app/assets/stylesheets/training_tasks.css.scss new file mode 100644 index 000000000..8a97abb85 --- /dev/null +++ b/app/assets/stylesheets/training_tasks.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the training_tasks controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb new file mode 100644 index 000000000..7b9485d1c --- /dev/null +++ b/app/controllers/training_tasks_controller.rb @@ -0,0 +1,1011 @@ +# encoding: utf-8 +class TrainingTasksController < ApplicationController + + layout 'base_projects'#Added by young + default_search_scope :issues + + before_filter :authorize1, :only => [:show] + before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org] + before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] + before_filter :find_project, :only => [:new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete] + #before_filter :authorize, :except => [:index, :show] + # before_filter :authorize, :except => [:new, :index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits, :commit_for_issue, :issue_commit_delete] + before_filter :allow_manager, :only => [] + before_filter :allow_members, :only => [:new, :create] + + before_filter :find_optional_project, :only => [:index] + before_filter :check_for_default_issue_status, :only => [:new, :create] + before_filter :build_new_issue_from_params, :only => [:new, :create, :update_form] + accept_rss_auth :index, :show + accept_api_auth :index, :show, :create, :update, :destroy + + rescue_from Query::StatementInvalid, :with => :query_statement_invalid + + helper :journals + helper :projects + include ProjectsHelper + helper :custom_fields + include CustomFieldsHelper + helper :issue_relations + include IssueRelationsHelper + helper :watchers + include WatchersHelper + helper :attachments + include AttachmentsHelper + helper :queries + include QueriesHelper + helper :repositories + include RepositoriesHelper + helper :sort + include SortHelper + include IssuesHelper + helper :timelog + include Redmine::Export::PDF + helper :project_score + include ApplicationHelper + + # issue和代码提交id关联模块 --> over + # 获取某个项目的commit_ids + def issue_commits + begin + return render_404 if @project.gpid.nil? + @issue_commit_ids = (params[:issue_commit_ids].is_a?(Array) ? params[:issue_commit_ids] : params[:issue_commit_ids].split(",")) unless params[:issue_commit_ids].nil? + search = params[:search].to_s.strip + @type = params[:type] + limit = 15 + g = Gitlab.client + g_project = g.project(@project.gpid) + rev = params[:branch].nil? ? g_project.default_branch : params[:branch] + @project_branches = g.branches(@project.gpid) + @branch_names = @project_branches.map{|b| b.name} + @default_branch = g_project.default_branch + # 搜索的分页需要单独处理,因为搜索不容易获取总数 + if search.present? + @commits = g.commits(@project.gpid, ref_name:rev, :search => search) + @commits_count = @commits.count + @commits_pages = Paginator.new @commits_count, limit, params['page'] || 1 + @offset ||= @commits_pages.offset + @commits = paginateHelper @commits,limit + else + @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev, :search => search) + @commits_count = g.user_static(@project.gpid, :rev => rev).count + @commits_pages = Redmine::Pagination::Paginator.new @commits_count, limit, params[:page] + end + rescue Exception => e + puts e + end + end + + # 选择对应的Commit + def commit_for_issue + history_commit_ids = params[:issue_for_commit_ids].split(",") unless params[:issue_for_commit_ids].nil? + @issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq + end + + def issue_commit_delete + commit_id = params[:commit_id].split(",") + issue_commit_ids = params[:issue_commit_ids] + # issue_id存在则为issue详情或者编辑的时候,否则为新建Issue + # 编辑和详情的时候需要在数据库中删除记录,新建的时候在内存中删除 + if params[:issue_id] + commit_issue = CommitIssues.where(:commit_id => commit_id, :issue_id => params[:issue_id], :project_id => @project.id).first + commit_issue.delete if commit_issue + end + @issue_commit_ids = issue_commit_ids - commit_id + end + # over + + def index + # 顶部导航 + @project_menu_type = 2 + # 为了性能所有用了两种模式,issue的@query查询所有的没有优势 + # 但是对过滤条件很有有时 + if params[:set_filter] != "1" + @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' + if User.current.member_of?(@project) + @issues_filter = Issue.where(:project_id => @project.id).order('updated_on desc') + else + @issues_filter = Issue.where(:project_id => @project.id, :is_private => 0).order('updated_on desc') + end + open_and_close_num(@project) + @issue_count = @issues_filter.count + @limit = 10 + @is_remote = true + @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 + @offset ||= @issue_pages.offset + @issues = paginateHelper @issues_filter, @limit + respond_to do |format| + format.js + format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young + format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')} + format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls" + send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + } + end + else + retrieve_query + sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) + sort_update(@query.sortable_columns) + @query.sort_criteria = sort_criteria.to_a + @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' + if @query.valid? + @tracker_id = params[:tracker_id] + @assign_to_id = params[:assigned_to_id] + @author_id = params[:author_id] + @priority_id = params[:priority_id] + @status_id = params[:status_id] + @subject = params[:subject] + @done_ratio = params[:done_ratio] + @fixed_version_id = params[:fixed_version_id] + @issue_count = @query.issue_count + @test = params[:test] + @project_sort = 'issues.updated_on desc' + + if params[:test] != "0" + case @test + when "1" + @project_sort = 'issues.created_on desc' + when "2" + @project_sort = 'issues.created_on asc' + when "3" + @project_sort = 'issues.updated_on desc' + when "4" + @project_sort = 'issues.updated_on asc' + end + end + open_and_close_num(@project) + @issues_filter_assign_count = @query.issues.select{|issue| issue.assigned_to_id == User.current.id }.count + @issues_filter_author_count = @query.issues.select{|issue| issue.author_id == User.current.id }.count + @issues_filter = @query.issues(:order => @project_sort) + @limit = 10 + @is_remote = true + @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 + @offset ||= @issue_pages.offset + @issues = paginateHelper @issues_filter, @limit + respond_to do |format| + format.js + format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young + format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')} + # format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json} + format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") } + format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') } + format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') } + format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls" + send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) + } + end + else + respond_to do |format| + format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young + format.any(:atom, :csv, :pdf) { render(:nothing => true) } + format.api { render_validation_errors(@query) } + format.js + end + end + end + rescue ActiveRecord::RecordNotFound + render_404 + end + + # 获取issue的开启统计数 + def open_and_close_num project + if User.current.member_of?(project) + @issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6)").count + @issue_close_count = Issue.where(:project_id => project.id, :status_id => 5 ).count + else + @issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6) and is_private = 0").count + @issue_close_count = Issue.where(:project_id => project.id, :status_id => 5, :is_private => 0).count + end + end + + def show + # 顶部导航 + @project_menu_type = 2 + # 打开编辑内容 + @is_edit = true unless params[:edit].nil? + # 当前用户查看指派给他的缺陷消息,则设置消息为已读 + query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first + query.update_attribute(:viewed, true) unless query.nil? + # issue 关联的commit + commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) + @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} + # issue 新建的at消息 + User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!} + # 回复的at消息 + @issue.journals.each do |j| + User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!} + end + + # 缺陷状态消息更新 + query_journals_ids = @issue.journals.map{|journal| journal.id} + if query_journals_ids.length > 0 + query_journals = ForgeMessage.where("user_id =? and forge_message_type =? and forge_message_id in (#{query_journals_ids.join(",")})", User.current.id, "Journal") + query_journals.update_all(:viewed => true) + end + + @jour_reply = Journal.new + @journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id desc").all + @journals = get_no_children_comments_all @journals + @journals.each_with_index {|j,i| j.indice = i+1} + @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) + @journals.reverse! if User.current.wants_comments_in_reverse_order? + + @changesets = @issue.changesets.visible.all + @changesets.reverse! if User.current.wants_comments_in_reverse_order? + + @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } + @allowed_statuses = @issue.new_statuses_allowed_to(User.current) + @edit_allowed = User.current.allowed_to?(:edit_issues, @project) + @priorities = IssuePriority.active + @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) + + @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young + @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq + @journal = Journal.new(:journalized => @issue) + + respond_to do |format| + format.html { + retrieve_previous_and_next_issue_ids + render :template => 'issues/show', :layout => @project_base_tag#by young + } + format.js + format.api + format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' } + format.pdf { + pdf = issue_to_pdf(@issue, :journals => @journals) + send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") ) + } + end + end + + # Add a new issue + # The new issue will be created from an existing one if copy_from parameter is given + def new + # 顶部导航 + @project_menu_type = 11 + @training_task = TrainingTask.new + respond_to do |format| + format.html { render :action => 'new', :layout => 'base_projects' } + end + end + + # 用户发布新issue + def create + @training_task.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) + # 给该issue在它所在的项目中所有的issues中所在的位置给一个序号 + if @training_task.save + # senduser = User.find(params[:issue][:assigned_to_id]) + # issue_id = @issue.id + # issue_title = params[:training_task][:subject] + # priority_id = params[:issue][:priority_id] + + # ps = ProjectsService.new + # if senduser.id != User.current.id + # ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id + # end + # call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) + respond_to do |format| + format.html { + render_attachment_warning_if_needed(@issue) + #flash[:notice] = l(:label_successful_create) + #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("#{@issue.subject}", issue_path(@issue), :title => @issue.subject)) + #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject)) + if params[:continue] + attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} + redirect_to new_project_issue_url(@issue.project, :issue => attrs) + else + redirect_to issue_url(@issue.id) + end + } + format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) } + end + return + else + respond_to do |format| + format.html { render :action => 'new' } + format.api { render_validation_errors(@issue) } + end + end + end + + def edit + # 修改实例变量的值 + return unless update_issue_from_params + # issue 关联的commit + commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) + @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} + + respond_to do |format| + format.html {render :layout => 'base_projects' }#added by young + format.xml { } + end + end + + # 用户编辑更改issue + def update + # params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0 + # params[:fixed_version_id] = nil if params[:fixed_version_id].to_i == 0 + if params[:issue_detail] + issue = Issue.find(params[:id]) + issue = update_user_issue_detail(issue, params) + @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 + @issue.fixed_version_id = nil if @issue.fixed_version_id == 0 + saved = false + begin + @saved = @issue.save_issue_with_child_records(params, @time_entry) + rescue ActiveRecord::StaleObjectError + @conflict = true + if params[:last_journal_id] + @conflict_journals = @issue.journals_after(params[:last_journal_id]).all + @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) + end + end + end + if @saved + # 更新commit关联情况 + update_issue_commit params[:commit_ids] + #修改界面增加跟踪者 + watcherlist = @issue.watcher_users + select_users = [] + if params[:issue] + if params[:issue][:watcher_user_ids] + params[:issue][:watcher_user_ids].each do |user_id| + select_users << User.find(user_id) + end + end + end + select_users.each do |user| + if watcherlist.include? user + else + @issue.add_watcher user + end + end + watcherlist.each do |user| + if select_users.include? user + else + @issue.remove_watcher user + end + end + + render_attachment_warning_if_needed(@issue) + reply_id = params[:reference_user_id].to_i + if reply_id > 0 + JournalReply.add_reply(@issue.current_journal.id, reply_id, User.current.id) + end + #flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record? 去掉这个notice,因为现在更新都是ajax操作 + respond_to do |format| + format.js + format.html { redirect_to issue_url(@issue.id) } + format.api { render_api_ok } + end + else + respond_to do |format| + + format.js + format.html { render :action => 'edit' } + format.api { render_validation_errors(@issue) } + end + end + end + + # 保存issue的时候相关的commit操作 + # commit_ids => "9b9845ff,poor56el" + def update_issue_commit commit_ids + # 关联commmit + commit_ids = params[:commit_ids] + unless commit_ids.blank? + commit_ids = commit_ids.split(",").uniq + if params[:action] == "update" + exist_commit_ids = CommitIssues.where(:issue_id => @issue, :project_id => @issue.project_id) + unless exist_commit_ids.blank? + exist_commit_ids = exist_commit_ids.map{|commit| commit.commit_id} + commit_ids = commit_ids - exist_commit_ids + end + end + commit_ids.each do |commit_id| + CommitIssues.create(:commit_id => commit_id, :project_id => @issue.project_id, :issue_id => @issue.id) + end + end + end + + def update_user_issue_detail(issue, params) + case params[:type] + when "status" + issue.update_attribute(:status_id, params[:status_id]) + when "assigned" + issue.update_attribute(:assigned_to_id, params[:assigned_to_id]) + when "ratio" + issue.update_attribute(:done_ratio, params[:done_ratio]) + when "prior" + issue.update_attribute(:priority_id, params[:priority_id]) + end + end + + # Updates the issue form when changing the project, status or tracker + # on issue creation/update + def update_form + end + + # Bulk edit/copy a set of issues + def bulk_edit + @issues.sort! + @copy = params[:copy].present? + @notes = params[:notes] + + if User.current.allowed_to?(:move_issues, @projects) + @allowed_projects = Issue.allowed_target_projects_on_move + if params[:issue] + @target_project = @allowed_projects.detect {|p| p.id.to_s == params[:issue][:project_id].to_s} + if @target_project + target_projects = [@target_project] + end + end + end + target_projects ||= @projects + + if @copy + @available_statuses = [IssueStatus.default] + else + @available_statuses = @issues.map(&:new_statuses_allowed_to).reduce(:&) + end + @custom_fields = target_projects.map{|p|p.all_issue_custom_fields}.reduce(:&) + @assignables = target_projects.map(&:assignable_users).reduce(:&) + @trackers = target_projects.map(&:trackers).reduce(:&) + @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&) + @categories = target_projects.map {|p| p.issue_categories}.reduce(:&) + if @copy + @attachments_present = @issues.detect {|i| i.attachments.any?}.present? + @subtasks_present = @issues.detect {|i| !i.leaf?}.present? + end + + @safe_attributes = @issues.map(&:safe_attribute_names).reduce(:&) + render :layout => false if request.xhr? + end + + def bulk_update + @issues.sort! + @copy = params[:copy].present? + attributes = parse_params_for_bulk_issue_attributes(params) + + unsaved_issue_ids = [] + moved_issues = [] + + if @copy && params[:copy_subtasks].present? + # Descendant issues will be copied with the parent task + # Don't copy them twice + @issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}} + end + + @issues.each do |issue| + issue.reload + if @copy + issue = issue.copy({}, + :attachments => params[:copy_attachments].present?, + :subtasks => params[:copy_subtasks].present? + ) + end + journal = issue.init_journal(User.current, params[:notes]) + issue.safe_attributes = attributes + call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue }) + if issue.save + moved_issues << issue + else + # Keep unsaved issue ids to display them in flash error + unsaved_issue_ids << issue.id + end + end + set_flash_from_bulk_issue_save(@issues, unsaved_issue_ids) + + if params[:follow] + if @issues.size == 1 && moved_issues.size == 1 + redirect_to issue_url(moved_issues.first) + elsif moved_issues.map(&:project).uniq.size == 1 + redirect_to project_issues_url(moved_issues.map(&:project).first) + end + else + redirect_back_or_default _project_issues_path(@project) + end + end + + def destroy + # 增加删除页面类型,如果是个人主页,则返回该主页,项目动态则返回项目动态页眉 + page_classify = params[:page_classify] unless params[:page_classify].nil? + page_id = params[:page_id] unless params[:page_id].nil? + @hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f + if @hours > 0 + case params[:todo] + when 'destroy' + # nothing to do + when 'nullify' + TimeEntry.update_all('issue_id = NULL', ['issue_id IN (?)', @issues]) + when 'reassign' + reassign_to = @project.issues.find_by_id(params[:reassign_to_id]) + if reassign_to.nil? + flash.now[:error] = l(:error_issue_not_found_in_project) + return + else + TimeEntry.update_all("issue_id = #{reassign_to.id}", ['issue_id IN (?)', @issues]) + end + else + # display the destroy form if it's a user request + return unless api_request? + end + end + @issues.each do |issue| + begin + issue.reload.destroy + rescue ::ActiveRecord::RecordNotFound # raised by #reload if issue no longer exists + # nothing to do, issue was already deleted (eg. by a parent) + end + end + respond_to do |format| + if page_classify + format.html { redirect_back_or_default _project_issues_path(@project, page_classify, page_id) } + else + format.html { redirect_back_or_default _project_issues_path(@project) } + end + format.api { render_api_ok } + end + end + + def add_journal + if User.current.logged? + jour = Journal.new + jour.user_id = User.current.id + jour.notes = params[:notes] + jour.journalized = @issue + jour.save_attachments(params[:attachments]) + jour.save + update_user_activity(@issue.class,@issue.id) + update_forge_activity(@issue.class,@issue.id) + @allowed_statuses = @issue.new_statuses_allowed_to(User.current) + @user_activity_id = params[:user_activity_id] + @priorities = IssuePriority.active + + respond_to do |format| + # Issue详情单独处理 + if params[:is_issue_show] + format.js{redirect_to issue_path(@issue)} + else + format.js + end + end + end + end + + def add_journal_in_org + if User.current.logged? + jour = Journal.new + jour.user_id = User.current.id + jour.notes = params[:notes] + jour.journalized = @issue + jour.save + org_activity = OrgActivity.where("org_act_type='Issue' and org_act_id =#{@issue.id}").first + org_activity.updated_at = jour.created_on + org_activity.save + @user_activity_id = params[:user_activity_id] + respond_to do |format| + format.js + end + end + end + + #对某个journ回复,显示回复框 + def reply + @issue = Issue.find(params[:id]) + @jour = Journal.find(params[:journal_id]) + respond_to do |format| + format.js + end + end + + #给issue添加journ。回复内容包含 对某个被回复的journ的内容 + def add_reply + if User.current.logged? + jour = Journal.find(params[:journal_id]) + @issue = Issue.find params[:id] + @project = @issue.project + @allowed_statuses = @issue.new_statuses_allowed_to(User.current) + @priorities = IssuePriority.active + new_jour = Journal.new + new_jour.user_id = User.current.id + new_jour.reply_id = params[:journal_id] + new_jour.parent_id = jour.id + new_jour.notes = params[:content] + new_jour.journalized = @issue + new_jour.save_attachments(params[:attachments]) + # new_jour = @issue.journals.build(:user_id => User.current.id, :reply_id => params[:journal_id], :notes => params[:content], :parent_id => jour.id) + @user_activity_id = params[:user_activity_id] + if new_jour.save + update_user_activity(@issue.class,@issue.id) + update_forge_activity(@issue.class,@issue.id) + respond_to do |format| + if params[:is_issue_show] + format.js{redirect_to issue_path(@issue)} + else + format.js + end + end + end + end + end + + # 需要刷新详情页面,代码同步一致 + # 获取project和issue状态是为了刷新页面 + # 值所以用delete是因为issue和journal在act_as_attachment中是同一个类型 + # 非动态页面直接刷新,动态页面手动刷新 + def delete_journal + @is_project = params[:is_project] + @issue = Issue.find(params[:id]) + begin + forge_acts = ForgeMessage.where(:forge_message_type => "Journal", :forge_message_id => params[:journal_id]) + forge_acts.destroy_all unless forge_acts.empty? + at_message = AtMessage.where(:at_message_type => "Journal", :at_message_id => params[:journal_id]) + at_message.destroy_all unless at_message.empty? + Journal.delete(params[:journal_id]) + rescue Exception => e + puts e + end + @user_activity_id = params[:user_activity_id] + respond_to do |format| + if @user_activity_id + format.js + else + format.js{ redirect_to issue_url(@issue)} + end + end + end + + def statistics + @project = Project.find(params[:id]) + params[:author_id].to_i != 0 ? (@author = User.find(params[:author_id].to_i).show_name) : @author = 0 + case params[:tracker_id].to_i + when 1 + @tracker = "缺陷" + when 2 + @tracker = "功能" + when 3 + @tracker = "支持" + when 4 + @tracker = "任务" + when 5 + @tracker = "周报" + when 0 + @tracker = 0 + end + params[:subject].blank? ? @search = 0 : @search = params[:subject] + params[:assigned_to_id].to_i != 0 ? (@assigned = User.find(params[:assigned_to_id].to_i).show_name) : @assigned = 0 + params[:fixed_version_id].to_i != 0 ? (@version = Version.find(params[:fixed_version_id].to_i).name) : @version = 0 + params[:done_ratio].to_i != -1 ? (@done = params[:done_ratio].to_i) : @done = -1 + case params[:priority_id].to_i + when 1 + @prior = "低" + when 2 + @prior = "正常" + when 3 + @prior = "高" + when 4 + @prior = "紧急" + when 5 + @prior = "立刻" + when 0 + @prior = 0 + end + case params[:status_id].to_i + when 1 + @status = "新增" + when 2 + @status = "正在解决" + when 3 + @status = "已解决" + when 4 + @status = "反馈" + when 5 + @status = "关闭" + when 6 + @status = "拒绝" + when 0 + @status = 0 + end + params[:issue_create_date_start].blank? ? @start_time = 0 : @start_time = params[:issue_create_date_start] + params[:issue_create_date_end].blank? ? @end_time = 0 : @end_time = params[:issue_create_date_end] + @filter_condition = true + @filter_condition = false if (@author == 0 && @tracker == 0 && @search == 0 && @assigned == 0 && @version == 0 && @done == -1 && @prior ==0 && @status == 0 && @start_time ==0 && @end_time) + if @project.nil? + render_404 + end + retrieve_query + sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) + sort_update(@query.sortable_columns) + @query.sort_criteria = sort_criteria.to_a + @project_base_tag = 'base_projects' + if @query.valid? + @tracker_id = params[:tracker_id] + @assign_to_id = params[:assigned_to_id] + @author_id = params[:author_id] + @priority_id = params[:priority_id] + @status_id = params[:status_id] + @subject = params[:subject] + @done_ratio = params[:done_ratio] + @fixed_version_id = params[:fixed_version_id] + @issue_count = @query.issue_count + @test = params[:test] + @project_sort = 'issues.updated_on desc' + if params[:test] != "0" + case @test + when "1" + @project_sort = 'issues.created_on desc' + when "2" + @project_sort = 'issues.created_on asc' + when "3" + @project_sort = 'issues.updated_on desc' + when "4" + @project_sort = 'issues.updated_on asc' + end + end + # 搜索结果 + # SELECT assigned_to_id, count(*) as ac FROM `issues` where project_id = @project.id group by assigned_to_id order by ac desc; + @issues_filter = @query.issues.sort_by{ |i| Issue.where(:project_id => @project.id , :assigned_to_id => i.assigned_to_id).count }.reverse + # @issues_filter = @query.issues(:order => @project_sort) + + # if params[:type] == 1 || params[:type].nil? + # @results = @issues_filter + # elsif params[:type] == "2" + # @results = @issues_filter.collect{|result| result.status_id !=5 } + # elsif params[:type] == "3" + # @results = @issues_filter.collect{|result| result.status_id !=5 } + # end + + #统计 + @results = {} + + #统计total + @alltotal = {} + for i in 0..5 do + @alltotal[i] = 0 + end + + @opentotal = {} + for i in 0..5 do + @opentotal[i] = 0 + end + + @closetotal = {} + for i in 0..5 do + @closetotal[i] = 0 + end + + #开启关闭 + @issue_open_count = 0 + @issue_close_count = 0 + + @issues_filter.each do |issue| + @alltotal[0] = @alltotal[0] + 1 + @alltotal[issue.tracker_id.to_i] = @alltotal[issue.tracker_id.to_i] + 1 + user_id = issue.assigned_to_id + if issue.assigned_to_id.nil? + user_id = 0 + end + + if !@results[user_id].nil? + @results[user_id][0] = @results[user_id][0] + 1 + @results[user_id][issue.tracker_id.to_i] = @results[user_id][issue.tracker_id.to_i] + 1 + + if issue.status_id.to_i == 5 + @issue_close_count = @issue_close_count + 1 + @results[user_id][12] = @results[user_id][12]+1 + @results[user_id][12+issue.tracker_id.to_i] = @results[user_id][12+issue.tracker_id.to_i]+1 + + @closetotal[0] = @closetotal[0] + 1 + @closetotal[issue.tracker_id.to_i] = @closetotal[issue.tracker_id.to_i] + 1 + else + @issue_open_count = @issue_open_count + 1 + @results[user_id][6] = @results[user_id][6]+1 + @results[user_id][6+issue.tracker_id.to_i] = @results[user_id][6+issue.tracker_id.to_i]+1 + + @opentotal[0] = @opentotal[0] + 1 + @opentotal[issue.tracker_id.to_i] = @opentotal[issue.tracker_id.to_i] + 1 + end + else + + @results[user_id] = {} + + tmpuser = User.find(user_id) + + @results[user_id][:name] = tmpuser.nil? ? "" : tmpuser.show_name + #所有的 + @results[user_id][0] = 1 + for i in 1..17 do + @results[user_id][i] = 0 + end + # @results[user_id][1] = 0 + # @results[user_id][2] = 0 + # @results[user_id][3] = 0 + # @results[user_id][4] = 0 + # @results[user_id][5] = 0 + @results[user_id][issue.tracker_id.to_i] = 1 + + #开启的 status_id = 12346 + # @results[user_id][6] = 0 + # @results[user_id][7] = 0 + # @results[user_id][8] = 0 + # @results[user_id][9] = 0 + # @results[user_id][10] = 0 + # @results[user_id][11] = 0 + + #关闭的 status_id = 5 + # @results[user_id][12] = 0 + # @results[user_id][13] = 0 + # @results[user_id][14] = 0 + # @results[user_id][15] = 0 + # @results[user_id][16] = 0 + # @results[user_id][17] = 0 + + if issue.status_id.to_i == 5 + @results[user_id][12] = 1 + @results[user_id][12+issue.tracker_id.to_i] = 1 + @issue_close_count = @issue_close_count+1 + + @closetotal[0] = @closetotal[0] + 1 + @closetotal[issue.tracker_id.to_i] = @closetotal[issue.tracker_id.to_i] + 1 + else + @issue_open_count = @issue_open_count+1 + @results[user_id][6] = 1 + @results[user_id][6+issue.tracker_id.to_i] = 1 + + @opentotal[0] = @opentotal[0] + 1 + @opentotal[issue.tracker_id.to_i] = @opentotal[issue.tracker_id.to_i] + 1 + end + + end + end + + respond_to do |format| + format.js + end + + else + render_404 + end + end + + private + + def find_project + project_id = params[:project_id] || (params[:issue] && params[:issue][:project_id]) + @project = Project.find(project_id) + rescue ActiveRecord::RecordNotFound + render_404 + end + + def allow_members + if !User.current.member_of?(@project) + return_403 + end + end + + def retrieve_previous_and_next_issue_ids + retrieve_query_from_session + if @query + sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) + sort_update(@query.sortable_columns, 'issues_index_sort') + limit = 500 + issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1), :include => [:assigned_to, :tracker, :priority, :category, :fixed_version]) + if (idx = issue_ids.index(@issue.id)) && idx < limit + if issue_ids.size < 500 + @issue_position = idx + 1 + @issue_count = issue_ids.size + end + @prev_issue_id = issue_ids[idx - 1] if idx > 0 + @next_issue_id = issue_ids[idx + 1] if idx < (issue_ids.size - 1) + end + end + end + + # Used by #edit and #update to set some common instance variables + # from the params + # TODO: Refactor, not everything in here is needed by #edit + def update_issue_from_params + @edit_allowed = User.current.allowed_to?(:edit_issues, @project) + @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) + @time_entry.attributes = params[:time_entry] + + # 更新issue状态时,journal表产生记录,返回@current_journal + @issue.init_journal(User.current) + issue_attributes = params[:issue] + if issue_attributes && params[:conflict_resolution] + case params[:conflict_resolution] + when 'overwrite' + issue_attributes = issue_attributes.dup + issue_attributes.delete(:lock_version) + when 'add_notes' + issue_attributes = issue_attributes.slice(:notes) + when 'cancel' + redirect_to issue_url(@issue) + return false + end + end + + if params[:action] == "update" + senduser = User.find(params[:issue][:assigned_to_id]) + if senduser.id != User.current.id && @issue.assigned_to_id != params[:issue][:assigned_to_id].to_i + issue_id = @issue.id + issue_title = params[:issue][:subject] + priority_id = params[:issue][:priority_id] + ps = ProjectsService.new + ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id + end + end + + @issue.safe_attributes = issue_attributes + @priorities = IssuePriority.active + @allowed_statuses = @issue.new_statuses_allowed_to(User.current) + true + end + + # TODO: Refactor, lots of extra code in here + # TODO: Changing tracker on an existing issue should not trigger this + def build_new_issue_from_params + if params[:id].blank? + @issue = Issue.new + if params[:copy_from] + begin + @copy_from = Issue.visible.find(params[:copy_from]) + @copy_attachments = params[:copy_attachments].present? || request.get? + @copy_subtasks = params[:copy_subtasks].present? || request.get? + @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks) + rescue ActiveRecord::RecordNotFound + render_404 + return + end + end + @issue.project = @project + else + @issue = @project.issues.visible.find(params[:id]) + end + + @issue.project = @project + @issue.author ||= User.current + # Tracker must be set before custom field values + @issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first) + if @issue.tracker.nil? + render_error l(:error_no_tracker_in_project) + return false + end + @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date? + @issue.safe_attributes = params[:issue] + + @priorities = IssuePriority.active + @allowed_statuses = @issue.new_statuses_allowed_to(User.current, true) + @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq + end + + def check_for_default_issue_status + if IssueStatus.default.nil? + render_error l(:error_no_default_issue_status) + return false + end + end + + def parse_params_for_bulk_issue_attributes(params) + attributes = (params[:issue] || {}).reject {|k,v| v.blank?} + attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'} + if custom = attributes[:custom_field_values] + custom.reject! {|k,v| v.blank?} + custom.keys.each do |k| + if custom[k].is_a?(Array) + custom[k] << '' if custom[k].delete('__none__') + else + custom[k] = '' if custom[k] == '__none__' + end + end + end + attributes + end +end diff --git a/app/helpers/training_tasks_helper.rb b/app/helpers/training_tasks_helper.rb new file mode 100644 index 000000000..27569b973 --- /dev/null +++ b/app/helpers/training_tasks_helper.rb @@ -0,0 +1,2 @@ +module TrainingTasksHelper +end diff --git a/app/models/project.rb b/app/models/project.rb index e48a5296c..1421ebc8e 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -57,6 +57,7 @@ class Project < ActiveRecord::Base has_many :enabled_modules, :dependent => :delete_all has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position" has_many :issues, :dependent => :destroy, :include => [:status, :tracker],:order => "issues.id ASC" + has_many :training_tasks, :dependent => :destroy, :order => "training_tasks.id ASC" has_many :issue_changes, :through => :issues, :source => :journals has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC" has_many :time_entries, :dependent => :delete_all diff --git a/app/models/training_task.rb b/app/models/training_task.rb new file mode 100644 index 000000000..a476ea882 --- /dev/null +++ b/app/models/training_task.rb @@ -0,0 +1,4 @@ +class TrainingTask < ActiveRecord::Base + attr_accessible :description, :project_id, :subject, :tracker_id + belongs_to :project,:touch=> true +end diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index d28aacb25..f7c988873 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -37,6 +37,12 @@ <%= link_to project_issue_count > 0 ? "#{l(:label_issue_tracking)}#{switch_integer_into_k project_issue_count}".html_safe : "#{l(:label_issue_tracking)}", project_issues_path(@project, :remote => true), :class => "pro_new_proname", :title => "#{project_issue_count}" %> <% end %> + + <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> +
  • + <%= link_to project_issue_count > 0 ? "#{l(:project_module_training_tasks)}#{switch_integer_into_k project_issue_count}".html_safe : "#{l(:project_module_training_tasks)}", project_issues_path(@project, :remote => true), :class => "pro_new_proname", :title => "#{project_issue_count}" %> +
  • + <% end %> <% unless @project.enabled_modules.where("name = 'boards'").empty? %>
  • diff --git a/app/views/training_tasks/_form.html.erb b/app/views/training_tasks/_form.html.erb new file mode 100644 index 000000000..9ddf80d90 --- /dev/null +++ b/app/views/training_tasks/_form.html.erb @@ -0,0 +1,55 @@ +<%= labelled_fields_for :training_task, @training_task do |f| %> +
      +
    • + 类   型 + <%= f.select :tracker_id, Tracker.all.collect{ |t| [t.name, t.id] },{:required => true, :no_label => true}, + :class => "fl", :style => "width:160px;padding-left:0px;" %> +
    • +
    • + + <%= f.text_field :subject, :style => "font-size:small;width:606px;", :no_label => true %> + + <%= javascript_tag do %> + observeAutocompleteField('issue_subject', + '<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>', + { select: function(event, ui) { + $('input#issue_subject').val(ui.item.value); + } + }); + <% end %> +
    • +
    • + <% if @issue.safe_attribute? 'description' %> + + <%= f.label_for_field :description, :no_label => true, :class => "label" %> + <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> + <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> + <%= f.kindeditor :description,:editor_id => "training_task_desc_editor", :width=>'85%', :height =>159, :resizeType => 0, :no_label => true, at_id: @project.id, at_type: @project.class.to_s %> + <%# end %> + <%#= wikitoolbar_for 'issue_description' %> + <% end %> +
    • + +
    • + + <%#= render :partial => 'attachments/form', :locals => {:container => @training_task} %> +
    • +
    • + <% if params[:action] == "new" %> + 取消 + <% else %> + <%= link_to "取消", training_task_path(@training_task), :class => "sy_btn_grey mr5 fr" %> + <% end %> + + + +
    • +
    + +<% end %> + diff --git a/app/views/training_tasks/new.html.erb b/app/views/training_tasks/new.html.erb new file mode 100644 index 000000000..f81523562 --- /dev/null +++ b/app/views/training_tasks/new.html.erb @@ -0,0 +1,27 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> +<% end %> + + + +
    +
    + <%= call_hook(:view_issues_new_top, {:training_task => @training_task}) %> + <%= labelled_form_for @training_task, :url => project_training_tasks_url(@project), + :html => {:id => 'project_training_form', :multipart => true} do |f| %> + <%= error_messages_for 'training_task' %> + <%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %> +
    + <%= render :partial => 'training_tasks/form', :locals => {:f => f} %> +
    + <% end %> +
    +
    + + + diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index acbc722d1..9f1f6e348 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -389,7 +389,9 @@ zh: project_moule_boards_show: 项目论坛 project_module_time_tracking: 时间跟踪 #project_module_course: 课程 - + + project_module_training_tasks: 实训任务 + # 成员配置 label_approve: 批准 label_refusal: 拒绝 diff --git a/config/routes.rb b/config/routes.rb index b679c9b1b..6f280e7f1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -965,6 +965,18 @@ RedmineApp::Application.routes.draw do end end + resources :training_tasks do + collection do + + end + member do + post 'add_journal' + get 'delete_journal' + get 'reply' + post 'add_reply' + end + end + resources :pull_requests do collection do end diff --git a/config/settings.yml b/config/settings.yml index f5001947e..1d52b96dd 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -201,6 +201,7 @@ default_projects_modules: - calendar - gantt - course + - training_tasks # - dts default_projects_tracker_ids: serialized: true diff --git a/db/migrate/20170217092541_create_training_tasks.rb b/db/migrate/20170217092541_create_training_tasks.rb new file mode 100644 index 000000000..316f38d5b --- /dev/null +++ b/db/migrate/20170217092541_create_training_tasks.rb @@ -0,0 +1,12 @@ +class CreateTrainingTasks < ActiveRecord::Migration + def change + create_table :training_tasks do |t| + t.integer :project_id + t.integer :tracker_id + t.string :subject + t.text :description + + t.timestamps + end + end +end diff --git a/db/migrate/20170217092859_add_author_id_to_training_tasks.rb b/db/migrate/20170217092859_add_author_id_to_training_tasks.rb new file mode 100644 index 000000000..c5502b7ed --- /dev/null +++ b/db/migrate/20170217092859_add_author_id_to_training_tasks.rb @@ -0,0 +1,6 @@ +class AddAuthorIdToTrainingTasks < ActiveRecord::Migration + def change + add_column :training_tasks, :author_id, :integer + add_column :training_tasks, :status, :integer, :limit => 1, :default => 1 + end +end diff --git a/db/schema.rb b/db/schema.rb index 96c27b9cc..7eafcc88f 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 => 20170209020934) do +ActiveRecord::Schema.define(:version => 20170217092859) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -305,17 +305,18 @@ ActiveRecord::Schema.define(:version => 20170209020934) do end create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false t.integer "last_message_id" t.integer "parent_id" t.integer "course_id" t.integer "org_subfield_id" t.integer "contest_id" + t.integer "training_project_id" end add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" @@ -350,14 +351,16 @@ ActiveRecord::Schema.define(:version => 20170209020934) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" + t.integer "project_id" + t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" @@ -628,20 +631,6 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.integer "container_id", :default => 0 end - create_table "course_class_post", :id => false, :force => true do |t| - t.integer "班级id", :default => 0, :null => false - t.string "班级名" - t.integer "帖子id", :default => 0, :null => false - t.integer "主贴id" - t.string "帖子标题", :default => "", :null => false - t.text "帖子内容" - t.integer "帖子用户id" - t.integer "帖子回复数", :default => 0, :null => false - t.integer "最后回帖id" - t.datetime "发帖时间", :null => false - t.datetime "帖子更新时间", :null => false - end - create_table "course_contributor_scores", :force => true do |t| t.integer "course_id" t.integer "user_id" @@ -725,8 +714,8 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.string "code" t.integer "time" t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "location" t.string "term" t.string "string" @@ -736,28 +725,29 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.string "class_period" t.integer "school_id" t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 t.integer "lft" t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 t.integer "end_time" t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 t.integer "syllabus_id" t.string "invite_code" t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.integer "invite_code_halt", :limit => 1, :default => 0 - t.integer "os_allow", :default => 0 + t.integer "qrcode_expiretime", :default => 0 + t.integer "professional_level_id", :limit => 1 + t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true @@ -832,6 +822,11 @@ ActiveRecord::Schema.define(:version => 20170209020934) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "disciplines", :force => true do |t| + t.string "name" + t.integer "professional_level_id", :limit => 1 + end + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -957,13 +952,11 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.integer "exercise_status" t.integer "user_id" t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.datetime "publish_time" t.datetime "end_time" t.integer "show_result" - t.integer "question_random", :default => 0 - t.integer "choice_random", :default => 0 end create_table "first_pages", :force => true do |t| @@ -986,8 +979,9 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.integer "forge_act_id" t.string "forge_act_type" t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "training_project_id" end add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" @@ -1153,6 +1147,10 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.datetime "updated_at", :null => false end + create_table "innodb_monitor", :id => false, :force => true do |t| + t.integer "a" + end + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1685,9 +1683,12 @@ ActiveRecord::Schema.define(:version => 20170209020934) do end create_table "professional_levels", :force => true do |t| - t.string "level" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "level" + end + + create_table "professions", :force => true do |t| + t.string "name" + t.integer "discipline_id", :limit => 1 end create_table "project_infos", :force => true do |t| @@ -1700,18 +1701,19 @@ ActiveRecord::Schema.define(:version => 20170209020934) do create_table "project_scores", :force => true do |t| t.string "project_id" t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 t.datetime "commit_time" - t.integer "pull_request_num", :default => 0 + t.integer "pull_request_num", :default => 0 + t.integer "training_project_id", :default => -1 end create_table "project_statuses", :force => true do |t| @@ -1750,7 +1752,6 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.boolean "hidden_repo", :default => false, :null => false t.integer "attachmenttype", :default => 1 t.integer "user_id" - t.integer "dts_test", :default => 0 t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" @@ -1758,6 +1759,11 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.integer "forked_from_project_id" t.integer "forked_count" t.integer "publish_resource", :default => 0 + t.integer "boards_count", :default => 0 + t.integer "news_count", :default => 0 + t.integer "acts_count", :default => 0 + t.integer "journals_count", :default => 0 + t.integer "boards_reply_count", :default => 0 t.integer "visits", :default => 0 t.integer "hot", :default => 0 t.string "invite_code" @@ -2156,8 +2162,8 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.string "title" t.text "description" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "eng_name" t.integer "syllabus_type" t.integer "credit" @@ -2166,8 +2172,9 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.integer "practice_hours" t.string "applicable_major" t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 + t.integer "professional_level_id", :limit => 1 end add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" @@ -2248,6 +2255,57 @@ ActiveRecord::Schema.define(:version => 20170209020934) do t.integer "fields_bits", :default => 0 end + create_table "trackers_training_projects", :id => false, :force => true do |t| + t.integer "training_project_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "trackers_training_projects", ["training_project_id"], :name => "projects_trackers_training_project_id" + + create_table "training_projects", :force => true do |t| + t.string "name", :limit => 30, :null => false + t.text "description" + t.string "homepage", :limit => 60 + t.boolean "is_public", :default => true, :null => false + t.integer "parent_id" + t.integer "projects_count", :default => 0 + t.string "identifier", :null => false + t.integer "status", :default => 1 + t.integer "lft" + t.integer "rgt" + t.boolean "inherit_members", :default => false, :null => false + t.integer "project_type" + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 + t.integer "user_id" + t.integer "dts_test", :default => 0 + t.string "enterprise_name" + t.integer "organization_id" + t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "publish_resource", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "training_tasks", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.string "subject" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "author_id" + t.integer "status", :limit => 1, :default => 1 + end + create_table "user_actions", :force => true do |t| t.integer "user_id" t.string "action_type" diff --git a/lib/redmine.rb b/lib/redmine.rb index 3f3514bea..baf7e413b 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -193,6 +193,11 @@ Redmine::AccessControl.map do |map| map.permission :delete_issue_watchers, {:watchers => :destroy} end + map.project_module :training_tasks do |map| + # map.permission :manage_training_tasks, {:training_tasks => [:new, :create]}, :require => :loggedin + # map.permission :view_training_tasks, {:training_tasks => :index, :versions => :download}, :read => true + end + # map.project_module :time_tracking do |map| # map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin # map.permission :view_time_entries, {:timelog => [:index, :report, :show]}, :read => true diff --git a/spec/controllers/training_tasks_controller_spec.rb b/spec/controllers/training_tasks_controller_spec.rb new file mode 100644 index 000000000..d358a1412 --- /dev/null +++ b/spec/controllers/training_tasks_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe TrainingTasksController, :type => :controller do + +end diff --git a/spec/factories/training_tasks.rb b/spec/factories/training_tasks.rb new file mode 100644 index 000000000..027184bd3 --- /dev/null +++ b/spec/factories/training_tasks.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :training_task do + project_id 1 +tracker_id 1 +subject "MyString" +description "MyText" + end + +end diff --git a/spec/models/training_task_spec.rb b/spec/models/training_task_spec.rb new file mode 100644 index 000000000..c7374ac60 --- /dev/null +++ b/spec/models/training_task_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe TrainingTask, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 9c3e7ab59502c6e16a248294b274c892e02b9bff Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 18 Feb 2017 14:14:54 +0800 Subject: [PATCH 029/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=BA=95=E9=83=A8=E7=95=99=E7=99=BD?= =?UTF-8?q?=E4=B8=8D=E8=A6=81=E5=A4=AA=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings.html.erb | 1 - app/views/courses/settings/_edit.html.erb | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index b01ddea89..9e6bbbf64 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -42,7 +42,6 @@ <% elsif @select_tab == 'boards'%> $("#tb_4").click(); <% end %> - $("#homework_page_right").css("min-height",$("#courseLSide").height()+45); }); function g(o){ diff --git a/app/views/courses/settings/_edit.html.erb b/app/views/courses/settings/_edit.html.erb index df1b0e73b..8f7c895c6 100644 --- a/app/views/courses/settings/_edit.html.erb +++ b/app/views/courses/settings/_edit.html.erb @@ -63,9 +63,9 @@ <% end %> <% if @course.is_delete == 1 %> -
    <%=link_to "恢复该班级", renew_course_path(@course) %>
    +
    <%=link_to "恢复该班级", renew_course_path(@course) %>
    <% else %> -
    +
    <%=link_to "删除该班级", course_path(@course), :method => :delete, :confirm=>"确认要删除该班级吗?" %> (友情提示:删除该班级后如果您想恢复该班级,请联系系统管理员!)
    From 9ef33daa39e3af715f7816ae186a0a1421c64e13 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 18 Feb 2017 15:07:48 +0800 Subject: [PATCH 030/118] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=90=84=E7=A7=AF=E5=88=86=E6=A0=87=E9=A2=98=E7=9A=84tip?= =?UTF-8?q?=E8=AF=B7=E7=BB=9F=E4=B8=80=E6=94=BE=E5=9C=A8=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=8C=BA=EF=BC=88=E5=8F=82=E7=85=A7=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E9=82=80=E8=AF=B7=E7=A0=81tip=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_new_member_list.html.erb | 22 +++++++++++++++++---- public/stylesheets/syllabus.css | 4 +++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index 67973dc65..0ae68b65b 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -20,7 +20,8 @@ <% elsif @sort_type == "score" && @score_sort_by == 'asc' %> <% end %> -
    +
    +

    积分规则
    班级作业的得分总和

    @@ -32,7 +33,8 @@ <% elsif @sort_type == "ex_score" && @score_sort_by == 'asc' %> <% end %> -
    +
    +

    积分规则
    班级测验的得分总和

    @@ -44,7 +46,8 @@ <% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %> <% end %> -
    +
    +

    积分规则
    资源发布:资源数 x 5
    问答发布:发帖数 x 2
    @@ -58,7 +61,8 @@

    总得分 -
    +
    +

    积分规则
    作业得分+测评得分+社区得分

    @@ -212,6 +216,16 @@ }); }); + $(".sy_fenban_tap").each(function(){ + $(this).mouseenter(function(){ + $(".sy_fenban_show").hide(); + $(this).children('.sy_fenban_show').show(); + }); + $(this).mouseleave(function(){ + $(this).children('.sy_fenban_show').hide(0); + }); + }); + $(".sy_tips_box_inner").each(function(){ $(this).mouseover(function(){ $(this).stop(); diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index 5c2d2bd77..d56c3d1cd 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -643,7 +643,9 @@ a:hover.sy_class_ltitle{ color:#333;} .sy_new_table_width tr th.sy_th13{ width: 13%;} .sy_fenban_tap{ cursor: pointer; position: relative;} .sy_fenban_tap:hover .sy_fenban_show{ display: block;} -.sy_fenban_show{ width:140px; z-index: 999;text-align: center; line-height:2.0; font-size:12px; font-weight: normal;color:#888;background-color:#fff; border:1px solid #eaeaea;border-radius:5px;position:absolute;left:20px; top:30px;padding:5px 0px;display:none; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} +.sy_fenban_show{ position: absolute;line-height: 2.0;padding: 5px 10px; white-space: nowrap; font-weight: normal;color:#888; background-color: #fff; left:30px; top: -5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} +.sy_fenban_show span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #fff transparent transparent;font-size: 0;line-height: 0;} +.sy_fenban_show em { display: block; border-width: 11px;position: absolute;top: 42px; left: -23px; border-style: dashed solid dashed dashed;border-color: transparent #eaeaea transparent transparent;font-size: 0;line-height: 0;} .sy_tips_box{ position: relative; cursor: pointer;} .sy_tips_box:hover .sy_tips_box_inner{ display: block;} .sy_tips_box_inner{ position: absolute;line-height: 2.0;padding: 5px 10px; white-space: nowrap; background-color: #fff; left:30px; top: -5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} From a43c5cdb2faa5db31985ffcfaeac5efc7a00e985 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 18 Feb 2017 17:44:50 +0800 Subject: [PATCH 031/118] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=AE=9E=E8=AE=ADApi?= =?UTF-8?q?=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/praise_tread_controller.rb | 2 + app/controllers/projects_controller.rb | 1 + app/controllers/repositories_controller.rb | 46 + app/controllers/training_tasks_controller.rb | 321 +--- app/models/praise_tread.rb | 2 + app/models/training_task.rb | 16 + app/views/layouts/_base_project_top.html.erb | 5 +- app/views/projects/_applied_status.html.erb | 12 +- .../repositories/_forked_popbox.html.erb | 72 +- app/views/training_tasks/_all_list.html.erb | 12 + .../training_tasks/_content_list.html.erb | 71 + app/views/training_tasks/_detail.html.erb | 54 + app/views/training_tasks/_form.html.erb | 8 +- .../training_tasks/_issue_replies.html.erb | 89 ++ .../training_tasks/_reply_banner.html.erb | 5 + .../training_tasks/_task_attachments.html.erb | 10 + app/views/training_tasks/index.html.erb | 232 +++ app/views/training_tasks/new.html.erb | 2 +- app/views/training_tasks/show.html.erb | 42 + config/locales/commons/zh.yml | 1 + config/routes.rb | 9 + db/schema.rb | 1351 ++--------------- lib/redmine.rb | 5 +- 23 files changed, 816 insertions(+), 1552 deletions(-) create mode 100644 app/views/training_tasks/_all_list.html.erb create mode 100644 app/views/training_tasks/_content_list.html.erb create mode 100644 app/views/training_tasks/_detail.html.erb create mode 100644 app/views/training_tasks/_issue_replies.html.erb create mode 100644 app/views/training_tasks/_reply_banner.html.erb create mode 100644 app/views/training_tasks/_task_attachments.html.erb create mode 100644 app/views/training_tasks/index.html.erb create mode 100644 app/views/training_tasks/show.html.erb diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb index 3e3c338b4..136915bbd 100644 --- a/app/controllers/praise_tread_controller.rb +++ b/app/controllers/praise_tread_controller.rb @@ -125,6 +125,8 @@ class PraiseTreadController < ApplicationController @obj = User.find_by_id(id) when 'Issue' @obj = Issue.find_by_id(id) + when 'TrainingTask' + @obj = TrainingTask.find_by_id(id) when 'Project' @obj = Project.find_by_id(id) when 'Bid' diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7d69e3a6f..8e4f64d49 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -806,6 +806,7 @@ class ProjectsController < ApplicationController # 资源库fork弹框 def forked_pop + @type = params[:type] respond_to do |format| format.js end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index a955fa88b..0c79da148 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -132,6 +132,52 @@ class RepositoriesController < ApplicationController # send_file "/path/to/file.zip" end + # 开启实训项目 + def training_task_execute + @project = Project.find(params[:id]) + @repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab") + # 如果当前用户已经fork过该项目,不会新fork项目,则跳至已fork的项 + unless has_forked?(@project, User.current) + project = project_from_current_project(@project.id, User.current.id) + redirect_to project_path(project) + else + ActiveRecord::Base.transaction do + g = Gitlab.client + if User.current.gid.nil? + begin + s = Trustie::Gitlab::Sync.new + s.sync_user(User.current) + ensure + logger.error "Synv user failed ==>#{User.current.id}" + end + end + gproject = g.fork(@project.gpid, User.current.gid) + if gproject + new_training_project = copy_project(@project, gproject) + forked_count = @project.forked_count.to_i + 1 + @project.update_attributes(:forked_count => forked_count) + # 发布实训任务,只发布实训任务的第一个 + publish_training_tasks(@project, new_training_project) + end + end + end + end + + def publish_training_tasks project, new_training_project + original_task = TrainingTask.where(:project_id => project.id, :position => 1) + training_task = TrainingTask.new + training_task.save_attachments(params[:attachments] || (params[:training_task] && params[:training_task][:uploads])) + training_task.subject = params[:training_task][:subject] + training_task.description = params[:training_task][:description] + training_task.tracker_id = params[:training_task][:tracker_id] + if training_task.save + respond_to do |format| + format.html{redirect_to project_training_tasks_url(:project_id => new_training_project)} + end + end + end + + # 判断用户是否已经fork过该项目 def has_forked?(project, user) projects = Project.where("user_id =?", user) diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index 7b9485d1c..467701e2a 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -1,21 +1,19 @@ # encoding: utf-8 class TrainingTasksController < ApplicationController - layout 'base_projects'#Added by young - default_search_scope :issues - - before_filter :authorize1, :only => [:show] - before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org] - before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] - before_filter :find_project, :only => [:new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete] - #before_filter :authorize, :except => [:index, :show] - # before_filter :authorize, :except => [:new, :index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits, :commit_for_issue, :issue_commit_delete] + layout 'base_projects' before_filter :allow_manager, :only => [] before_filter :allow_members, :only => [:new, :create] + before_filter :build_new_task_from_params, :only => [:new, :create, :update_form] + before_filter :find_training_task, :only => [:show, :edit, :update, :add_journal, :complete_training_task] + + # before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] + before_filter :find_project, :only => [:index, :new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete] + # before_filter :authorize, :except => [:index, :show] + # before_filter :authorize, :except => [:new, :index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits, :commit_for_issue, :issue_commit_delete] - before_filter :find_optional_project, :only => [:index] before_filter :check_for_default_issue_status, :only => [:new, :create] - before_filter :build_new_issue_from_params, :only => [:new, :create, :update_form] + before_filter :build_new_task_from_params, :only => [:new, :create, :update_form] accept_rss_auth :index, :show accept_api_auth :index, :show, :create, :update, :destroy @@ -44,44 +42,6 @@ class TrainingTasksController < ApplicationController helper :project_score include ApplicationHelper - # issue和代码提交id关联模块 --> over - # 获取某个项目的commit_ids - def issue_commits - begin - return render_404 if @project.gpid.nil? - @issue_commit_ids = (params[:issue_commit_ids].is_a?(Array) ? params[:issue_commit_ids] : params[:issue_commit_ids].split(",")) unless params[:issue_commit_ids].nil? - search = params[:search].to_s.strip - @type = params[:type] - limit = 15 - g = Gitlab.client - g_project = g.project(@project.gpid) - rev = params[:branch].nil? ? g_project.default_branch : params[:branch] - @project_branches = g.branches(@project.gpid) - @branch_names = @project_branches.map{|b| b.name} - @default_branch = g_project.default_branch - # 搜索的分页需要单独处理,因为搜索不容易获取总数 - if search.present? - @commits = g.commits(@project.gpid, ref_name:rev, :search => search) - @commits_count = @commits.count - @commits_pages = Paginator.new @commits_count, limit, params['page'] || 1 - @offset ||= @commits_pages.offset - @commits = paginateHelper @commits,limit - else - @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev, :search => search) - @commits_count = g.user_static(@project.gpid, :rev => rev).count - @commits_pages = Redmine::Pagination::Paginator.new @commits_count, limit, params[:page] - end - rescue Exception => e - puts e - end - end - - # 选择对应的Commit - def commit_for_issue - history_commit_ids = params[:issue_for_commit_ids].split(",") unless params[:issue_for_commit_ids].nil? - @issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq - end - def issue_commit_delete commit_id = params[:commit_id].split(",") issue_commit_ids = params[:issue_commit_ids] @@ -97,164 +57,36 @@ class TrainingTasksController < ApplicationController def index # 顶部导航 - @project_menu_type = 2 - # 为了性能所有用了两种模式,issue的@query查询所有的没有优势 - # 但是对过滤条件很有有时 - if params[:set_filter] != "1" - @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' - if User.current.member_of?(@project) - @issues_filter = Issue.where(:project_id => @project.id).order('updated_on desc') - else - @issues_filter = Issue.where(:project_id => @project.id, :is_private => 0).order('updated_on desc') - end - open_and_close_num(@project) - @issue_count = @issues_filter.count - @limit = 10 - @is_remote = true - @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 - @offset ||= @issue_pages.offset - @issues = paginateHelper @issues_filter, @limit - respond_to do |format| - format.js - format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young - format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')} - format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls" - send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) - } - end - else - retrieve_query - sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) - sort_update(@query.sortable_columns) - @query.sort_criteria = sort_criteria.to_a - @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' - if @query.valid? - @tracker_id = params[:tracker_id] - @assign_to_id = params[:assigned_to_id] - @author_id = params[:author_id] - @priority_id = params[:priority_id] - @status_id = params[:status_id] - @subject = params[:subject] - @done_ratio = params[:done_ratio] - @fixed_version_id = params[:fixed_version_id] - @issue_count = @query.issue_count - @test = params[:test] - @project_sort = 'issues.updated_on desc' - - if params[:test] != "0" - case @test - when "1" - @project_sort = 'issues.created_on desc' - when "2" - @project_sort = 'issues.created_on asc' - when "3" - @project_sort = 'issues.updated_on desc' - when "4" - @project_sort = 'issues.updated_on asc' - end - end - open_and_close_num(@project) - @issues_filter_assign_count = @query.issues.select{|issue| issue.assigned_to_id == User.current.id }.count - @issues_filter_author_count = @query.issues.select{|issue| issue.author_id == User.current.id }.count - @issues_filter = @query.issues(:order => @project_sort) - @limit = 10 - @is_remote = true - @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 - @offset ||= @issue_pages.offset - @issues = paginateHelper @issues_filter, @limit - respond_to do |format| - format.js - format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young - format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')} - # format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json} - format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") } - format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') } - format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') } - format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls" - send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) - } - end - else - respond_to do |format| - format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young - format.any(:atom, :csv, :pdf) { render(:nothing => true) } - format.api { render_validation_errors(@query) } - format.js - end - end + @project_menu_type = 11 + @training_tasks = TrainingTask.where(:project_id => @project.id).order('updated_at desc') + @training_tasks_count = @training_tasks.count + @limit = 10 + @is_remote = true + @training_tasks_pages = Paginator.new @training_tasks_count, @limit, params['page'] || 1 + @offset ||= @training_tasks_pages.offset + @training_tasks = paginateHelper @training_tasks, @limit + respond_to do |format| + format.js + format.html end rescue ActiveRecord::RecordNotFound render_404 end - # 获取issue的开启统计数 - def open_and_close_num project - if User.current.member_of?(project) - @issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6)").count - @issue_close_count = Issue.where(:project_id => project.id, :status_id => 5 ).count - else - @issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6) and is_private = 0").count - @issue_close_count = Issue.where(:project_id => project.id, :status_id => 5, :is_private => 0).count - end - end - def show # 顶部导航 - @project_menu_type = 2 + @project_menu_type = 11 # 打开编辑内容 @is_edit = true unless params[:edit].nil? - # 当前用户查看指派给他的缺陷消息,则设置消息为已读 - query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first - query.update_attribute(:viewed, true) unless query.nil? - # issue 关联的commit - commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) - @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} - # issue 新建的at消息 - User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!} - # 回复的at消息 - @issue.journals.each do |j| - User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!} - end - - # 缺陷状态消息更新 - query_journals_ids = @issue.journals.map{|journal| journal.id} - if query_journals_ids.length > 0 - query_journals = ForgeMessage.where("user_id =? and forge_message_type =? and forge_message_id in (#{query_journals_ids.join(",")})", User.current.id, "Journal") - query_journals.update_all(:viewed => true) - end - @jour_reply = Journal.new - @journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id desc").all + @journals = @training_task.journals.includes(:user, :details).reorder("#{Journal.table_name}.id desc").all @journals = get_no_children_comments_all @journals @journals.each_with_index {|j,i| j.indice = i+1} - @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) + @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @training_task.project) @journals.reverse! if User.current.wants_comments_in_reverse_order? - - @changesets = @issue.changesets.visible.all - @changesets.reverse! if User.current.wants_comments_in_reverse_order? - - @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } - @allowed_statuses = @issue.new_statuses_allowed_to(User.current) - @edit_allowed = User.current.allowed_to?(:edit_issues, @project) - @priorities = IssuePriority.active - @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) - - @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young - @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq - @journal = Journal.new(:journalized => @issue) - + @journal = Journal.new(:journalized => @training_task) respond_to do |format| - format.html { - retrieve_previous_and_next_issue_ids - render :template => 'issues/show', :layout => @project_base_tag#by young - } - format.js - format.api - format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' } - format.pdf { - pdf = issue_to_pdf(@issue, :journals => @journals) - send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") ) - } + format.html end end @@ -263,51 +95,36 @@ class TrainingTasksController < ApplicationController def new # 顶部导航 @project_menu_type = 11 - @training_task = TrainingTask.new respond_to do |format| format.html { render :action => 'new', :layout => 'base_projects' } end end - # 用户发布新issue + # 用户发布新任务 def create - @training_task.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads])) - # 给该issue在它所在的项目中所有的issues中所在的位置给一个序号 + @training_task.save_attachments(params[:attachments] || (params[:training_task] && params[:training_task][:uploads])) + @training_task.subject = params[:training_task][:subject] + @training_task.description = params[:training_task][:description] + @training_task.tracker_id = params[:training_task][:tracker_id] if @training_task.save - # senduser = User.find(params[:issue][:assigned_to_id]) - # issue_id = @issue.id - # issue_title = params[:training_task][:subject] - # priority_id = params[:issue][:priority_id] - - # ps = ProjectsService.new - # if senduser.id != User.current.id - # ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id - # end - # call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) respond_to do |format| format.html { - render_attachment_warning_if_needed(@issue) - #flash[:notice] = l(:label_successful_create) - #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("#{@issue.subject}", issue_path(@issue), :title => @issue.subject)) - #flash[:notice] = l(:notice_issue_successful_create, :id => view_context.link_to("##{@issue.id}", issue_path(@issue), :title => @issue.subject)) - if params[:continue] - attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} - redirect_to new_project_issue_url(@issue.project, :issue => attrs) - else - redirect_to issue_url(@issue.id) - end + render_attachment_warning_if_needed(@training_task) + redirect_to training_task_url(@training_task) } - format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) } end return else respond_to do |format| format.html { render :action => 'new' } - format.api { render_validation_errors(@issue) } end end end + def complete_training_task + taskId = @training_task.position + end + def edit # 修改实例变量的值 return unless update_issue_from_params @@ -394,26 +211,6 @@ class TrainingTasksController < ApplicationController end end - # 保存issue的时候相关的commit操作 - # commit_ids => "9b9845ff,poor56el" - def update_issue_commit commit_ids - # 关联commmit - commit_ids = params[:commit_ids] - unless commit_ids.blank? - commit_ids = commit_ids.split(",").uniq - if params[:action] == "update" - exist_commit_ids = CommitIssues.where(:issue_id => @issue, :project_id => @issue.project_id) - unless exist_commit_ids.blank? - exist_commit_ids = exist_commit_ids.map{|commit| commit.commit_id} - commit_ids = commit_ids - exist_commit_ids - end - end - commit_ids.each do |commit_id| - CommitIssues.create(:commit_id => commit_id, :project_id => @issue.project_id, :issue_id => @issue.id) - end - end - end - def update_user_issue_detail(issue, params) case params[:type] when "status" @@ -885,8 +682,8 @@ class TrainingTasksController < ApplicationController end def allow_members - if !User.current.member_of?(@project) - return_403 + if !(User.current.member_of?(@project) || User.current.admin?) + render_403 end end @@ -951,39 +748,22 @@ class TrainingTasksController < ApplicationController # TODO: Refactor, lots of extra code in here # TODO: Changing tracker on an existing issue should not trigger this - def build_new_issue_from_params + def build_new_task_from_params if params[:id].blank? - @issue = Issue.new - if params[:copy_from] - begin - @copy_from = Issue.visible.find(params[:copy_from]) - @copy_attachments = params[:copy_attachments].present? || request.get? - @copy_subtasks = params[:copy_subtasks].present? || request.get? - @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks) - rescue ActiveRecord::RecordNotFound - render_404 - return - end - end - @issue.project = @project + @training_task = TrainingTask.new + @training_task.project = @project else - @issue = @project.issues.visible.find(params[:id]) + @training_task = @project.training_tasks.visible.find(params[:id]) end - @issue.project = @project - @issue.author ||= User.current + @training_task.project = @project + @training_task.author ||= User.current # Tracker must be set before custom field values - @issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first) - if @issue.tracker.nil? + @training_task.tracker ||= @project.trackers.find((params[:training_task] && params[:training_task][:tracker_id]) || params[:tracker_id] || :first) + if @training_task.tracker.nil? render_error l(:error_no_tracker_in_project) return false end - @issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date? - @issue.safe_attributes = params[:issue] - - @priorities = IssuePriority.active - @allowed_statuses = @issue.new_statuses_allowed_to(User.current, true) - @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq end def check_for_default_issue_status @@ -1008,4 +788,13 @@ class TrainingTasksController < ApplicationController end attributes end + + # Find the issue whose id is the :id parameter + # Raises a Unauthorized exception if the issue is not visible + def find_training_task + @training_task = TrainingTask.find(params[:id]) + @project = @training_task.project + rescue ActiveRecord::RecordNotFound + render_404 + end end diff --git a/app/models/praise_tread.rb b/app/models/praise_tread.rb index 63ba89b18..ec0711bc4 100644 --- a/app/models/praise_tread.rb +++ b/app/models/praise_tread.rb @@ -12,6 +12,8 @@ class PraiseTread < ActiveRecord::Base @obj = User.find_by_id(id) when 'Issue' @obj = Issue.find_by_id(id) + when 'TrainingTask' + @obj = TrainingTask.find_by_id(id) when 'Project' @obj = Project.find_by_id(id) when 'Bid' diff --git a/app/models/training_task.rb b/app/models/training_task.rb index a476ea882..54fa72648 100644 --- a/app/models/training_task.rb +++ b/app/models/training_task.rb @@ -1,4 +1,20 @@ class TrainingTask < ActiveRecord::Base attr_accessible :description, :project_id, :subject, :tracker_id belongs_to :project,:touch=> true + belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' + belongs_to :tracker + has_many :journals, :as => :journalized, :dependent => :destroy + has_many :visible_journals, + :class_name => 'Journal', + :as => :journalized, + :conditions => Proc.new { + ["(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))", false] + }, + :readonly => true + has_many :praise_tread, as: :praise_tread_object, dependent: :destroy + has_one :praise_tread_cache, as: :object, dependent: :destroy + acts_as_attachable + + validates_presence_of :subject, :author + validates_length_of :subject, :maximum => 255 end diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index f7c988873..e4511b474 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -1,5 +1,6 @@ <% project_file_num = Attachment.where(:container_type => "Project", :container_id => @project.id).count %> <% project_issue_count = @project.issues.count %> +<% training_tasks_count = @project.training_tasks.count %> <% project_acts = ForgeActivity.where("project_id = ?", @project.id).count %> <% raodmaps = Version.where("project_id = ?", @project.id).count %> <% project_score = @project.project_score %> @@ -38,9 +39,9 @@
  • <% end %> - <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + <% unless @project.enabled_modules.where("name = 'training_tasks'").empty? %>
  • - <%= link_to project_issue_count > 0 ? "#{l(:project_module_training_tasks)}#{switch_integer_into_k project_issue_count}".html_safe : "#{l(:project_module_training_tasks)}", project_issues_path(@project, :remote => true), :class => "pro_new_proname", :title => "#{project_issue_count}" %> + <%= link_to training_tasks_count > 0 ? "#{l(:project_module_training_tasks)}#{switch_integer_into_k training_tasks_count}".html_safe : "#{l(:project_module_training_tasks)}", project_training_tasks_url(@project, :remote => true), :class => "pro_new_proname", :title => "#{training_tasks_count}" %>
  • <% end %> diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb index 59d339b9d..cce8ba32e 100644 --- a/app/views/projects/_applied_status.html.erb +++ b/app/views/projects/_applied_status.html.erb @@ -35,9 +35,15 @@
  • - <%= link_to "".html_safe+"Fork", forked_pop_project_path(@project), - :class=>"pro_new_topbtn_left fl", :remote => true %> - <%= project_fork_count %> + + <% if !@project.enabled_modules.where("name = 'training_tasks'").empty? && @project.forked_from_project_id.nil? %> + <%= link_to "开始实训", forked_pop_project_path(@project, :task => true), :class => "sy_btn_green fr" %> + <% else %> + <%= link_to "".html_safe+"Fork", forked_pop_project_path(@project), + :class=>"pro_new_topbtn_left fl", :remote => true %> + <%= project_fork_count %> + <% end %> +
  • diff --git a/app/views/repositories/_forked_popbox.html.erb b/app/views/repositories/_forked_popbox.html.erb index c28bef2d6..88b52ed0a 100644 --- a/app/views/repositories/_forked_popbox.html.erb +++ b/app/views/repositories/_forked_popbox.html.erb @@ -6,31 +6,61 @@
      - <% if User.current.id == @project.user_id %> -
    • - 自己不能Fork自己创建的项目 -
    • - <% else %> - <% if @project.gpid.blank? %> + <%# 实训项目和非实训项目,@type为true的时候为实训 %> + <% if @type %> + <% if User.current.id == @project.user_id %>
    • - 该项目还没有创建版本库,暂时不能Fork + 很抱歉,您不能在自己的实训项目中启动训练
    • - <% else %> -
    • - <% if has_forked_cur_project(@project) %> - 您已经Fork过该项目,点击“确定”将会跳入您Fork的项目主页,请问是否继续? - <% else %> - Fork将在后台执行
      平台将为您创建一个新的同名项目和版本库,请问是否继续? - <% end %> + <% else %> + <% if @project.gpid.blank? %> +
    • + 该项目还没有创建版本库,暂时不支持实训 +
    • + <% else %> +
    • + <% if has_training_cur_project(@project) %> + 您已经实训过该项目,点击“确定”将会跳转到您的实训项目主页,请问您是否继续? + <% else %> + 实训将在后台为您创建一个新的同名项目,并为您推送第一个任务,请问您是否继续? + <% end %> +
    • +
    • + + 取  消 + <%= link_to "确 定", {:controller => 'projects', :action => 'training_task_execute'}, :class => "sy_btn_blue fl ml20", :onclick => "hideModal();", :target => "_blank" %> +
      +
    • + <% end %> + <% end %> + <% else %> + <% if User.current.id == @project.user_id %> +
    • + 自己不能Fork自己创建的项目
    • -
    • - - 取  消 - <%= link_to "确 定", {:controller => 'repositories', :action => 'forked'}, :class => "sy_btn_blue fl ml20", :onclick => "hideModal();", :target => "_blank" %> -
      -
    • - <% end %> + <% else %> + <% if @project.gpid.blank? %> +
    • + 该项目还没有创建版本库,暂时不能Fork +
    • + <% else %> +
    • + <% if has_forked_cur_project(@project) %> + 您已经Fork过该项目,点击“确定”将会跳入您Fork的项目主页,请问是否继续? + <% else %> + Fork将在后台执行
      平台将为您创建一个新的同名项目和版本库,请问是否继续? + <% end %> +
    • +
    • + + 取  消 + <%= link_to "确 定", {:controller => 'repositories', :action => 'forked'}, :class => "sy_btn_blue fl ml20", :onclick => "hideModal();", :target => "_blank" %> +
      +
    • + <% end %> + <% end %> <% end %> +
    \ No newline at end of file diff --git a/app/views/training_tasks/_all_list.html.erb b/app/views/training_tasks/_all_list.html.erb new file mode 100644 index 000000000..b712b814d --- /dev/null +++ b/app/views/training_tasks/_all_list.html.erb @@ -0,0 +1,12 @@ +<% tasks.each do |task| -%> + <%= render :partial => 'content_list', :locals => {:activity => task, :user_activity_id => task.id} %> +<% end %> + +
    +
    +
      + <%= pagination_links_full @training_tasks_pages, @training_tasks_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/training_tasks/_content_list.html.erb b/app/views/training_tasks/_content_list.html.erb new file mode 100644 index 000000000..e3871c925 --- /dev/null +++ b/app/views/training_tasks/_content_list.html.erb @@ -0,0 +1,71 @@ +<% unless activity.author.nil? %> +
    +
    + +
    +
    + +
    + <%# if activity.try(:author).try(:realname) == ' ' %> + <%#= link_to activity.try(:author), user_path(activity.author_id), :class => "fl issues_list_name" %> + <%# else %> + <%#= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "fl issues_list_name" %> + <%# end %> + +

    <%= format_time(activity.created_at) %> 发布

    +

    <%= format_time(activity.updated_at) %> 更新

    +
    +
    +
      +
    • + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id)%> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id)%> + <% end %> +
    • + +
    • + <% case activity.tracker_id %> + <% when 1%> + 缺陷 + <% when 2%> + 功能 + <% when 3%> + 支持 + <% when 4%> + 任务 + <% when 5%> + 周报 + <% end %> +
    • +
    +
    +<% end %> + + + diff --git a/app/views/training_tasks/_detail.html.erb b/app/views/training_tasks/_detail.html.erb new file mode 100644 index 000000000..f7612de08 --- /dev/null +++ b/app/views/training_tasks/_detail.html.erb @@ -0,0 +1,54 @@ +
    +
    + <%= link_to image_tag(url_to_avatar(@training_task.author), :width => 46, :height => 46), user_path(@training_task.author), :class => "ping_dispic" %> +
    +
    +

    + <% case @training_task.tracker_id %> + <% when 1%> + 【缺陷】 + <% when 2%> + 【功能】 + <% when 3%> + 【支持】 + <% when 4%> + 【任务】 + <% when 5%> + 【周报】 + <% end %> + <%= @training_task.subject %>

    + +
    +
    + 由<%=link_to @training_task.author.show_name, user_path(@training_task.author), :class => "link-blue" %>添加于 <%= format_time(@training_task.created_at).html_safe %> +
    + <%= link_to "完成", complete_training_task_training_task_path(@training_task), :class => "sy_btn_green fr" %> + + + + <%#= render :partial => 'action_menu' %> +
    + <% if @training_task.description? || @training_task.attachments.any? -%> +
    + <% if @training_task.description? %> + <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> + <%= textAreailizable @training_task, :description, :attachments => @training_task.attachments %> + <% end %> +
    + <% end -%> + + <%# 附件局部刷新 %> +
    + <%= render :partial => 'task_attachments',:locals => {:training_task => @training_task} %> +
    + + <%#= render :partial => 'issues/attributes_show' %> +
    +
    + + \ No newline at end of file diff --git a/app/views/training_tasks/_form.html.erb b/app/views/training_tasks/_form.html.erb index 9ddf80d90..704a420fe 100644 --- a/app/views/training_tasks/_form.html.erb +++ b/app/views/training_tasks/_form.html.erb @@ -7,7 +7,8 @@
  • - <%= f.text_field :subject, :style => "font-size:small;width:606px;", :no_label => true %> + <%= f.text_field :subject, :style => "font-size:small;width:606px;", :no_label => true, :id => "training_task_id" %> + 标题不能为空 <%= javascript_tag do %> observeAutocompleteField('issue_subject', @@ -19,7 +20,6 @@ <% end %>
  • - <% if @issue.safe_attribute? 'description' %> <%= f.label_for_field :description, :no_label => true, :class => "label" %> <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> @@ -27,12 +27,12 @@ <%= f.kindeditor :description,:editor_id => "training_task_desc_editor", :width=>'85%', :height =>159, :resizeType => 0, :no_label => true, at_id: @project.id, at_type: @project.class.to_s %> <%# end %> <%#= wikitoolbar_for 'issue_description' %> - <% end %> +
  • - <%#= render :partial => 'attachments/form', :locals => {:container => @training_task} %> + <%= render :partial => 'attachments/form', :locals => {:container => @training_task} %>
  • <% if params[:action] == "new" %> diff --git a/app/views/training_tasks/_issue_replies.html.erb b/app/views/training_tasks/_issue_replies.html.erb new file mode 100644 index 000000000..4ea392103 --- /dev/null +++ b/app/views/training_tasks/_issue_replies.html.erb @@ -0,0 +1,89 @@ +
      + <% @journals.each do |comment| %> + +
    • +
      + <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %> +
      +
      + <%= render :partial => 'users/news_contents', :locals => {:comment => comment, :type => 'Issue', :user_activity_id => issue.id}%> + +
      + <% if comment.details.any? %> + <% details_to_strings(comment.details).each do |string| %> +

      <%= string %>

      + <% end %> + <% end %> +

      <%= comment.notes.html_safe %>

      +
      +
      +
      + + + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> + + + <%= link_to( + l(:button_reply), + {:controller => 'issues', :action => 'reply', :user_id => comment.user_id, :id => issue.id, :journal_id => comment.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <%= link_to( + l(:button_delete), + {:controller => 'issues',:action => 'delete_journal', :id => issue.id, :journal_id=>comment.id}, + :method => :get, + :remote => true, + :id => "delete_reply_#{comment.id}", + :class => 'fr mr20 undis', + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete) + ) if comment.user_id == User.current.id %> + +
      +
      +
      +

      +
      +
      +
    • + <% end %> +
    +
    + +
    + <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@training_task.author_id), :alt => "用户头像" %> +
    + +
    + <% if User.current.logged? %> +
    + <%= form_for('new_form', :url => add_journal_issue_path(@training_task.id, :is_issue_show => true), :method => "post", :remote => true) do |f| %> + +
    +
    + +
    +
    + <%= render :partial => 'attachments/issue_reply', :locals => {:container => @training_task} %> +
    + + +
    + <% end %> +
    + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
    + +
    +
    +
    \ No newline at end of file diff --git a/app/views/training_tasks/_reply_banner.html.erb b/app/views/training_tasks/_reply_banner.html.erb new file mode 100644 index 000000000..8b49a10bf --- /dev/null +++ b/app/views/training_tasks/_reply_banner.html.erb @@ -0,0 +1,5 @@ +<% count = @training_task.journals.count %> +回复<%= count>0 ? "(#{count})" : "" %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity => @training_task, :user_activity_id=> @training_task.id, :type => "activity"}%> + \ No newline at end of file diff --git a/app/views/training_tasks/_task_attachments.html.erb b/app/views/training_tasks/_task_attachments.html.erb new file mode 100644 index 000000000..c3e5fafc0 --- /dev/null +++ b/app/views/training_tasks/_task_attachments.html.erb @@ -0,0 +1,10 @@ +<% if training_task.attachments.any? %> +
    + + + <%= link_to_attachment_project training_task, :thumbnails => true %> +
    + <%#= call_hook(:view_issues_show_description_bottom, :training_task => training_task) %> +
    +
    +<% end %> \ No newline at end of file diff --git a/app/views/training_tasks/index.html.erb b/app/views/training_tasks/index.html.erb new file mode 100644 index 000000000..120b2c392 --- /dev/null +++ b/app/views/training_tasks/index.html.erb @@ -0,0 +1,232 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true,init_activity: true) %> +<% end %> + + + + +
    +
    + + 新建 +
    + <% if @training_tasks.empty? %> + <%= render :partial => "projects/no_data" %> + <% else %> +
    + <%= render :partial => 'all_list', :locals => {:tasks => @training_tasks, :query => @query, :training_tasks_pages=> @training_tasks_pages, :training_tasks_count=> @training_tasks_count, :project=> @project, :subject => @subject} %> +
    + <% end %> +<%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> +
    +
    + +
    +
    +
    +
    +
    +
    + diff --git a/app/views/training_tasks/new.html.erb b/app/views/training_tasks/new.html.erb index f81523562..c789561cc 100644 --- a/app/views/training_tasks/new.html.erb +++ b/app/views/training_tasks/new.html.erb @@ -11,7 +11,7 @@
    - <%= call_hook(:view_issues_new_top, {:training_task => @training_task}) %> + <%#= call_hook(:view_issues_new_top, {:training_task => @training_task}) %> <%= labelled_form_for @training_task, :url => project_training_tasks_url(@project), :html => {:id => 'project_training_form', :multipart => true} do |f| %> <%= error_messages_for 'training_task' %> diff --git a/app/views/training_tasks/show.html.erb b/app/views/training_tasks/show.html.erb new file mode 100644 index 000000000..1b61f634d --- /dev/null +++ b/app/views/training_tasks/show.html.erb @@ -0,0 +1,42 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true) %> + <%= javascript_include_tag 'create_kindeditor'%> +<% end %> + + +
    + + +
    +
    +
    +
    + <%= render :partial => 'detail'%> +
    +
    + + +
    +
    +
    +
    +
    + <%=render :partial => 'reply_banner' %> +
    +
    +
    +
    + <%= render :partial => 'issue_replies',:locals => {:issue => @training_task, :replies_all_i => 0} %> +
    +
    +
    +
    + +
    +
    + diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml index c153ba334..b19c5d2b4 100644 --- a/config/locales/commons/zh.yml +++ b/config/locales/commons/zh.yml @@ -268,6 +268,7 @@ zh: label_tags_numbers: "Tag统计" label_issue_plural: 问题跟踪 + label_training_task: 实训任务 # label_project_plural: 项目列表 label_user_plural: 用户列表 label_tags_call: 需求 diff --git a/config/routes.rb b/config/routes.rb index 6f280e7f1..891058d18 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1093,7 +1093,16 @@ RedmineApp::Application.routes.draw do resources :queries, :except => [:show] + resources :training_tasks do + member do + post 'complete_training_task' + end + collection do + end + end + resources :news, :only => [:index, :show, :edit, :update, :destroy] + match '/news/:id/comments', :to => 'comments#create', :via => :post #match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete delete '/news/:id/comments/:comment_id', :to => 'comments#destroy', as: :delete_news_comments diff --git a/db/schema.rb b/db/schema.rb index 7eafcc88f..591f6bce5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,15 +11,12 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20170217092859) do +ActiveRecord::Schema.define(:version => 20150604153000) do create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false - t.integer "activity_container_id" - t.string "activity_container_type", :default => "" - t.datetime "created_at" + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false end add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" @@ -52,62 +49,11 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - create_table "applied_contests", :force => true do |t| - t.integer "contest_id" - t.integer "user_id" - t.string "role" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" - add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" - - create_table "applied_messages", :force => true do |t| - t.integer "user_id" - t.integer "applied_id" - t.string "applied_type" - t.integer "viewed", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "name" - t.integer "applied_user_id" - t.integer "role" - t.integer "project_id" - end - create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "role", :default => 0 + t.integer "project_id", :null => false + t.integer "user_id", :null => false end - create_table "apply_add_schools", :force => true do |t| - t.string "name" - t.string "province" - t.string "city" - t.string "address" - t.string "remarks" - t.integer "school_id" - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - create_table "apply_homeworks", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" - add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" - create_table "apply_project_masters", :force => true do |t| t.integer "user_id" t.string "apply_type" @@ -117,67 +63,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_at", :null => false end - create_table "apply_resources", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "attachment_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id" - t.string "container_type" - t.text "content" - t.integer "apply_user_id" - end - - create_table "article_homepages", :force => true do |t| - t.string "title" - t.text "content" - t.integer "user_id" - t.integer "homepage_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" - add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" - - create_table "at_messages", :force => true do |t| - t.integer "user_id" - t.integer "at_message_id" - t.string "at_message_type" - t.boolean "viewed", :default => false - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sender_id" - end - - add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" - - create_table "attachment_histories", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.string "filename", :default => "" - t.string "disk_filename", :default => "" - t.integer "filesize", :default => 0 - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "" - t.integer "downloads", :default => 0 - t.integer "author_id" - t.datetime "created_on" - t.text "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.integer "copy_from" - t.integer "quotes" - t.integer "version" - t.integer "attachment_id" - t.integer "is_publish", :default => 1 - t.date "publish_time" - end - create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 @@ -189,14 +74,12 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "downloads", :default => 0, :null => false t.integer "author_id", :default => 0, :null => false t.datetime "created_on" - t.text "description" + t.string "description" t.string "disk_directory" t.integer "attachtype", :default => 1 t.integer "is_public", :default => 1 t.integer "copy_from" t.integer "quotes" - t.integer "is_publish", :default => 1 - t.datetime "publish_time" end add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" @@ -258,65 +141,16 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "open_anonymous_evaluation", :default => 1 end - create_table "blog_comments", :force => true do |t| - t.integer "blog_id", :null => false - t.integer "parent_id" - t.string "title", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comment_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "root_id" - end - - add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" - - create_table "blog_messages", :force => true do |t| - t.integer "user_id" - t.integer "blog_message_id" - t.integer "blog_id" - t.string "blog_message_type" - t.boolean "viewed", :default => false - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_operator_id" - end - - create_table "blogs", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.integer "position", :default => 1 - t.integer "article_count", :default => 0, :null => false - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comments_id" - t.integer "parent_id" - t.integer "author_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "homepage_id" - end - create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false t.integer "last_message_id" t.integer "parent_id" t.integer "course_id" - t.integer "org_subfield_id" - t.integer "contest_id" - t.integer "training_project_id" end add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" @@ -351,16 +185,14 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" - t.integer "project_id" - t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" @@ -376,69 +208,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - - create_table "code_tests", :force => true do |t| - t.integer "homework_id" - t.integer "wait_time", :default => 0 - t.integer "language" - t.integer "status" - t.integer "time_used", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "student_work_id", :default => 0 - end - create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false @@ -446,173 +215,61 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.text "comments" t.datetime "created_on", :null => false t.datetime "updated_on", :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" end add_index "comments", ["author_id"], :name => "index_comments_on_author_id" add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" - create_table "commit_issues", :force => true do |t| - t.string "commit_id" - t.integer "issue_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "commits", :force => true do |t| - t.integer "repository_id" - t.string "version" - t.string "committer" - t.text "comments" - t.datetime "committed_on" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contest_activities", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_act_id" - t.string "contest_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" - add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" - - create_table "contest_member_roles", :force => true do |t| - t.integer "contest_member_id" - t.integer "role_id" - t.boolean "is_current", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" - add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" - - create_table "contest_members", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.boolean "is_collect", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" - add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" - - create_table "contest_messages", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_message_id" - t.string "contest_message_type" - t.boolean "viewed", :default => false + create_table "contest_notifications", :force => true do |t| + t.text "title" t.text "content" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" - add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" - - create_table "contestant_for_contests", :force => true do |t| - t.integer "student_id" - t.integer "contest_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end - add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" - add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" - - create_table "contestant_work_evaluation_distributions", :force => true do |t| + create_table "contesting_projects", :force => true do |t| + t.integer "project_id" + t.string "contest_id" t.integer "user_id" - t.integer "contestant_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" end - add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" - - create_table "contestant_work_projects", :force => true do |t| + create_table "contesting_softapplications", :force => true do |t| + t.integer "softapplication_id" t.integer "contest_id" - t.integer "work_id" - t.integer "contestant_work_id" - t.integer "project_id" t.integer "user_id" - t.boolean "is_leader" + t.string "description" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.string "reward" end - add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" - add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" - add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" - add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" - - create_table "contestant_work_scores", :force => true do |t| - t.integer "contestant_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" - add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" - - create_table "contestant_works", :force => true do |t| - t.string "name" + create_table "contestnotifications", :force => true do |t| + t.integer "contest_id" + t.string "title" + t.string "summary" t.text "description" - t.integer "work_id" - t.integer "user_id" - t.float "work_score" - t.integer "project_id" - t.integer "work_status" - t.datetime "commit_time" - t.boolean "is_delete", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "judge_score" + t.integer "author_id" + t.integer "notificationcomments_count" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end - add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" - add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" - add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" - create_table "contests", :force => true do |t| - t.integer "user_id" t.string "name" - t.text "description" - t.boolean "is_public" - t.boolean "is_delete", :default => false - t.integer "visits", :default => 0 - t.string "invite_code" - t.integer "invite_code_halt", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "budget", :default => "" + t.integer "author_id" + t.date "deadline" + t.string "description" + t.integer "commit" + t.string "password" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false end - create_table "course_activities", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_act_id" - t.string "course_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" - create_table "course_attachments", :force => true do |t| t.string "filename" t.string "disk_filename" @@ -631,24 +288,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "container_id", :default => 0 end - create_table "course_contributor_scores", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.integer "message_num", :default => 0 - t.integer "message_reply_num", :default => 0 - t.integer "news_reply_num", :default => 0 - t.integer "resource_num", :default => 0 - t.integer "journal_num", :default => 0 - t.integer "journal_reply_num", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "total_score", :default => 0 - t.integer "homework_journal_num", :default => 0 - t.integer "news_num", :default => 0 - end - - add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" - create_table "course_groups", :force => true do |t| t.string "name" t.integer "course_id" @@ -656,23 +295,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_at", :null => false end - add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" - - create_table "course_homework_statistics", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "committed_work_num", :default => 0 - t.integer "un_commit_work_num", :default => 0 - t.integer "late_commit_work_num", :default => 0 - t.integer "absence_evaluation_work_num", :default => 0 - t.integer "un_evaluation_work_num", :default => 0 - t.integer "appeal_num", :default => 0 - t.float "average_score", :default => 0.0 - t.float "total_score", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "course_infos", :force => true do |t| t.integer "course_id" t.integer "user_id" @@ -680,23 +302,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_at", :null => false end - create_table "course_messages", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_message_id" - t.string "course_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "content" - t.integer "status" - t.integer "apply_user_id" - t.integer "apply_result" - end - - add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" - add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" - create_table "course_statuses", :force => true do |t| t.integer "changesets_count" t.integer "watchers_count" @@ -714,8 +319,8 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "code" t.integer "time" t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "location" t.string "term" t.string "string" @@ -725,34 +330,15 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "class_period" t.integer "school_id" t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 t.integer "lft" t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 - t.integer "end_time" - t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 - t.integer "syllabus_id" - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.integer "professional_level_id", :limit => 1 - t.integer "invite_code_halt", :limit => 1, :default => 0 - t.integer "os_allow", :default => 0 + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 end - add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true - add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" - create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -798,14 +384,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - create_table "data_exceptions", :force => true do |t| - t.string "message" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "delayed_jobs", :force => true do |t| t.integer "priority", :default => 0, :null => false t.integer "attempts", :default => 0, :null => false @@ -822,11 +400,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "disciplines", :force => true do |t| - t.string "name" - t.integer "professional_level_id", :limit => 1 - end - create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -848,34 +421,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 - t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false - end - - create_table "editor_of_documents", :force => true do |t| - t.integer "editor_id" - t.integer "org_document_comment_id" - t.datetime "created_at" - end - create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -898,67 +443,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - create_table "exercise_answers", :force => true do |t| - t.integer "user_id" - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_choices", :force => true do |t| - t.integer "exercise_question_id" - t.text "choice_text" - t.integer "choice_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_questions", :force => true do |t| - t.text "question_title" - t.integer "question_type" - t.integer "question_number" - t.integer "exercise_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_score" - end - - create_table "exercise_standard_answers", :force => true do |t| - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_users", :force => true do |t| - t.integer "user_id" - t.integer "exercise_id" - t.integer "score" - t.datetime "start_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "end_at" - t.integer "status" - t.integer "commit_status", :default => 0 - end - - create_table "exercises", :force => true do |t| - t.text "exercise_name" - t.text "exercise_description" - t.integer "course_id" - t.integer "exercise_status" - t.integer "user_id" - t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "publish_time" - t.datetime "end_time" - t.integer "show_result" - end - create_table "first_pages", :force => true do |t| t.string "web_title" t.string "title" @@ -979,29 +463,11 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "forge_act_id" t.string "forge_act_type" t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "training_project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" - add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" - - create_table "forge_messages", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_message_id" - t.string "forge_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "secret_key" - t.integer "status" - t.integer "operate_user_id" - end - - add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" - add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" create_table "forums", :force => true do |t| t.string "name", :null => false @@ -1016,14 +482,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "locked" end - create_table "forwards", :force => true do |t| - t.integer "from_id" - t.string "from_type" - t.integer "to_id" - t.string "to_type" - t.datetime "created_at" - end - create_table "groups_users", :id => false, :force => true do |t| t.integer "group_id", :null => false t.integer "user_id", :null => false @@ -1031,16 +489,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - create_table "homepages", :force => true do |t| - t.string "name" - t.integer "article_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" - create_table "homework_attaches", :force => true do |t| t.integer "bid_id" t.integer "user_id" @@ -1063,33 +511,13 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.text "description" t.date "publish_time" t.date "end_time" - t.integer "homework_type", :default => 1 + t.integer "homework_type", :default => 1 t.string "late_penalty" t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 - t.integer "anonymous_comment", :default => 0 - t.integer "quotes", :default => 0 - t.integer "is_open", :default => 0 - t.datetime "simi_time" - t.integer "score_open", :default => 1 - t.integer "anonymous_appeal", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end - add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" - - create_table "homework_detail_groups", :force => true do |t| - t.integer "homework_common_id" - t.integer "min_num" - t.integer "max_num" - t.integer "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" - create_table "homework_detail_manuals", :force => true do |t| t.float "ta_proportion" t.integer "comment_status" @@ -1100,19 +528,14 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "homework_common_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "no_anon_penalty", :default => 1 - t.integer "appeal_penalty", :default => 0 - t.integer "ta_mode", :default => 1 end create_table "homework_detail_programings", :force => true do |t| t.string "language" t.text "standard_code", :limit => 2147483647 t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "ta_proportion", :default => 0.1 - t.integer "question_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "homework_evaluations", :force => true do |t| @@ -1136,8 +559,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "homework_common_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "result" - t.text "error_msg" end create_table "homework_users", :force => true do |t| @@ -1147,16 +568,11 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_at", :null => false end - create_table "innodb_monitor", :id => false, :force => true do |t| - t.integer "a" - end - create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "mail" end create_table "issue_categories", :force => true do |t| @@ -1270,9 +686,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.text "notes" t.datetime "created_on", :null => false t.boolean "private_notes", :default => false, :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" end add_index "journals", ["created_on"], :name => "index_journals_on_created_on" @@ -1287,19 +700,15 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.text "notes" t.integer "status" t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false t.string "m_parent_id" t.boolean "is_readed" t.integer "m_reply_count" t.integer "m_reply_id" t.integer "is_comprehensive_evaluation" - t.integer "private", :default => 0 - t.integer "root_id" end - add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" - create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1312,10 +721,9 @@ ActiveRecord::Schema.define(:version => 20170217092859) do end create_table "member_roles", :force => true do |t| - t.integer "member_id", :null => false - t.integer "role_id", :null => false + t.integer "member_id", :null => false + t.integer "role_id", :null => false t.integer "inherited_from" - t.integer "is_current", :default => 1 end add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" @@ -1328,27 +736,12 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.boolean "mail_notification", :default => false, :null => false t.integer "course_id", :default => -1 t.integer "course_group_id", :default => 0 - t.integer "is_collect", :default => 1 end - add_index "members", ["course_id"], :name => "index_members_on_course_id" add_index "members", ["project_id"], :name => "index_members_on_project_id" add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true add_index "members", ["user_id"], :name => "index_members_on_user_id" - create_table "memo_messages", :force => true do |t| - t.integer "user_id" - t.integer "forum_id" - t.integer "memo_id" - t.string "memo_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" - add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" - create_table "memos", :force => true do |t| t.integer "forum_id", :null => false t.integer "parent_id" @@ -1362,22 +755,8 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "viewed_count", :default => 0 - t.integer "root_id" end - add_index "memos", ["root_id"], :name => "index_memos_on_root_id" - - create_table "message_alls", :force => true do |t| - t.integer "user_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" - add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" - create_table "messages", :force => true do |t| t.integer "board_id", :null => false t.integer "parent_id" @@ -1390,10 +769,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_on", :null => false t.boolean "locked", :default => false t.integer "sticky", :default => 0 - t.integer "reply_id" - t.integer "quotes" - t.integer "status", :default => 0 - t.integer "root_id" end add_index "messages", ["author_id"], :name => "index_messages_on_author_id" @@ -1401,20 +776,16 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "messages", ["created_on"], :name => "index_messages_on_created_on" add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" - add_index "messages", ["root_id"], :name => "index_messages_on_root_id" create_table "news", :force => true do |t| t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" t.text "description" - t.integer "author_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false t.integer "course_id" - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "contest_id" end add_index "news", ["author_id"], :name => "index_news_on_author_id" @@ -1438,13 +809,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_at", :null => false end - create_table "onclick_times", :force => true do |t| - t.integer "user_id" - t.datetime "onclick_time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "open_id_authentication_associations", :force => true do |t| t.integer "issued" t.integer "lifetime" @@ -1500,102 +864,11 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "project_id" end - create_table "org_activities", :force => true do |t| - t.integer "user_id" - t.integer "org_act_id" - t.string "org_act_type" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_courses", :force => true do |t| - t.integer "organization_id" - t.integer "course_id" - t.datetime "created_at" - end - - create_table "org_document_comments", :force => true do |t| - t.text "title" - t.text "content" - t.integer "organization_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "status", :default => 0 - t.integer "root_id" - end - - add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" - - create_table "org_member_roles", :force => true do |t| - t.integer "org_member_id" - t.integer "role_id" - end - - create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_messages", :force => true do |t| - t.integer "user_id" - t.integer "sender_id" - t.integer "organization_id" - t.string "message_type" - t.integer "message_id" - t.integer "viewed" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - end - - create_table "org_projects", :force => true do |t| - t.integer "organization_id" - t.integer "project_id" - t.datetime "created_at" - end - - create_table "org_subfield_messages", :force => true do |t| - t.integer "org_subfield_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_subfields", :force => true do |t| - t.integer "organization_id" - t.integer "priority" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 1 - end - create_table "organizations", :force => true do |t| t.string "name" - t.text "description" - t.integer "creator_id" - t.integer "home_id" - t.boolean "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "allow_guest_download", :default => true - t.integer "visits", :default => 0 - t.integer "show_mode", :default => 0 - t.integer "allow_teacher", :default => 0 + t.string "logo_link" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "phone_app_versions", :force => true do |t| @@ -1618,11 +891,9 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "question_type" t.integer "is_necessary" t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "question_number" - t.integer "max_choices", :default => 0 - t.integer "min_choices", :default => 0 end create_table "poll_users", :force => true do |t| @@ -1673,24 +944,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_at", :null => false end - create_table "principal_activities", :force => true do |t| - t.integer "user_id" - t.integer "principal_id" - t.integer "principal_act_id" - t.string "principal_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "professional_levels", :force => true do |t| - t.integer "level" - end - - create_table "professions", :force => true do |t| - t.string "name" - t.integer "discipline_id", :limit => 1 - end - create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1701,19 +954,14 @@ ActiveRecord::Schema.define(:version => 20170217092859) do create_table "project_scores", :force => true do |t| t.string "project_id" t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 - t.datetime "commit_time" - t.integer "pull_request_num", :default => 0 - t.integer "training_project_id", :default => -1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 end create_table "project_statuses", :force => true do |t| @@ -1736,39 +984,26 @@ ActiveRecord::Schema.define(:version => 20170217092859) do end create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false + t.string "name", :default => "", :null => false t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false t.integer "parent_id" t.datetime "created_on" t.datetime "updated_on" t.string "identifier" - t.integer "status", :default => 1, :null => false + t.integer "status", :default => 1, :null => false t.integer "lft" t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false + t.boolean "inherit_members", :default => false, :null => false t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 t.integer "user_id" + t.integer "dts_test", :default => 0 t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "boards_count", :default => 0 - t.integer "news_count", :default => 0 - t.integer "acts_count", :default => 0 - t.integer "journals_count", :default => 0 - t.integer "boards_reply_count", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 end add_index "projects", ["lft"], :name => "index_projects_on_lft" @@ -1782,30 +1017,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - create_table "pull_requests", :force => true do |t| - t.integer "pull_request_id" - t.integer "gpid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - t.integer "project_id" - t.string "title" - end - - create_table "quality_analyses", :force => true do |t| - t.integer "project_id" - t.string "author_login" - t.string "rep_identifier" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sonar_version", :default => 0 - t.string "path" - t.string "branch" - t.string "language" - t.string "sonar_name" - end - create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1850,18 +1061,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "topic_resource" end - create_table "rep_statics", :force => true do |t| - t.integer "project_id" - t.integer "commits_num" - t.string "uname" - t.string "email" - t.integer "add" - t.integer "del" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "changeset" - end - create_table "repositories", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "url", :default => "", :null => false @@ -1904,20 +1103,9 @@ ActiveRecord::Schema.define(:version => 20170217092859) do create_table "schools", :force => true do |t| t.string "name" t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "logo_link" - t.string "pinyin" - t.integer "school_type", :default => 0 - end - - create_table "secdomains", :force => true do |t| - t.integer "sub_type" - t.string "subname" - t.integer "pid", :default => 0 - t.string "desc" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false end create_table "seems_rateable_cached_ratings", :force => true do |t| @@ -1961,24 +1149,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "description" end - create_table "shield_activities", :force => true do |t| - t.string "container_type" - t.integer "container_id" - t.string "shield_type" - t.integer "shield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "shield_wechat_messages", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.integer "shield_id" - t.string "shield_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1997,82 +1167,20 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "project_id" end - create_table "sonar_errors", :force => true do |t| - t.integer "project_id" - t.string "jenkins_job_name" - t.text "output" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "ssos", :force => true do |t| - t.integer "user_id" - t.string "openid" - t.string "name" - t.string "password" - t.string "email" - t.integer "sex" - t.string "school" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" - - create_table "student_work_projects", :force => true do |t| - t.integer "homework_common_id" - t.integer "student_work_id" - t.integer "project_id" - t.integer "user_id" - t.integer "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "course_id" - end - - add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" - add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" - add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" - add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" - - create_table "student_work_tests", :force => true do |t| - t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 - t.text "results" - t.text "src" - end - - add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" - create_table "student_works", :force => true do |t| t.string "name" - t.text "description", :limit => 2147483647 + t.text "description" t.integer "homework_common_id" t.integer "user_id" t.float "final_score" t.float "teacher_score" t.float "student_score" t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "late_penalty", :default => 0 - t.integer "absence_penalty", :default => 0 - t.float "system_score", :default => 0.0 - t.boolean "is_test", :default => false - t.integer "simi_id" - t.integer "simi_value" - t.float "work_score" - t.integer "work_status", :default => 0 - t.datetime "commit_time" - t.integer "is_delete", :default => 0 - t.integer "appeal_penalty", :default => 0 + t.integer "project_id", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end - add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" - create_table "student_works_evaluation_distributions", :force => true do |t| t.integer "student_work_id" t.integer "user_id" @@ -2086,22 +1194,8 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "score" t.text "comment" t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "appeal_status", :default => 0 - t.boolean "is_hidden", :default => false - end - - add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" - add_index "student_works_scores", ["user_id"], :name => "user_id" - - create_table "student_works_scores_appeals", :force => true do |t| - t.integer "student_works_score_id" - t.integer "user_id" - t.text "comment" - t.integer "appeal_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "students_for_courses", :force => true do |t| @@ -2114,80 +1208,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" - create_table "sub_document_comments", :force => true do |t| - t.text "content" - t.text "title" - t.integer "sub_domain_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.integer "locked" - t.integer "sticky" - t.integer "org_subfield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "sub_domains", :force => true do |t| - t.integer "org_subfield_id" - t.integer "priority", :default => 0 - t.string "name" - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "subfield_subdomain_dirs", :force => true do |t| - t.integer "org_subfield_id" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "syllabus_members", :force => true do |t| - t.integer "rank" - t.integer "syllabus_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" - add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" - add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" - - create_table "syllabuses", :force => true do |t| - t.string "title" - t.text "description" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "eng_name" - t.integer "syllabus_type" - t.integer "credit" - t.integer "hours" - t.integer "theory_hours" - t.integer "practice_hours" - t.string "applicable_major" - t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 - t.integer "professional_level_id", :limit => 1 - end - - add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" - end - create_table "taggings", :force => true do |t| t.integer "tag_id" t.integer "taggable_id" @@ -2255,79 +1275,8 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.integer "fields_bits", :default => 0 end - create_table "trackers_training_projects", :id => false, :force => true do |t| - t.integer "training_project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "trackers_training_projects", ["training_project_id"], :name => "projects_trackers_training_project_id" - - create_table "training_projects", :force => true do |t| - t.string "name", :limit => 30, :null => false - t.text "description" - t.string "homepage", :limit => 60 - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.integer "projects_count", :default => 0 - t.string "identifier", :null => false - t.integer "status", :default => 1 - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "training_tasks", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.string "subject" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "author_id" - t.integer "status", :limit => 1, :default => 1 - end - - create_table "user_actions", :force => true do |t| - t.integer "user_id" - t.string "action_type" - t.integer "action_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_activities", :force => true do |t| - t.string "act_type" - t.integer "act_id" - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" - create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false + t.integer "user_id", :null => false t.date "birthday" t.string "brief_introduction" t.integer "gender" @@ -2335,8 +1284,8 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "occupation" t.integer "work_experience" t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "technical_title" t.integer "identity" t.string "student_id" @@ -2344,23 +1293,8 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "student_realname" t.string "location_city" t.integer "school_id" - t.string "description", :default => "" end - add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" - - create_table "user_feedback_messages", :force => true do |t| - t.integer "user_id" - t.integer "journals_for_message_id" - t.string "journals_for_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" - add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" - create_table "user_grades", :force => true do |t| t.integer "user_id", :null => false t.integer "project_id", :null => false @@ -2426,26 +1360,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "bindtype", :default => 0 - end - create_table "users", :force => true do |t| t.string "login", :default => "", :null => false t.string "hashed_password", :limit => 40, :default => "", :null => false @@ -2463,10 +1377,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "identity_url" t.string "mail_notification", :default => "", :null => false t.string "salt", :limit => 64 - t.integer "gid" - t.integer "visits", :default => 0 - t.integer "excellent_teacher", :default => 0 - t.integer "excellent_student", :default => 0 end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" @@ -2483,23 +1393,11 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.string "wiki_page_title" t.string "status", :default => "open" t.string "sharing", :default => "none", :null => false - t.integer "user_id" end add_index "versions", ["project_id"], :name => "versions_project_id" add_index "versions", ["sharing"], :name => "index_versions_on_sharing" - create_table "visitors", :force => true do |t| - t.integer "user_id" - t.integer "master_id" - t.datetime "updated_on" - t.datetime "created_on" - end - - add_index "visitors", ["master_id"], :name => "index_visitors_master_id" - add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" - add_index "visitors", ["user_id"], :name => "index_visitors_user_id" - create_table "watchers", :force => true do |t| t.string "watchable_type", :default => "", :null => false t.integer "watchable_id", :default => 0, :null => false @@ -2525,16 +1423,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do t.datetime "updated_at", :null => false end - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - - add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" - create_table "wiki_content_versions", :force => true do |t| t.integer "wiki_content_id", :null => false t.integer "page_id", :null => false @@ -2591,28 +1479,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "wikis", ["project_id"], :name => "wikis_project_id" - create_table "work_detail_groups", :force => true do |t| - t.integer "work_id" - t.integer "min_num" - t.integer "max_num" - t.boolean "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" - - create_table "work_detail_manuals", :force => true do |t| - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" - create_table "workflows", :force => true do |t| t.integer "tracker_id", :default => 0, :null => false t.integer "old_status_id", :default => 0, :null => false @@ -2630,27 +1496,6 @@ ActiveRecord::Schema.define(:version => 20170217092859) do add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - create_table "works", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "work_type" - t.integer "contest_id" - t.boolean "is_delete", :default => false - t.boolean "score_open", :default => false - t.boolean "is_open", :default => false - t.integer "work_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "online_evaluation", :default => false - t.boolean "score_valid", :default => true - end - - add_index "works", ["contest_id"], :name => "index_works_on_contest_id" - add_index "works", ["user_id"], :name => "index_works_on_user_id" - create_table "works_categories", :force => true do |t| t.string "category" t.datetime "created_at", :null => false diff --git a/lib/redmine.rb b/lib/redmine.rb index baf7e413b..86b513539 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -194,8 +194,8 @@ Redmine::AccessControl.map do |map| end map.project_module :training_tasks do |map| - # map.permission :manage_training_tasks, {:training_tasks => [:new, :create]}, :require => :loggedin - # map.permission :view_training_tasks, {:training_tasks => :index, :versions => :download}, :read => true + map.permission :manage_training_tasks, {:training_tasks => [:new, :create]}, :require => :loggedin + map.permission :view_training_tasks, {:training_tasks => :index, :versions => :download}, :read => true end # map.project_module :time_tracking do |map| @@ -418,6 +418,7 @@ Redmine::MenuManager.map :project_menu do |menu| #menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id # :if => Proc.new { |p| p.shared_versions.any? } menu.push :issues, { :controller => 'issues', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('issue_tracking') } ,:param => :project_id, :caption => :label_issue_plural + menu.push :training_tasks, { :controller => 'training_tasks', :action => 'index' },:if => Proc.new {|p| p.enabled_module_names.include?('training_tasks') } ,:param => :project_id, :caption => :label_training_task # menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, # :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } # menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt From c3cd2ea153747a153945c5616c900e0e4f7e52c3 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 18 Feb 2017 18:00:52 +0800 Subject: [PATCH 032/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E7=A8=8B=E4=BD=9C=E4=B8=9A=E5=9C=A8=E6=96=B0=E5=BB=BA=E5=92=8C?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=97=B6=EF=BC=8C=E9=9C=80=E8=A6=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=BE=93=E5=85=A5=E8=BE=93=E5=87=BA=E6=A0=B7=E4=BE=8B?= =?UTF-8?q?=E7=9A=84=E5=BD=95=E5=85=A5=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 11 ++ app/controllers/users_controller.rb | 10 + app/models/homework_common.rb | 1 + app/models/homework_sample.rb | 4 + .../_homework_post_brief.html.erb | 26 +++ app/views/users/_course_homework.html.erb | 2 +- app/views/users/_intro_content.html.erb | 26 ++- app/views/users/_user_homework_form.html.erb | 16 +- .../users/_user_programing_attr.html.erb | 173 +++++++++++++----- .../20170218074506_create_homework_samples.rb | 12 ++ db/schema.rb | 12 +- public/javascripts/course.js | 79 +++++++- public/javascripts/new_user.js | 165 +---------------- public/stylesheets/css/common.css | 2 +- public/stylesheets/css/courses.css | 5 +- spec/factories/homework_samples.rb | 8 + spec/models/homework_sample_spec.rb | 5 + 17 files changed, 344 insertions(+), 213 deletions(-) create mode 100644 app/models/homework_sample.rb create mode 100644 db/migrate/20170218074506_create_homework_samples.rb create mode 100644 spec/factories/homework_samples.rb create mode 100644 spec/models/homework_sample_spec.rb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 7d6539e8d..fadc25542 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -179,6 +179,17 @@ class HomeworkCommonController < ApplicationController end end + @homework.homework_samples.delete_all if params[:sample] + sample_inputs = params[:sample][:input] if params[:sample] + if Array === sample_inputs + sample_inputs.each_with_index do |val, i| + @homework.homework_samples << HomeworkSample.new( + input: val, + output: params[:sample][:output][i] + ) + end + end + @homework.homework_tests.delete_all if params[:program] inputs = params[:program][:input] if params[:program] if Array === inputs diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6fbdaa34f..c1aee3dd8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1397,6 +1397,16 @@ class UsersController < ApplicationController end homework_detail_programing.language = params[:language_type].to_i + sample_inputs = params[:sample][:input] + if Array === sample_inputs + sample_inputs.each_with_index do |val, i| + homework.homework_samples << HomeworkSample.new( + input: val, + output: params[:sample][:output][i] + ) + end + end + inputs = params[:program][:input] if Array === inputs inputs.each_with_index do |val, i| diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 34147a7d1..13b076617 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -15,6 +15,7 @@ class HomeworkCommon < ActiveRecord::Base has_one :homework_detail_group, :dependent => :destroy has_many :student_work_projects, :dependent => :destroy has_many :homework_tests, :dependent => :destroy + has_many :homework_samples, :dependent => :destroy has_many :student_works, :dependent => :destroy, :conditions => "is_test=0 and is_delete != 1" has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表 has_many :journals_for_messages, :as => :jour, :dependent => :destroy diff --git a/app/models/homework_sample.rb b/app/models/homework_sample.rb new file mode 100644 index 000000000..67bc85ff6 --- /dev/null +++ b/app/models/homework_sample.rb @@ -0,0 +1,4 @@ +class HomeworkSample < ActiveRecord::Base + belongs_to :homework_common + attr_accessible :input, :output, :homework_common_id +end diff --git a/app/views/student_work/_homework_post_brief.html.erb b/app/views/student_work/_homework_post_brief.html.erb index 0419db665..c4bc2561f 100644 --- a/app/views/student_work/_homework_post_brief.html.erb +++ b/app/views/student_work/_homework_post_brief.html.erb @@ -40,6 +40,32 @@ <%= homework.description.html_safe %>
    + + <% samples = homework.homework_samples %> + <% unless samples.empty? %> +
    +

    输入输出样例:<%= samples.count %>组

    + <% samples.each_with_index do |sample, index| %> + #<%= index + 1 %> +
      +
    • + 样例输入: +
      +
      <%=sample.input %>
      +
      +
    • +
    • + 样例输出: +
      +
      <%=sample.output %>
      +
      +
    • +
    +
    + <% end %> +
    + <% end %> + <% if is_pro %>
    测试集:<%=homework.homework_tests.count %>组 diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index b7ed168f4..13a057135 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -42,7 +42,7 @@ <% end %> - <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %> + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description, :samples => activity.homework_samples} %>
    diff --git a/app/views/users/_intro_content.html.erb b/app/views/users/_intro_content.html.erb index 04babe100..059fc5627 100644 --- a/app/views/users/_intro_content.html.erb +++ b/app/views/users/_intro_content.html.erb @@ -1,7 +1,31 @@ -
    +
    <%= content.to_s.html_safe %>
    + + <% if defined?(samples) && !samples.empty? %> +
    +

    输入输出样例:<%= samples.count %>组

    + <% samples.each_with_index do |sample, index| %> + #<%= index + 1 %> +
      +
    • + 样例输入: +
      +
      <%=sample.input %>
      +
      +
    • +
    • + 样例输出: +
      +
      <%=sample.output %>
      +
      +
    • +
    +
    + <% end %> +
    + <% end %>
    + + diff --git a/app/views/users/_user_programing_attr.html.erb b/app/views/users/_user_programing_attr.html.erb index d1e750ccb..885013600 100644 --- a/app/views/users/_user_programing_attr.html.erb +++ b/app/views/users/_user_programing_attr.html.erb @@ -1,76 +1,155 @@
    - 测试集设置: - - 温馨提示:您可以在发布作业后,在作业"模拟答题"中进行标准代码的检测。 -
    - <% if edit_mode && homework.is_program_homework? %> - <% homework.homework_tests.each_with_index do |test, index| %> -
    - - - +
    + 输入输出示例: + 温馨提示:请至少输入一组样例供学生参考。 + +
    + <% if edit_mode && homework.is_program_homework? %> + <% homework.homework_samples.each_with_index do |sample, index| %> +
    + + <% unless not_allow_select %> - - <% if index != 0 %> - - <% end %> + + <% if index != 0 %> + + <% end %> <% end %>
    -
    - <% end %> - <% else %> -
    - - - - -
    -
    - <% end %> + +
    +
    + <% end %> + <% else %> +
    + + + +
    + +
    +
    + <% end %> +
    + +
    + 测试集设置: + + 温馨提示:您可以在发布作业后,在作业"模拟答题"中进行标准代码的检测。 + +
    + <% if edit_mode && homework.is_program_homework? %> + <% homework.homework_tests.each_with_index do |test, index| %> +
    + + + + <% unless not_allow_select %> + + <% if index != 0 %> + + <% end %> + <% end %> +
    +
    + <% end %> + <% else %> +
    + + + + + +
    +
    + <% end %> +
    \ No newline at end of file diff --git a/db/migrate/20170218074506_create_homework_samples.rb b/db/migrate/20170218074506_create_homework_samples.rb new file mode 100644 index 000000000..fb864de0b --- /dev/null +++ b/db/migrate/20170218074506_create_homework_samples.rb @@ -0,0 +1,12 @@ +class CreateHomeworkSamples < ActiveRecord::Migration + def change + create_table :homework_samples do |t| + t.text :input + t.text :output + t.references :homework_common + + t.timestamps + end + add_index :homework_samples, :homework_common_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 6b7ab2ef1..b06d1196e 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 => 20170217104309) do +ActiveRecord::Schema.define(:version => 20170218074506) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1175,6 +1175,16 @@ ActiveRecord::Schema.define(:version => 20170217104309) do add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + create_table "homework_samples", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_samples", ["homework_common_id"], :name => "index_homework_samples_on_homework_common_id" + create_table "homework_tests", :force => true do |t| t.text "input" t.text "output" diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 29098938c..9d6f0eaa1 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -917,7 +917,13 @@ function regex_group_attr(){ //验证编程作业的参数 function regex_program_attr() { var result = true; - $.each($('#programHomework textarea.InputBox'), function(i, val){ + $.each($("#programHomework textarea[name='sample[input][]']"), function(i, val){ + if (result && $(val).val().length<=0) { + $(val)[0].focus(); + result = false; + } + }); + $.each($("#programHomework textarea[name='program[input][]']"), function(i, val){ if (result && $(val).val().length<=0) { $(val)[0].focus(); result = false; @@ -1442,6 +1448,77 @@ function show_student_work(url){ ); } +//textarea自适应高度 纯js写的 有浏览器判断 +/** + * 文本框根据输入内容自适应高度 + * @param {HTMLElement} 输入框元素 + * @param {Number} 设置光标与输入框保持的距离(默认0) + * @param {Number} 设置最大高度(可选) + */ +var autoTextarea = function (elem, extra, maxHeight) { + extra = extra || 0; + var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX' in window, + isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera'), + addEvent = function (type, callback) { + elem.addEventListener ? + elem.addEventListener(type, callback, false) : + elem.attachEvent('on' + type, callback); + }, + getStyle = elem.currentStyle ? function (name) { + var val = elem.currentStyle[name]; + + if (name === 'height' && val.search(/px/i) !== 1) { + var rect = elem.getBoundingClientRect(); + return rect.bottom - rect.top - + parseFloat(getStyle('paddingTop')) - + parseFloat(getStyle('paddingBottom')) + 'px'; + }; + + return val; + } : function (name) { + return getComputedStyle(elem, null)[name]; + }, + minHeight = parseFloat(getStyle('height')); + + + elem.style.resize = 'none'; + + var change = function () { + var scrollTop, height, + padding = 0, + style = elem.style; + + if (elem._length === elem.value.length) return; + elem._length = elem.value.length; + + if (!isFirefox && !isOpera) { + padding = parseInt(getStyle('paddingTop')) + parseInt(getStyle('paddingBottom')); + }; + scrollTop = document.body.scrollTop || document.documentElement.scrollTop; + + elem.style.height = minHeight + 'px'; + if (elem.scrollHeight > minHeight) { + if (maxHeight && elem.scrollHeight > maxHeight) { + height = maxHeight - padding; + style.overflowY = 'auto'; + } else { + height = elem.scrollHeight - padding; + style.overflowY = 'hidden'; + }; + style.height = height + extra + 'px'; + scrollTop += parseInt(style.height) - elem.currHeight; + document.body.scrollTop = scrollTop; + document.documentElement.scrollTop = scrollTop; + elem.currHeight = parseInt(style.height); + }; + }; + + addEvent('propertychange', change); + addEvent('input', change); + addEvent('focus', change); + change(); +}; + ///////////////////////////////////////////////////////////////////////////////////////// var autoTextarea2 = function (elem,elem2, extra, maxHeight) { diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index e1ea64b6d..ee793253d 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -254,7 +254,13 @@ function regex_group_attr(){ //验证编程作业的参数 function regex_program_attr() { var result = true; - $.each($('#programHomework textarea.InputBox'), function(i, val){ + $.each($("#programHomework textarea[name='sample[input][]']"), function(i, val){ + if (result && $(val).val().length<=0) { + $(val)[0].focus(); + result = false; + } + }); + $.each($("#programHomework textarea[name='program[input][]']"), function(i, val){ if (result && $(val).val().length<=0) { $(val)[0].focus(); result = false; @@ -465,77 +471,6 @@ function show_group_member(){ //$('#min_num').focus(); } -//textarea自适应高度 纯js写的 有浏览器判断 -/** - * 文本框根据输入内容自适应高度 - * @param {HTMLElement} 输入框元素 - * @param {Number} 设置光标与输入框保持的距离(默认0) - * @param {Number} 设置最大高度(可选) - */ -var autoTextarea = function (elem, extra, maxHeight) { - extra = extra || 0; - var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX' in window, - isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera'), - addEvent = function (type, callback) { - elem.addEventListener ? - elem.addEventListener(type, callback, false) : - elem.attachEvent('on' + type, callback); - }, - getStyle = elem.currentStyle ? function (name) { - var val = elem.currentStyle[name]; - - if (name === 'height' && val.search(/px/i) !== 1) { - var rect = elem.getBoundingClientRect(); - return rect.bottom - rect.top - - parseFloat(getStyle('paddingTop')) - - parseFloat(getStyle('paddingBottom')) + 'px'; - }; - - return val; - } : function (name) { - return getComputedStyle(elem, null)[name]; - }, - minHeight = parseFloat(getStyle('height')); - - - elem.style.resize = 'none'; - - var change = function () { - var scrollTop, height, - padding = 0, - style = elem.style; - - if (elem._length === elem.value.length) return; - elem._length = elem.value.length; - - if (!isFirefox && !isOpera) { - padding = parseInt(getStyle('paddingTop')) + parseInt(getStyle('paddingBottom')); - }; - scrollTop = document.body.scrollTop || document.documentElement.scrollTop; - - elem.style.height = minHeight + 'px'; - if (elem.scrollHeight > minHeight) { - if (maxHeight && elem.scrollHeight > maxHeight) { - height = maxHeight - padding; - style.overflowY = 'auto'; - } else { - height = elem.scrollHeight - padding; - style.overflowY = 'hidden'; - }; - style.height = height + extra + 'px'; - scrollTop += parseInt(style.height) - elem.currHeight; - document.body.scrollTop = scrollTop; - document.documentElement.scrollTop = scrollTop; - elem.currHeight = parseInt(style.height); - }; - }; - - addEvent('propertychange', change); - addEvent('input', change); - addEvent('focus', change); - change(); -}; - function limitStrsize(id,length){ $('#'+id).keypress(function(e) { @@ -625,92 +560,6 @@ function hideResource(){ hideModal(); } ///////////////////////////////////////////////////////////////////////////////////////// - -var autoTextarea2 = function (elem,elem2, extra, maxHeight) { - extra = extra || 0; - var isFirefox = !!document.getBoxObjectFor || 'mozInnerScreenX' in window, - isOpera = !!window.opera && !!window.opera.toString().indexOf('Opera'), - addEvent = function (element, type, callback) { - element.addEventListener ? - element.addEventListener(type, callback, false) : - element.attachEvent('on' + type, callback); - }, - getFirstStyle = elem.currentStyle ? function (name) { - var val = elem.currentStyle[name]; - - if (name === 'height' && val.search(/px/i) !== 1) { - var rect = elem.getBoundingClientRect(); - return rect.bottom - rect.top - - parseFloat(getFirstStyle('paddingTop')) - - parseFloat(getFirstStyle('paddingBottom')) + 'px'; - }; - - return val; - } : function (name) { - return getComputedStyle(elem, null)[name]; - }, - minHeight = parseFloat(getFirstStyle('height')); - - elem.style.resize = 'none'; - elem2.style.resize = 'none'; - var change = function () { - var scrollTop, height, - padding = 0, - style = elem.style, - style2 = elem2.style; - - - if (elem._length === elem.value.length) return; - elem._length = elem.value.length; - elem2._length = elem._length; - if (!isFirefox && !isOpera) { - padding = parseInt(getFirstStyle('paddingTop')) + parseInt(getFirstStyle('paddingBottom')); - }; - scrollTop = document.body.scrollTop || document.documentElement.scrollTop; - - elem.style.height = minHeight + 'px'; - elem2.style.height = minHeight + 'px'; - if (elem.scrollHeight > minHeight) { - if (maxHeight && elem.scrollHeight > maxHeight) { - height = maxHeight - padding; - style.overflowY = 'auto'; - style2.overflowY = 'auto'; - } else { - height = elem.scrollHeight - padding; - }; - style.height = height + extra + 'px'; - style2.height = height + extra + 'px'; - scrollTop += parseInt(style.height) - elem.currHeight; - document.body.scrollTop = scrollTop; - document.documentElement.scrollTop = scrollTop; - elem.currHeight = parseInt(style.height); - }; - if (elem2.scrollHeight > minHeight) { - if (maxHeight && elem2.scrollHeight > maxHeight) { - height = maxHeight - padding; - style.overflowY = 'auto'; - style2.overflowY = 'auto'; - } else { - height = elem2.scrollHeight - padding; - }; - style.height = height + extra + 'px'; - style2.height = height + extra + 'px'; - scrollTop += parseInt(style2.height) - elem2.currHeight; - document.body.scrollTop = scrollTop; - document.documentElement.scrollTop = scrollTop; - elem2.currHeight = parseInt(style2.height); - }; - }; - - addEvent(elem, 'propertychange', change); - addEvent(elem, 'input', change); - addEvent(elem, 'focus', change); - addEvent(elem2, 'propertychange', change); - addEvent(elem2, 'input', change); - addEvent(elem2, 'focus', change); - change(); -}; - function user_name_keypress(e){ if (e.keyCode == '13') { $('#main_login_form').submit(); diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index a0ee39245..09bd7167b 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -114,7 +114,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .w230{width:230px !important;}.w235{ width:235px !important;}.w265{ width: 265px;}.w270{ width: 270px;}.w280{ width:280px;}.w289{ width:289px !important;}.w290{ width:290px !important;} .w300{ width:300px !important;}.w305{ width:305px;}.w350 {width:350px;}.w360 {width:360px;}.w362 {width:362px;}.h400{height:400px !important;}.w430{ width:430px;} .W440{ width:440px;}.w450 {width:450px;}.w455{width:455px !important;}.w459{ width:459px;}.w460{ width:460px;}.w465{width:465px !important;} -.w490{width:490px;}.w536{ width:536px;}.w543{ width:543px;}.w557{ width:557px;}.w570 {width:570px !important;}.w576{ width:576px;}.w590{ width:590px !important;} +.w490{width:490px;}.w536{ width:536px;}.w543{ width:543px;}.w547{ width:547px;}.w557{ width:557px;}.w570 {width:570px !important;}.w576{ width:576px;}.w590{ width:590px !important;} .w607 {width:607px;}.w664{ width:664px;}.w683{ width:683px;}.w610{ width:610px;}.w600{ width:600px !important;}.w603{ width:603px !important;} .w606{ width:606px; }.w620{ width:620px;}.w680{ width: 680px;}.w701{width: 701px;}.w705{ width:705px;}.w708{width: 708px;}.w709{width: 709px;} .w712{width:712px; max-width:712px; min-width:712px;}.w713{width: 713px;}.w720{width:721px;}.w730{width:730px;}.w770{ width:770px;}.h15{ height: 15px; } diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css index 3c97ebc96..d747219d3 100644 --- a/public/stylesheets/css/courses.css +++ b/public/stylesheets/css/courses.css @@ -535,4 +535,7 @@ a.banner-course-notice {position: absolute; font-size: 12px; line-height: 20px; .syllabus_class_open { color: #7dd26c; border: 1px solid #7dd26c;} .st_tips_box_inner{ position: absolute;line-height: 2.0;padding: 5px 10px; white-space: nowrap; background-color: #fff; left:100px; top: -5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} .st_tips_box_inner span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #fff transparent transparent;font-size: 0;line-height: 0;} -.course_class_users_st_name{ display: inline-block;width:120px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} \ No newline at end of file +.course_class_users_st_name{ display: inline-block;width:120px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} + +.program_input_pre{font-family: '微软雅黑','宋体'; max-width:450px; word-wrap:break-word; white-space:pre-wrap;} +.homeworkInfo .program_input_ul li{list-style-type: none; margin-left: 0;} \ No newline at end of file diff --git a/spec/factories/homework_samples.rb b/spec/factories/homework_samples.rb new file mode 100644 index 000000000..6aa10027c --- /dev/null +++ b/spec/factories/homework_samples.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :homework_sample do + input "MyText" +output "MyText" +homework_common nil + end + +end diff --git a/spec/models/homework_sample_spec.rb b/spec/models/homework_sample_spec.rb new file mode 100644 index 000000000..98dd09d64 --- /dev/null +++ b/spec/models/homework_sample_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe HomeworkSample, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 243062bee283059db9410993a8f25cec97b49c65 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 19 Feb 2017 10:50:08 +0800 Subject: [PATCH 033/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AEmod?= =?UTF-8?q?ule=E4=B8=AD=E2=80=9C=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E2=80=9D=E5=92=8C"issue=E2=80=9D=E4=B8=8D=E8=83=BD=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E9=80=89=E4=B8=AD=EF=BC=8C=E5=8F=AA=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/settings/_new_modules.html.erb | 51 ++++++++------- db/schema.rb | 62 +++++++------------ 2 files changed, 49 insertions(+), 64 deletions(-) diff --git a/app/views/projects/settings/_new_modules.html.erb b/app/views/projects/settings/_new_modules.html.erb index 6413823c5..b1f9718f7 100644 --- a/app/views/projects/settings/_new_modules.html.erb +++ b/app/views/projects/settings/_new_modules.html.erb @@ -2,8 +2,8 @@

    请选择此项目可以使用的模块:

    <%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %> <% Redmine::AccessControl.available_project_modules.each do |m| %> -
  • - <%= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m), :class=>"fl mt8").html_safe -%> +
  • + <%= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m), :class=>"fl mt8", :id => 'project_module_'+m.to_s ).html_safe -%>

    <%= l_or_humanize(m, :prefix => "project_module_").html_safe %>

  • <% end %> @@ -16,27 +16,26 @@ - - - + \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 6b7ab2ef1..662251467 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -521,13 +521,6 @@ ActiveRecord::Schema.define(:version => 20170217104309) do add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" - create_table "contest_notifications", :force => true do |t| - t.text "title" - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "contestant_for_contests", :force => true do |t| t.integer "student_id" t.integer "contest_id" @@ -595,37 +588,6 @@ ActiveRecord::Schema.define(:version => 20170217104309) do add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" - create_table "contesting_projects", :force => true do |t| - t.integer "project_id" - t.string "contest_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "contesting_softapplications", :force => true do |t| - t.integer "softapplication_id" - t.integer "contest_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "contestnotifications", :force => true do |t| - t.integer "contest_id" - t.string "title" - t.string "summary" - t.text "description" - t.integer "author_id" - t.integer "notificationcomments_count" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "contests", :force => true do |t| t.integer "user_id" t.string "name" @@ -1192,6 +1154,19 @@ ActiveRecord::Schema.define(:version => 20170217104309) do t.datetime "updated_at", :null => false end + create_table "ii", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + create_table "innodb_monitor", :id => false, :force => true do |t| t.integer "a" end @@ -2291,6 +2266,17 @@ ActiveRecord::Schema.define(:version => 20170217104309) do t.integer "fields_bits", :default => 0 end + create_table "training_tasks", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.string "subject" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "author_id" + t.integer "status", :limit => 1, :default => 1 + end + create_table "user_actions", :force => true do |t| t.integer "user_id" t.string "action_type" From 568bc4e6b71f51cc238b315647daaa727d8bc93e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 19 Feb 2017 11:24:43 +0800 Subject: [PATCH 034/118] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE-?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=A1=B5=E9=9D=A2=E5=8A=A0=E5=85=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/settings.html.erb | 1 - app/views/projects/settings/_new_modules.html.erb | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index 5ca0820ed..84ef59fe6 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -27,7 +27,6 @@
    <%= render :partial=>"projects/settings/new_edit" if User.current.allowed_to?(:edit_project, @project)%>
    -
    <%= render :partial=>"projects/settings/new_modules" if User.current.allowed_to?(:select_project_modules, @project)%>
    diff --git a/app/views/projects/settings/_new_modules.html.erb b/app/views/projects/settings/_new_modules.html.erb index b1f9718f7..aaf3e748b 100644 --- a/app/views/projects/settings/_new_modules.html.erb +++ b/app/views/projects/settings/_new_modules.html.erb @@ -1,3 +1,4 @@ +

    问题跟踪模块与实训模块不能同时选择

    一旦选定并保存后,将不能修改

      请选择此项目可以使用的模块:

      <%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %> From df66e6d60c4268bc2262fc21bae24e8c8f31164c Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 19 Feb 2017 14:39:15 +0800 Subject: [PATCH 035/118] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 30 +- app/helpers/projects_helper.rb | 2 + app/views/projects/settings.html.erb | 7 + .../settings/_new_trainig_task.html.erb | 15 + config/routes.rb | 1 + .../20170219025424_add_script_to_project.rb | 5 + ...0219062646_add_positon_to_training_task.rb | 5 + db/schema.rb | 1358 +++++++++++++++-- 8 files changed, 1321 insertions(+), 102 deletions(-) create mode 100644 app/views/projects/settings/_new_trainig_task.html.erb create mode 100644 db/migrate/20170219025424_add_script_to_project.rb create mode 100644 db/migrate/20170219062646_add_positon_to_training_task.rb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8e4f64d49..cfe4a6cd8 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -29,7 +29,7 @@ class ProjectsController < ApplicationController 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, :project_home] + :view_homework_attaches,:join_project, :project_home, :training_execute] 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] @@ -804,6 +804,34 @@ class ProjectsController < ApplicationController redirect_to admin_projects_url(:status => params[:status]) end + def training_project_execute + user_name = @project.owner.try(:login) + jobName = "#{user_name}_#{@project.id}" + pipeLine = Base64.encode64(@project.script) + params = {} + params["jobName"] = "#{jobName}" + params["pipeLine"] = "#{pipeLine}" + uri = URI.parse("http://106.75.33.219:9999/jenkins-exec/api/createJob") + uri_exec uri, params + # 返回成功信息,job名存到数据库 + end + + def training_task_execute + taskId = params[:training_task_id] + jobName = @project.job_name + params = {} + params["jobName"] = "#{jobName}" + params["pipeLine"] = "#{pipeLine}" + uri = URI.parse("http://106.75.33.219:9999/jenkins-exec/api/createJob") + uri_exec uri, params + # 返回job执行信息,哪一步成功,错误原因 + end + + def uri_exec uri, params + res = Net::HTTP.post_form(uri, params) + res.body + end + # 资源库fork弹框 def forked_pop @type = params[:type] diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 653afef62..c87cdcca5 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -544,6 +544,8 @@ module ProjectsHelper result = "manage_versions" elsif user.allowed_to?(:manage_repository, @project) result = "manage_repository" + elsif user.admin? + result = "training_task" end result end diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index 5ca0820ed..f504ad926 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -19,6 +19,9 @@ <% if User.current.allowed_to?(:manage_repository, @project) %>
    • 版本库
    • <% end %> + <% if User.current.admin? %> +
    • 实训任务
    • + <% end %>
    @@ -51,6 +54,10 @@
    <%= render :partial=>"projects/settings/new_repositories" if User.current.allowed_to?(:manage_repository, @project)%>
    + +
    + <%= render :partial=>"projects/settings/new_trainig_task" if User.current.admin? %> +
    diff --git a/app/views/projects/settings/_new_trainig_task.html.erb b/app/views/projects/settings/_new_trainig_task.html.erb new file mode 100644 index 000000000..2c27c29dc --- /dev/null +++ b/app/views/projects/settings/_new_trainig_task.html.erb @@ -0,0 +1,15 @@ +

    请输入脚本

    +

    <%= link_to "开启实训", training_project_execute_project_path(@project) %>

    + + + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 891058d18..de24241ac 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -911,6 +911,7 @@ RedmineApp::Application.routes.draw do post 'unarchive' post 'close' post 'reopen' + get 'training_project_execute' get 'forked_pop' get 'delete_member_pop', :to => 'projects#delete_member_pop', :via => :get, :as => "delete_member_pop" get 'search_public_orgs_not_in_project' diff --git a/db/migrate/20170219025424_add_script_to_project.rb b/db/migrate/20170219025424_add_script_to_project.rb new file mode 100644 index 000000000..058f59280 --- /dev/null +++ b/db/migrate/20170219025424_add_script_to_project.rb @@ -0,0 +1,5 @@ +class AddScriptToProject < ActiveRecord::Migration + def change + add_column :projects, :script, :text + end +end diff --git a/db/migrate/20170219062646_add_positon_to_training_task.rb b/db/migrate/20170219062646_add_positon_to_training_task.rb new file mode 100644 index 000000000..56e1bdf7b --- /dev/null +++ b/db/migrate/20170219062646_add_positon_to_training_task.rb @@ -0,0 +1,5 @@ +class AddPositonToTrainingTask < ActiveRecord::Migration + def change + add_column :training_tasks, :position, :integer, :limit => 1 + end +end diff --git a/db/schema.rb b/db/schema.rb index 591f6bce5..5e2308145 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,12 +11,15 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150604153000) do +ActiveRecord::Schema.define(:version => 20170219025424) do create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false + t.integer "activity_container_id" + t.string "activity_container_type", :default => "" + t.datetime "created_at" end add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" @@ -49,11 +52,62 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false + create_table "applied_contests", :force => true do |t| + t.integer "contest_id" + t.integer "user_id" + t.string "role" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end + add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" + add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" + + create_table "applied_messages", :force => true do |t| + t.integer "user_id" + t.integer "applied_id" + t.string "applied_type" + t.integer "viewed", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "name" + t.integer "applied_user_id" + t.integer "role" + t.integer "project_id" + end + + create_table "applied_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "role", :default => 0 + end + + create_table "apply_add_schools", :force => true do |t| + t.string "name" + t.string "province" + t.string "city" + t.string "address" + t.string "remarks" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + create_table "apply_homeworks", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" + add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" + create_table "apply_project_masters", :force => true do |t| t.integer "user_id" t.string "apply_type" @@ -63,6 +117,67 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_at", :null => false end + create_table "apply_resources", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "attachment_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id" + t.string "container_type" + t.text "content" + t.integer "apply_user_id" + end + + create_table "article_homepages", :force => true do |t| + t.string "title" + t.text "content" + t.integer "user_id" + t.integer "homepage_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" + add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" + + create_table "at_messages", :force => true do |t| + t.integer "user_id" + t.integer "at_message_id" + t.string "at_message_type" + t.boolean "viewed", :default => false + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sender_id" + end + + add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" + + create_table "attachment_histories", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.string "filename", :default => "" + t.string "disk_filename", :default => "" + t.integer "filesize", :default => 0 + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "" + t.integer "downloads", :default => 0 + t.integer "author_id" + t.datetime "created_on" + t.text "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.integer "copy_from" + t.integer "quotes" + t.integer "version" + t.integer "attachment_id" + t.integer "is_publish", :default => 1 + t.date "publish_time" + end + create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 @@ -74,12 +189,14 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "downloads", :default => 0, :null => false t.integer "author_id", :default => 0, :null => false t.datetime "created_on" - t.string "description" + t.text "description" t.string "disk_directory" t.integer "attachtype", :default => 1 t.integer "is_public", :default => 1 t.integer "copy_from" t.integer "quotes" + t.integer "is_publish", :default => 1 + t.datetime "publish_time" end add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" @@ -141,16 +258,65 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "open_anonymous_evaluation", :default => 1 end + create_table "blog_comments", :force => true do |t| + t.integer "blog_id", :null => false + t.integer "parent_id" + t.string "title", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comment_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "root_id" + end + + add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" + + create_table "blog_messages", :force => true do |t| + t.integer "user_id" + t.integer "blog_message_id" + t.integer "blog_id" + t.string "blog_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_operator_id" + end + + create_table "blogs", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.integer "position", :default => 1 + t.integer "article_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comments_id" + t.integer "parent_id" + t.integer "author_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "homepage_id" + end + create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false t.integer "last_message_id" t.integer "parent_id" t.integer "course_id" + t.integer "org_subfield_id" + t.integer "contest_id" + t.integer "training_project_id" end add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" @@ -185,14 +351,16 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false t.string "committer" - t.datetime "committed_on", :null => false + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" t.integer "user_id" + t.integer "project_id" + t.integer "type", :default => 0 end add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" @@ -208,6 +376,69 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + + create_table "code_tests", :force => true do |t| + t.integer "homework_id" + t.integer "wait_time", :default => 0 + t.integer "language" + t.integer "status" + t.integer "time_used", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "student_work_id", :default => 0 + end + create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false @@ -215,61 +446,173 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.text "comments" t.datetime "created_on", :null => false t.datetime "updated_on", :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" end add_index "comments", ["author_id"], :name => "index_comments_on_author_id" add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" - create_table "contest_notifications", :force => true do |t| - t.text "title" - t.text "content" + create_table "commit_issues", :force => true do |t| + t.string "commit_id" + t.integer "issue_id" + t.integer "project_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end - create_table "contesting_projects", :force => true do |t| + create_table "commits", :force => true do |t| + t.integer "repository_id" + t.string "version" + t.string "committer" + t.text "comments" + t.datetime "committed_on" t.integer "project_id" - t.string "contest_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end - create_table "contesting_softapplications", :force => true do |t| - t.integer "softapplication_id" - t.integer "contest_id" + create_table "contest_activities", :force => true do |t| t.integer "user_id" - t.string "description" + t.integer "contest_id" + t.integer "contest_act_id" + t.string "contest_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" + add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" + + create_table "contest_member_roles", :force => true do |t| + t.integer "contest_member_id" + t.integer "role_id" + t.boolean "is_current", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" + add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" + + create_table "contest_members", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.boolean "is_collect", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" + add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" + + create_table "contest_messages", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_message_id" + t.string "contest_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" + add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" + + create_table "contestant_for_contests", :force => true do |t| + t.integer "student_id" + t.integer "contest_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" + add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" + + create_table "contestant_work_evaluation_distributions", :force => true do |t| + t.integer "user_id" + t.integer "contestant_work_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "reward" end - create_table "contestnotifications", :force => true do |t| + add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" + + create_table "contestant_work_projects", :force => true do |t| t.integer "contest_id" - t.string "title" - t.string "summary" - t.text "description" - t.integer "author_id" - t.integer "notificationcomments_count" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "work_id" + t.integer "contestant_work_id" + t.integer "project_id" + t.integer "user_id" + t.boolean "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end + add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" + add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" + add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" + add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" + + create_table "contestant_work_scores", :force => true do |t| + t.integer "contestant_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" + add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" + + create_table "contestant_works", :force => true do |t| + t.string "name" + t.text "description" + t.integer "work_id" + t.integer "user_id" + t.float "work_score" + t.integer "project_id" + t.integer "work_status" + t.datetime "commit_time" + t.boolean "is_delete", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "judge_score" + end + + add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" + add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" + add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" + create_table "contests", :force => true do |t| + t.integer "user_id" t.string "name" - t.string "budget", :default => "" - t.integer "author_id" - t.date "deadline" - t.string "description" - t.integer "commit" - t.string "password" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false + t.text "description" + t.boolean "is_public" + t.boolean "is_delete", :default => false + t.integer "visits", :default => 0 + t.string "invite_code" + t.integer "invite_code_halt", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end + create_table "course_activities", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_act_id" + t.string "course_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" + create_table "course_attachments", :force => true do |t| t.string "filename" t.string "disk_filename" @@ -288,6 +631,24 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "container_id", :default => 0 end + create_table "course_contributor_scores", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.integer "message_num", :default => 0 + t.integer "message_reply_num", :default => 0 + t.integer "news_reply_num", :default => 0 + t.integer "resource_num", :default => 0 + t.integer "journal_num", :default => 0 + t.integer "journal_reply_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "total_score", :default => 0 + t.integer "homework_journal_num", :default => 0 + t.integer "news_num", :default => 0 + end + + add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" + create_table "course_groups", :force => true do |t| t.string "name" t.integer "course_id" @@ -295,6 +656,23 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_at", :null => false end + add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" + + create_table "course_homework_statistics", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "committed_work_num", :default => 0 + t.integer "un_commit_work_num", :default => 0 + t.integer "late_commit_work_num", :default => 0 + t.integer "absence_evaluation_work_num", :default => 0 + t.integer "un_evaluation_work_num", :default => 0 + t.integer "appeal_num", :default => 0 + t.float "average_score", :default => 0.0 + t.float "total_score", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "course_infos", :force => true do |t| t.integer "course_id" t.integer "user_id" @@ -302,6 +680,23 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_at", :null => false end + create_table "course_messages", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_message_id" + t.string "course_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "content" + t.integer "status" + t.integer "apply_user_id" + t.integer "apply_result" + end + + add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" + add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" + create_table "course_statuses", :force => true do |t| t.integer "changesets_count" t.integer "watchers_count" @@ -319,8 +714,8 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "code" t.integer "time" t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "location" t.string "term" t.string "string" @@ -330,15 +725,34 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "class_period" t.integer "school_id" t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 t.integer "lft" t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 + t.integer "end_time" + t.string "end_term" + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 + t.integer "syllabus_id" + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.integer "professional_level_id", :limit => 1 + t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 end + add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true + add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" + create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -384,6 +798,14 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + create_table "data_exceptions", :force => true do |t| + t.string "message" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "delayed_jobs", :force => true do |t| t.integer "priority", :default => 0, :null => false t.integer "attempts", :default => 0, :null => false @@ -400,6 +822,11 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "disciplines", :force => true do |t| + t.string "name" + t.integer "professional_level_id", :limit => 1 + end + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -421,6 +848,34 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 + t.string "File" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false + end + + create_table "editor_of_documents", :force => true do |t| + t.integer "editor_id" + t.integer "org_document_comment_id" + t.datetime "created_at" + end + create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -443,6 +898,67 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + create_table "exercise_answers", :force => true do |t| + t.integer "user_id" + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_choices", :force => true do |t| + t.integer "exercise_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "exercise_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_score" + end + + create_table "exercise_standard_answers", :force => true do |t| + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_users", :force => true do |t| + t.integer "user_id" + t.integer "exercise_id" + t.integer "score" + t.datetime "start_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "end_at" + t.integer "status" + t.integer "commit_status", :default => 0 + end + + create_table "exercises", :force => true do |t| + t.text "exercise_name" + t.text "exercise_description" + t.integer "course_id" + t.integer "exercise_status" + t.integer "user_id" + t.integer "time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "publish_time" + t.datetime "end_time" + t.integer "show_result" + end + create_table "first_pages", :force => true do |t| t.string "web_title" t.string "title" @@ -463,11 +979,29 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "forge_act_id" t.string "forge_act_type" t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "training_project_id" end add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" + add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" + + create_table "forge_messages", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_message_id" + t.string "forge_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "secret_key" + t.integer "status" + t.integer "operate_user_id" + end + + add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" + add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" create_table "forums", :force => true do |t| t.string "name", :null => false @@ -482,6 +1016,14 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "locked" end + create_table "forwards", :force => true do |t| + t.integer "from_id" + t.string "from_type" + t.integer "to_id" + t.string "to_type" + t.datetime "created_at" + end + create_table "groups_users", :id => false, :force => true do |t| t.integer "group_id", :null => false t.integer "user_id", :null => false @@ -489,6 +1031,16 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true + create_table "homepages", :force => true do |t| + t.string "name" + t.integer "article_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" + create_table "homework_attaches", :force => true do |t| t.integer "bid_id" t.integer "user_id" @@ -511,13 +1063,33 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.text "description" t.date "publish_time" t.date "end_time" - t.integer "homework_type", :default => 1 + t.integer "homework_type", :default => 1 t.string "late_penalty" t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 + t.integer "quotes", :default => 0 + t.integer "is_open", :default => 0 + t.datetime "simi_time" + t.integer "score_open", :default => 1 + t.integer "anonymous_appeal", :default => 0 end + add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + + create_table "homework_detail_groups", :force => true do |t| + t.integer "homework_common_id" + t.integer "min_num" + t.integer "max_num" + t.integer "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" + create_table "homework_detail_manuals", :force => true do |t| t.float "ta_proportion" t.integer "comment_status" @@ -528,14 +1100,19 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "homework_common_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "no_anon_penalty", :default => 1 + t.integer "appeal_penalty", :default => 0 + t.integer "ta_mode", :default => 1 end create_table "homework_detail_programings", :force => true do |t| t.string "language" t.text "standard_code", :limit => 2147483647 t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "ta_proportion", :default => 0.1 + t.integer "question_id" end create_table "homework_evaluations", :force => true do |t| @@ -559,6 +1136,8 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "homework_common_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "result" + t.text "error_msg" end create_table "homework_users", :force => true do |t| @@ -568,11 +1147,16 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_at", :null => false end + create_table "innodb_monitor", :id => false, :force => true do |t| + t.integer "a" + end + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.string "mail" end create_table "issue_categories", :force => true do |t| @@ -686,6 +1270,9 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.text "notes" t.datetime "created_on", :null => false t.boolean "private_notes", :default => false, :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" end add_index "journals", ["created_on"], :name => "index_journals_on_created_on" @@ -700,15 +1287,19 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.text "notes" t.integer "status" t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false t.string "m_parent_id" t.boolean "is_readed" t.integer "m_reply_count" t.integer "m_reply_id" t.integer "is_comprehensive_evaluation" + t.integer "private", :default => 0 + t.integer "root_id" end + add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" + create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -721,9 +1312,10 @@ ActiveRecord::Schema.define(:version => 20150604153000) do end create_table "member_roles", :force => true do |t| - t.integer "member_id", :null => false - t.integer "role_id", :null => false + t.integer "member_id", :null => false + t.integer "role_id", :null => false t.integer "inherited_from" + t.integer "is_current", :default => 1 end add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" @@ -736,12 +1328,27 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.boolean "mail_notification", :default => false, :null => false t.integer "course_id", :default => -1 t.integer "course_group_id", :default => 0 + t.integer "is_collect", :default => 1 end + add_index "members", ["course_id"], :name => "index_members_on_course_id" add_index "members", ["project_id"], :name => "index_members_on_project_id" add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true add_index "members", ["user_id"], :name => "index_members_on_user_id" + create_table "memo_messages", :force => true do |t| + t.integer "user_id" + t.integer "forum_id" + t.integer "memo_id" + t.string "memo_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" + add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" + create_table "memos", :force => true do |t| t.integer "forum_id", :null => false t.integer "parent_id" @@ -755,8 +1362,22 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "viewed_count", :default => 0 + t.integer "root_id" end + add_index "memos", ["root_id"], :name => "index_memos_on_root_id" + + create_table "message_alls", :force => true do |t| + t.integer "user_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" + add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" + create_table "messages", :force => true do |t| t.integer "board_id", :null => false t.integer "parent_id" @@ -769,6 +1390,10 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_on", :null => false t.boolean "locked", :default => false t.integer "sticky", :default => 0 + t.integer "reply_id" + t.integer "quotes" + t.integer "status", :default => 0 + t.integer "root_id" end add_index "messages", ["author_id"], :name => "index_messages_on_author_id" @@ -776,16 +1401,20 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "messages", ["created_on"], :name => "index_messages_on_created_on" add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" + add_index "messages", ["root_id"], :name => "index_messages_on_root_id" create_table "news", :force => true do |t| t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" t.text "description" - t.integer "author_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "contest_id" end add_index "news", ["author_id"], :name => "index_news_on_author_id" @@ -809,6 +1438,13 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_at", :null => false end + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "open_id_authentication_associations", :force => true do |t| t.integer "issued" t.integer "lifetime" @@ -864,11 +1500,102 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "project_id" end + create_table "org_activities", :force => true do |t| + t.integer "user_id" + t.integer "org_act_id" + t.string "org_act_type" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_courses", :force => true do |t| + t.integer "organization_id" + t.integer "course_id" + t.datetime "created_at" + end + + create_table "org_document_comments", :force => true do |t| + t.text "title" + t.text "content" + t.integer "organization_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "status", :default => 0 + t.integer "root_id" + end + + add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" + + create_table "org_member_roles", :force => true do |t| + t.integer "org_member_id" + t.integer "role_id" + end + + create_table "org_members", :force => true do |t| + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_messages", :force => true do |t| + t.integer "user_id" + t.integer "sender_id" + t.integer "organization_id" + t.string "message_type" + t.integer "message_id" + t.integer "viewed" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + end + + create_table "org_projects", :force => true do |t| + t.integer "organization_id" + t.integer "project_id" + t.datetime "created_at" + end + + create_table "org_subfield_messages", :force => true do |t| + t.integer "org_subfield_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_subfields", :force => true do |t| + t.integer "organization_id" + t.integer "priority" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 1 + end + create_table "organizations", :force => true do |t| t.string "name" - t.string "logo_link" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.text "description" + t.integer "creator_id" + t.integer "home_id" + t.boolean "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "allow_guest_download", :default => true + t.integer "visits", :default => 0 + t.integer "show_mode", :default => 0 + t.integer "allow_teacher", :default => 0 end create_table "phone_app_versions", :force => true do |t| @@ -891,9 +1618,11 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "question_type" t.integer "is_necessary" t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "question_number" + t.integer "max_choices", :default => 0 + t.integer "min_choices", :default => 0 end create_table "poll_users", :force => true do |t| @@ -944,6 +1673,24 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_at", :null => false end + create_table "principal_activities", :force => true do |t| + t.integer "user_id" + t.integer "principal_id" + t.integer "principal_act_id" + t.string "principal_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "professional_levels", :force => true do |t| + t.integer "level" + end + + create_table "professions", :force => true do |t| + t.string "name" + t.integer "discipline_id", :limit => 1 + end + create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -954,14 +1701,19 @@ ActiveRecord::Schema.define(:version => 20150604153000) do create_table "project_scores", :force => true do |t| t.string "project_id" t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 + t.datetime "commit_time" + t.integer "pull_request_num", :default => 0 + t.integer "training_project_id", :default => -1 end create_table "project_statuses", :force => true do |t| @@ -984,26 +1736,40 @@ ActiveRecord::Schema.define(:version => 20150604153000) do end create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false + t.string "name", :default => "", :null => false t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false t.integer "parent_id" t.datetime "created_on" t.datetime "updated_on" t.string "identifier" - t.integer "status", :default => 1, :null => false + t.integer "status", :default => 1, :null => false t.integer "lft" t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false + t.boolean "inherit_members", :default => false, :null => false t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 t.integer "user_id" - t.integer "dts_test", :default => 0 t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "publish_resource", :default => 0 + t.integer "boards_count", :default => 0 + t.integer "news_count", :default => 0 + t.integer "acts_count", :default => 0 + t.integer "journals_count", :default => 0 + t.integer "boards_reply_count", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.text "script" end add_index "projects", ["lft"], :name => "index_projects_on_lft" @@ -1017,6 +1783,30 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + create_table "pull_requests", :force => true do |t| + t.integer "pull_request_id" + t.integer "gpid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + t.integer "project_id" + t.string "title" + end + + create_table "quality_analyses", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1061,6 +1851,18 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "topic_resource" end + create_table "rep_statics", :force => true do |t| + t.integer "project_id" + t.integer "commits_num" + t.string "uname" + t.string "email" + t.integer "add" + t.integer "del" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "changeset" + end + create_table "repositories", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "url", :default => "", :null => false @@ -1103,9 +1905,20 @@ ActiveRecord::Schema.define(:version => 20150604153000) do create_table "schools", :force => true do |t| t.string "name" t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "logo_link" + t.string "pinyin" + t.integer "school_type", :default => 0 + end + + create_table "secdomains", :force => true do |t| + t.integer "sub_type" + t.string "subname" + t.integer "pid", :default => 0 + t.string "desc" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "seems_rateable_cached_ratings", :force => true do |t| @@ -1149,6 +1962,24 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "description" end + create_table "shield_activities", :force => true do |t| + t.string "container_type" + t.integer "container_id" + t.string "shield_type" + t.integer "shield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "shield_wechat_messages", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.integer "shield_id" + t.string "shield_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1167,20 +1998,82 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "project_id" end + create_table "sonar_errors", :force => true do |t| + t.integer "project_id" + t.string "jenkins_job_name" + t.text "output" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "ssos", :force => true do |t| + t.integer "user_id" + t.string "openid" + t.string "name" + t.string "password" + t.string "email" + t.integer "sex" + t.string "school" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" + + create_table "student_work_projects", :force => true do |t| + t.integer "homework_common_id" + t.integer "student_work_id" + t.integer "project_id" + t.integer "user_id" + t.integer "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "course_id" + end + + add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" + add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" + add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" + add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" + + create_table "student_work_tests", :force => true do |t| + t.integer "student_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 + t.text "results" + t.text "src" + end + + add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" + create_table "student_works", :force => true do |t| t.string "name" - t.text "description" + t.text "description", :limit => 2147483647 t.integer "homework_common_id" t.integer "user_id" t.float "final_score" t.float "teacher_score" t.float "student_score" t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "project_id", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "late_penalty", :default => 0 + t.integer "absence_penalty", :default => 0 + t.float "system_score", :default => 0.0 + t.boolean "is_test", :default => false + t.integer "simi_id" + t.integer "simi_value" + t.float "work_score" + t.integer "work_status", :default => 0 + t.datetime "commit_time" + t.integer "is_delete", :default => 0 + t.integer "appeal_penalty", :default => 0 end + add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + create_table "student_works_evaluation_distributions", :force => true do |t| t.integer "student_work_id" t.integer "user_id" @@ -1194,8 +2087,22 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "score" t.text "comment" t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "appeal_status", :default => 0 + t.boolean "is_hidden", :default => false + end + + add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" + add_index "student_works_scores", ["user_id"], :name => "user_id" + + create_table "student_works_scores_appeals", :force => true do |t| + t.integer "student_works_score_id" + t.integer "user_id" + t.text "comment" + t.integer "appeal_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "students_for_courses", :force => true do |t| @@ -1208,6 +2115,80 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" + create_table "sub_document_comments", :force => true do |t| + t.text "content" + t.text "title" + t.integer "sub_domain_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.integer "locked" + t.integer "sticky" + t.integer "org_subfield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "sub_domains", :force => true do |t| + t.integer "org_subfield_id" + t.integer "priority", :default => 0 + t.string "name" + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "subfield_subdomain_dirs", :force => true do |t| + t.integer "org_subfield_id" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "syllabus_members", :force => true do |t| + t.integer "rank" + t.integer "syllabus_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" + add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" + add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" + + create_table "syllabuses", :force => true do |t| + t.string "title" + t.text "description" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "eng_name" + t.integer "syllabus_type" + t.integer "credit" + t.integer "hours" + t.integer "theory_hours" + t.integer "practice_hours" + t.string "applicable_major" + t.string "pre_course" + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 + t.integer "professional_level_id", :limit => 1 + end + + add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" + + create_table "system_messages", :force => true do |t| + t.integer "user_id" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "description" + t.string "subject" + end + create_table "taggings", :force => true do |t| t.integer "tag_id" t.integer "taggable_id" @@ -1275,8 +2256,79 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.integer "fields_bits", :default => 0 end + create_table "trackers_training_projects", :id => false, :force => true do |t| + t.integer "training_project_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "trackers_training_projects", ["training_project_id"], :name => "projects_trackers_training_project_id" + + create_table "training_projects", :force => true do |t| + t.string "name", :limit => 30, :null => false + t.text "description" + t.string "homepage", :limit => 60 + t.boolean "is_public", :default => true, :null => false + t.integer "parent_id" + t.integer "projects_count", :default => 0 + t.string "identifier", :null => false + t.integer "status", :default => 1 + t.integer "lft" + t.integer "rgt" + t.boolean "inherit_members", :default => false, :null => false + t.integer "project_type" + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 + t.integer "user_id" + t.integer "dts_test", :default => 0 + t.string "enterprise_name" + t.integer "organization_id" + t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "publish_resource", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "training_tasks", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.string "subject" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "author_id" + t.integer "status", :limit => 1, :default => 1 + end + + create_table "user_actions", :force => true do |t| + t.integer "user_id" + t.string "action_type" + t.integer "action_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_activities", :force => true do |t| + t.string "act_type" + t.integer "act_id" + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" + create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false + t.integer "user_id", :null => false t.date "birthday" t.string "brief_introduction" t.integer "gender" @@ -1284,8 +2336,8 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "occupation" t.integer "work_experience" t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "technical_title" t.integer "identity" t.string "student_id" @@ -1293,8 +2345,23 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "student_realname" t.string "location_city" t.integer "school_id" + t.string "description", :default => "" end + add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" + + create_table "user_feedback_messages", :force => true do |t| + t.integer "user_id" + t.integer "journals_for_message_id" + t.string "journals_for_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" + add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" + create_table "user_grades", :force => true do |t| t.integer "user_id", :null => false t.integer "project_id", :null => false @@ -1360,6 +2427,26 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" + create_table "user_wechats", :force => true do |t| + t.integer "subscribe" + t.string "openid" + t.string "nickname" + t.integer "sex" + t.string "language" + t.string "city" + t.string "province" + t.string "country" + t.string "headimgurl" + t.string "subscribe_time" + t.string "unionid" + t.string "remark" + t.integer "groupid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "bindtype", :default => 0 + end + create_table "users", :force => true do |t| t.string "login", :default => "", :null => false t.string "hashed_password", :limit => 40, :default => "", :null => false @@ -1377,6 +2464,10 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "identity_url" t.string "mail_notification", :default => "", :null => false t.string "salt", :limit => 64 + t.integer "gid" + t.integer "visits", :default => 0 + t.integer "excellent_teacher", :default => 0 + t.integer "excellent_student", :default => 0 end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" @@ -1393,11 +2484,23 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.string "wiki_page_title" t.string "status", :default => "open" t.string "sharing", :default => "none", :null => false + t.integer "user_id" end add_index "versions", ["project_id"], :name => "versions_project_id" add_index "versions", ["sharing"], :name => "index_versions_on_sharing" + create_table "visitors", :force => true do |t| + t.integer "user_id" + t.integer "master_id" + t.datetime "updated_on" + t.datetime "created_on" + end + + add_index "visitors", ["master_id"], :name => "index_visitors_master_id" + add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" + add_index "visitors", ["user_id"], :name => "index_visitors_user_id" + create_table "watchers", :force => true do |t| t.string "watchable_type", :default => "", :null => false t.integer "watchable_id", :default => 0, :null => false @@ -1423,6 +2526,16 @@ ActiveRecord::Schema.define(:version => 20150604153000) do t.datetime "updated_at", :null => false end + create_table "wechat_logs", :force => true do |t| + t.string "openid", :null => false + t.text "request_raw" + t.text "response_raw" + t.text "session_raw" + t.datetime "created_at", :null => false + end + + add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" + create_table "wiki_content_versions", :force => true do |t| t.integer "wiki_content_id", :null => false t.integer "page_id", :null => false @@ -1479,6 +2592,28 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "wikis", ["project_id"], :name => "wikis_project_id" + create_table "work_detail_groups", :force => true do |t| + t.integer "work_id" + t.integer "min_num" + t.integer "max_num" + t.boolean "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" + + create_table "work_detail_manuals", :force => true do |t| + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" + create_table "workflows", :force => true do |t| t.integer "tracker_id", :default => 0, :null => false t.integer "old_status_id", :default => 0, :null => false @@ -1496,6 +2631,27 @@ ActiveRecord::Schema.define(:version => 20150604153000) do add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" + create_table "works", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "work_type" + t.integer "contest_id" + t.boolean "is_delete", :default => false + t.boolean "score_open", :default => false + t.boolean "is_open", :default => false + t.integer "work_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "online_evaluation", :default => false + t.boolean "score_valid", :default => true + end + + add_index "works", ["contest_id"], :name => "index_works_on_contest_id" + add_index "works", ["user_id"], :name => "index_works_on_user_id" + create_table "works_categories", :force => true do |t| t.string "category" t.datetime "created_at", :null => false From 2aa025cf32ce0a135b462d38961f3bc3b524ef40 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 19 Feb 2017 15:17:46 +0800 Subject: [PATCH 036/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/training_tasks_controller.rb | 1 + app/views/training_tasks/_form.html.erb | 93 +++++++++----------- app/views/training_tasks/new.html.erb | 4 +- public/stylesheets/css/project.css | 18 ++++ 4 files changed, 65 insertions(+), 51 deletions(-) diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index aa716cf5c..50a78566a 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -106,6 +106,7 @@ class TrainingTasksController < ApplicationController @training_task.subject = params[:training_task][:subject] @training_task.description = params[:training_task][:description] @training_task.tracker_id = params[:training_task][:tracker_id] + @training_task.position = params[:training_sequence].to_i if @training_task.save respond_to do |format| format.html { diff --git a/app/views/training_tasks/_form.html.erb b/app/views/training_tasks/_form.html.erb index 790c8b17b..0b3245e74 100644 --- a/app/views/training_tasks/_form.html.erb +++ b/app/views/training_tasks/_form.html.erb @@ -1,52 +1,47 @@ -<%= labelled_fields_for :training_task, @training_task do |f| %> -
      -
    • - 类   型 - <%= f.select :tracker_id, Tracker.all.collect{ |t| [t.name, t.id] },{:required => true, :no_label => true}, - :class => "fl", :style => "width:160px;padding-left:0px;" %> -
    • -
    • - - <%= f.text_field :subject, :style => "font-size:small;width:606px;", :no_label => true, :id => "training_task_id" %> - 标题不能为空 - - <%= javascript_tag do %> - observeAutocompleteField('issue_subject', - '<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>', - { select: function(event, ui) { - $('input#issue_subject').val(ui.item.value); - } - }); - <% end %> -
    • -
    • - - <%= f.label_for_field :description, :no_label => true, :class => "label" %> - <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> - <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> - <%= f.kindeditor :description,:editor_id => "training_task_desc_editor", :width=>'85%', :height =>159, :resizeType => 0, :no_label => true, at_id: @project.id, at_type: @project.class.to_s %> - <%# end %> - <%#= wikitoolbar_for 'issue_description' %> - -
    • - -
    • - - <%= render :partial => 'attachments/form', :locals => {:container => @training_task} %> -
    • -
    • - <% if params[:action] == "new" %> - 取消 - <% else %> - <%= link_to "取消", training_task_path(@training_task), :class => "sy_btn_grey mr5 fr" %> - <% end %> - - - -
    • -
    - -<% end %> +
      +
    • + + + +
    • +
    • + + <%= f.text_field :subject, :class => "input-big", :no_label => true, :id => "training_task_id", :placeholder => "请输入标题" %> + 标题不能为空 + <%= javascript_tag do %> + observeAutocompleteField('issue_subject', + '<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil)) %>', + { select: function(event, ui) { + $('input#issue_subject').val(ui.item.value); + } + }); + <% end %> +
    • +
    • + + <%= f.label_for_field :description, :no_label => true, :class => "fl" %> + <%= f.kindeditor :description, + :editor_id => "training_task_desc_editor", + :width=>'885px', + :height =>192, + :resizeType => 0, + :no_label => true, + :at_id => @project.id, + :at_type => @project.class.to_s %> +
    • +
    • + + <%= render :partial => 'attachments/form', :locals => {:container => @training_task} %> +
    • +
    • + <% if params[:action] == "new" %> + 取消 + <% else %> + <%= link_to "取消", training_task_path(@training_task), :class => "sy_btn_grey mr5 fr" %> + <% end %> + +
    • +
    -
    -
    +
    +
    <%#= call_hook(:view_issues_new_top, {:training_task => @training_task}) %> <%= labelled_form_for @training_task, :url => project_training_tasks_url(@project), :html => {:id => 'project_training_form', :multipart => true} do |f| %> diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 92b372bb7..059683919 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -654,3 +654,21 @@ a.pro-fenzhi-a{height:25px; line-height: 25px; border: 1px solid #dddddd; bac border-bottom-right-radius: 0; display: inline-block; text-align: center; padding:0 5px; border-left: none;} a:hover.pro-fenzhi-a{color:#3b94d6;} +/*实训项目*/ +.pro-task-new-con{ padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; width:968px;} +.pro-task-new-con ul li{ margin-bottom:10px; line-height: 28px;} +.pro-task-new-con ul li:last-child{margin-bottom:0px;} +.pro-task-new-con input{ border:1px solid #c8c8c8; height: 28px; width: 200px; color: #888;} +.pro-task-new-con textarea{ width: 881px;border:1px solid #c8c8c8;} +.pro-task-new-con input.input-big{ width: 881px;} +.issues-table{ width: 100%;} +.issues-table select{ border: none; width: 100px; color:#888; font-weight: bold;appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;} +.issues-table tr th{ height: 40px; border-bottom:1px solid #e5e5e5; color: #888;} +.issues-table p.text-left{ text-align: left; color: #333; border-bottom: 3px solid #3498db; display: block; width: 100px; height:40px; line-height: 40px; padding-left:15px;} +.issues-table tr td{ padding:10px 0; border-bottom: 1px dashed #c8c8c8; text-align: center; color:#888;} +.issues-table tr td.w50{ width: 60px;} +.issues-table tbody tr:hover{ background:#f2f2f2;} +.issues-table tr td span.w100{ display: inline-block; width: 100px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis; } +span.task-linebtn-green{color:#59af48; border: 1px solid #59af48;font-size: 12px; padding: 0 5px; border-radius: 3px;line-height: 14px;} +.issues-table select.select-w50{ width: 50px;} +span.task-step{ color:#ee4a20;font-style: italic; font-weight:bold; font-size:14px;} From 89dc320027a313c07351f620c4af02a9ddab44a8 Mon Sep 17 00:00:00 2001 From: Linda <2294690300@qq.com> Date: Sun, 19 Feb 2017 15:28:57 +0800 Subject: [PATCH 037/118] =?UTF-8?q?=E5=90=88=E4=BD=9C=E4=BC=99=E4=BC=B4?= =?UTF-8?q?=E5=9B=BE=E7=89=87=20=E5=8F=8A=E9=A1=B9=E7=9B=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=84=9A=E6=9C=AC=E5=BD=95=E5=85=A5=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/cooperation/index.html.erb | 3 + .../projects/settings/_new_modules.html.erb | 80 +- .../settings/_new_trainig_task.html.erb | 39 +- .../20170219025424_add_script_to_project.rb | 10 +- ...0219062646_add_positon_to_training_task.rb | 10 +- db/schema.rb | 5284 ++++++++--------- public/images/footer_logo/p-zgkyrj.png | Bin 0 -> 31860 bytes 7 files changed, 2689 insertions(+), 2737 deletions(-) create mode 100644 public/images/footer_logo/p-zgkyrj.png diff --git a/app/views/cooperation/index.html.erb b/app/views/cooperation/index.html.erb index 2a3a7a430..2341f45cf 100644 --- a/app/views/cooperation/index.html.erb +++ b/app/views/cooperation/index.html.erb @@ -40,6 +40,9 @@
  • 湘潭大学
  • +
  • + 中国开源软件推进联盟 +
  • diff --git a/app/views/projects/settings/_new_modules.html.erb b/app/views/projects/settings/_new_modules.html.erb index b1f9718f7..c2696070d 100644 --- a/app/views/projects/settings/_new_modules.html.erb +++ b/app/views/projects/settings/_new_modules.html.erb @@ -1,41 +1,41 @@ -
      -

      请选择此项目可以使用的模块:

      - <%= form_for @project,:url => { :action => 'modules', :id => @project },:html => {:id => 'modules-form',:method => :post} do |f| %> - <% Redmine::AccessControl.available_project_modules.each do |m| %> -
    • - <%= check_box_tag('enabled_module_names[]', m, @project.module_enabled?(m), :class=>"fl mt8", :id => 'project_module_'+m.to_s ).html_safe -%> -

      <%= l_or_humanize(m, :prefix => "project_module_").html_safe %>

      -
    • - <% end %> -
    • -

      <%= check_all_links('modules-form').html_safe %>

      -
    • - <% end %> -
    • - <%= l(:button_save) %> -
    • -
    - - \ No newline at end of file diff --git a/app/views/projects/settings/_new_trainig_task.html.erb b/app/views/projects/settings/_new_trainig_task.html.erb index 2c27c29dc..e92c42006 100644 --- a/app/views/projects/settings/_new_trainig_task.html.erb +++ b/app/views/projects/settings/_new_trainig_task.html.erb @@ -1,15 +1,26 @@ -

    请输入脚本

    -

    <%= link_to "开启实训", training_project_execute_project_path(@project) %>

    - - - + 取消 + 确定 +
    + +
    +

    请输入脚本

    +

    <%= link_to "开启实训", training_project_execute_project_path(@project) %>

    + + + \ No newline at end of file diff --git a/db/migrate/20170219025424_add_script_to_project.rb b/db/migrate/20170219025424_add_script_to_project.rb index 058f59280..27f76485b 100644 --- a/db/migrate/20170219025424_add_script_to_project.rb +++ b/db/migrate/20170219025424_add_script_to_project.rb @@ -1,5 +1,5 @@ -class AddScriptToProject < ActiveRecord::Migration - def change - add_column :projects, :script, :text - end -end +class AddScriptToProject < ActiveRecord::Migration + def change + add_column :projects, :script, :text + end +end diff --git a/db/migrate/20170219062646_add_positon_to_training_task.rb b/db/migrate/20170219062646_add_positon_to_training_task.rb index 56e1bdf7b..3bba0e446 100644 --- a/db/migrate/20170219062646_add_positon_to_training_task.rb +++ b/db/migrate/20170219062646_add_positon_to_training_task.rb @@ -1,5 +1,5 @@ -class AddPositonToTrainingTask < ActiveRecord::Migration - def change - add_column :training_tasks, :position, :integer, :limit => 1 - end -end +class AddPositonToTrainingTask < ActiveRecord::Migration + def change + add_column :training_tasks, :position, :integer, :limit => 1 + end +end diff --git a/db/schema.rb b/db/schema.rb index 5e2308145..a289290dd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,2673 +1,2611 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20170219025424) do - - create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false - t.integer "activity_container_id" - t.string "activity_container_type", :default => "" - t.datetime "created_at" - end - - add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" - add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" - add_index "activities", ["user_id"], :name => "index_activities_on_user_id" - - create_table "activity_notifies", :force => true do |t| - t.integer "activity_container_id" - t.string "activity_container_type" - t.integer "activity_id" - t.string "activity_type" - t.integer "notify_to" - t.datetime "created_on" - t.integer "is_read" - end - - add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" - add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" - add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" - - create_table "api_keys", :force => true do |t| - t.string "access_token" - t.datetime "expires_at" - t.integer "user_id" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" - add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - - create_table "applied_contests", :force => true do |t| - t.integer "contest_id" - t.integer "user_id" - t.string "role" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" - add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" - - create_table "applied_messages", :force => true do |t| - t.integer "user_id" - t.integer "applied_id" - t.string "applied_type" - t.integer "viewed", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "name" - t.integer "applied_user_id" - t.integer "role" - t.integer "project_id" - end - - create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "role", :default => 0 - end - - create_table "apply_add_schools", :force => true do |t| - t.string "name" - t.string "province" - t.string "city" - t.string "address" - t.string "remarks" - t.integer "school_id" - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - create_table "apply_homeworks", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" - add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" - - create_table "apply_project_masters", :force => true do |t| - t.integer "user_id" - t.string "apply_type" - t.integer "apply_id" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "apply_resources", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "attachment_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id" - t.string "container_type" - t.text "content" - t.integer "apply_user_id" - end - - create_table "article_homepages", :force => true do |t| - t.string "title" - t.text "content" - t.integer "user_id" - t.integer "homepage_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" - add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" - - create_table "at_messages", :force => true do |t| - t.integer "user_id" - t.integer "at_message_id" - t.string "at_message_type" - t.boolean "viewed", :default => false - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sender_id" - end - - add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" - - create_table "attachment_histories", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.string "filename", :default => "" - t.string "disk_filename", :default => "" - t.integer "filesize", :default => 0 - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "" - t.integer "downloads", :default => 0 - t.integer "author_id" - t.datetime "created_on" - t.text "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.integer "copy_from" - t.integer "quotes" - t.integer "version" - t.integer "attachment_id" - t.integer "is_publish", :default => 1 - t.date "publish_time" - end - - create_table "attachments", :force => true do |t| - t.integer "container_id" - t.string "container_type", :limit => 30 - t.string "filename", :default => "", :null => false - t.string "disk_filename", :default => "", :null => false - t.integer "filesize", :default => 0, :null => false - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "", :null => false - t.integer "downloads", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.text "description" - t.string "disk_directory" - t.integer "attachtype", :default => 1 - t.integer "is_public", :default => 1 - t.integer "copy_from" - t.integer "quotes" - t.integer "is_publish", :default => 1 - t.datetime "publish_time" - end - - add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" - add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" - add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" - - create_table "attachmentstypes", :force => true do |t| - t.integer "typeId", :null => false - t.string "typeName", :limit => 50 - end - - create_table "auth_sources", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 60, :default => "", :null => false - t.string "host", :limit => 60 - t.integer "port" - t.string "account" - t.string "account_password", :default => "" - t.string "base_dn" - t.string "attr_login", :limit => 30 - t.string "attr_firstname", :limit => 30 - t.string "attr_lastname", :limit => 30 - t.string "attr_mail", :limit => 30 - t.boolean "onthefly_register", :default => false, :null => false - t.boolean "tls", :default => false, :null => false - t.string "filter" - t.integer "timeout" - end - - add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" - - create_table "biding_projects", :force => true do |t| - t.integer "project_id" - t.integer "bid_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "bids", :force => true do |t| - t.string "name" - t.string "budget", :null => false - t.integer "author_id" - t.date "deadline" - t.text "description" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "commit" - t.integer "reward_type" - t.integer "homework_type" - t.integer "parent_id" - t.string "password" - t.integer "is_evaluation" - t.integer "proportion", :default => 60 - t.integer "comment_status", :default => 0 - t.integer "evaluation_num", :default => 3 - t.integer "open_anonymous_evaluation", :default => 1 - end - - create_table "blog_comments", :force => true do |t| - t.integer "blog_id", :null => false - t.integer "parent_id" - t.string "title", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comment_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "root_id" - end - - add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" - - create_table "blog_messages", :force => true do |t| - t.integer "user_id" - t.integer "blog_message_id" - t.integer "blog_id" - t.string "blog_message_type" - t.boolean "viewed", :default => false - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_operator_id" - end - - create_table "blogs", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.integer "position", :default => 1 - t.integer "article_count", :default => 0, :null => false - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comments_id" - t.integer "parent_id" - t.integer "author_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "homepage_id" - end - - create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false - t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false - t.integer "last_message_id" - t.integer "parent_id" - t.integer "course_id" - t.integer "org_subfield_id" - t.integer "contest_id" - t.integer "training_project_id" - end - - add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" - add_index "boards", ["project_id"], :name => "boards_project_id" - - create_table "bug_to_osps", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "changes", :force => true do |t| - t.integer "changeset_id", :null => false - t.string "action", :limit => 1, :default => "", :null => false - t.text "path", :null => false - t.text "from_path" - t.string "from_revision" - t.string "revision" - t.string "branch" - end - - add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" - - create_table "changeset_parents", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "parent_id", :null => false - end - - add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" - add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" - - create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false - t.string "committer" - t.datetime "committed_on", :null => false - t.text "comments" - t.date "commit_date" - t.string "scmid" - t.integer "user_id" - t.integer "project_id" - t.integer "type", :default => 0 - end - - add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" - add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true - add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" - add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" - add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" - - create_table "changesets_issues", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "issue_id", :null => false - end - - add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - - create_table "code_tests", :force => true do |t| - t.integer "homework_id" - t.integer "wait_time", :default => 0 - t.integer "language" - t.integer "status" - t.integer "time_used", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "student_work_id", :default => 0 - end - - create_table "comments", :force => true do |t| - t.string "commented_type", :limit => 30, :default => "", :null => false - t.integer "commented_id", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.text "comments" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "comments", ["author_id"], :name => "index_comments_on_author_id" - add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" - - create_table "commit_issues", :force => true do |t| - t.string "commit_id" - t.integer "issue_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "commits", :force => true do |t| - t.integer "repository_id" - t.string "version" - t.string "committer" - t.text "comments" - t.datetime "committed_on" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contest_activities", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_act_id" - t.string "contest_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" - add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" - - create_table "contest_member_roles", :force => true do |t| - t.integer "contest_member_id" - t.integer "role_id" - t.boolean "is_current", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" - add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" - - create_table "contest_members", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.boolean "is_collect", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" - add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" - - create_table "contest_messages", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_message_id" - t.string "contest_message_type" - t.boolean "viewed", :default => false - t.text "content" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" - add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" - - create_table "contestant_for_contests", :force => true do |t| - t.integer "student_id" - t.integer "contest_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" - add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" - - create_table "contestant_work_evaluation_distributions", :force => true do |t| - t.integer "user_id" - t.integer "contestant_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" - - create_table "contestant_work_projects", :force => true do |t| - t.integer "contest_id" - t.integer "work_id" - t.integer "contestant_work_id" - t.integer "project_id" - t.integer "user_id" - t.boolean "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" - add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" - add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" - add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" - - create_table "contestant_work_scores", :force => true do |t| - t.integer "contestant_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" - add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" - - create_table "contestant_works", :force => true do |t| - t.string "name" - t.text "description" - t.integer "work_id" - t.integer "user_id" - t.float "work_score" - t.integer "project_id" - t.integer "work_status" - t.datetime "commit_time" - t.boolean "is_delete", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "judge_score" - end - - add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" - add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" - add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" - - create_table "contests", :force => true do |t| - t.integer "user_id" - t.string "name" - t.text "description" - t.boolean "is_public" - t.boolean "is_delete", :default => false - t.integer "visits", :default => 0 - t.string "invite_code" - t.integer "invite_code_halt", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_activities", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_act_id" - t.string "course_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" - - create_table "course_attachments", :force => true do |t| - t.string "filename" - t.string "disk_filename" - t.integer "filesize" - t.string "content_type" - t.string "digest" - t.integer "downloads" - t.string "author_id" - t.string "integer" - t.string "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id", :default => 0 - end - - create_table "course_contributor_scores", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.integer "message_num", :default => 0 - t.integer "message_reply_num", :default => 0 - t.integer "news_reply_num", :default => 0 - t.integer "resource_num", :default => 0 - t.integer "journal_num", :default => 0 - t.integer "journal_reply_num", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "total_score", :default => 0 - t.integer "homework_journal_num", :default => 0 - t.integer "news_num", :default => 0 - end - - add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" - - create_table "course_groups", :force => true do |t| - t.string "name" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" - - create_table "course_homework_statistics", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "committed_work_num", :default => 0 - t.integer "un_commit_work_num", :default => 0 - t.integer "late_commit_work_num", :default => 0 - t.integer "absence_evaluation_work_num", :default => 0 - t.integer "un_evaluation_work_num", :default => 0 - t.integer "appeal_num", :default => 0 - t.float "average_score", :default => 0.0 - t.float "total_score", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_infos", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_messages", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_message_id" - t.string "course_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "content" - t.integer "status" - t.integer "apply_user_id" - t.integer "apply_result" - end - - add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" - add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" - - create_table "course_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "course_id" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "courses", :force => true do |t| - t.integer "tea_id" - t.string "name" - t.integer "state" - t.string "code" - t.integer "time" - t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "location" - t.string "term" - t.string "string" - t.string "password" - t.string "setup_time" - t.string "endup_time" - t.string "class_period" - t.integer "school_id" - t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 - t.integer "lft" - t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 - t.integer "end_time" - t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 - t.integer "syllabus_id" - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.integer "professional_level_id", :limit => 1 - t.integer "invite_code_halt", :limit => 1, :default => 0 - t.integer "os_allow", :default => 0 - end - - add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true - add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" - - create_table "custom_fields", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.string "field_format", :limit => 30, :default => "", :null => false - t.text "possible_values" - t.string "regexp", :default => "" - t.integer "min_length", :default => 0, :null => false - t.integer "max_length", :default => 0, :null => false - t.boolean "is_required", :default => false, :null => false - t.boolean "is_for_all", :default => false, :null => false - t.boolean "is_filter", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "searchable", :default => false - t.text "default_value" - t.boolean "editable", :default => true - t.boolean "visible", :default => true, :null => false - t.boolean "multiple", :default => false - end - - add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" - - create_table "custom_fields_projects", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "project_id", :default => 0, :null => false - end - - add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true - - create_table "custom_fields_trackers", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true - - create_table "custom_values", :force => true do |t| - t.string "customized_type", :limit => 30, :default => "", :null => false - t.integer "customized_id", :default => 0, :null => false - t.integer "custom_field_id", :default => 0, :null => false - t.text "value" - end - - add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" - add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - - create_table "data_exceptions", :force => true do |t| - t.string "message" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "delayed_jobs", :force => true do |t| - t.integer "priority", :default => 0, :null => false - t.integer "attempts", :default => 0, :null => false - t.text "handler", :null => false - t.text "last_error" - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" - t.string "locked_by" - t.string "queue" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - - create_table "disciplines", :force => true do |t| - t.string "name" - t.integer "professional_level_id", :limit => 1 - end - - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "documents", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "category_id", :default => 0, :null => false - t.string "title", :limit => 60, :default => "", :null => false - t.text "description" - t.datetime "created_on" - t.integer "user_id", :default => 0 - t.integer "is_public", :default => 1 - end - - add_index "documents", ["category_id"], :name => "index_documents_on_category_id" - add_index "documents", ["created_on"], :name => "index_documents_on_created_on" - add_index "documents", ["project_id"], :name => "documents_project_id" - - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 - t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false - end - - create_table "editor_of_documents", :force => true do |t| - t.integer "editor_id" - t.integer "org_document_comment_id" - t.datetime "created_at" - end - - create_table "enabled_modules", :force => true do |t| - t.integer "project_id" - t.string "name", :null => false - t.integer "course_id" - end - - add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" - - create_table "enumerations", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "is_default", :default => false, :null => false - t.string "type" - t.boolean "active", :default => true, :null => false - t.integer "project_id" - t.integer "parent_id" - t.string "position_name", :limit => 30 - end - - add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" - add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - - create_table "exercise_answers", :force => true do |t| - t.integer "user_id" - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_choices", :force => true do |t| - t.integer "exercise_question_id" - t.text "choice_text" - t.integer "choice_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_questions", :force => true do |t| - t.text "question_title" - t.integer "question_type" - t.integer "question_number" - t.integer "exercise_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_score" - end - - create_table "exercise_standard_answers", :force => true do |t| - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_users", :force => true do |t| - t.integer "user_id" - t.integer "exercise_id" - t.integer "score" - t.datetime "start_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "end_at" - t.integer "status" - t.integer "commit_status", :default => 0 - end - - create_table "exercises", :force => true do |t| - t.text "exercise_name" - t.text "exercise_description" - t.integer "course_id" - t.integer "exercise_status" - t.integer "user_id" - t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "publish_time" - t.datetime "end_time" - t.integer "show_result" - end - - create_table "first_pages", :force => true do |t| - t.string "web_title" - t.string "title" - t.text "description" - t.string "page_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sort_type" - t.integer "image_width", :default => 107 - t.integer "image_height", :default => 63 - t.integer "show_course", :default => 1 - t.integer "show_contest", :default => 1 - end - - create_table "forge_activities", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_act_id" - t.string "forge_act_type" - t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "training_project_id" - end - - add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" - add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" - - create_table "forge_messages", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_message_id" - t.string "forge_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "secret_key" - t.integer "status" - t.integer "operate_user_id" - end - - add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" - add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" - - create_table "forums", :force => true do |t| - t.string "name", :null => false - t.text "description" - t.integer "topic_count", :default => 0 - t.integer "memo_count", :default => 0 - t.integer "last_memo_id", :default => 0 - t.integer "creator_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sticky" - t.integer "locked" - end - - create_table "forwards", :force => true do |t| - t.integer "from_id" - t.string "from_type" - t.integer "to_id" - t.string "to_type" - t.datetime "created_at" - end - - create_table "groups_users", :id => false, :force => true do |t| - t.integer "group_id", :null => false - t.integer "user_id", :null => false - end - - add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - - create_table "homepages", :force => true do |t| - t.string "name" - t.integer "article_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" - - create_table "homework_attaches", :force => true do |t| - t.integer "bid_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - t.string "name" - t.text "description" - t.integer "state" - t.integer "project_id", :default => 0 - t.float "score", :default => 0.0 - t.integer "is_teacher_score", :default => 0 - end - - add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" - - create_table "homework_commons", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "homework_type", :default => 1 - t.string "late_penalty" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 - t.integer "anonymous_comment", :default => 0 - t.integer "quotes", :default => 0 - t.integer "is_open", :default => 0 - t.datetime "simi_time" - t.integer "score_open", :default => 1 - t.integer "anonymous_appeal", :default => 0 - end - - add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" - - create_table "homework_detail_groups", :force => true do |t| - t.integer "homework_common_id" - t.integer "min_num" - t.integer "max_num" - t.integer "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" - - create_table "homework_detail_manuals", :force => true do |t| - t.float "ta_proportion" - t.integer "comment_status" - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "absence_penalty", :default => 1 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "no_anon_penalty", :default => 1 - t.integer "appeal_penalty", :default => 0 - t.integer "ta_mode", :default => 1 - end - - create_table "homework_detail_programings", :force => true do |t| - t.string "language" - t.text "standard_code", :limit => 2147483647 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "ta_proportion", :default => 0.1 - t.integer "question_id" - end - - create_table "homework_evaluations", :force => true do |t| - t.string "user_id" - t.string "homework_attach_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "homework_for_courses", :force => true do |t| - t.integer "course_id" - t.integer "bid_id" - end - - add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" - add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" - - create_table "homework_tests", :force => true do |t| - t.text "input" - t.text "output" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "result" - t.text "error_msg" - end - - create_table "homework_users", :force => true do |t| - t.string "homework_attach_id" - t.string "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "innodb_monitor", :id => false, :force => true do |t| - t.integer "a" - end - - create_table "invite_lists", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "mail" - end - - create_table "issue_categories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.integer "assigned_to_id" - end - - add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" - add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" - - create_table "issue_relations", :force => true do |t| - t.integer "issue_from_id", :null => false - t.integer "issue_to_id", :null => false - t.string "relation_type", :default => "", :null => false - t.integer "delay" - end - - add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true - add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" - add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" - - create_table "issue_statuses", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_closed", :default => false, :null => false - t.boolean "is_default", :default => false, :null => false - t.integer "position", :default => 1 - t.integer "default_done_ratio" - end - - add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" - add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" - add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" - - create_table "issues", :force => true do |t| - t.integer "tracker_id", :null => false - t.integer "project_id", :null => false - t.string "subject", :default => "", :null => false - t.text "description" - t.date "due_date" - t.integer "category_id" - t.integer "status_id", :null => false - t.integer "assigned_to_id" - t.integer "priority_id", :null => false - t.integer "fixed_version_id" - t.integer "author_id", :null => false - t.integer "lock_version", :default => 0, :null => false - t.datetime "created_on" - t.datetime "updated_on" - t.date "start_date" - t.integer "done_ratio", :default => 0, :null => false - t.float "estimated_hours" - t.integer "parent_id" - t.integer "root_id" - t.integer "lft" - t.integer "rgt" - t.boolean "is_private", :default => false, :null => false - t.datetime "closed_on" - t.integer "project_issues_index" - end - - add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" - add_index "issues", ["author_id"], :name => "index_issues_on_author_id" - add_index "issues", ["category_id"], :name => "index_issues_on_category_id" - add_index "issues", ["created_on"], :name => "index_issues_on_created_on" - add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" - add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" - add_index "issues", ["project_id"], :name => "issues_project_id" - add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" - add_index "issues", ["status_id"], :name => "index_issues_on_status_id" - add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" - - create_table "join_in_competitions", :force => true do |t| - t.integer "user_id" - t.integer "competition_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "join_in_contests", :force => true do |t| - t.integer "user_id" - t.integer "bid_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "journal_details", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - - create_table "journal_replies", :id => false, :force => true do |t| - t.integer "journal_id" - t.integer "user_id" - t.integer "reply_id" - end - - add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" - add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" - add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" - - create_table "journals", :force => true do |t| - t.integer "journalized_id", :default => 0, :null => false - t.string "journalized_type", :limit => 30, :default => "", :null => false - t.integer "user_id", :default => 0, :null => false - t.text "notes" - t.datetime "created_on", :null => false - t.boolean "private_notes", :default => false, :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "journals", ["created_on"], :name => "index_journals_on_created_on" - add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" - add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" - add_index "journals", ["user_id"], :name => "index_journals_on_user_id" - - create_table "journals_for_messages", :force => true do |t| - t.integer "jour_id" - t.string "jour_type" - t.integer "user_id" - t.text "notes" - t.integer "status" - t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.string "m_parent_id" - t.boolean "is_readed" - t.integer "m_reply_count" - t.integer "m_reply_id" - t.integer "is_comprehensive_evaluation" - t.integer "private", :default => 0 - t.integer "root_id" - end - - add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" - - create_table "kindeditor_assets", :force => true do |t| - t.string "asset" - t.integer "file_size" - t.string "file_type" - t.integer "owner_id" - t.string "asset_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "owner_type", :default => 0 - end - - create_table "member_roles", :force => true do |t| - t.integer "member_id", :null => false - t.integer "role_id", :null => false - t.integer "inherited_from" - t.integer "is_current", :default => 1 - end - - add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" - add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" - - create_table "members", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "project_id", :default => 0 - t.datetime "created_on" - t.boolean "mail_notification", :default => false, :null => false - t.integer "course_id", :default => -1 - t.integer "course_group_id", :default => 0 - t.integer "is_collect", :default => 1 - end - - add_index "members", ["course_id"], :name => "index_members_on_course_id" - add_index "members", ["project_id"], :name => "index_members_on_project_id" - add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true - add_index "members", ["user_id"], :name => "index_members_on_user_id" - - create_table "memo_messages", :force => true do |t| - t.integer "user_id" - t.integer "forum_id" - t.integer "memo_id" - t.string "memo_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" - add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" - - create_table "memos", :force => true do |t| - t.integer "forum_id", :null => false - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false - t.integer "author_id", :null => false - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count", :default => 0 - t.integer "root_id" - end - - add_index "memos", ["root_id"], :name => "index_memos_on_root_id" - - create_table "message_alls", :force => true do |t| - t.integer "user_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" - add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" - - create_table "messages", :force => true do |t| - t.integer "board_id", :null => false - t.integer "parent_id" - t.string "subject", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "replies_count", :default => 0, :null => false - t.integer "last_reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.integer "quotes" - t.integer "status", :default => 0 - t.integer "root_id" - end - - add_index "messages", ["author_id"], :name => "index_messages_on_author_id" - add_index "messages", ["board_id"], :name => "messages_board_id" - add_index "messages", ["created_on"], :name => "index_messages_on_created_on" - add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" - add_index "messages", ["parent_id"], :name => "messages_parent_id" - add_index "messages", ["root_id"], :name => "index_messages_on_root_id" - - create_table "news", :force => true do |t| - t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" - t.text "description" - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false - t.integer "course_id" - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "contest_id" - end - - add_index "news", ["author_id"], :name => "index_news_on_author_id" - add_index "news", ["created_on"], :name => "index_news_on_created_on" - add_index "news", ["project_id"], :name => "news_project_id" - - create_table "no_uses", :force => true do |t| - t.integer "user_id", :null => false - t.string "no_use_type" - t.integer "no_use_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "notificationcomments", :force => true do |t| - t.string "notificationcommented_type" - t.integer "notificationcommented_id" - t.integer "author_id" - t.text "notificationcomments" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "onclick_times", :force => true do |t| - t.integer "user_id" - t.datetime "onclick_time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "open_id_authentication_associations", :force => true do |t| - t.integer "issued" - t.integer "lifetime" - t.string "handle" - t.string "assoc_type" - t.binary "server_url" - t.binary "secret" - end - - create_table "open_id_authentication_nonces", :force => true do |t| - t.integer "timestamp", :null => false - t.string "server_url" - t.string "salt", :null => false - end - - create_table "open_source_projects", :force => true do |t| - t.string "name" - t.text "description" - t.integer "commit_count", :default => 0 - t.integer "code_line", :default => 0 - t.integer "users_count", :default => 0 - t.date "last_commit_time" - t.string "url" - t.date "date_collected" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "option_numbers", :force => true do |t| - t.integer "user_id" - t.integer "memo" - t.integer "messages_for_issues" - t.integer "issues_status" - t.integer "replay_for_message" - t.integer "replay_for_memo" - t.integer "follow" - t.integer "tread" - t.integer "praise_by_one" - t.integer "praise_by_two" - t.integer "praise_by_three" - t.integer "tread_by_one" - t.integer "tread_by_two" - t.integer "tread_by_three" - t.integer "changeset" - t.integer "document" - t.integer "attachment" - t.integer "issue_done_ratio" - t.integer "post_issue" - t.integer "score_type" - t.integer "total_score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - end - - create_table "org_activities", :force => true do |t| - t.integer "user_id" - t.integer "org_act_id" - t.string "org_act_type" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_courses", :force => true do |t| - t.integer "organization_id" - t.integer "course_id" - t.datetime "created_at" - end - - create_table "org_document_comments", :force => true do |t| - t.text "title" - t.text "content" - t.integer "organization_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "status", :default => 0 - t.integer "root_id" - end - - add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" - - create_table "org_member_roles", :force => true do |t| - t.integer "org_member_id" - t.integer "role_id" - end - - create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_messages", :force => true do |t| - t.integer "user_id" - t.integer "sender_id" - t.integer "organization_id" - t.string "message_type" - t.integer "message_id" - t.integer "viewed" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - end - - create_table "org_projects", :force => true do |t| - t.integer "organization_id" - t.integer "project_id" - t.datetime "created_at" - end - - create_table "org_subfield_messages", :force => true do |t| - t.integer "org_subfield_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_subfields", :force => true do |t| - t.integer "organization_id" - t.integer "priority" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 1 - end - - create_table "organizations", :force => true do |t| - t.string "name" - t.text "description" - t.integer "creator_id" - t.integer "home_id" - t.boolean "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "allow_guest_download", :default => true - t.integer "visits", :default => 0 - t.integer "show_mode", :default => 0 - t.integer "allow_teacher", :default => 0 - end - - create_table "phone_app_versions", :force => true do |t| - t.string "version" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_answers", :force => true do |t| - t.integer "poll_question_id" - t.text "answer_text" - t.integer "answer_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_questions", :force => true do |t| - t.string "question_title" - t.integer "question_type" - t.integer "is_necessary" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_number" - t.integer "max_choices", :default => 0 - t.integer "min_choices", :default => 0 - end - - create_table "poll_users", :force => true do |t| - t.integer "user_id" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_votes", :force => true do |t| - t.integer "user_id" - t.integer "poll_question_id" - t.integer "poll_answer_id" - t.text "vote_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "polls", :force => true do |t| - t.string "polls_name" - t.string "polls_type" - t.integer "polls_group_id" - t.integer "polls_status" - t.integer "user_id" - t.datetime "published_at" - t.datetime "closed_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "polls_description" - t.integer "show_result", :default => 1 - end - - create_table "praise_tread_caches", :force => true do |t| - t.integer "object_id", :null => false - t.string "object_type" - t.integer "praise_num" - t.integer "tread_num" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "praise_treads", :force => true do |t| - t.integer "user_id", :null => false - t.integer "praise_tread_object_id" - t.string "praise_tread_object_type" - t.integer "praise_or_tread" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "principal_activities", :force => true do |t| - t.integer "user_id" - t.integer "principal_id" - t.integer "principal_act_id" - t.string "principal_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "professional_levels", :force => true do |t| - t.integer "level" - end - - create_table "professions", :force => true do |t| - t.string "name" - t.integer "discipline_id", :limit => 1 - end - - create_table "project_infos", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_scores", :force => true do |t| - t.string "project_id" - t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 - t.datetime "commit_time" - t.integer "pull_request_num", :default => 0 - t.integer "training_project_id", :default => -1 - end - - create_table "project_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "project_id" - t.integer "project_type" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - end - - add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" - - create_table "projecting_softapplictions", :force => true do |t| - t.integer "user_id" - t.integer "softapplication_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "identifier" - t.integer "status", :default => 1, :null => false - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "boards_count", :default => 0 - t.integer "news_count", :default => 0 - t.integer "acts_count", :default => 0 - t.integer "journals_count", :default => 0 - t.integer "boards_reply_count", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.text "script" - end - - add_index "projects", ["lft"], :name => "index_projects_on_lft" - add_index "projects", ["rgt"], :name => "index_projects_on_rgt" - - create_table "projects_trackers", :id => false, :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true - add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - - create_table "pull_requests", :force => true do |t| - t.integer "pull_request_id" - t.integer "gpid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - t.integer "project_id" - t.string "title" - end - - create_table "quality_analyses", :force => true do |t| - t.integer "project_id" - t.string "author_login" - t.string "rep_identifier" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sonar_version", :default => 0 - t.string "path" - t.string "branch" - t.string "language" - t.string "sonar_name" - end - - create_table "queries", :force => true do |t| - t.integer "project_id" - t.string "name", :default => "", :null => false - t.text "filters" - t.integer "user_id", :default => 0, :null => false - t.boolean "is_public", :default => false, :null => false - t.text "column_names" - t.text "sort_criteria" - t.string "group_by" - t.string "type" - end - - add_index "queries", ["project_id"], :name => "index_queries_on_project_id" - add_index "queries", ["user_id"], :name => "index_queries_on_user_id" - - create_table "relative_memo_to_open_source_projects", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "relative_memos", :force => true do |t| - t.integer "osp_id" - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false - t.integer "author_id" - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 - t.string "url" - t.string "username" - t.string "userhomeurl" - t.date "date_collected" - t.string "topic_resource" - end - - create_table "rep_statics", :force => true do |t| - t.integer "project_id" - t.integer "commits_num" - t.string "uname" - t.string "email" - t.integer "add" - t.integer "del" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "changeset" - end - - create_table "repositories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "url", :default => "", :null => false - t.string "login", :limit => 60, :default => "" - t.string "password", :default => "" - t.string "root_url", :default => "" - t.string "type" - t.string "path_encoding", :limit => 64 - t.string "log_encoding", :limit => 64 - t.text "extra_info" - t.string "identifier" - t.boolean "is_default", :default => false - t.boolean "hidden", :default => false - end - - add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - - create_table "roles", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "assignable", :default => true - t.integer "builtin", :default => 0, :null => false - t.text "permissions" - t.string "issues_visibility", :limit => 30, :default => "default", :null => false - end - - create_table "schools", :force => true do |t| - t.string "name" - t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "logo_link" - t.string "pinyin" - t.integer "school_type", :default => 0 - end - - create_table "secdomains", :force => true do |t| - t.integer "sub_type" - t.string "subname" - t.integer "pid", :default => 0 - t.string "desc" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_cached_ratings", :force => true do |t| - t.integer "cacheable_id", :limit => 8 - t.string "cacheable_type" - t.float "avg", :null => false - t.integer "cnt", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_rates", :force => true do |t| - t.integer "rater_id", :limit => 8 - t.integer "rateable_id" - t.string "rateable_type" - t.float "stars", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "is_teacher_score", :default => 0 - end - - create_table "settings", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "value" - t.datetime "updated_on" - end - - add_index "settings", ["name"], :name => "index_settings_on_name" - - create_table "shares", :force => true do |t| - t.date "created_on" - t.string "url" - t.string "title" - t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - t.integer "user_id" - t.string "description" - end - - create_table "shield_activities", :force => true do |t| - t.string "container_type" - t.integer "container_id" - t.string "shield_type" - t.integer "shield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "shield_wechat_messages", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.integer "shield_id" - t.string "shield_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "softapplications", :force => true do |t| - t.string "name" - t.text "description" - t.integer "app_type_id" - t.string "app_type_name" - t.string "android_min_version_available" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "contest_id" - t.integer "softapplication_id" - t.integer "is_public" - t.string "application_developers" - t.string "deposit_project_url" - t.string "deposit_project" - t.integer "project_id" - end - - create_table "sonar_errors", :force => true do |t| - t.integer "project_id" - t.string "jenkins_job_name" - t.text "output" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "ssos", :force => true do |t| - t.integer "user_id" - t.string "openid" - t.string "name" - t.string "password" - t.string "email" - t.integer "sex" - t.string "school" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" - - create_table "student_work_projects", :force => true do |t| - t.integer "homework_common_id" - t.integer "student_work_id" - t.integer "project_id" - t.integer "user_id" - t.integer "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "course_id" - end - - add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" - add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" - add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" - add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" - - create_table "student_work_tests", :force => true do |t| - t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 - t.text "results" - t.text "src" - end - - add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" - - create_table "student_works", :force => true do |t| - t.string "name" - t.text "description", :limit => 2147483647 - t.integer "homework_common_id" - t.integer "user_id" - t.float "final_score" - t.float "teacher_score" - t.float "student_score" - t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "late_penalty", :default => 0 - t.integer "absence_penalty", :default => 0 - t.float "system_score", :default => 0.0 - t.boolean "is_test", :default => false - t.integer "simi_id" - t.integer "simi_value" - t.float "work_score" - t.integer "work_status", :default => 0 - t.datetime "commit_time" - t.integer "is_delete", :default => 0 - t.integer "appeal_penalty", :default => 0 - end - - add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" - - create_table "student_works_evaluation_distributions", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "student_works_scores", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "appeal_status", :default => 0 - t.boolean "is_hidden", :default => false - end - - add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" - add_index "student_works_scores", ["user_id"], :name => "user_id" - - create_table "student_works_scores_appeals", :force => true do |t| - t.integer "student_works_score_id" - t.integer "user_id" - t.text "comment" - t.integer "appeal_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "students_for_courses", :force => true do |t| - t.integer "student_id" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" - add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" - - create_table "sub_document_comments", :force => true do |t| - t.text "content" - t.text "title" - t.integer "sub_domain_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.integer "locked" - t.integer "sticky" - t.integer "org_subfield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "sub_domains", :force => true do |t| - t.integer "org_subfield_id" - t.integer "priority", :default => 0 - t.string "name" - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "subfield_subdomain_dirs", :force => true do |t| - t.integer "org_subfield_id" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "syllabus_members", :force => true do |t| - t.integer "rank" - t.integer "syllabus_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" - add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" - add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" - - create_table "syllabuses", :force => true do |t| - t.string "title" - t.text "description" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "eng_name" - t.integer "syllabus_type" - t.integer "credit" - t.integer "hours" - t.integer "theory_hours" - t.integer "practice_hours" - t.string "applicable_major" - t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 - t.integer "professional_level_id", :limit => 1 - end - - add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" - end - - create_table "taggings", :force => true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context", :limit => 128 - t.datetime "created_at" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" - add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" - - create_table "tags", :force => true do |t| - t.string "name" - end - - create_table "teachers", :force => true do |t| - t.string "tea_name" - t.string "location" - t.integer "couurse_time" - t.integer "course_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "extra" - end - - create_table "time_entries", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "issue_id" - t.float "hours", :null => false - t.string "comments" - t.integer "activity_id", :null => false - t.date "spent_on", :null => false - t.integer "tyear", :null => false - t.integer "tmonth", :null => false - t.integer "tweek", :null => false - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" - add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" - add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" - add_index "time_entries", ["project_id"], :name => "time_entries_project_id" - add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - - create_table "tokens", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "value", :limit => 40, :default => "", :null => false - t.datetime "created_on", :null => false - end - - add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" - add_index "tokens", ["value"], :name => "tokens_value", :unique => true - - create_table "trackers", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_in_chlog", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "is_in_roadmap", :default => true, :null => false - t.integer "fields_bits", :default => 0 - end - - create_table "trackers_training_projects", :id => false, :force => true do |t| - t.integer "training_project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "trackers_training_projects", ["training_project_id"], :name => "projects_trackers_training_project_id" - - create_table "training_projects", :force => true do |t| - t.string "name", :limit => 30, :null => false - t.text "description" - t.string "homepage", :limit => 60 - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.integer "projects_count", :default => 0 - t.string "identifier", :null => false - t.integer "status", :default => 1 - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "training_tasks", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.string "subject" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "author_id" - t.integer "status", :limit => 1, :default => 1 - end - - create_table "user_actions", :force => true do |t| - t.integer "user_id" - t.string "action_type" - t.integer "action_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_activities", :force => true do |t| - t.string "act_type" - t.integer "act_id" - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" - - create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false - t.date "birthday" - t.string "brief_introduction" - t.integer "gender" - t.string "location" - t.string "occupation" - t.integer "work_experience" - t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "technical_title" - t.integer "identity" - t.string "student_id" - t.string "teacher_realname" - t.string "student_realname" - t.string "location_city" - t.integer "school_id" - t.string "description", :default => "" - end - - add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" - - create_table "user_feedback_messages", :force => true do |t| - t.integer "user_id" - t.integer "journals_for_message_id" - t.string "journals_for_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" - add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" - - create_table "user_grades", :force => true do |t| - t.integer "user_id", :null => false - t.integer "project_id", :null => false - t.float "grade", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" - add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" - add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" - - create_table "user_levels", :force => true do |t| - t.integer "user_id" - t.integer "level" - end - - create_table "user_preferences", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.text "others" - t.boolean "hide_mail", :default => false - t.string "time_zone" - end - - add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" - - create_table "user_score_details", :force => true do |t| - t.integer "current_user_id" - t.integer "target_user_id" - t.string "score_type" - t.string "score_action" - t.integer "user_id" - t.integer "old_score" - t.integer "new_score" - t.integer "current_user_level" - t.integer "target_user_level" - t.integer "score_changeable_obj_id" - t.string "score_changeable_obj_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "grade", :default => 0.0 - end - - add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" - add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" - add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "bindtype", :default => 0 - end - - create_table "users", :force => true do |t| - t.string "login", :default => "", :null => false - t.string "hashed_password", :limit => 40, :default => "", :null => false - t.string "firstname", :limit => 30, :default => "", :null => false - t.string "lastname", :default => "", :null => false - t.string "mail", :limit => 60, :default => "", :null => false - t.boolean "admin", :default => false, :null => false - t.integer "status", :default => 1, :null => false - t.datetime "last_login_on" - t.string "language", :limit => 5, :default => "" - t.integer "auth_source_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "type" - t.string "identity_url" - t.string "mail_notification", :default => "", :null => false - t.string "salt", :limit => 64 - t.integer "gid" - t.integer "visits", :default => 0 - t.integer "excellent_teacher", :default => 0 - t.integer "excellent_student", :default => 0 - end - - add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" - add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" - add_index "users", ["type"], :name => "index_users_on_type" - - create_table "versions", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :default => "", :null => false - t.string "description", :default => "" - t.date "effective_date" - t.datetime "created_on" - t.datetime "updated_on" - t.string "wiki_page_title" - t.string "status", :default => "open" - t.string "sharing", :default => "none", :null => false - t.integer "user_id" - end - - add_index "versions", ["project_id"], :name => "versions_project_id" - add_index "versions", ["sharing"], :name => "index_versions_on_sharing" - - create_table "visitors", :force => true do |t| - t.integer "user_id" - t.integer "master_id" - t.datetime "updated_on" - t.datetime "created_on" - end - - add_index "visitors", ["master_id"], :name => "index_visitors_master_id" - add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" - add_index "visitors", ["user_id"], :name => "index_visitors_user_id" - - create_table "watchers", :force => true do |t| - t.string "watchable_type", :default => "", :null => false - t.integer "watchable_id", :default => 0, :null => false - t.integer "user_id" - end - - add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" - add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" - add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" - - create_table "web_footer_companies", :force => true do |t| - t.string "name" - t.string "logo_size" - t.string "url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "web_footer_oranizers", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - - add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" - - create_table "wiki_content_versions", :force => true do |t| - t.integer "wiki_content_id", :null => false - t.integer "page_id", :null => false - t.integer "author_id" - t.binary "data", :limit => 2147483647 - t.string "compression", :limit => 6, :default => "" - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" - add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" - - create_table "wiki_contents", :force => true do |t| - t.integer "page_id", :null => false - t.integer "author_id" - t.text "text", :limit => 2147483647 - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" - add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" - - create_table "wiki_pages", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title", :null => false - t.datetime "created_on", :null => false - t.boolean "protected", :default => false, :null => false - t.integer "parent_id" - end - - add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" - add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" - add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" - - create_table "wiki_redirects", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title" - t.string "redirects_to" - t.datetime "created_on", :null => false - end - - add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" - add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" - - create_table "wikis", :force => true do |t| - t.integer "project_id", :null => false - t.string "start_page", :null => false - t.integer "status", :default => 1, :null => false - end - - add_index "wikis", ["project_id"], :name => "wikis_project_id" - - create_table "work_detail_groups", :force => true do |t| - t.integer "work_id" - t.integer "min_num" - t.integer "max_num" - t.boolean "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" - - create_table "work_detail_manuals", :force => true do |t| - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" - - create_table "workflows", :force => true do |t| - t.integer "tracker_id", :default => 0, :null => false - t.integer "old_status_id", :default => 0, :null => false - t.integer "new_status_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - t.boolean "assignee", :default => false, :null => false - t.boolean "author", :default => false, :null => false - t.string "type", :limit => 30 - t.string "field_name", :limit => 30 - t.string "rule", :limit => 30 - end - - add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" - add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" - add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" - add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - - create_table "works", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "work_type" - t.integer "contest_id" - t.boolean "is_delete", :default => false - t.boolean "score_open", :default => false - t.boolean "is_open", :default => false - t.integer "work_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "online_evaluation", :default => false - t.boolean "score_valid", :default => true - end - - add_index "works", ["contest_id"], :name => "index_works_on_contest_id" - add_index "works", ["user_id"], :name => "index_works_on_user_id" - - create_table "works_categories", :force => true do |t| - t.string "category" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "zip_packs", :force => true do |t| - t.integer "user_id" - t.integer "homework_id" - t.string "file_digest" - t.string "file_path" - t.integer "pack_times", :default => 1 - t.integer "pack_size", :default => 0 - t.text "file_digests" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - -end +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20170219062646) do + + create_table "activities", :force => true do |t| + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false + t.integer "activity_container_id" + t.string "activity_container_type", :default => "" + t.datetime "created_at" + end + + add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" + add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" + add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + + create_table "activity_notifies", :force => true do |t| + t.integer "activity_container_id" + t.string "activity_container_type" + t.integer "activity_id" + t.string "activity_type" + t.integer "notify_to" + t.datetime "created_on" + t.integer "is_read" + end + + add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" + add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" + add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" + + create_table "api_keys", :force => true do |t| + t.string "access_token" + t.datetime "expires_at" + t.integer "user_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" + add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + + create_table "applied_contests", :force => true do |t| + t.integer "contest_id" + t.integer "user_id" + t.string "role" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" + add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" + + create_table "applied_messages", :force => true do |t| + t.integer "user_id" + t.integer "applied_id" + t.string "applied_type" + t.integer "viewed", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "name" + t.integer "applied_user_id" + t.integer "role" + t.integer "project_id" + end + + create_table "applied_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "role", :default => 0 + end + + create_table "apply_add_schools", :force => true do |t| + t.string "name" + t.string "province" + t.string "city" + t.string "address" + t.string "remarks" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + create_table "apply_homeworks", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" + add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" + + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "apply_resources", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "attachment_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id" + t.string "container_type" + t.text "content" + t.integer "apply_user_id" + end + + create_table "article_homepages", :force => true do |t| + t.string "title" + t.text "content" + t.integer "user_id" + t.integer "homepage_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" + add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" + + create_table "at_messages", :force => true do |t| + t.integer "user_id" + t.integer "at_message_id" + t.string "at_message_type" + t.boolean "viewed", :default => false + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sender_id" + end + + add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" + + create_table "attachment_histories", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.string "filename", :default => "" + t.string "disk_filename", :default => "" + t.integer "filesize", :default => 0 + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "" + t.integer "downloads", :default => 0 + t.integer "author_id" + t.datetime "created_on" + t.text "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.integer "copy_from" + t.integer "quotes" + t.integer "version" + t.integer "attachment_id" + t.integer "is_publish", :default => 1 + t.date "publish_time" + end + + create_table "attachments", :force => true do |t| + t.integer "container_id" + t.string "container_type", :limit => 30 + t.string "filename", :default => "", :null => false + t.string "disk_filename", :default => "", :null => false + t.integer "filesize", :default => 0, :null => false + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "", :null => false + t.integer "downloads", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.text "description" + t.string "disk_directory" + t.integer "attachtype", :default => 1 + t.integer "is_public", :default => 1 + t.integer "copy_from" + t.integer "quotes" + t.integer "is_publish", :default => 1 + t.datetime "publish_time" + end + + add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" + add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" + add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" + + create_table "attachmentstypes", :force => true do |t| + t.integer "typeId", :null => false + t.string "typeName", :limit => 50 + end + + create_table "auth_sources", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 60, :default => "", :null => false + t.string "host", :limit => 60 + t.integer "port" + t.string "account" + t.string "account_password", :default => "" + t.string "base_dn" + t.string "attr_login", :limit => 30 + t.string "attr_firstname", :limit => 30 + t.string "attr_lastname", :limit => 30 + t.string "attr_mail", :limit => 30 + t.boolean "onthefly_register", :default => false, :null => false + t.boolean "tls", :default => false, :null => false + t.string "filter" + t.integer "timeout" + end + + add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" + + create_table "biding_projects", :force => true do |t| + t.integer "project_id" + t.integer "bid_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "bids", :force => true do |t| + t.string "name" + t.string "budget", :null => false + t.integer "author_id" + t.date "deadline" + t.text "description" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "commit" + t.integer "reward_type" + t.integer "homework_type" + t.integer "parent_id" + t.string "password" + t.integer "is_evaluation" + t.integer "proportion", :default => 60 + t.integer "comment_status", :default => 0 + t.integer "evaluation_num", :default => 3 + t.integer "open_anonymous_evaluation", :default => 1 + end + + create_table "blog_comments", :force => true do |t| + t.integer "blog_id", :null => false + t.integer "parent_id" + t.string "title", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comment_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "root_id" + end + + add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" + + create_table "blog_messages", :force => true do |t| + t.integer "user_id" + t.integer "blog_message_id" + t.integer "blog_id" + t.string "blog_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_operator_id" + end + + create_table "blogs", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.integer "position", :default => 1 + t.integer "article_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comments_id" + t.integer "parent_id" + t.integer "author_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "homepage_id" + end + + create_table "boards", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false + t.string "description" + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false + t.integer "last_message_id" + t.integer "parent_id" + t.integer "course_id" + t.integer "org_subfield_id" + t.integer "contest_id" + end + + add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" + add_index "boards", ["project_id"], :name => "boards_project_id" + + create_table "bug_to_osps", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "changes", :force => true do |t| + t.integer "changeset_id", :null => false + t.string "action", :limit => 1, :default => "", :null => false + t.text "path", :null => false + t.text "from_path" + t.string "from_revision" + t.string "revision" + t.string "branch" + end + + add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" + + create_table "changeset_parents", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "parent_id", :null => false + end + + add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" + add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" + + create_table "changesets", :force => true do |t| + t.integer "repository_id", :null => false + t.string "revision", :null => false + t.string "committer" + t.datetime "committed_on", :null => false + t.text "comments" + t.date "commit_date" + t.string "scmid" + t.integer "user_id" + end + + add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" + add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true + add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" + add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" + add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" + + create_table "changesets_issues", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "issue_id", :null => false + end + + add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + + create_table "code_tests", :force => true do |t| + t.integer "homework_id" + t.integer "wait_time", :default => 0 + t.integer "language" + t.integer "status" + t.integer "time_used", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "student_work_id", :default => 0 + end + + create_table "comments", :force => true do |t| + t.string "commented_type", :limit => 30, :default => "", :null => false + t.integer "commented_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.text "comments" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "comments", ["author_id"], :name => "index_comments_on_author_id" + add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" + + create_table "commit_issues", :force => true do |t| + t.string "commit_id" + t.integer "issue_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "commits", :force => true do |t| + t.integer "repository_id" + t.string "version" + t.string "committer" + t.text "comments" + t.datetime "committed_on" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contest_activities", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_act_id" + t.string "contest_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" + add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" + + create_table "contest_member_roles", :force => true do |t| + t.integer "contest_member_id" + t.integer "role_id" + t.boolean "is_current", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" + add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" + + create_table "contest_members", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.boolean "is_collect", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" + add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" + + create_table "contest_messages", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_message_id" + t.string "contest_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" + add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" + + create_table "contestant_for_contests", :force => true do |t| + t.integer "student_id" + t.integer "contest_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" + add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" + + create_table "contestant_work_evaluation_distributions", :force => true do |t| + t.integer "user_id" + t.integer "contestant_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" + + create_table "contestant_work_projects", :force => true do |t| + t.integer "contest_id" + t.integer "work_id" + t.integer "contestant_work_id" + t.integer "project_id" + t.integer "user_id" + t.boolean "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" + add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" + add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" + add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" + + create_table "contestant_work_scores", :force => true do |t| + t.integer "contestant_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" + add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" + + create_table "contestant_works", :force => true do |t| + t.string "name" + t.text "description" + t.integer "work_id" + t.integer "user_id" + t.float "work_score" + t.integer "project_id" + t.integer "work_status" + t.datetime "commit_time" + t.boolean "is_delete", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "judge_score" + end + + add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" + add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" + add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" + + create_table "contests", :force => true do |t| + t.integer "user_id" + t.string "name" + t.text "description" + t.boolean "is_public" + t.boolean "is_delete", :default => false + t.integer "visits", :default => 0 + t.string "invite_code" + t.integer "invite_code_halt", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_activities", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_act_id" + t.string "course_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" + + create_table "course_attachments", :force => true do |t| + t.string "filename" + t.string "disk_filename" + t.integer "filesize" + t.string "content_type" + t.string "digest" + t.integer "downloads" + t.string "author_id" + t.string "integer" + t.string "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id", :default => 0 + end + + create_table "course_contributor_scores", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.integer "message_num", :default => 0 + t.integer "message_reply_num", :default => 0 + t.integer "news_reply_num", :default => 0 + t.integer "resource_num", :default => 0 + t.integer "journal_num", :default => 0 + t.integer "journal_reply_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "total_score", :default => 0 + t.integer "homework_journal_num", :default => 0 + t.integer "news_num", :default => 0 + end + + add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" + + create_table "course_groups", :force => true do |t| + t.string "name" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" + + create_table "course_homework_statistics", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "committed_work_num", :default => 0 + t.integer "un_commit_work_num", :default => 0 + t.integer "late_commit_work_num", :default => 0 + t.integer "absence_evaluation_work_num", :default => 0 + t.integer "un_evaluation_work_num", :default => 0 + t.integer "appeal_num", :default => 0 + t.float "average_score", :default => 0.0 + t.float "total_score", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_infos", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_messages", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_message_id" + t.string "course_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "content" + t.integer "status" + t.integer "apply_user_id" + t.integer "apply_result" + end + + add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" + add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" + + create_table "course_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "course_id" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "courses", :force => true do |t| + t.integer "tea_id" + t.string "name" + t.integer "state" + t.string "code" + t.integer "time" + t.string "extra" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "location" + t.string "term" + t.string "string" + t.string "password" + t.string "setup_time" + t.string "endup_time" + t.string "class_period" + t.integer "school_id" + t.text "description" + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 + t.integer "lft" + t.integer "rgt" + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 + t.integer "end_time" + t.string "end_term" + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 + t.integer "syllabus_id" + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 + end + + add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true + add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" + + create_table "custom_fields", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.string "field_format", :limit => 30, :default => "", :null => false + t.text "possible_values" + t.string "regexp", :default => "" + t.integer "min_length", :default => 0, :null => false + t.integer "max_length", :default => 0, :null => false + t.boolean "is_required", :default => false, :null => false + t.boolean "is_for_all", :default => false, :null => false + t.boolean "is_filter", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "searchable", :default => false + t.text "default_value" + t.boolean "editable", :default => true + t.boolean "visible", :default => true, :null => false + t.boolean "multiple", :default => false + end + + add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" + + create_table "custom_fields_projects", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "project_id", :default => 0, :null => false + end + + add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true + + create_table "custom_fields_trackers", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true + + create_table "custom_values", :force => true do |t| + t.string "customized_type", :limit => 30, :default => "", :null => false + t.integer "customized_id", :default => 0, :null => false + t.integer "custom_field_id", :default => 0, :null => false + t.text "value" + end + + add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" + add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + + create_table "data_exceptions", :force => true do |t| + t.string "message" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "delayed_jobs", :force => true do |t| + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "documents", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "category_id", :default => 0, :null => false + t.string "title", :limit => 60, :default => "", :null => false + t.text "description" + t.datetime "created_on" + t.integer "user_id", :default => 0 + t.integer "is_public", :default => 1 + end + + add_index "documents", ["category_id"], :name => "index_documents_on_category_id" + add_index "documents", ["created_on"], :name => "index_documents_on_created_on" + add_index "documents", ["project_id"], :name => "documents_project_id" + + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 + t.string "File" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false + end + + create_table "editor_of_documents", :force => true do |t| + t.integer "editor_id" + t.integer "org_document_comment_id" + t.datetime "created_at" + end + + create_table "enabled_modules", :force => true do |t| + t.integer "project_id" + t.string "name", :null => false + t.integer "course_id" + end + + add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" + + create_table "enumerations", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "is_default", :default => false, :null => false + t.string "type" + t.boolean "active", :default => true, :null => false + t.integer "project_id" + t.integer "parent_id" + t.string "position_name", :limit => 30 + end + + add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" + add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + + create_table "exercise_answers", :force => true do |t| + t.integer "user_id" + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_choices", :force => true do |t| + t.integer "exercise_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "exercise_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_score" + end + + create_table "exercise_standard_answers", :force => true do |t| + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_users", :force => true do |t| + t.integer "user_id" + t.integer "exercise_id" + t.integer "score" + t.datetime "start_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "end_at" + t.integer "status" + t.integer "commit_status", :default => 0 + end + + create_table "exercises", :force => true do |t| + t.text "exercise_name" + t.text "exercise_description" + t.integer "course_id" + t.integer "exercise_status" + t.integer "user_id" + t.integer "time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "publish_time" + t.datetime "end_time" + t.integer "show_result" + end + + create_table "first_pages", :force => true do |t| + t.string "web_title" + t.string "title" + t.text "description" + t.string "page_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sort_type" + t.integer "image_width", :default => 107 + t.integer "image_height", :default => 63 + t.integer "show_course", :default => 1 + t.integer "show_contest", :default => 1 + end + + create_table "forge_activities", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_act_id" + t.string "forge_act_type" + t.integer "org_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" + add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" + + create_table "forge_messages", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_message_id" + t.string "forge_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "secret_key" + t.integer "status" + t.integer "operate_user_id" + end + + add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" + add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + + create_table "forums", :force => true do |t| + t.string "name", :null => false + t.text "description" + t.integer "topic_count", :default => 0 + t.integer "memo_count", :default => 0 + t.integer "last_memo_id", :default => 0 + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sticky" + t.integer "locked" + end + + create_table "forwards", :force => true do |t| + t.integer "from_id" + t.string "from_type" + t.integer "to_id" + t.string "to_type" + t.datetime "created_at" + end + + create_table "groups_users", :id => false, :force => true do |t| + t.integer "group_id", :null => false + t.integer "user_id", :null => false + end + + add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true + + create_table "homepages", :force => true do |t| + t.string "name" + t.integer "article_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" + + create_table "homework_attaches", :force => true do |t| + t.integer "bid_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + t.string "name" + t.text "description" + t.integer "state" + t.integer "project_id", :default => 0 + t.float "score", :default => 0.0 + t.integer "is_teacher_score", :default => 0 + end + + add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + + create_table "homework_commons", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "homework_type", :default => 1 + t.string "late_penalty" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 + t.integer "quotes", :default => 0 + t.integer "is_open", :default => 0 + t.datetime "simi_time" + t.integer "score_open", :default => 1 + t.integer "anonymous_appeal", :default => 0 + end + + add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + + create_table "homework_detail_groups", :force => true do |t| + t.integer "homework_common_id" + t.integer "min_num" + t.integer "max_num" + t.integer "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" + + create_table "homework_detail_manuals", :force => true do |t| + t.float "ta_proportion" + t.integer "comment_status" + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "absence_penalty", :default => 1 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "no_anon_penalty", :default => 1 + t.integer "appeal_penalty", :default => 0 + t.integer "ta_mode", :default => 1 + end + + create_table "homework_detail_programings", :force => true do |t| + t.string "language" + t.text "standard_code", :limit => 2147483647 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "ta_proportion", :default => 0.1 + t.integer "question_id" + end + + create_table "homework_evaluations", :force => true do |t| + t.string "user_id" + t.string "homework_attach_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_for_courses", :force => true do |t| + t.integer "course_id" + t.integer "bid_id" + end + + add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" + add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + + create_table "homework_tests", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "result" + t.text "error_msg" + end + + create_table "homework_users", :force => true do |t| + t.string "homework_attach_id" + t.string "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "invite_lists", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "mail" + end + + create_table "issue_categories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.integer "assigned_to_id" + end + + add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" + add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" + + create_table "issue_relations", :force => true do |t| + t.integer "issue_from_id", :null => false + t.integer "issue_to_id", :null => false + t.string "relation_type", :default => "", :null => false + t.integer "delay" + end + + add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true + add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" + add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" + + create_table "issue_statuses", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_closed", :default => false, :null => false + t.boolean "is_default", :default => false, :null => false + t.integer "position", :default => 1 + t.integer "default_done_ratio" + end + + add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" + add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" + add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" + + create_table "issues", :force => true do |t| + t.integer "tracker_id", :null => false + t.integer "project_id", :null => false + t.string "subject", :default => "", :null => false + t.text "description" + t.date "due_date" + t.integer "category_id" + t.integer "status_id", :null => false + t.integer "assigned_to_id" + t.integer "priority_id", :null => false + t.integer "fixed_version_id" + t.integer "author_id", :null => false + t.integer "lock_version", :default => 0, :null => false + t.datetime "created_on" + t.datetime "updated_on" + t.date "start_date" + t.integer "done_ratio", :default => 0, :null => false + t.float "estimated_hours" + t.integer "parent_id" + t.integer "root_id" + t.integer "lft" + t.integer "rgt" + t.boolean "is_private", :default => false, :null => false + t.datetime "closed_on" + t.integer "project_issues_index" + end + + add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" + add_index "issues", ["author_id"], :name => "index_issues_on_author_id" + add_index "issues", ["category_id"], :name => "index_issues_on_category_id" + add_index "issues", ["created_on"], :name => "index_issues_on_created_on" + add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" + add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" + add_index "issues", ["project_id"], :name => "issues_project_id" + add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" + add_index "issues", ["status_id"], :name => "index_issues_on_status_id" + add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" + + create_table "join_in_competitions", :force => true do |t| + t.integer "user_id" + t.integer "competition_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "join_in_contests", :force => true do |t| + t.integer "user_id" + t.integer "bid_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "journal_details", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + + create_table "journal_replies", :id => false, :force => true do |t| + t.integer "journal_id" + t.integer "user_id" + t.integer "reply_id" + end + + add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" + add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" + add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" + + create_table "journals", :force => true do |t| + t.integer "journalized_id", :default => 0, :null => false + t.string "journalized_type", :limit => 30, :default => "", :null => false + t.integer "user_id", :default => 0, :null => false + t.text "notes" + t.datetime "created_on", :null => false + t.boolean "private_notes", :default => false, :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "journals", ["created_on"], :name => "index_journals_on_created_on" + add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" + add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" + add_index "journals", ["user_id"], :name => "index_journals_on_user_id" + + create_table "journals_for_messages", :force => true do |t| + t.integer "jour_id" + t.string "jour_type" + t.integer "user_id" + t.text "notes" + t.integer "status" + t.integer "reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.string "m_parent_id" + t.boolean "is_readed" + t.integer "m_reply_count" + t.integer "m_reply_id" + t.integer "is_comprehensive_evaluation" + t.integer "private", :default => 0 + t.integer "root_id" + end + + add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" + + create_table "kindeditor_assets", :force => true do |t| + t.string "asset" + t.integer "file_size" + t.string "file_type" + t.integer "owner_id" + t.string "asset_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "owner_type", :default => 0 + end + + create_table "member_roles", :force => true do |t| + t.integer "member_id", :null => false + t.integer "role_id", :null => false + t.integer "inherited_from" + t.integer "is_current", :default => 1 + end + + add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" + add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" + + create_table "members", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "project_id", :default => 0 + t.datetime "created_on" + t.boolean "mail_notification", :default => false, :null => false + t.integer "course_id", :default => -1 + t.integer "course_group_id", :default => 0 + t.integer "is_collect", :default => 1 + end + + add_index "members", ["course_id"], :name => "index_members_on_course_id" + add_index "members", ["project_id"], :name => "index_members_on_project_id" + add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true + add_index "members", ["user_id"], :name => "index_members_on_user_id" + + create_table "memo_messages", :force => true do |t| + t.integer "user_id" + t.integer "forum_id" + t.integer "memo_id" + t.string "memo_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" + add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" + + create_table "memos", :force => true do |t| + t.integer "forum_id", :null => false + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :null => false + t.integer "author_id", :null => false + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count", :default => 0 + t.integer "root_id" + end + + add_index "memos", ["root_id"], :name => "index_memos_on_root_id" + + create_table "message_alls", :force => true do |t| + t.integer "user_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" + add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" + + create_table "messages", :force => true do |t| + t.integer "board_id", :null => false + t.integer "parent_id" + t.string "subject", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "replies_count", :default => 0, :null => false + t.integer "last_reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.integer "quotes" + t.integer "status", :default => 0 + t.integer "root_id" + end + + add_index "messages", ["author_id"], :name => "index_messages_on_author_id" + add_index "messages", ["board_id"], :name => "messages_board_id" + add_index "messages", ["created_on"], :name => "index_messages_on_created_on" + add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" + add_index "messages", ["parent_id"], :name => "messages_parent_id" + add_index "messages", ["root_id"], :name => "index_messages_on_root_id" + + create_table "news", :force => true do |t| + t.integer "project_id" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" + t.text "description" + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.integer "comments_count", :default => 0, :null => false + t.integer "course_id" + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "contest_id" + end + + add_index "news", ["author_id"], :name => "index_news_on_author_id" + add_index "news", ["created_on"], :name => "index_news_on_created_on" + add_index "news", ["project_id"], :name => "news_project_id" + + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "notificationcomments", :force => true do |t| + t.string "notificationcommented_type" + t.integer "notificationcommented_id" + t.integer "author_id" + t.text "notificationcomments" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "open_id_authentication_associations", :force => true do |t| + t.integer "issued" + t.integer "lifetime" + t.string "handle" + t.string "assoc_type" + t.binary "server_url" + t.binary "secret" + end + + create_table "open_id_authentication_nonces", :force => true do |t| + t.integer "timestamp", :null => false + t.string "server_url" + t.string "salt", :null => false + end + + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "option_numbers", :force => true do |t| + t.integer "user_id" + t.integer "memo" + t.integer "messages_for_issues" + t.integer "issues_status" + t.integer "replay_for_message" + t.integer "replay_for_memo" + t.integer "follow" + t.integer "tread" + t.integer "praise_by_one" + t.integer "praise_by_two" + t.integer "praise_by_three" + t.integer "tread_by_one" + t.integer "tread_by_two" + t.integer "tread_by_three" + t.integer "changeset" + t.integer "document" + t.integer "attachment" + t.integer "issue_done_ratio" + t.integer "post_issue" + t.integer "score_type" + t.integer "total_score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + end + + create_table "org_activities", :force => true do |t| + t.integer "user_id" + t.integer "org_act_id" + t.string "org_act_type" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_courses", :force => true do |t| + t.integer "organization_id" + t.integer "course_id" + t.datetime "created_at" + end + + create_table "org_document_comments", :force => true do |t| + t.text "title" + t.text "content" + t.integer "organization_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "status", :default => 0 + t.integer "root_id" + end + + add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" + + create_table "org_member_roles", :force => true do |t| + t.integer "org_member_id" + t.integer "role_id" + end + + create_table "org_members", :force => true do |t| + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_messages", :force => true do |t| + t.integer "user_id" + t.integer "sender_id" + t.integer "organization_id" + t.string "message_type" + t.integer "message_id" + t.integer "viewed" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + end + + create_table "org_projects", :force => true do |t| + t.integer "organization_id" + t.integer "project_id" + t.datetime "created_at" + end + + create_table "org_subfield_messages", :force => true do |t| + t.integer "org_subfield_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_subfields", :force => true do |t| + t.integer "organization_id" + t.integer "priority" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 1 + end + + create_table "organizations", :force => true do |t| + t.string "name" + t.text "description" + t.integer "creator_id" + t.integer "home_id" + t.boolean "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "allow_guest_download", :default => true + t.integer "visits", :default => 0 + t.integer "show_mode", :default => 0 + t.integer "allow_teacher", :default => 0 + end + + create_table "phone_app_versions", :force => true do |t| + t.string "version" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_answers", :force => true do |t| + t.integer "poll_question_id" + t.text "answer_text" + t.integer "answer_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_questions", :force => true do |t| + t.string "question_title" + t.integer "question_type" + t.integer "is_necessary" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_number" + t.integer "max_choices", :default => 0 + t.integer "min_choices", :default => 0 + end + + create_table "poll_users", :force => true do |t| + t.integer "user_id" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_votes", :force => true do |t| + t.integer "user_id" + t.integer "poll_question_id" + t.integer "poll_answer_id" + t.text "vote_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "polls", :force => true do |t| + t.string "polls_name" + t.string "polls_type" + t.integer "polls_group_id" + t.integer "polls_status" + t.integer "user_id" + t.datetime "published_at" + t.datetime "closed_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "polls_description" + t.integer "show_result", :default => 1 + end + + create_table "praise_tread_caches", :force => true do |t| + t.integer "object_id", :null => false + t.string "object_type" + t.integer "praise_num" + t.integer "tread_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "praise_treads", :force => true do |t| + t.integer "user_id", :null => false + t.integer "praise_tread_object_id" + t.string "praise_tread_object_type" + t.integer "praise_or_tread" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "principal_activities", :force => true do |t| + t.integer "user_id" + t.integer "principal_id" + t.integer "principal_act_id" + t.string "principal_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "professional_levels", :force => true do |t| + t.string "level" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_infos", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_scores", :force => true do |t| + t.string "project_id" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 + t.datetime "commit_time" + t.integer "pull_request_num", :default => 0 + end + + create_table "project_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "project_id" + t.integer "project_type" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + end + + add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" + + create_table "projecting_softapplictions", :force => true do |t| + t.integer "user_id" + t.integer "softapplication_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "projects", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false + t.integer "parent_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "identifier" + t.integer "status", :default => 1, :null => false + t.integer "lft" + t.integer "rgt" + t.boolean "inherit_members", :default => false, :null => false + t.integer "project_type" + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 + t.integer "user_id" + t.integer "dts_test", :default => 0 + t.string "enterprise_name" + t.integer "organization_id" + t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "publish_resource", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.text "script" + end + + add_index "projects", ["lft"], :name => "index_projects_on_lft" + add_index "projects", ["rgt"], :name => "index_projects_on_rgt" + + create_table "projects_trackers", :id => false, :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true + add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + + create_table "pull_requests", :force => true do |t| + t.integer "pull_request_id" + t.integer "gpid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + t.string "title" + end + + create_table "quality_analyses", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + + create_table "queries", :force => true do |t| + t.integer "project_id" + t.string "name", :default => "", :null => false + t.text "filters" + t.integer "user_id", :default => 0, :null => false + t.boolean "is_public", :default => false, :null => false + t.text "column_names" + t.text "sort_criteria" + t.string "group_by" + t.string "type" + end + + add_index "queries", ["project_id"], :name => "index_queries_on_project_id" + add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + + create_table "relative_memo_to_open_source_projects", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "relative_memos", :force => true do |t| + t.integer "osp_id" + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + t.string "username" + t.string "userhomeurl" + t.date "date_collected" + t.string "topic_resource" + end + + create_table "rep_statics", :force => true do |t| + t.integer "project_id" + t.integer "commits_num" + t.string "uname" + t.string "email" + t.integer "add" + t.integer "del" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "changeset" + end + + create_table "repositories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "url", :default => "", :null => false + t.string "login", :limit => 60, :default => "" + t.string "password", :default => "" + t.string "root_url", :default => "" + t.string "type" + t.string "path_encoding", :limit => 64 + t.string "log_encoding", :limit => 64 + t.text "extra_info" + t.string "identifier" + t.boolean "is_default", :default => false + t.boolean "hidden", :default => false + end + + add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + + create_table "roles", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "assignable", :default => true + t.integer "builtin", :default => 0, :null => false + t.text "permissions" + t.string "issues_visibility", :limit => 30, :default => "default", :null => false + end + + create_table "schools", :force => true do |t| + t.string "name" + t.string "province" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "logo_link" + t.string "pinyin" + t.integer "school_type", :default => 0 + end + + create_table "secdomains", :force => true do |t| + t.integer "sub_type" + t.string "subname" + t.integer "pid", :default => 0 + t.string "desc" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_cached_ratings", :force => true do |t| + t.integer "cacheable_id", :limit => 8 + t.string "cacheable_type" + t.float "avg", :null => false + t.integer "cnt", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_rates", :force => true do |t| + t.integer "rater_id", :limit => 8 + t.integer "rateable_id" + t.string "rateable_type" + t.float "stars", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "is_teacher_score", :default => 0 + end + + create_table "settings", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "value" + t.datetime "updated_on" + end + + add_index "settings", ["name"], :name => "index_settings_on_name" + + create_table "shares", :force => true do |t| + t.date "created_on" + t.string "url" + t.string "title" + t.integer "share_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + t.integer "user_id" + t.string "description" + end + + create_table "shield_activities", :force => true do |t| + t.string "container_type" + t.integer "container_id" + t.string "shield_type" + t.integer "shield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "shield_wechat_messages", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.integer "shield_id" + t.string "shield_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "softapplications", :force => true do |t| + t.string "name" + t.text "description" + t.integer "app_type_id" + t.string "app_type_name" + t.string "android_min_version_available" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "contest_id" + t.integer "softapplication_id" + t.integer "is_public" + t.string "application_developers" + t.string "deposit_project_url" + t.string "deposit_project" + t.integer "project_id" + end + + create_table "sonar_errors", :force => true do |t| + t.integer "project_id" + t.string "jenkins_job_name" + t.text "output" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "ssos", :force => true do |t| + t.integer "user_id" + t.string "openid" + t.string "name" + t.string "password" + t.string "email" + t.integer "sex" + t.string "school" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" + + create_table "student_work_projects", :force => true do |t| + t.integer "homework_common_id" + t.integer "student_work_id" + t.integer "project_id" + t.integer "user_id" + t.integer "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "course_id" + end + + add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" + add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" + add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" + add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" + + create_table "student_work_tests", :force => true do |t| + t.integer "student_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 + t.text "results" + t.text "src" + t.integer "uwait_time", :default => 0 + end + + add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" + + create_table "student_works", :force => true do |t| + t.string "name" + t.text "description", :limit => 2147483647 + t.integer "homework_common_id" + t.integer "user_id" + t.float "final_score" + t.float "teacher_score" + t.float "student_score" + t.float "teaching_asistant_score" + t.integer "project_id", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "late_penalty", :default => 0 + t.integer "absence_penalty", :default => 0 + t.float "system_score", :default => 0.0 + t.boolean "is_test", :default => false + t.integer "simi_id", :default => 0 + t.integer "simi_value", :default => 0 + t.float "work_score" + t.integer "work_status", :default => 0 + t.datetime "commit_time" + t.integer "is_delete", :default => 0 + t.integer "appeal_penalty", :default => 0 + end + + add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + + create_table "student_works_evaluation_distributions", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "student_works_scores", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "appeal_status", :default => 0 + t.boolean "is_hidden", :default => false + end + + add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" + add_index "student_works_scores", ["user_id"], :name => "user_id" + + create_table "student_works_scores_appeals", :force => true do |t| + t.integer "student_works_score_id" + t.integer "user_id" + t.text "comment" + t.integer "appeal_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "students_for_courses", :force => true do |t| + t.integer "student_id" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" + add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" + + create_table "sub_document_comments", :force => true do |t| + t.text "content" + t.text "title" + t.integer "sub_domain_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.integer "locked" + t.integer "sticky" + t.integer "org_subfield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "sub_domains", :force => true do |t| + t.integer "org_subfield_id" + t.integer "priority", :default => 0 + t.string "name" + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "subfield_subdomain_dirs", :force => true do |t| + t.integer "org_subfield_id" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "syllabus_members", :force => true do |t| + t.integer "rank" + t.integer "syllabus_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" + add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" + add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" + + create_table "syllabuses", :force => true do |t| + t.string "title" + t.text "description" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "eng_name" + t.integer "syllabus_type" + t.integer "credit" + t.integer "hours" + t.integer "theory_hours" + t.integer "practice_hours" + t.string "applicable_major" + t.string "pre_course" + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 + end + + add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" + + create_table "system_messages", :force => true do |t| + t.integer "user_id" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "description" + t.string "subject" + end + + create_table "taggings", :force => true do |t| + t.integer "tag_id" + t.integer "taggable_id" + t.string "taggable_type" + t.integer "tagger_id" + t.string "tagger_type" + t.string "context", :limit => 128 + t.datetime "created_at" + end + + add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" + add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" + + create_table "tags", :force => true do |t| + t.string "name" + end + + create_table "teachers", :force => true do |t| + t.string "tea_name" + t.string "location" + t.integer "couurse_time" + t.integer "course_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "extra" + end + + create_table "time_entries", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "issue_id" + t.float "hours", :null => false + t.string "comments" + t.integer "activity_id", :null => false + t.date "spent_on", :null => false + t.integer "tyear", :null => false + t.integer "tmonth", :null => false + t.integer "tweek", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" + add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" + add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" + add_index "time_entries", ["project_id"], :name => "time_entries_project_id" + add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" + + create_table "tokens", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "value", :limit => 40, :default => "", :null => false + t.datetime "created_on", :null => false + end + + add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" + add_index "tokens", ["value"], :name => "tokens_value", :unique => true + + create_table "trackers", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_in_chlog", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "is_in_roadmap", :default => true, :null => false + t.integer "fields_bits", :default => 0 + end + + create_table "training_tasks", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.string "subject" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "author_id" + t.integer "status", :limit => 1, :default => 1 + t.integer "position", :limit => 1 + end + + create_table "user_actions", :force => true do |t| + t.integer "user_id" + t.string "action_type" + t.integer "action_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_activities", :force => true do |t| + t.string "act_type" + t.integer "act_id" + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" + + create_table "user_extensions", :force => true do |t| + t.integer "user_id", :null => false + t.date "birthday" + t.string "brief_introduction" + t.integer "gender" + t.string "location" + t.string "occupation" + t.integer "work_experience" + t.integer "zip_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "technical_title" + t.integer "identity" + t.string "student_id" + t.string "teacher_realname" + t.string "student_realname" + t.string "location_city" + t.integer "school_id" + t.string "description", :default => "" + end + + add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" + + create_table "user_feedback_messages", :force => true do |t| + t.integer "user_id" + t.integer "journals_for_message_id" + t.string "journals_for_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" + add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" + + create_table "user_grades", :force => true do |t| + t.integer "user_id", :null => false + t.integer "project_id", :null => false + t.float "grade", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" + add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" + add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" + + create_table "user_levels", :force => true do |t| + t.integer "user_id" + t.integer "level" + end + + create_table "user_preferences", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.text "others" + t.boolean "hide_mail", :default => false + t.string "time_zone" + end + + add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" + + create_table "user_score_details", :force => true do |t| + t.integer "current_user_id" + t.integer "target_user_id" + t.string "score_type" + t.string "score_action" + t.integer "user_id" + t.integer "old_score" + t.integer "new_score" + t.integer "current_user_level" + t.integer "target_user_level" + t.integer "score_changeable_obj_id" + t.string "score_changeable_obj_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_scores", :force => true do |t| + t.integer "user_id", :null => false + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "active" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "grade", :default => 0.0 + end + + add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" + add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" + add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" + + create_table "user_wechats", :force => true do |t| + t.integer "subscribe" + t.string "openid" + t.string "nickname" + t.integer "sex" + t.string "language" + t.string "city" + t.string "province" + t.string "country" + t.string "headimgurl" + t.string "subscribe_time" + t.string "unionid" + t.string "remark" + t.integer "groupid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "bindtype", :default => 0 + end + + create_table "users", :force => true do |t| + t.string "login", :default => "", :null => false + t.string "hashed_password", :limit => 40, :default => "", :null => false + t.string "firstname", :limit => 30, :default => "", :null => false + t.string "lastname", :default => "", :null => false + t.string "mail", :limit => 60, :default => "", :null => false + t.boolean "admin", :default => false, :null => false + t.integer "status", :default => 1, :null => false + t.datetime "last_login_on" + t.string "language", :limit => 5, :default => "" + t.integer "auth_source_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "type" + t.string "identity_url" + t.string "mail_notification", :default => "", :null => false + t.string "salt", :limit => 64 + t.integer "gid" + t.integer "visits", :default => 0 + t.integer "excellent_teacher", :default => 0 + t.integer "excellent_student", :default => 0 + end + + add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" + add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" + add_index "users", ["type"], :name => "index_users_on_type" + + create_table "versions", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :default => "", :null => false + t.string "description", :default => "" + t.date "effective_date" + t.datetime "created_on" + t.datetime "updated_on" + t.string "wiki_page_title" + t.string "status", :default => "open" + t.string "sharing", :default => "none", :null => false + t.integer "user_id" + end + + add_index "versions", ["project_id"], :name => "versions_project_id" + add_index "versions", ["sharing"], :name => "index_versions_on_sharing" + + create_table "visitors", :force => true do |t| + t.integer "user_id" + t.integer "master_id" + t.datetime "updated_on" + t.datetime "created_on" + end + + add_index "visitors", ["master_id"], :name => "index_visitors_master_id" + add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" + add_index "visitors", ["user_id"], :name => "index_visitors_user_id" + + create_table "watchers", :force => true do |t| + t.string "watchable_type", :default => "", :null => false + t.integer "watchable_id", :default => 0, :null => false + t.integer "user_id" + end + + add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" + add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" + add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" + + create_table "web_footer_companies", :force => true do |t| + t.string "name" + t.string "logo_size" + t.string "url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "web_footer_oranizers", :force => true do |t| + t.string "name" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "wechat_logs", :force => true do |t| + t.string "openid", :null => false + t.text "request_raw" + t.text "response_raw" + t.text "session_raw" + t.datetime "created_at", :null => false + end + + add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" + + create_table "wiki_content_versions", :force => true do |t| + t.integer "wiki_content_id", :null => false + t.integer "page_id", :null => false + t.integer "author_id" + t.binary "data", :limit => 2147483647 + t.string "compression", :limit => 6, :default => "" + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" + add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" + + create_table "wiki_contents", :force => true do |t| + t.integer "page_id", :null => false + t.integer "author_id" + t.text "text", :limit => 2147483647 + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" + add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" + + create_table "wiki_pages", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title", :null => false + t.datetime "created_on", :null => false + t.boolean "protected", :default => false, :null => false + t.integer "parent_id" + end + + add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" + add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" + add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" + + create_table "wiki_redirects", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title" + t.string "redirects_to" + t.datetime "created_on", :null => false + end + + add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" + add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" + + create_table "wikis", :force => true do |t| + t.integer "project_id", :null => false + t.string "start_page", :null => false + t.integer "status", :default => 1, :null => false + end + + add_index "wikis", ["project_id"], :name => "wikis_project_id" + + create_table "work_detail_groups", :force => true do |t| + t.integer "work_id" + t.integer "min_num" + t.integer "max_num" + t.boolean "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" + + create_table "work_detail_manuals", :force => true do |t| + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" + + create_table "workflows", :force => true do |t| + t.integer "tracker_id", :default => 0, :null => false + t.integer "old_status_id", :default => 0, :null => false + t.integer "new_status_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + t.boolean "assignee", :default => false, :null => false + t.boolean "author", :default => false, :null => false + t.string "type", :limit => 30 + t.string "field_name", :limit => 30 + t.string "rule", :limit => 30 + end + + add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" + add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" + add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" + add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" + + create_table "works", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "work_type" + t.integer "contest_id" + t.boolean "is_delete", :default => false + t.boolean "score_open", :default => false + t.boolean "is_open", :default => false + t.integer "work_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "online_evaluation", :default => false + t.boolean "score_valid", :default => true + end + + add_index "works", ["contest_id"], :name => "index_works_on_contest_id" + add_index "works", ["user_id"], :name => "index_works_on_user_id" + + create_table "works_categories", :force => true do |t| + t.string "category" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "zip_packs", :force => true do |t| + t.integer "user_id" + t.integer "homework_id" + t.string "file_digest" + t.string "file_path" + t.integer "pack_times", :default => 1 + t.integer "pack_size", :default => 0 + t.text "file_digests" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + +end diff --git a/public/images/footer_logo/p-zgkyrj.png b/public/images/footer_logo/p-zgkyrj.png new file mode 100644 index 0000000000000000000000000000000000000000..abd08c264b4ed6e28a996e7802253b5509c9e114 GIT binary patch literal 31860 zcmeFabyQqS7Ps9(o=bs_PuqX#!>6iX$TsAOHXWWC@U%+~fP`-7yxjZ zNtJh0iN3%QSiAtEDv5kQEQ>eu29S~!!gZsmenyJ|==h>x2z~PlKv2TMMo$4LcKA#n zfKmgNKT*{h3I_$e4^~v?+J7;ZTjlO@u(x+JbfKP=&qzurl#SmVq)hyzWUQN#c4q+-0s6yHR zuS5~LegKdQ5+F*9IRFKeg8IZX+Om|VW#v~3f&jGk#SX+vjf8mzPMpWY)3yIci3bKMFNr)9`? z^ASBqKt$Z5(9LLKS_u|-VEtja6zp;S=)IqHIRscI2_+V_W`4M{*0FFXmJ8eHgBD@7 zxY!`O@AC7!3!@%cW-C*t!wx!939OYRmF{w`lZzB1>4{y&*z#mKdJ%UAAMJp4OOUYsz#LMzXA z=&DjEf=}p4KhP@Mn7NQQmN3-4cdT$>wDHo~@f!W%p@qBQFm*_H0?>8CzLO5Z;U~$A+rm75CY6grJg`->dp_?ug{3y&b?kC``|5gc-#kWLif(e3{!{l16`#sibhhxax4y0IgEAHLYC7>lNpLz@ zz(*<~lQv3FJ9MTA(zJH!O6r1#}R>V#>}O6*dL*{X_{bM zJ96mz;|qG9QGH~GQRaw5=F3{j{f~w#>`u4>28EW-bqm=Rz;mX2I=aRzvsoQk-&UKc z2VzW<4C+TJ$L#w1yXoc%zZdrGhH+1%n5OA8PdCoqhWcf{O8NFCm?O9=ZYIvH?^&F5 z+(lu6l7N!4(wWj!p~R&64&9FVq_UYTp>i@(GEZ_}^_QaLq7H{-^F^#>tZ?d4>N9zZ z8Rp&FU4-4FU6?)YbDeXFbMx~dqWw~BQZ^(s z%&<*8VaLspjOfFNcZkQ8H_r{qwMcjAi(MnwuOF=%JIhRNNS-U2HXonw=l|wja3jr- zOxUCGmH$Ba^zcGu*}8uvH8(l8{Ul<8QPV+FRr98aSf(O{GHsH{ynD7oZKKG0xH3XW9^L5Ni-k z-UQwiP^M5XpcA39VcDOBK5KwsL=wOjL4rqCePI)A*@}Bic%{cWXGoVcg53+3iv6DO znyH^sig*$|%zp@O5zWIg=Spg;zZx!JN!%=;_JuKiBJPzt7Bvk^KEw9AN_jhLy9>I> z!d2B9!=|vK@Vt;Z-dU4s8wbNe6Eit8z1`$muiE@tZ>Nu!ua4p|>@dmU_X1ZtzIX5k zuGm6um?g2MtR^YM+36Lp&3&%JUEdn)OLOE?Wmk=Ga{mXq_YRqw2^`q?N=b z7Yc`_t*7a^V^U&LGUbqs<0@&Vm};nMWDIC&qmfsg*Uftgqd)dutdd>Xp3GvK`ALmr zR>~F2qTom|exY?z!&7sr1vP=*kFzcs+;3lzA^PCBHAR%l)|OU$uXR#AS|V+E)qq15 zERXBRz^oxxukU1hIO^VK)K?yNC%dd7r+94QJa-%>_hB?UTa?yEnJqRirl-%M`1F09 z9=1-bzT$yN{Dhj4Ck<|_R-sklm*UIP*R|`*%5SwM+|HcMXJ!`O)b#G{fOfKWEDA4F zTT0$EnFvn|`yV0~5gvuE5o(#gS+L7+F*yqxs2u1WfMVBS-&5Kk;WY9c+eVrV?oqi8t3gcpNaV=-GF% zhbyOjN~PjIx?1&#Udh$ZO-p?%$UmMq=X@b`n`o->PNT_CbSO;_*KS{`M(d*IWMLy* z?=6P+>I$=9?ImMun z?%Z_Hxl34MK{@}tmZJXb(&2m$*AZb~YEHu?+^OWYdFE~#_8N8Dv+}+S+-kmbsoknQ z^i>u000sVI+I`H!*vB8E;{DoIX~0y()EnAtfw**NKdEKJPoj7+SItW5MQtUPQ?JZvn$e>_M95FS7A+2|Ya z$cerFM{|!BKdF(OofQuwqoboEgCi@0rHvsYGdDLkBNGcF3k&^Y4SHK=3p*VrdJ9{! zKZ5)-ju_Zh&&Jrw&e+ld_*+~ZT}yjAep1rk8v66`kA9h3{n?O(?LXK(QeYwKyf6D*mF#dG^*WTM18~imm|DyfP^Iv6P zC*%Jj`_1!*?DtgoV}$q~^N&Z=2CQReX`^6iX(sSTmi=}1^my|0TUG(7l#MO)EgfyC z`52!{{u=MUqJhP9?7#w#N=|wv7J6oG1txAD78V{Bc3LJb9ww&01^J`qlNi#Exv#Hd zr}Mu=`Iov+<5=n&8#w<@QU0p=uQ8;hc_b`s?Q|^kz!G8tk9}t_HrD6iWYO2x*VEyq z*9Wt4(zCI%antLta)aqPS(w?GxO8>(Idt@Y@8rMA|1GqbrJnt7iS!uykBP5usrMNE z&-CEYH(=#r=4R2MH{f7nre|gbbI|MPakA6vadU&&bhy~qxOLe6+0fsD{aZsaHjjH_ z3mvn+)%mS2`oHyslZ%s$3(P{#4(8yZ=U`@Iqt|6);-u%)=VIpKVCK-*0dxJciT@Dh z-lJn<^@|))O z3C^RV_uJYdp!Zw)f**1JOX**S^{4V5GUNX+oc|MoKjQyQ{@>ehGy+@vEdBoo^?R-V z9>mttz|K*}1}tp&m?8hm%={zjzsjD5=VSbBtu{0Mzc3KCIu8Fohv9#kRsT;6!(Umf zXQX3c2-X*1{AU9Hv*3Rlxj)A9UuV`oXY0SuL_U2z9s^4oa~(SYV{;utFr$@)As^#k zg@3il_tzREYH4O^BW)a!yXdLsKPpxKQnLMv@NbTP2>-~ZzwPaQUnu@4ecU-dZdw`t+_nDO8uI5- z`+xGoUp@Li8TCo5UyVEg@^kYSuAlRH;{Ao|36P(gzi|DW&lB%2Tu*@f-28>>=X{=c zf8lxpTHjs+0G#>~V!{eeGrLWO38`K7l$UAw*X^OHwwyeG zP>WSD05k*!FoF6FDaHG^LL-UlE@JKwvx9z@-74h;4M9CqgUMr1++Gz$QK3|DR)PeR zm)KxlBw?!Ue)AThqM^r}t2azEl`-+du{$weZRmY|bH4lmyrTUeqOQU1?8c(NL;Z_0 z*0wObVQ7fB-LH6f0LTb0XmnbpRwVOQBo;Iz;{>EnttiY^cjo=tkO0Ww+eH8rk^vq( zy*5Bi6we8#d^lv-&zc0JHVg^<1&tg}WP{g$>h%#l0Z_t^0X-2_H}fAuI|(t{reDyb6HvxdjO`0lX39wIK^%jketL zwE^0fhz#4bk(sC#LxMt2^q7L1<;#X{TQGqTka%V|p%VZ=UQMg;=8gy=I|x83h@R7U z>7^Ua34dh>YoeozAsYce^h#*e&R}PTAcv=8gGWa2LX%};J{IoKhH35hlVJG(NeU@p z03UE`BByf*$)Uofe(Cs(loC`#!Tjkm2OFI;$505Gl#)S6?`VcOCdV=91*SLjCt(Eu zs{{BiVvk5p9M}O!+F6k^Uwu-p#xMNrs}uxVC_O2W2)2D?$m?f+G##T2j7hh z3^&7{ymoo z`YQk%CydUYRF_E@7h4WLoD1*`2)A6X-R*T8WD)X?1}N-z)=mm9$`a_9R!N!Q6G%t* zr5noso!1Yw0YhR(=aUXjP3I;=>!!T{Dq-}Bs~+nNc4#1CPEfGq+gEce*y2J5MmvXb z@pDd>*J=v}IKk$}YLqrjKh99DVD3X+3juwA5r9B9ncH)yJN!Z-2!cZ$EFiG#do)%^ zK_$tti;UMe8UY*xGL?}e9t=Da)GNJCZ3rsg4kS3HudDQM!kBQ)aJGkVy_9`8V$W71 zi$VZeU7qi7kbD86SU4;Pwa_Y9ugn3WS$=LObH#*jX{gw7PtyWJyOV7{-$s*K!g%f6 zqj`CGLxAvL#-uso;PiulWShzH^TVO`*x%}~T!*2Nal{lVIXf)QGRQp?c)Lu$bZt6;X4OY--B#ZN)G&Sso)`l+!B5q4)dq-#ky0FL%gX(Ez z5BbR#G{1Umi+^y}hg5;7hT?+3T5m!U#ZwnY#oeQUcn$UZjra$0;3s(hglRmCb|GJ; zq)q9J2r8cee+-zA#(lhA*kq(q20v)U|N2K5zl> z{>XSDaD#-Kq{qiZ_?T}p;E;^))1l3Hb8?-JP7XVMh%WQL5Di0XvW<`30sM63_ zQQD2x=i@-g0WBRP3IY;F1;rHx*uGfxcGE8hecZjO>yZ#lB{4v#fXF%RN$AgB3UtYFa*DvsgT&4U)ffd?l-iJ?UDR=-q-1CUj2C*Z@Dg<$%1m>}jw zybsB%i0A54kfcnk-c^%wXm$V+5C{g}08bhS0i_2F2!w;l%5X2$$$-Ns1j4<>MWzu& zgBylqM_0|FC~F$1zmGq?`DBD!1gs6MhM(DlxaH74OBle9tO;rXC- z2(STT3`jta2NOrG&DZJ|35P!_bW;i@hG-+jygyOnZ3U31_{7xh<5EFGwt~a}5SY3; zVO`>5E17MVDop&TNlE=up@+9I@q^Hb&)q^(x;&_m(R}qm(NKLX9V9ATa@^HxUyR6? zzsC_4Ip)s}%Q6tq?AG@>i9+?#0t*48uzMy^fNnH&s3eK#h;N4~1Zb?Y`YX za-!Scj@WPqgglg!COQh~hJ>h+@gZgVAz?(WNyrnH5K*#Y&~SjPNpPK!NW*8{A`m!0 zDL52SQaG@%KU|0bBsDd>zLbzQX$u;n5rBo9n(i4ea~kc{s}T<0Z+m3k&yYSw(S6my zBbY6(L=i0_nuS2SY>x2{kouCn2YJ{eq}q$8)Qb?g2y6N($sS+;_pKd4MF`EhO%fv^ zAR&|-Qe`Ki+o*`1me|YZHlWg)oEo|V!5i($+XN~@7@EW#4eFc`hL_aW3=$`f5}Sak zG`aopW9Y`_T&6tsLQ^>m zB?-dRjXF+)qhynMPZbV=#3)_V@rMvi_6juD*@%_ELdDi+j;R8m4$n|g!@&Vwpn3T< z%G0IHQMC>};H_$Nb4TF%!)Ie@ zS(~W|RiLz?9afE)L5M;6p!v#Tbb3KQhsYEC>Ybf(8^#Xs`8=%+)UJglg!>@$#yH?P zDP-ek(l@QJkV54;U#+P{fx`kHDl730gQK4<;pmw_d?&DmH=;*W^Q?2iJ!Wm&zlI4* z5FH?qm=#KBJj49`l@?=zJue}e-xXOlV7S#Weg0;~`)j)MY1{mc@`eVTH(vl-so_IU&lTM( zGJIcP5tiK{*90x{eiRCKc;_c)|!Ao!0$r1&j zMXB|&gWJC2wbU1ljuk@PArXomEioLI#}Ak1ZfFbki%rO9J%M>6xgLk#i_L4?H`7w7 zI$S6r&$bhz7hQK_!`)BgYf8-Awp)9kZo>HvTcI|F9Hj^PZySd0-=sbRL?_Oz2s-x$ z#_?TyyHX6Nqck54bj8_M&exldjfL|oDk~mmz&ff4Evlb)m)XkFkYl4^qS+P&MjmAk zAlDSBoqy;`tE96(&}b-FiNycVmA+sLHcHvcf_0t9&tB{K9w_?Kt&dKq0O-0CG#PF& zOY?~+lb%fYILCdUq0>QOuFj}ch!sRYEf4sluJpVVjGsmMVI?;Q^*KI|4Hdfp-gRPB zA%=G~DY`0lFgs%~dyV+ajDlhTPVe@aMwtyu+nX3w6lbm>*z8vxNER~u(vo`d0kR+-bwWCfos9tvC*0y&HD`o z)-xm>;WYf-`z38p#hs|OCPQ~iyXj-a@N^9$RXuTp*M3N_V)>?NEf1Y#d#Ej*WQU9; z8UjwsbHy_Ey+G3NmfIO3RQ~sq+Or{Bl@D{?74g^p8+of44K>7dEJsC9ccvSdh~Rr= zP5k$of@96r7JBAA9k>09f>+UPmBVlIm`M#z=y#OVn{4u`9d(i+Ox&X-?h3k zC*(1??OI(-!&_**pLRUgM$3t}FTP$+TbW3uRS4;1a8Mm}w<9Eth#F|vC7s|+y+#9Y z2ze}aCqYD!e2o&K;dDRsi;PcG5|_!(2$aiQK~KY3P_a{0?V6#evF}u72(2j=0%N97 zk@NL42th?cYYVevorhupzxhymE!|R=!M6!y>Au9_5g~uGTvc^cL}Z`n>a6Xuzgc%Q zg_6c)Yhh(le%5wlaW%h~10E0>jN0ziUneXfE^k+1!_E5KcK<`DYT@EEa6I;hvfbdz z8aIjd>$$Z2^*Vj-q`Y*m$Z@auP=3!eS-xM;?S8`DUDNm^u0nKc>}7hMd7kn2X4hJiZ)w&o z7p6mTu<|ukvF`hA4ViL-P%=b~GaD}*=bRtbBy)3e+!qT{i|hAJ^>^!RZByP_YHH#z zwsE4Q-1i)j)Ksl}tC$)@$vYvd9&0>KtiWBD8aIA_QIvbGUR?2_&h=(Ae>K-*rKb6G z;^6e{5K#lmb-b3RS-$>sp0&VzxJ-6${0riyb7if&T+hqsp_&QB81|C=?Y@Qjn|s?_ zMnk#iqt1yu@2lXGqZZE}+g0k|=n1BZ)-T%M+8PzPqrc!quVr9|za~>6-=`qhNXe-M zj|$hsP#}~hyz;2Iamd+EEhGwV{Pscrvur7O6eTFaSIBC4GuAL2&uwq*`=L>l-L!NV z1`9=GuYD@*L0yf*ia|jRF-?ybGZ5;>SEcMI9X99>&pnr!5?7%atw# zmdvM-oE0C^BH*8)2Zd!j*^2iWIu=(!7>i?+ZC+1cf7IkpN!osqZ1cg$FLNWaYGFpP zFU^C2$neFmH2ld&RKWx&hA@wpDR}pzjP6GE7=pDt_nmE?wYKxH_qY4(S0Bpu%Q6o5 zCKPKNJu-D#h6{8T|mZ7@e9xe)KY7pKPX?c{2 z7&aAN7FfPeGKP1oHZ(g{IcOD=Ila4BXix}>j{YHELR4&A= z@X?1M0nHp6tvf-_mALY_TumOUEI}!yniiK`nnu;xxA~y03Rf9=sl@AYf6?6f)!NHL z(T361dc~@ihn5EqN#yde3Uk_7Mvb00#Z9oZqU&2^Wu^Co9F;W2$`ZL5^{l(wX~YP( z)BU}1lhYY_8MLAn#%sGOJk%-0nYlye7A7 z#kc318M_fa8El)5qT|52?(uP9!9TJM8{IqlnX7(UfLQ* zCRf_wiKOf#dSMd=a8;;BR;;%5A=ZE6W{x;Z>GkdzZ|-?kw^XI{s%q#XDp8t%&32^L zox-dBUj1C$@@U(NlRet0NbD^h=R!jllIWh=5hG_h^a{QH>8bOUqdeFBgk&jHbz&N| z(P5SClG%E#640rMV-MQTTX%Bi_=PlW(oWX51g7=?6 zQ!%RO(4I%hFRr%B>MVD+@@ZsTY;|eAswr6pQLa7y_L%}lm6_*Zoc+<2Ow^cGYU{LrIgN3EX; z?^un5(R&&_r0wg&6BOzkbFyi}C7Vf|UU=LQevlE=#0X);F8hLG>n(`>4%>0Q?6x93 zGfWzQBnMrC)hm7<1R($!*Zh?u+LxmEt)V~e=v&{wO3II_?Bto!VYJk*+MAL_Z-(q# z5p8*uYUoNz03&s2_i1VP68rV`1MF)k6{uopkPwI%K1g&g0`w)IaZ-Y!<_q$lFJ)K1 zPUW2$*0dcO4YCEqi`lUBGZD7-4T@(m$mA=d64zSUB-GmL_+K<$zSq5o>KuG48R>=X zb-!K4smbRlP?*oE)L@tVu$i8wWBBI#fWujR`tuh~S5@v4h$k%%(>DSRQ(=Pl%a)q> zsYd3K&2hv?WE0hdi2Or+*YD6PK9Rl<9cQu0H_n-1=!S5)U+ zuZI08&L}$6cxRKK)3%75?yL9%IHhyP2ssP4YwagCh>fm#>ilpuxf>1c!Wb9EEC7;* zw@eN7IiJgTaD3;f87cNa<6)^>uJ7t*0y|31&ZW-wgDuQL3J+8g61Z%a`|&Q66_q9x z;?6^*c}X|<1&=>irb%*DMU!nkToi;%Z(O8VQ!mgx*l*QNT3?l!k%KdK-fmUC+Ph?zK+s@$lT@U}DNwi3KX;mS&cEZ5 zRZT^>#LuN_uv$|Ci4owfZ?J#*aDiGO==|B*qnKlPQ+BWiR5H*faDTr&olck$JaIH^DMF~Ij4L*riXzdt^_8;Gwqr z{P&hdmW<4^>FG9wZU@pd1Ta+!bZKE(;bP@9e40 zi*Hi-ji28Dz~FbTaz>0hhVp?b6}gEaVLS}@zN(B}iMQCwdR24v9@8KO?%0a4h1I(T zCAZ}tRf~dLZr4JxgtQMW9v6B8@6eK~&SEe27LM$u5~`sSx?sic*Ih+FzRb>3IiC4e zme_CS;I_QLE=fF7eoeb5c=#2Qx=Wv%b9PvTpRauQyFx5os0Nou_UF%b(t0;h^$4i7 z4`H*>k{q`e2QBNOr)T}od29;#G+Ei1?DUQNSCA{F$9I&&n?2?4{HqOk+Y$5H?mlX! zr#rqeF>Sd=Em3d&t|6x=|E_LbZPDW{d5ph?f&O7f@M^F3%XN{AKz|q>RP$|r2dd{` zbX7sJ;N2!s_B*#7Sot0mw^!oH0D!QZSBILM^#ZyBG#TI-gn=lz{-)ODd5vqDhl5|b zY4FRC@OS8SUv|S}9&FAGi6?u$KhIq$zg^W{H)Tv;aIL51OzX?~YLus@aUf7>x@Wmi z!3>XzmPqO9yk{pD6sfun)<*d3x?+So$lXRvVrWHF4J z+xK*kLh+_qkqOA(i;w`%hg7SzFTIFBFH)$RrF#Gch5vE?hb_HR4#PQVb9s5S^3wHl zfPr09AcIEQ|yi&xIGdrU2Smbtc&{-#bx_`7EB3Ib?BTY^-!Q8*uJ3(yl{bvYnm0F?4UZ^f zVk6PGEag z{d)6bwfIW5=S8@TZJ3>Z1mYVqhlJ#)`Z>tB4m}rpy6w)FojCgsb9=FCYY&I1xt=E# zs1AiD_oGwkmSzF>Be)MM^*JgyOu~HY1}n~6P!HDvp9wG%*xqDTj`nAX4vf1!-jZ``;Pj4pO!m(S!GEM9v&>i z#ZbFSUtBd~5v`)o!RGBZYUCOlu&q0ywrRQuavTr@5vw?B??sDMtpLk=nsu-8=R?=bmUKiZyx+m-6IE=6F+m$| zKwtJ3Vk$8pj3B<0YXBJSWl|emehjX!(e|1XmYO^CugWpctHdb4aM={Yf~ChS?qa$T z5})r9zHc&7q_kz*aqf$o)N$b=4s~fQ6BS1ZbF#D(S751rxQyHyX}vyWOy{!a*cfU# z?evCq;MgsE>t*Jf^S-C|OB0j8@yO!!YIT0Ye8SnD==`GF?HcO-%xU0_KtyVyS(pvR z56{bv{iMl}1A+Tp|JW*SE!wv-p{PSc47D^oJZu7ln$1-_IsgdYkeH8jeSyx+R$C^D z;Azo|LYnZv5WxsK)oNSkSKL-^P8kO?wWB?cCl4Dwc~&}RckYe{b0gQ;Ete9O2eJ0F z91nw*e8c$&d7klI1}!(Y%}I(i1DE-9#2+{q_xRJkd^z=zVu&v%V$yDB^3-G4Y~odw z^Iw8^C!Fwt(B*!5bRnbq%UUZUc`lLb`;nZF0zzlfJaBYG=YrncYd5UHCm2IzSf7A1MXtU0hSUUVJm;v2otOibIM zAw%spJlnlVM1ai$qGVMj>s&WeJ$WoI2~n>eun#~T&kC(nKUz~W?Xqw2PN7MDaZmT-tNz-HVZ;3pN-O|o`9QS}3IwFtr-GZ~$05$=;Rp*uQHx{c zVez~-Q{L#s?ghWZ%%RLa}GMC9?J^v z_D*<>@AIslRY)yY4->_WqF8oGEw^P^!=3V3PK$i{A9PDB2ZHRQocyd^WuhCfIZaj< zcMSx(pDjsdtM!c)!7Eos{XyiN29$$ZJOuR>1i>uwBR?(b8mf*NXSGtF5H02Sd<9UT$SGZpR0YTp8P!JKg->Fg*7)C?&8 zSpO0-L`u)ds=UuJkN=tg0x{Z{^@UyPX1=IWZ=`yABC|;wYjkJo1=)}G7`8g{!=kB$ zOGZIAO1nA1%gZj}1-a-kD+&dd&h*6RLkV=igurfSgIBiMpy9H8%&Mcw#2HDtQOg#}1{vxLiQh z^cBR7?G{#huFhvW7j{a9_9m~i`D*iI+631p!-B{1OLt-P&Y)(AzKA=n4Z>dqSN_W zU~d3|*W-C_!=zT--MQL}I(J+6HeWc3W%ROava-+pv0kX7t@(q44||T=xHc|ZJ4(`e z(Kfo6(YComDIqeU^JVq}#qayBvo91o>4vmV{Nswe_-0OAEQ$>%G5Zl8N!CHnd`?K)!ej77%jHs0DlHAo zPzdUHLR~Dfq*9TQoZJ@EMsA_MZ}Kw?cH}++8q1c)>&;Pd2X{tx77Ot|^bf2Ufau|V z8EF;E)oNo3`MZmaC)GAfG>1ccX1(p_`T85@gIYJ2)zZ?D*hjO?>soIWUTXJTZKX_wISBP89&Uj$ zp}OgTohkPp^1S*e5p&$1GId$jQIhbHCG84p(blE!N;QF?$KV zg;RyjA$)}a4M{>Cfh9tKoEOTx)O|NwJln8y6Hc|D27%gqQ(rZ;ANut#X3egY4vZ9GQ##2Kslx&@)a&m9-*l&dK zODX=c70pNf&Af0@X6l;#5xpzwUzl0;bRT3*K{ko!X*fLUU(;HibChAdFuj z6(%4gKpKdO$*o@GcLJA%V3<0&-l+NLh>(6=^&;P3g;@MrNAylW4=#co{8r=av^6#W zD+&r1>zzsE#mwpt_gF^(tg1+uBtp|&QK+nqmYd!mm`&BabkDinL}0&H+4p6lE{L?6 zEu{|GpCGJg7{}Ds@3xuo~Hv@TsSo0g&Xxr>^x{oR#3GWT` zvg2%hp-rZ4I1)cnQNL@tJ7Uaq(1$?C9*m4r)|JKkjSA1ZSd@%D>X-I-??(_xcBBcb zZ-2ZP4nh`~`zk-p=;=7L^YX@EjQSa4rw&+QZ^5C@khsZH!%t4gLEvU!$w{=ebFc*F(tX{29lCdYt>-DA|8n^G9EA&N>?m47DY;V%I|R}9oP9L zv4jxPu)P&zla+1XJtJn8j1229`n5fZyK_yl3Ebo4?w;)x7y-wnwfV~X0Fgu(4qu8q z`%r{ZR}JBrzSJk6(5T*NNWcEq(xSYecDqC(d7(jVHdfZyM9X{&2QMn1C>ff_G{h1s zornR0Ji)tC^P)Bk5@2PIpUx*^hSaoVnTe^%_zqu4w^k-PA6yf>y_q<`cP8|9Alj%u zxgb*c_0UD{ zn<(@y79pM;-fFq1Du%4`nYd_~7I&Fgy)1a4_kIGmPNE*DJkBhQE)I-`J6^$l zf|eriR{kWofUtnn3*ZCr_~I@s93ZC*WE18v?D~v}ukoIg9tNG^6p8=p)b>a}k9qwo zs-S`zjz+ifR&UR=9SeRiqCP*-b)6VnQlB#gGbbX_P_9YzQQJ|V>C|;}q;LA$MaNnH zqbs55QTtajoLf@)mEk(Sn?w*PH~NTiR0Jpj2T&LQe`IP^ylU-a9@lvFxstG!E}} z*UGWrR>BorY?hJ9XRaDM+oZ8~wqQu!%`bii6&yvolJDX^wT{9MUnb2A&mm7YUkLsGCKT8#wWacnr^~84>MmV$;I=W z&iTpTxr?q4PgWs`XM`w4rOKp~uCP z;KgbItQMbxPJ3?Ky#S`mti>V+51+^VX5wDWLR7E8kXEyLR7j)cMi{$2ST(e)uK!Y` z)XcfU@?{#A)zQ)qvYjbAj`4|psjwP$&hU`8+ruqRN4NP^ri_jkt0EO1C+m@cTeP?g zmKt@tcf6C3D&6ayxQ)l<21G^MN$THE=1xdH_i>tU5+q5*#H!Ca+I@1=HJMKe3}n_y z&KZ^4+lib$9iQvh;H`e{w!%JT(`!obRvphsL+-3wgRob_ktUf~awD$LY@y|#HKQW_ z#E%==x(qVG$=)5dt^3MJuvHI zcRq0fb#p-!{Bl{X+ET!J`Lg>^+jTbT<96Y>EM7NJyI6SkMX(K4bAlDL>dd# z9ig?4fAEF+fH@>^VMC5TZ@oc;JET?X(p->PcP4tVh^=gwxp_nX4eMCu;Z$bPhucRR zqDUK>4t_R2zgTmWKx}hYOv}@NL?pjILfSyb!eaOITMty%-I!s=5(Vw7A)(g$Y-UNS zBw#O%m{~2tj9;}dM-06$#xRo7l^hn6m{8bYe2Nzm2oniC8f^+OHlS7(9hoL3l>iTp zq+UEHEM?#2GE&1Ho0-CDx1%mQwZNdl#m0pL={9mif^j_Xxc8`MOXc(F8yQa-%Ln@8 zNzU&!i+LxkC(|;!DvNs=JH6dLxC%;B(BxWNR#r}CqrPms@l70DbESpW`feQ%B^Jgh zJ?rb!fs`2hqM|DmCx(m~^UXV9#gg$1_7|lXr76XI?xLBQ*i}_yCtD+VJ@cr|2XaHL zX-zkJW%?1Cwcr7p_z3^rnWG<9yKa=O$KTrq&)27=iVGSV%5{21v-^4wYYH`Nk47gp z7Py>rv{hW|j(d9}>#ii-r^;VDUTCP*d3;?UduhPW&&yj?omt0>)5Is>zIkX(F+ZTj zQCrRDaoX=6N_f6Id(nDB%w@OvJ(l(^GGM1Z@+v0Rtj5#o^v%K2xDLivyGD+`iw?T4k~ zwLX`dkG8^G9NdoQHlDVw;xxFLbu+vI9MiIkP8kKJiiYCO?eti)w#`|o9zj(n@X*zX zv6TK`fY#UdRW`;OxGB8Kr+fTNN4F5p_Eh`ttKQ|lAvAO$ujS!6?d|Ism8v!|*3y+$ z)lf8LFYsMcX27=ZGed}x#G*$pjx`u4PW@6C*G>V_rB+!-M57P^AjpXVBDC8C0@|X2 zW0(A(eB9oph-nYcjSr8=-F&d*kLwwC=8eHt!KiD_G^c-mK^5qljD3@X5>`aUAIhpva+Se zqA0lgIOJaT>Ne%R?fruJhM}ZDvp)Y$WN|6mdn>1NMy_krORqmFezMX)I@betg$+W4__u{gTJfV(9j@XblUUShFm<=yzlzsHMf|tsw$kj zb1kY=Rh2y`Te+rMN^4u$SS#*T+|*Rl_4Pu@!--=BwPuZ*qJc?$W)axH4g*4*EHZyI z-@EM{inOW59+ph8O0}Cysn(7c1SK+puzE=90(&)LAY37rFJ;8I6oja%b{4&FH$y@+ zE~S=}`E~oZx!c0Tr0^{F3}iA;ud&wm6?GWumG19CgA%0gUsJ|}A-$2zC9|R1t`u|{ z+P>fyqtO8txoH@X6e-}Ex`4}ECK#E_gjQeBCGf1f;akVO62c?WaymOx_UmxJSYTyh z6H!u_DKj&P<3fu=&X@z~TQH>dfnSS@_en}}6q}h!y=DuH#&yx+waYIrzAAR*bUU+b zNq)1nSF>2}Z0b4`>%CtrxieKrF5Fu+mY101Waq5W6vt&}ul>-bH^F|^;9!}WqUm%t z;clvAU;KW;<#I`4&-x_Fp9!g;Pp?WbThRIZ%umW-N~1x%i;~e^W3JhHU^|ZH)h2$b zyTwBf-FPZ*O>Ea%-w?kZ_sHyit-H3<=lsvQZdM>)N=>O`=Ebn$08=iUBS#(ATo zzWQU+kKLhcIvCEYt`BP9C<1==9!ZQW>!~uGC4+STI<~ShwlhiBz{YidY+7PD?^1r8y_{*Zpt?_zpEvI=IX8I z4-c)t_S1*MvNxma$4(vSuiIq3NtSZk!WP7gga8%H{Xhe#YUrmkL zUkt<#03i253U_N$qOk^OheXPOg!3w2(o0geb)rQcm{Mmmzo(|q#uCZ!#lvhhyVQ8VZn0B12S9~HFTiB5}b=R)c-LzOMU(1wXf8>19iQiLG_Kh$ibvY266M1))}WadQN@_Y`1z*a(Q z1A^hgrC2m7MX`wP=PX!cW-tdt836)YAQvRT-~hP{=I4Tm32$`ROiyJd##7UC#tV=O zOgh7UpqPA}oA&0Kw{2hYD<4Nyy{B~`9UH)F5JDSG`C54)q!fmW zYzzj>21K?^fe$a|*{&s(@O>sQ31Ws)Bqg%hkQtUz0tiDbrO2-d13J`F2*)MQAn>)N zWPaI%6wJ_}Hd-6QmTd_k^2Z;XXAIEVv2B2L7)T+tF_w}H7|nUwA8ptODTuVzL?na= zg3z)Q5qv+iEFlC1VaRN3%Q41iqqWhlWix}d7DOav5CjAgB=VK(%C-Z|T5H=cEW+-M`kSXxp87)Sxbg>{jFv|%AAZ-E7oG05BF>ubmi@s`88 zpOF=SiHoEzED#!oAR!O}nqjjM1Qb^Xi`Z8**uZDN7^7JkuuWu9{uCw87pj9Q zFAYI?9vlM@kzm#!B8JX0j1)yqL|mlq02dEq1OR9T3UqLg1O*r!<_~`J@?&lC;?KLF z!Z?|3S~unbI*LOfz;MCe6j@sGgeqLP17c_G1_nz!bzGBeS2^CpTcU3tI8bX^ztW_CbkCSqtXi997rK~j7(Ll<#TVnp;7 z5;ojqRlwjIBsFiQS6IXubrT&I-ymEnEP4JN-0b-K^!r^foo%B#QK2^m9&UaSOX-n;011M1%U?2g5g;_Fu@!B2OKNVt{m$1CfOiwRhoC z0pGAIg04SKKkw4 Date: Sun, 19 Feb 2017 17:49:58 +0800 Subject: [PATCH 038/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=A8=A1=E5=9D=97=E7=9B=B8=E5=85=B3api?= =?UTF-8?q?=E7=9A=84=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 36 ++-- app/controllers/repositories_controller.rb | 50 ++--- app/controllers/training_tasks_controller.rb | 3 +- app/views/projects/_applied_status.html.erb | 2 +- .../repositories/_forked_popbox.html.erb | 6 +- app/views/repositories/forked.html.erb | 11 +- config/routes.rb | 1 + ...7092859_add_author_id_to_training_tasks.rb | 2 +- ...0219062646_add_positon_to_training_task.rb | 2 +- ...19070127_add_training_status_to_project.rb | 5 + db/schema.rb | 182 +++++++----------- 11 files changed, 136 insertions(+), 164 deletions(-) create mode 100644 db/migrate/20170219070127_add_training_status_to_project.rb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f3f91d558..e91b17212 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -806,26 +806,34 @@ class ProjectsController < ApplicationController end def training_project_execute - user_name = @project.owner.try(:login) - jobName = "#{user_name}_#{@project.id}" + jobName = "#{@project.id}" pipeLine = Base64.encode64(@project.script) - params = {} - params["jobName"] = "#{jobName}" - params["pipeLine"] = "#{pipeLine}" + params = {:jobName => "#{jobName}", :pipeLine => "#{pipeLine}"} uri = URI.parse("http://106.75.33.219:9999/jenkins-exec/api/createJob") - uri_exec uri, params - # 返回成功信息,job名存到数据库 + begin + respond_message = uri_exec uri, params + @project.update_attribute(:training_status, 1) if respond_message.message + return + rescue + @message = "failure" + end end def training_task_execute + positon = params[:positon].to_i taskId = params[:training_task_id] jobName = @project.job_name - params = {} - params["jobName"] = "#{jobName}" - params["pipeLine"] = "#{pipeLine}" - uri = URI.parse("http://106.75.33.219:9999/jenkins-exec/api/createJob") - uri_exec uri, params - # 返回job执行信息,哪一步成功,错误原因 + params = {:jobName => "#{jobName}", :taskId => "#{taskId}"} + uri = URI.parse("http://106.75.33.219:9999/jenkins-exec/api/buildJob") + begin + task = TrainingTask.find(taskId) + respond_message = uri_exec uri, params + # status 标注第几步已完成,0表示未完成 + task.update_attribute(:status, position) + return + rescue + @message = "失败,请联系系统管理员" + end end def uri_exec uri, params @@ -835,7 +843,7 @@ class ProjectsController < ApplicationController # 资源库fork弹框 def forked_pop - @type = params[:type] + @task = params[:task] respond_to do |format| format.js end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 0c79da148..e279e46bd 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -35,12 +35,12 @@ class RepositoriesController < ApplicationController before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats, :quality_analysis] before_filter :find_repository, :only => [:edit, :update, :destroy, :committers] - before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :export_rep_static] + before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :export_rep_static, :training_task_execute] # 连接gitlab # before_filter :connect_gitlab, :only => [:quality_analysis, :commit_diff] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] - before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis, :commit_diff] + before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis, :commit_diff, :training_task_execute] # 版本库新增权限 # before_filter :show_rep, :only => [:show, :stats, :revisions, :revision, :diff, :commit_diff ] accept_rss_auth :revisions @@ -132,7 +132,7 @@ class RepositoriesController < ApplicationController # send_file "/path/to/file.zip" end - # 开启实训项目 + # 开启实训项目,学生会fork一个项目并自动发送任务 def training_task_execute @project = Project.find(params[:id]) @repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab") @@ -163,17 +163,22 @@ class RepositoriesController < ApplicationController end end - def publish_training_tasks project, new_training_project - original_task = TrainingTask.where(:project_id => project.id, :position => 1) + # REDO: 如果实训项目还没有创建任务的时候应该跳出 + def publish_training_tasks original_project, new_training_project + original_task = TrainingTask.where(:project_id => original_project.id, :position => 1).first training_task = TrainingTask.new training_task.save_attachments(params[:attachments] || (params[:training_task] && params[:training_task][:uploads])) - training_task.subject = params[:training_task][:subject] - training_task.description = params[:training_task][:description] - training_task.tracker_id = params[:training_task][:tracker_id] + training_task.subject = original_task.subject + training_task.description = original_task.description + training_task.position = original_task.position + training_task.project_id = new_training_project.id + training_task.author_id = User.current.id if training_task.save respond_to do |format| - format.html{redirect_to project_training_tasks_url(:project_id => new_training_project)} + format.html{redirect_to project_training_tasks_url(:project_id => new_training_project.id)} end + else + raise "create task failed" end end @@ -216,19 +221,20 @@ class RepositoriesController < ApplicationController project.members << m project.project_infos << project_info copy_repository(project, gproject) - respond_to do |format| - format.html { - flash[:notice] = l(:notice_successful_create) - if params[:continue] - attrs = {:parent_id => project.parent_id}.reject {|k,v| v.nil?} - redirect_to new_project_url(attrs, :course => '0') - else - redirect_to project_path(project) - end - } - format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => project.id) } - format.js - end + # respond_to do |format| + # format.html { + # flash[:notice] = l(:notice_successful_create) + # if params[:continue] + # attrs = {:parent_id => project.parent_id}.reject {|k,v| v.nil?} + # redirect_to new_project_url(attrs, :course => '0') + # else + # redirect_to project_path(project) + # end + # } + # format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => project.id) } + # format.js + # end + return project else respond_to do |format| format.html { render :action => 'forked', :layout => 'base_projects'} diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index aa716cf5c..b828f60f2 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -2,13 +2,14 @@ class TrainingTasksController < ApplicationController layout 'base_projects' + before_filter :find_project, :only => [:index, :new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete] before_filter :allow_manager, :only => [] before_filter :allow_members, :only => [:new, :create] before_filter :build_new_task_from_params, :only => [:new, :create, :update_form] before_filter :find_training_task, :only => [:show, :edit, :update, :add_journal, :complete_training_task] # before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] - before_filter :find_project, :only => [:index, :new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete] + # before_filter :authorize, :except => [:index, :show] # before_filter :authorize, :except => [:new, :index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits, :commit_for_issue, :issue_commit_delete] diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb index 25f5cc8d2..d86acac32 100644 --- a/app/views/projects/_applied_status.html.erb +++ b/app/views/projects/_applied_status.html.erb @@ -37,7 +37,7 @@
  • <% if !@project.enabled_modules.where("name = 'training_tasks'").empty? && @project.forked_from_project_id.nil? %> - <%= link_to "开始实训", forked_pop_project_path(@project, :task => true), :class => "sy_btn_green fr" %> + <%= link_to "开始实训", forked_pop_project_path(@project, :task => true), :class => "sy_btn_green fr", :remote => true %> <% else %> <%= link_to "".html_safe+"Fork", forked_pop_project_path(@project), :class=>"pro_new_topbtn_left fl", :remote => true %> diff --git a/app/views/repositories/_forked_popbox.html.erb b/app/views/repositories/_forked_popbox.html.erb index 88b52ed0a..54426bd0d 100644 --- a/app/views/repositories/_forked_popbox.html.erb +++ b/app/views/repositories/_forked_popbox.html.erb @@ -7,7 +7,7 @@
      <%# 实训项目和非实训项目,@type为true的时候为实训 %> - <% if @type %> + <% if @task %> <% if User.current.id == @project.user_id %>
    • 很抱歉,您不能在自己的实训项目中启动训练 @@ -19,7 +19,7 @@
    • <% else %>
    • - <% if has_training_cur_project(@project) %> + <% if has_forked_cur_project(@project) %> 您已经实训过该项目,点击“确定”将会跳转到您的实训项目主页,请问您是否继续? <% else %> 实训将在后台为您创建一个新的同名项目,并为您推送第一个任务,请问您是否继续? @@ -28,7 +28,7 @@
    • 取  消 - <%= link_to "确 定", {:controller => 'projects', :action => 'training_task_execute'}, :class => "sy_btn_blue fl ml20", :onclick => "hideModal();", :target => "_blank" %> + <%= link_to "确 定", {:controller => 'repositories', :action => 'training_task_execute'}, :class => "sy_btn_blue fl ml20", :onclick => "hideModal();", :target => "_blank" %>
    • <% end %> diff --git a/app/views/repositories/forked.html.erb b/app/views/repositories/forked.html.erb index 2860b9898..8b1378917 100644 --- a/app/views/repositories/forked.html.erb +++ b/app/views/repositories/forked.html.erb @@ -1,10 +1 @@ -
      -

      <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>

      -
      -<%= form_for('forked',:url => {:controller => 'repositories', :action => 'forked'},:method => "post") do |f| %> - - -<% end %> -<%= @project.id %> -<%= @repository.id %> -<%= User.current %> + diff --git a/config/routes.rb b/config/routes.rb index b8a2b738a..8548dc665 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1161,6 +1161,7 @@ RedmineApp::Application.routes.draw do get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes' get 'projects/:id/repository/forked', :to => 'repositories#forked' + get 'projects/:id/repository/training_task_execute', :to => 'repositories#training_task_execute' get 'projects/:id/repository/tree_head_message', :to => 'repositories#tree_head_message', :as => "tree_head_message" get 'projects/:id/repository/export_rep_static', :to => 'repositories#export_rep_static' get 'projects/:id/repository/project_archive', :to => 'repositories#project_archive', :as => 'project_archive' diff --git a/db/migrate/20170217092859_add_author_id_to_training_tasks.rb b/db/migrate/20170217092859_add_author_id_to_training_tasks.rb index 91d2513bc..9097bad81 100644 --- a/db/migrate/20170217092859_add_author_id_to_training_tasks.rb +++ b/db/migrate/20170217092859_add_author_id_to_training_tasks.rb @@ -1,6 +1,6 @@ class AddAuthorIdToTrainingTasks < ActiveRecord::Migration def change add_column :training_tasks, :author_id, :integer - add_column :training_tasks, :status, :integer, :limit => 1, :default => 1 + add_column :training_tasks, :status, :integer, :limit => 1, :default => 0 end end diff --git a/db/migrate/20170219062646_add_positon_to_training_task.rb b/db/migrate/20170219062646_add_positon_to_training_task.rb index 56e1bdf7b..daa578a7c 100644 --- a/db/migrate/20170219062646_add_positon_to_training_task.rb +++ b/db/migrate/20170219062646_add_positon_to_training_task.rb @@ -1,5 +1,5 @@ class AddPositonToTrainingTask < ActiveRecord::Migration def change - add_column :training_tasks, :position, :integer, :limit => 1 + add_column :training_tasks, :position, :integer, :limit => 1, :default => 0 end end diff --git a/db/migrate/20170219070127_add_training_status_to_project.rb b/db/migrate/20170219070127_add_training_status_to_project.rb new file mode 100644 index 000000000..bae54b272 --- /dev/null +++ b/db/migrate/20170219070127_add_training_status_to_project.rb @@ -0,0 +1,5 @@ +class AddTrainingStatusToProject < ActiveRecord::Migration + def change + add_column :projects, :training_status, :integer, :limit => 1, :default => 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index 5e2308145..5e041a681 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 => 20170219025424) do +ActiveRecord::Schema.define(:version => 20170219070127) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -305,18 +305,17 @@ ActiveRecord::Schema.define(:version => 20170219025424) do end create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false t.integer "last_message_id" t.integer "parent_id" t.integer "course_id" t.integer "org_subfield_id" t.integer "contest_id" - t.integer "training_project_id" end add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" @@ -714,8 +713,8 @@ ActiveRecord::Schema.define(:version => 20170219025424) do t.string "code" t.integer "time" t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "location" t.string "term" t.string "string" @@ -725,29 +724,28 @@ ActiveRecord::Schema.define(:version => 20170219025424) do t.string "class_period" t.integer "school_id" t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 t.integer "lft" t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 t.integer "end_time" t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 t.integer "syllabus_id" t.string "invite_code" t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.integer "professional_level_id", :limit => 1 - t.integer "invite_code_halt", :limit => 1, :default => 0 - t.integer "os_allow", :default => 0 + t.integer "qrcode_expiretime", :default => 0 + t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true @@ -822,9 +820,19 @@ ActiveRecord::Schema.define(:version => 20170219025424) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "disciplines", :force => true do |t| - t.string "name" - t.integer "professional_level_id", :limit => 1 + create_table "delayed_jobs_20161218", :id => false, :force => true do |t| + t.integer "id", :default => 0, :null => false + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" end create_table "discuss_demos", :force => true do |t| @@ -979,9 +987,8 @@ ActiveRecord::Schema.define(:version => 20170219025424) do t.integer "forge_act_id" t.string "forge_act_type" t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "training_project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" @@ -1683,12 +1690,9 @@ ActiveRecord::Schema.define(:version => 20170219025424) do end create_table "professional_levels", :force => true do |t| - t.integer "level" - end - - create_table "professions", :force => true do |t| - t.string "name" - t.integer "discipline_id", :limit => 1 + t.string "level" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "project_infos", :force => true do |t| @@ -1701,19 +1705,18 @@ ActiveRecord::Schema.define(:version => 20170219025424) do create_table "project_scores", :force => true do |t| t.string "project_id" t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 t.datetime "commit_time" - t.integer "pull_request_num", :default => 0 - t.integer "training_project_id", :default => -1 + t.integer "pull_request_num", :default => 0 end create_table "project_statuses", :force => true do |t| @@ -1736,40 +1739,37 @@ ActiveRecord::Schema.define(:version => 20170219025424) do end create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false + t.string "name", :default => "", :null => false t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false t.integer "parent_id" t.datetime "created_on" t.datetime "updated_on" t.string "identifier" - t.integer "status", :default => 1, :null => false + t.integer "status", :default => 1, :null => false t.integer "lft" t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false + t.boolean "inherit_members", :default => false, :null => false t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 t.integer "user_id" + t.integer "dts_test", :default => 0 t.string "enterprise_name" t.integer "organization_id" t.integer "project_new_type" t.integer "gpid" t.integer "forked_from_project_id" t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "boards_count", :default => 0 - t.integer "news_count", :default => 0 - t.integer "acts_count", :default => 0 - t.integer "journals_count", :default => 0 - t.integer "boards_reply_count", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 t.string "invite_code" t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 + t.integer "qrcode_expiretime", :default => 0 t.text "script" + t.integer "training_status", :limit => 1, :default => 0 end add_index "projects", ["lft"], :name => "index_projects_on_lft" @@ -2163,8 +2163,8 @@ ActiveRecord::Schema.define(:version => 20170219025424) do t.string "title" t.text "description" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "eng_name" t.integer "syllabus_type" t.integer "credit" @@ -2173,9 +2173,8 @@ ActiveRecord::Schema.define(:version => 20170219025424) do t.integer "practice_hours" t.string "applicable_major" t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 - t.integer "professional_level_id", :limit => 1 + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 end add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" @@ -2256,46 +2255,6 @@ ActiveRecord::Schema.define(:version => 20170219025424) do t.integer "fields_bits", :default => 0 end - create_table "trackers_training_projects", :id => false, :force => true do |t| - t.integer "training_project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "trackers_training_projects", ["training_project_id"], :name => "projects_trackers_training_project_id" - - create_table "training_projects", :force => true do |t| - t.string "name", :limit => 30, :null => false - t.text "description" - t.string "homepage", :limit => 60 - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.integer "projects_count", :default => 0 - t.string "identifier", :null => false - t.integer "status", :default => 1 - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "training_tasks", :force => true do |t| t.integer "project_id" t.integer "tracker_id" @@ -2304,7 +2263,8 @@ ActiveRecord::Schema.define(:version => 20170219025424) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.integer "author_id" - t.integer "status", :limit => 1, :default => 1 + t.integer "status", :limit => 1, :default => 0 + t.integer "position", :limit => 1 end create_table "user_actions", :force => true do |t| From 54eb9b0bca3bd10af35b24a9cc8594106a3caa3f Mon Sep 17 00:00:00 2001 From: Linda <2294690300@qq.com> Date: Mon, 20 Feb 2017 10:48:36 +0800 Subject: [PATCH 039/118] =?UTF-8?q?=E7=BD=91=E7=AB=99=E5=BA=95=E9=83=A8?= =?UTF-8?q?=E7=89=88=E6=9D=83=E4=BF=A1=E6=81=AF=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_footer.html.erb | 7 +++---- app/views/layouts/_footer_show.html.erb | 7 +++---- public/stylesheets/css/structure.css | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 5923817cc..121c27921 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -38,9 +38,8 @@
    • web小蜜蜂
    --> - +
    \ No newline at end of file diff --git a/app/views/layouts/_footer_show.html.erb b/app/views/layouts/_footer_show.html.erb index 99e71762d..d9c0eeeda 100644 --- a/app/views/layouts/_footer_show.html.erb +++ b/app/views/layouts/_footer_show.html.erb @@ -38,8 +38,7 @@
  • web小蜜蜂
  • - +
    \ No newline at end of file diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index a26de4f4d..4891d6416 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -433,7 +433,7 @@ a.topnav_login_box:hover {color:#a1ebff;} .languageBox {width:55px; height:20px; margin-left:5px; outline:none; color:#666666; border:1px solid #d9d9d9;} .departments{ width:855px; margin:5px auto;height:40px;line-height:40px;} .departments li {height:40px; line-height:40px;} -.copyright{ width:375px; margin:0 auto;height:20px;line-height:20px;} +.copyright{ width:100%; text-align: center; } a.f_grey {color:#666666;} a.f_grey:hover {color:#000000;} /*消息弹框*/ From 1fb79f717cbfcdff6d05e89e0ded00765f4d79ec Mon Sep 17 00:00:00 2001 From: Linda <2294690300@qq.com> Date: Mon, 20 Feb 2017 11:27:18 +0800 Subject: [PATCH 040/118] =?UTF-8?q?=E7=95=99=E8=A8=80=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E7=95=99=E8=A8=80=E4=B8=8E=E7=95=99=E8=A8=80=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E9=97=B4=E9=9A=94=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/feedback.html.erb | 2 +- app/views/users/_user_journalsformessage.html.erb | 2 +- app/views/users/user_newfeedback.html.erb | 4 ++-- public/stylesheets/css/public.css | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/contests/feedback.html.erb b/app/views/contests/feedback.html.erb index 120ec1365..062977d4e 100644 --- a/app/views/contests/feedback.html.erb +++ b/app/views/contests/feedback.html.erb @@ -5,7 +5,7 @@
    -
    <%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %> +
    <%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
    <%= form_for('new_form',:url => leave_contest_message_path(@contest.id), :html =>{:id => "contest_feedback_new"}, :method => "post") do |f|%> <%= render :partial => "users/jour_form", :locals => {:f => f, :object => @contest} %> diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index cd79b9052..340b4ab78 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -1,4 +1,4 @@ -
    +
    <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %> diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 4890e7fb9..3c8327eb0 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -13,10 +13,10 @@
    -
    +
    <% unless is_current_user %>
    <%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %> -
    +
    <%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%> <%= render :partial => "jour_form", :locals => {:f => f, :object => @user} %> diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 7b2f4413c..e8999a921 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -8,7 +8,7 @@ .courseRSide{ width:730px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;} .wrap-big {width:980px; background:#fff; padding:10px; margin-bottom:10px;} /*资源库*/ -.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right} +.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right;} .resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;} .bannerName {background:#3b94d6; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;} .resourcesSelect {width:30px; height:24px; float:right; position:relative; margin-top:-6px;} From 336c28ccdb996e2e09415a58192357d62b7f3bc0 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 20 Feb 2017 12:33:27 +0800 Subject: [PATCH 041/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 4 +++- app/helpers/projects_helper.rb | 2 +- app/models/project.rb | 13 +++++++++++++ app/views/layouts/_base_project_top.html.erb | 11 +++++++---- app/views/projects/_invite_code.html.erb | 2 +- app/views/projects/settings.html.erb | 2 +- .../projects/settings/_new_trainig_task.html.erb | 5 +---- app/views/projects/show.html.erb | 2 +- 8 files changed, 28 insertions(+), 13 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e91b17212..46000427b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -379,7 +379,9 @@ class ProjectsController < ApplicationController def settings # 顶部导航 @project_menu_type = 10 - + if @project.is_child_training_project? + return render_404 + end # 修改查看消息状态 applied_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =? and viewed =?", User.current.id, @project, "AppliedProject", 0) applied_messages.update_all(:viewed => true) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index c87cdcca5..a7fef3dd7 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -544,7 +544,7 @@ module ProjectsHelper result = "manage_versions" elsif user.allowed_to?(:manage_repository, @project) result = "manage_repository" - elsif user.admin? + elsif is_project_manager?(user.id, @project.id) result = "training_task" end result diff --git a/app/models/project.rb b/app/models/project.rb index 1421ebc8e..cd8ea3d7b 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -160,6 +160,7 @@ class Project < ActiveRecord::Base after_create :create_board_sync,:acts_as_forge_activities, :create_project_ealasticsearch_index before_destroy :delete_all_members,:delete_project_ealasticsearch_index after_update :update_project_ealasticsearch_index + def remove_references_before_destroy return if self.id.nil? Watcher.delete_all ['watchable_id = ?', id] @@ -194,6 +195,7 @@ class Project < ActiveRecord::Base scope :project_entities, -> { where(project_type: ProjectType_project) } scope :course_entities, -> { where(project_type: ProjectType_course) } scope :indexable,lambda { where('is_public = 1')} #用于elastic建索引的scope + def self.search(query) __elasticsearch__.search( { @@ -220,6 +222,17 @@ class Project < ActiveRecord::Base } ) end + + # 判断项目是否为实训项目 + def is_training_project? + (self.enabled_modules.where("name = 'training_tasks'").empty? && self.training_status == 0) ? false : true + end + + # 判断项目是否为开启实训的项目(eg:学生开启实训) + def is_child_training_project? + self.training_status == 1 ? true :false + end + def new_course self.where('project_type = ?', 1) end diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index 0c59da6cf..8c8c2bdb7 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -15,9 +15,12 @@
    -
    -
      <%= render :partial => "projects/applied_status" %>
    -
    + <% if !@project.is_child_training_project? %> +
    +
      <%= render :partial => "projects/applied_status" %>
    +
    + <% end %> +
    <% unless @project.forked_from_project_id.nil? %>
    @@ -87,7 +90,7 @@ <% end %> - <% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %> + <% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && !@project.is_child_training_project? %>
  • <%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "pro_new_proname" %>
  • diff --git a/app/views/projects/_invite_code.html.erb b/app/views/projects/_invite_code.html.erb index 94a2d1ea5..03591034a 100644 --- a/app/views/projects/_invite_code.html.erb +++ b/app/views/projects/_invite_code.html.erb @@ -1,5 +1,5 @@

    项目简介 -<% if User.current.member_of?(@project) %> +<% if User.current.member_of?(@project) && !@project.is_child_training_project? %> 邀请码:<%= @project.invite_code %> <% end %>

    \ No newline at end of file diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index 6685f1e4f..21f5e2ecd 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -55,7 +55,7 @@
    - <%= render :partial=>"projects/settings/new_trainig_task" if User.current.admin? %> + <%= render :partial=>"projects/settings/new_trainig_task" if is_project_manager?(User.current.id, @project.id) %>
    diff --git a/app/views/projects/settings/_new_trainig_task.html.erb b/app/views/projects/settings/_new_trainig_task.html.erb index e92c42006..7db7d8518 100644 --- a/app/views/projects/settings/_new_trainig_task.html.erb +++ b/app/views/projects/settings/_new_trainig_task.html.erb @@ -7,11 +7,8 @@ 取消 确定
    -
    -

    请输入脚本

    -

    <%= link_to "开启实训", training_project_execute_project_path(@project) %>

    - + - 取消 - 确定 + <%= form_tag(url_for(:controller => 'projects', :action => 'add_script', :project_id => @project.id), :id => 'project_script_form', :method => "post", :remote => true) do %> + + + 取消 + 确定 + <% end %>
    + diff --git a/app/views/projects/settings/_training_project_exec_tip.html.erb b/app/views/projects/settings/_training_project_exec_tip.html.erb new file mode 100644 index 000000000..3445f4c9b --- /dev/null +++ b/app/views/projects/settings/_training_project_exec_tip.html.erb @@ -0,0 +1,3 @@ +<% if @notice %> +

    <%= @notice %>

    +<% end %> diff --git a/app/views/projects/settings/_training_projects_filter_tip.html.erb b/app/views/projects/settings/_training_projects_filter_tip.html.erb new file mode 100644 index 000000000..e930bc4c7 --- /dev/null +++ b/app/views/projects/settings/_training_projects_filter_tip.html.erb @@ -0,0 +1,5 @@ +<% if @project.training_status == 1 %> + <%= link_to "重启实训", training_project_update_project_path, :class => "fr sy_btn_green mb10", :remote => true %> +<% else %> + <%= link_to "开启实训", training_project_execute_project_path, :class => "fr sy_btn_green mb10", :remote => true %> +<% end %> \ No newline at end of file diff --git a/app/views/projects/training_project_execute.js.erb b/app/views/projects/training_project_execute.js.erb new file mode 100644 index 000000000..5e1b2630c --- /dev/null +++ b/app/views/projects/training_project_execute.js.erb @@ -0,0 +1,2 @@ +$("#training_project_exec_tip").html('<%= escape_javascript(render :partial => 'projects/settings/training_project_exec_tip') %>'); +$("#training_project_filter_tip").html('<%= escape_javascript(render :partial => 'projects/settings/training_projects_filter_tip') %>'); \ No newline at end of file diff --git a/app/views/training_tasks/_content_list.html.erb b/app/views/training_tasks/_content_list.html.erb index 1ee35871e..9af990c08 100644 --- a/app/views/training_tasks/_content_list.html.erb +++ b/app/views/training_tasks/_content_list.html.erb @@ -29,7 +29,9 @@ <%= activity.journals.count %> <% end %> -
    + <% end %> diff --git a/config/routes.rb b/config/routes.rb index 8548dc665..b7b98eb05 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -906,12 +906,15 @@ RedmineApp::Application.routes.draw do match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #end + post 'add_script' post 'modules' post 'archive' post 'unarchive' post 'close' post 'reopen' get 'training_project_execute' + get 'training_project_update' + get 'task_execute' get 'forked_pop' get 'delete_member_pop', :to => 'projects#delete_member_pop', :via => :get, :as => "delete_member_pop" get 'search_public_orgs_not_in_project' @@ -922,6 +925,7 @@ RedmineApp::Application.routes.draw do collection do get 'project_home' match 'join_project', :via => [:get, :post] + match 'training_task_status', :via => [:get, :post] end #by young From 544432adcee83ca27d6cf3a3ae4318c283ce89ad Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 21 Feb 2017 14:38:05 +0800 Subject: [PATCH 048/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=9A=84=E4=B8=80=E7=BA=A7?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/at_controller.rb | 9 +++ app/controllers/training_tasks_controller.rb | 27 ++++---- app/helpers/training_tasks_helper.rb | 42 +++++++++++++ app/models/journal.rb | 62 +++++++++++++------ app/views/praise_tread/_praise.html.erb | 16 ++++- app/views/training_tasks/_detail.html.erb | 18 +----- .../training_tasks/_issue_replies.html.erb | 39 +++++++----- .../training_tasks/_reply_banner.html.erb | 5 +- .../training_tasks/_task_attachments.html.erb | 2 +- .../_training_tasks_reply_ke_form.html.erb | 27 ++++++++ app/views/training_tasks/add_journal.js.erb | 1 + app/views/training_tasks/reply.js.erb | 8 +++ app/views/training_tasks/show.html.erb | 12 ++-- app/views/training_tasks/show.js.erb | 19 ++++++ config/routes.rb | 5 ++ 15 files changed, 217 insertions(+), 75 deletions(-) create mode 100644 app/views/training_tasks/_training_tasks_reply_ke_form.html.erb create mode 100644 app/views/training_tasks/add_journal.js.erb create mode 100644 app/views/training_tasks/reply.js.erb create mode 100644 app/views/training_tasks/show.js.erb diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb index 66cbf27b8..81d678261 100644 --- a/app/controllers/at_controller.rb +++ b/app/controllers/at_controller.rb @@ -29,6 +29,8 @@ class AtController < ApplicationController case type when "Issue" find_issue(id) + whne 'TrainingTask' + find_training_task(id) when 'Project' find_project(id) when 'Course' @@ -69,6 +71,13 @@ class AtController < ApplicationController at_persons.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } end + def find_training_task(id) + training_task = TrainingTask.find(id) + journals = training_task.journals + at_persons = journals.map(&:user) + training_task.project.users + at_persons.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } + end + def find_project(id) return [] if id.to_i<0 at_persons = Project.find(id).users diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index 9c84b08f8..43fcd74d0 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -88,6 +88,7 @@ class TrainingTasksController < ApplicationController @journal = Journal.new(:journalized => @training_task) respond_to do |format| format.html + format.js end end @@ -358,19 +359,19 @@ class TrainingTasksController < ApplicationController jour = Journal.new jour.user_id = User.current.id jour.notes = params[:notes] - jour.journalized = @issue + jour.journalized = @training_task jour.save_attachments(params[:attachments]) jour.save - update_user_activity(@issue.class,@issue.id) - update_forge_activity(@issue.class,@issue.id) - @allowed_statuses = @issue.new_statuses_allowed_to(User.current) + update_user_activity(@training_task.class, @training_task.id) + update_forge_activity(@training_task.class, @training_task.id) + # @allowed_statuses = @training_task.new_statuses_allowed_to(User.current) @user_activity_id = params[:user_activity_id] @priorities = IssuePriority.active respond_to do |format| # Issue详情单独处理 if params[:is_issue_show] - format.js{redirect_to issue_path(@issue)} + format.js{ redirect_to training_task_path(@training_task) } else format.js end @@ -397,7 +398,7 @@ class TrainingTasksController < ApplicationController #对某个journ回复,显示回复框 def reply - @issue = Issue.find(params[:id]) + @training_task = TrainingTask.find(params[:id]) @jour = Journal.find(params[:journal_id]) respond_to do |format| format.js @@ -408,25 +409,25 @@ class TrainingTasksController < ApplicationController def add_reply if User.current.logged? jour = Journal.find(params[:journal_id]) - @issue = Issue.find params[:id] - @project = @issue.project - @allowed_statuses = @issue.new_statuses_allowed_to(User.current) + @training_task = TrainingTask.find params[:id] + @project = @training_task.project + @allowed_statuses = @training_task.new_statuses_allowed_to(User.current) @priorities = IssuePriority.active new_jour = Journal.new new_jour.user_id = User.current.id new_jour.reply_id = params[:journal_id] new_jour.parent_id = jour.id new_jour.notes = params[:content] - new_jour.journalized = @issue + new_jour.journalized = @training_task new_jour.save_attachments(params[:attachments]) # new_jour = @issue.journals.build(:user_id => User.current.id, :reply_id => params[:journal_id], :notes => params[:content], :parent_id => jour.id) @user_activity_id = params[:user_activity_id] if new_jour.save - update_user_activity(@issue.class,@issue.id) - update_forge_activity(@issue.class,@issue.id) + update_user_activity(@training_task.class,@issue.id) + update_forge_activity(@training_task.class,@issue.id) respond_to do |format| if params[:is_issue_show] - format.js{redirect_to issue_path(@issue)} + format.js{ redirect_to project_training_task_path(@training_task) } else format.js end diff --git a/app/helpers/training_tasks_helper.rb b/app/helpers/training_tasks_helper.rb index 4096b1cb0..bb52e8a79 100644 --- a/app/helpers/training_tasks_helper.rb +++ b/app/helpers/training_tasks_helper.rb @@ -1,2 +1,44 @@ module TrainingTasksHelper + include ApplicationHelper + include TagsHelper + require 'iconv' + + # Returns the textual representation of a journal details + # as an array of strings + def details_to_strings(details, no_html=false, options={}) + options[:only_path] = (options[:only_path] == false ? false : true) + options[:token] = options[:token] if options[:token] + strings = [] + values_by_field = {} + details.each do |detail| + + if detail.property == 'cf' + field_id = detail.prop_key + field = CustomField.find_by_id(field_id) + if field && field.multiple? + values_by_field[field_id] ||= {:added => [], :deleted => []} + if detail.old_value + values_by_field[field_id][:deleted] << detail.old_value + end + if detail.value + values_by_field[field_id][:added] << detail.value + end + next + end + end + strings << show_detail(detail, no_html, options) + + end + values_by_field.each do |field_id, changes| + detail = JournalDetail.new(:property => 'cf', :prop_key => field_id) + if changes[:added].any? + detail.value = changes[:added] + strings << show_detail(detail, no_html, options) + elsif changes[:deleted].any? + detail.old_value = changes[:deleted] + strings << show_detail(detail, no_html, options) + end + end + strings + end end diff --git a/app/models/journal.rb b/app/models/journal.rb index f14484a31..822d7beca 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -23,7 +23,8 @@ class Journal < ActiveRecord::Base belongs_to :journalized, :polymorphic => true,:touch => true # added as a quick fix to allow eager loading of the polymorphic association # since always associated to an issue, for now - belongs_to :issue, :foreign_key => :journalized_id,:touch => true + belongs_to :issue, :foreign_key => :journalized_id, :touch => true + belongs_to :training_task, :foreign_key => :journalized_id, :touch => true belongs_to :user has_many :details, :class_name => "JournalDetail", :dependent => :delete_all @@ -192,27 +193,44 @@ class Journal < ActiveRecord::Base def act_as_forge_message receivers = [] # 直接回复 - if self.user_id != self.issue.author_id - receivers << self.issue.author_id - end - if self.user_id != self.issue.assigned_to_id && self.issue.assigned_to_id != self.issue.author_id # 指派人不是自己的话,则给指派人发送 - receivers << self.issue.assigned_to_id - end - receivers.each do |r| - self.forge_messages << ForgeMessage.new(:user_id => r, :project_id => self.issue.project_id, :viewed => false) + if self.journalized_type == 'Issue' + if self.user_id != self.issue.author_id + receivers << self.issue.author_id + end + if self.user_id != self.issue.assigned_to_id && self.issue.assigned_to_id != self.issue.author_id # 指派人不是自己的话,则给指派人发送 + receivers << self.issue.assigned_to_id + end + receivers.each do |r| + self.forge_messages << ForgeMessage.new(:user_id => r, :project_id => self.issue.project_id, :viewed => false) + end + elsif self.journalized_type == 'TrainingTask' + if self.user_id != self.training_task.author_id + receivers << self.training_task.author_id + end + receivers.each do |r| + self.forge_messages << ForgeMessage.new(:user_id => r, :project_id => self.training_task.project, :viewed => false) + end end end # 更新用户分数 -by zjc def be_user_score + if (self.journalized_type == 'Issue') #新建了缺陷留言且留言不为空,不为空白 - if !self.notes.nil? && self.notes.gsub(' ','') != '' - #协同得分加分 - UserScore.joint(:post_issue_message, self.user,self.issue.author,self, { message_id: self.id }) - update_messges_for_issue(self.user,1) - update_messges_for_issue(self.user,2,self.issue.project) + if !self.notes.nil? && self.notes.gsub(' ','') != '' + #协同得分加分 + UserScore.joint(:post_issue_message, self.user,self.issue.author,self, { message_id: self.id }) + update_messges_for_issue(self.user,1) + update_messges_for_issue(self.user,2,self.issue.project) + end + elsif( self.journalized_type == 'TrainingTask') + if !self.notes.nil? && self.notes.gsub(' ','') != '' + #协同得分加分 + UserScore.joint(:post_issue_message, self.user, self.training_task.author, self, { message_id: self.id }) + update_messges_for_issue(self.user, 1) + update_messges_for_issue(self.user, 2, self.training_task.project) + end end - end # 减少用户分数 -by zjc def down_user_score @@ -237,12 +255,18 @@ class Journal < ActiveRecord::Base # issue留言总数更新 def add_journals_count - if !self.issue.project.nil? && self.journalized_type == "Issue" && !self.issue.project.project_score.nil? - project = self.issue.project - project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num + 1) + if self.journalized_type == 'Issue' + if !self.issue.project.nil? && self.journalized_type == "Issue" && !self.issue.project.project_score.nil? + project = self.issue.project + project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num + 1) + end + elsif self.journalized_type == 'TrainingTask' + if !self.training_task.project.nil? && self.journalized_type == "TrainingTask" && !self.training_task.project.project_score.nil? + project = self.training_task.project + project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num + 1) + end end end - # 回复issue的时候,更新issue的时候 def update_issue_time if self.journalized_type == "Issue" diff --git a/app/views/praise_tread/_praise.html.erb b/app/views/praise_tread/_praise.html.erb index dfd1011db..223cc9c5e 100644 --- a/app/views/praise_tread/_praise.html.erb +++ b/app/views/praise_tread/_praise.html.erb @@ -1,11 +1,23 @@ <% if PraiseTread.praised(activity) %> - <% else %> -
    diff --git a/app/views/training_tasks/_training_tasks_reply_ke_form.html.erb b/app/views/training_tasks/_training_tasks_reply_ke_form.html.erb new file mode 100644 index 000000000..6e76e8c30 --- /dev/null +++ b/app/views/training_tasks/_training_tasks_reply_ke_form.html.erb @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/app/views/training_tasks/add_journal.js.erb b/app/views/training_tasks/add_journal.js.erb new file mode 100644 index 000000000..d3f5a12fa --- /dev/null +++ b/app/views/training_tasks/add_journal.js.erb @@ -0,0 +1 @@ + diff --git a/app/views/training_tasks/reply.js.erb b/app/views/training_tasks/reply.js.erb new file mode 100644 index 000000000..3c7acd927 --- /dev/null +++ b/app/views/training_tasks/reply.js.erb @@ -0,0 +1,8 @@ +if($("#reply_message_<%= @jour.id %>").length > 0) { + $("#reply_message_<%= @jour.id %>").replaceWith("<%= escape_javascript(render :partial => 'training_tasks/training_tasks_reply_ke_form') %>"); + $(function(){ + sd_create_editor_from_data(<%= @jour.id %>, null, "100%", "<%= @jour.class.name %>"); + }); +}else if($("#reply_to_message_<%= @jour.id %>").length >0) { + $("#reply_to_message_<%= @jour.id %>").replaceWith("

    "); +} \ No newline at end of file diff --git a/app/views/training_tasks/show.html.erb b/app/views/training_tasks/show.html.erb index 2ce1fdb16..f125717b1 100644 --- a/app/views/training_tasks/show.html.erb +++ b/app/views/training_tasks/show.html.erb @@ -3,13 +3,13 @@ <%= javascript_include_tag 'create_kindeditor'%> <% end %>
    @@ -23,15 +23,15 @@
    -
    +
    -
    - <%=render :partial => 'reply_banner' %> +
    + <%= render :partial => 'reply_banner' %>
    - <%= render :partial => 'issue_replies',:locals => {:issue => @training_task, :replies_all_i => 0} %> + <%= render :partial => 'issue_replies',:locals => {:issue => @training_task, :replies_all_i => 0 } %>
    diff --git a/app/views/training_tasks/show.js.erb b/app/views/training_tasks/show.js.erb new file mode 100644 index 000000000..a465dab32 --- /dev/null +++ b/app/views/training_tasks/show.js.erb @@ -0,0 +1,19 @@ +// $("#div_user_issue_reply_<%#= @user_activity_id %>").html("<%#= escape_javascript(render :partial => 'projects/project_issue_reply', :locals => {:activity => @issue, :user_activity_id => @user_activity_id}) %>"); + +$("#reply_div_<%= @training_task.id %>").html("<%= escape_javascript(render :partial => 'training_tasks/issue_replies', :locals => {:issue => @training_task}) %>"); +$("#div_issue_attachment_<%=@training_task.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => @training_task}) %>"); +issue_desc_editor = KindEditor.create('#issue_description', + {"width":"85%", + "resizeType":0, + "no_label":true, + "at_id":<%= @training_task.project_id%>, + "at_type":"Project", + "autoHeightMode":true, + "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%= @training_task.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})", + "emotionsBasePath":'<%= Setting.host_name%>', + "height":300, + "allowFileManager":true, + "uploadJson":"/kindeditor/upload", + "fileManagerJson":"/kindeditor/filemanager"}); +$(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'reply_banner') %>'); +sd_create_editor_from_data(<%= @training_task.id %>, null, "100%", "<%= @training_task.class.name %>"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 8548dc665..a82e37a5d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1099,6 +1099,11 @@ RedmineApp::Application.routes.draw do post 'complete_training_task' end collection do + post 'add_journal' + post 'add_journal_in_org' + get 'delete_journal' + get 'reply' + post 'add_reply' end end From e6deabadba4e30b2b0bf624dc95f4e846d23ae49 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 21 Feb 2017 14:45:18 +0800 Subject: [PATCH 049/118] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E7=BC=96=E7=A8=8B=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 6 +++++- app/views/admin/homework.html.erb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index c2499e824..9d51e5839 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -978,7 +978,11 @@ class AdminController < ApplicationController #作业 def homework #@homework = HomeworkCommon.order('end_time desc') - @homework = HomeworkCommon.order( 'created_at desc ') + if params[:type] == "2" + @homework = HomeworkCommon.where(:homework_type => 2).order( 'created_at desc ') + else + @homework = HomeworkCommon.order( 'created_at desc ') + end @homework = paginateHelper @homework,30 @page = (params['page'] || 1).to_i - 1 respond_to do |format| diff --git a/app/views/admin/homework.html.erb b/app/views/admin/homework.html.erb index aaf21999d..1582193b2 100644 --- a/app/views/admin/homework.html.erb +++ b/app/views/admin/homework.html.erb @@ -1,7 +1,7 @@

    <%=l(:label_user_homework)%>

    - +

    <%= link_to "编程作业", admin_homework_path(:type => "2") %>

    提交评测 + <%= link_to "提交评测", task_execute_project_path(@project, :training_task_id => activity.id), :class => "btn btn-blue", :remote => true %> +
    From 74518385093098e1871b47e553f5932edda1d3d5 Mon Sep 17 00:00:00 2001 From: Linda <2294690300@qq.com> Date: Tue, 21 Feb 2017 14:51:48 +0800 Subject: [PATCH 050/118] =?UTF-8?q?syllablus.css=E5=92=8Csy.public.css?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=BD=AC=E7=A7=BB=E5=88=B0=20css=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=EF=BC=9B=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=AD=E5=BC=95=E7=94=A8=E8=BF=99=E4=B8=A4=E4=B8=AA=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/base_contest_community.html.erb | 2 +- app/views/layouts/base_contests.html.erb | 2 +- .../layouts/base_course_community.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 2 +- .../layouts/base_project_community.html.erb | 2 +- app/views/layouts/base_syllabus.html.erb | 2 +- app/views/layouts/new_base.html.erb | 2 +- app/views/layouts/new_base_user.html.erb | 2 +- app/views/layouts/new_base_user_show.html.erb | 2 +- app/views/layouts/static_base.html.erb | 2 +- .../users/user_manage_homeworks.html.erb | 2 +- .../users/user_receive_homeworks.html.erb | 2 +- public/stylesheets/css/popup.css | 20 +- public/stylesheets/sy_public.css | 163 ----- public/stylesheets/syllabus.css | 652 ------------------ 15 files changed, 31 insertions(+), 828 deletions(-) delete mode 100644 public/stylesheets/sy_public.css delete mode 100644 public/stylesheets/syllabus.css diff --git a/app/views/layouts/base_contest_community.html.erb b/app/views/layouts/base_contest_community.html.erb index 26c5f4f1f..d92df3bc3 100644 --- a/app/views/layouts/base_contest_community.html.erb +++ b/app/views/layouts/base_contest_community.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify','contest'%> diff --git a/app/views/layouts/base_contests.html.erb b/app/views/layouts/base_contests.html.erb index 0c52f8596..d935affca 100644 --- a/app/views/layouts/base_contests.html.erb +++ b/app/views/layouts/base_contests.html.erb @@ -12,7 +12,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus', 'css/moduel','css/contest'%> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','css/sy_public','css/syllabus', 'css/moduel','css/contest'%> <%= javascript_include_tag "course","avatars","header","attachments",'prettify','contest' %> <%= yield :header_tags -%> diff --git a/app/views/layouts/base_course_community.html.erb b/app/views/layouts/base_course_community.html.erb index 4897482c6..44fa0cea7 100644 --- a/app/views/layouts/base_course_community.html.erb +++ b/app/views/layouts/base_course_community.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index e662d9fa0..479f9f1cd 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -19,7 +19,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','sy_public','syllabus', 'css/moduel','css/contest'%> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup','css/syllabus', 'css/moduel','css/contest'%> <%= javascript_include_tag "course","avatars","header","attachments",'prettify' %> <%= yield :header_tags -%> diff --git a/app/views/layouts/base_project_community.html.erb b/app/views/layouts/base_project_community.html.erb index a9caebcdb..6161e424b 100644 --- a/app/views/layouts/base_project_community.html.erb +++ b/app/views/layouts/base_project_community.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','csws/syllabus','css/moduel', 'css/user', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> diff --git a/app/views/layouts/base_syllabus.html.erb b/app/views/layouts/base_syllabus.html.erb index 0b9b47c55..3e75e1739 100644 --- a/app/views/layouts/base_syllabus.html.erb +++ b/app/views/layouts/base_syllabus.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public','css/structure','css/courses','css/popup','prettify','syllabus','sy_public','css/moduel',:media => 'all'%> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public','css/structure','css/courses','css/popup','prettify','css/syllabus','css/sy_public','css/moduel',:media => 'all'%> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify','syllabus','cookie'%> diff --git a/app/views/layouts/new_base.html.erb b/app/views/layouts/new_base.html.erb index cc6da3581..ba5c84ca2 100644 --- a/app/views/layouts/new_base.html.erb +++ b/app/views/layouts/new_base.html.erb @@ -13,7 +13,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'css/common','css/structure', 'css/public', 'css/courses','prettify', 'css/org', 'syllabus'%> + <%= stylesheet_link_tag 'css/common','css/structure', 'css/public', 'css/courses','prettify', 'css/org', 'css/syllabus'%> <%= javascript_include_tag "course","header",'prettify','contest' %> <%= yield :header_tags -%> diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index acfdf4728..1d08ab7da 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel', 'css/user', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus','css/moduel', 'css/user', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> diff --git a/app/views/layouts/new_base_user_show.html.erb b/app/views/layouts/new_base_user_show.html.erb index 94c5c8a30..2a3d503b7 100644 --- a/app/views/layouts/new_base_user_show.html.erb +++ b/app/views/layouts/new_base_user_show.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus',:media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','css/syllabus',:media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> diff --git a/app/views/layouts/static_base.html.erb b/app/views/layouts/static_base.html.erb index ff0e30414..9f0bbaa37 100644 --- a/app/views/layouts/static_base.html.erb +++ b/app/views/layouts/static_base.html.erb @@ -16,7 +16,7 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> - <%= stylesheet_link_tag 'css/common','css/structure','css/public','css/popup','syllabus','sy_public', :media => 'all'%> + <%= stylesheet_link_tag 'css/common','css/structure','css/public','css/popup','css/syllabus','css/sy_public', :media => 'all'%> -
    +
    + <% if @project.is_child_training_project? %> + + <% end %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index b7b98eb05..ab73af63f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -914,8 +914,10 @@ RedmineApp::Application.routes.draw do post 'reopen' get 'training_project_execute' get 'training_project_update' + get 'training_project_extend' get 'task_execute' get 'forked_pop' + get 'training_chiled_project_exec' get 'delete_member_pop', :to => 'projects#delete_member_pop', :via => :get, :as => "delete_member_pop" get 'search_public_orgs_not_in_project' match 'copy', :via => [:get, :post] From 0070bed92b7fea4278df668a248911a14fe44192 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 22 Feb 2017 09:35:11 +0800 Subject: [PATCH 054/118] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=E5=88=86=E6=9E=90=E7=BB=93=E6=9E=9C=E5=88=97=E8=A1=A8=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/quality_analysis/_result_list.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/quality_analysis/_result_list.html.erb b/app/views/quality_analysis/_result_list.html.erb index 62837663e..135e59621 100644 --- a/app/views/quality_analysis/_result_list.html.erb +++ b/app/views/quality_analysis/_result_list.html.erb @@ -8,7 +8,7 @@
    - <%= link_to "提交评测", task_execute_project_path(@project, :training_task_id => activity.id), :class => "btn btn-blue", :remote => true %> - + <%= link_to "提交评测", task_execute_project_path(@project, :training_task_id => activity.id), :class => "btn btn-blue", :remote => true %> +
    - + @@ -20,7 +20,7 @@ <% if @quality_analyses && @quality_analyses.count > 0 %> <% @quality_analyses.each do |qa| %> - + From 422b5ffa95ab5aa3719b8d24be735b79a87dcb11 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 22 Feb 2017 10:01:54 +0800 Subject: [PATCH 055/118] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=AB=9E=E8=B5=9B=E7=9A=84=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/contests/_contest_base_info.html.erb | 2 +- app/views/layouts/_logined_header.html.erb | 2 ++ app/views/users/_user_message_contest.html.erb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/contests/_contest_base_info.html.erb b/app/views/contests/_contest_base_info.html.erb index 7e4c40d9e..cf5d41665 100644 --- a/app/views/contests/_contest_base_info.html.erb +++ b/app/views/contests/_contest_base_info.html.erb @@ -36,7 +36,7 @@ <%= link_to '管理员身份', switch_role_contest_path(@contest, :user_id => User.current.id, :curr_role => 14, :tar_role => 13), :class => "fr sy_btn_blue mt28 ml10", :title => "由评委身份切换至管理员身份" %> <% end %> <% end %> -<% else %> +<% elsif User.current.logged? %> <%= link_to "加入竞赛",join_contest_contests_path(),:remote => true, :method => "get", :class => "fr sy_btn_blue mt28 ml10" %> <% end %> 邀请码: diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index f99160f75..4cade508c 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -116,6 +116,7 @@ $("#navHomepageSearchType").hide(); }); + <% unless @force %> $("#user_messages").mouseenter(function(){ onNotice = true; $("#user_messages_list").show(); @@ -134,6 +135,7 @@ obj.html("<%=escape_javascript(render :partial => 'layouts/message_loading') %>"); } }, 500); }); + <% end %> $("#message_list_detail").mouseenter(function(event){ event.stopPropagation(); onUserMessages = true; diff --git a/app/views/users/_user_message_contest.html.erb b/app/views/users/_user_message_contest.html.erb index 12292620f..04b83d09c 100644 --- a/app/views/users/_user_message_contest.html.erb +++ b/app/views/users/_user_message_contest.html.erb @@ -25,7 +25,7 @@ <%=link_to user.show_name, user_path(user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> - <%= user.user_extensions.school_id.blank? ? "" : "来自"+user.user_extensions.school.name+"," %> + <%= user.user_extensions.school_id.blank? || user.user_extensions.school.nil? ? "" : "来自"+user.user_extensions.school.name+"," %> 申请以"<%= role_str%>"的身份加入竞赛: From 06306e0214b031fc8b395a7c3262b770cc8af4ea Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 22 Feb 2017 10:08:05 +0800 Subject: [PATCH 056/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8F=A0=E5=B1=82=E5=9B=9E=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/training_tasks_controller.rb | 4 +-- app/controllers/users_controller.rb | 5 +++ app/helpers/application_helper.rb | 2 +- .../training_tasks/_issue_replies.html.erb | 2 +- app/views/users/_comment_reply.html.erb | 4 +-- .../users/_comment_reply_detail.html.erb | 32 ++++++++++++------- app/views/users/_news_contents.html.erb | 2 +- app/views/users/_reply_to_comment.html.erb | 2 +- app/views/users/reply_detail.js.erb | 2 ++ app/views/users/reply_to_comment.js.erb | 12 +++---- 10 files changed, 41 insertions(+), 26 deletions(-) diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index aca59a68e..8346dbc20 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -457,7 +457,7 @@ class TrainingTasksController < ApplicationController # 非动态页面直接刷新,动态页面手动刷新 def delete_journal @is_project = params[:is_project] - @issue = Issue.find(params[:id]) + @training_task = TrainingTask.find(params[:id]) begin forge_acts = ForgeMessage.where(:forge_message_type => "Journal", :forge_message_id => params[:journal_id]) forge_acts.destroy_all unless forge_acts.empty? @@ -472,7 +472,7 @@ class TrainingTasksController < ApplicationController if @user_activity_id format.js else - format.js{ redirect_to issue_url(@issue)} + format.js{ redirect_to training_task_path(@training_task)} end end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6fbdaa34f..c5e785a53 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -417,6 +417,11 @@ class UsersController < ApplicationController comment = @root.journals.build(:user_id => User.current.id, :reply_id => params[:reply_id], :notes => params[:reply_message], :parent_id => reply.id) comment.save @is_project = params[:is_project] if params[:is_project] + when 'TrainingTask' + @root = reply.training_task + comment = @root.journals.build(:user_id => User.current.id, :reply_id => params[:reply_id], :notes => params[:reply_message], :parent_id => reply.id) + comment.save + @is_project = params[:is_project] if params[:is_project] when 'Syllabus' @root = Syllabus.find reply.jour_id options = {:notes => params[:reply_message], :reply_id => reply.user_id,:user_id => User.current.id,:m_parent_id => params[:reply_id].to_i,:m_reply_id => params[:reply_id].to_i, :root_id => reply.root_id} diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f479432ca..baca46b3b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3697,7 +3697,7 @@ def get_reply_by_type type, reply_id reply = OrgDocumentComment.find reply_id when 'News','Comment' reply = Comment.find reply_id - when 'Issue' + when 'Issue', 'TrainingTask' reply = Journal.find reply_id when 'Journal' reply = Journal.find reply_id diff --git a/app/views/training_tasks/_issue_replies.html.erb b/app/views/training_tasks/_issue_replies.html.erb index 3062612b9..ee31a78ab 100644 --- a/app/views/training_tasks/_issue_replies.html.erb +++ b/app/views/training_tasks/_issue_replies.html.erb @@ -43,7 +43,7 @@ {:controller => 'training_tasks', :action => 'delete_journal', :id => @training_task.id, - :journal_id=>comment.id}, + :journal_id => comment.id}, :method => :get, :remote => true, :id => "delete_reply_#{comment.id}", diff --git a/app/views/users/_comment_reply.html.erb b/app/views/users/_comment_reply.html.erb index 0720d2e25..c405b1ff0 100644 --- a/app/views/users/_comment_reply.html.erb +++ b/app/views/users/_comment_reply.html.erb @@ -1,8 +1,8 @@
    <% unless comment.parent.nil? %>
    - <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id} %> + <%= render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id} %>
    <% end %> - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id} %> + <%= render :partial => 'users/comment_reply_detail', :locals => {:comment => comment, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id} %>
    \ No newline at end of file diff --git a/app/views/users/_comment_reply_detail.html.erb b/app/views/users/_comment_reply_detail.html.erb index 12cd6874a..737a1a33c 100644 --- a/app/views/users/_comment_reply_detail.html.erb +++ b/app/views/users/_comment_reply_detail.html.erb @@ -26,23 +26,31 @@ <% topic = comment.root %> <% if !topic.locked? && authorize_for('messages', 'reply') %> - <%= link_to( - l(:button_reply), - {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, - :remote => true, - :method => 'get', - :title => l(:button_reply)) %> + <%= link_to(l(:button_reply), + {:controller => 'users' , + :action => 'reply_to_comment', + :reply_id => comment.id, + :type => type, + :user_activity_id => user_activity_id, + :parent_id => parent_id}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> <% end %> <% else %> - <%= link_to( - l(:button_reply), - {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, - :remote => true, - :method => 'get', - :title => l(:button_reply)) %> + <%= link_to(l(:button_reply), + {:controller => 'users', + :action => 'reply_to_comment', + :reply_id => comment.id, + :type => type, + :user_activity_id => user_activity_id, + :parent_id => parent_id}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> <% end %> diff --git a/app/views/users/_news_contents.html.erb b/app/views/users/_news_contents.html.erb index e421fd442..e46901d46 100644 --- a/app/views/users/_news_contents.html.erb +++ b/app/views/users/_news_contents.html.erb @@ -6,7 +6,7 @@ <% parents_rely = [] %> <% parents_rely = get_reply_parents parents_rely, comment %> <% length = parents_rely.length %> -
    +
    <% if length <= 5 %> <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %> <% else %> diff --git a/app/views/users/_reply_to_comment.html.erb b/app/views/users/_reply_to_comment.html.erb index 31b01f3f1..35c27000c 100644 --- a/app/views/users/_reply_to_comment.html.erb +++ b/app/views/users/_reply_to_comment.html.erb @@ -6,7 +6,7 @@ <%= form_for('new_form',:url => {:controller => 'users', :action => 'reply_detail', :reply_id => reply.id, :type => @type, :is_project => @is_project, :user_activity_id => @user_activity_id},:method => "post", :remote => true) do |f| %>
    - +

    <% end%> diff --git a/app/views/users/reply_detail.js.erb b/app/views/users/reply_detail.js.erb index 91828ef0f..e7e69507d 100644 --- a/app/views/users/reply_detail.js.erb +++ b/app/views/users/reply_detail.js.erb @@ -38,6 +38,8 @@ $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(re <% else %> window.location.href = "<%=issue_path(@root) %>"; <% end %> +<% elsif @type == 'TrainingTask' %> + window.location.href = "<%= training_task_path(@root) %>"; <% elsif @type == 'OrgDocumentComment' %> <% if @user_activity_id.to_i != @root.id %> $("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'organizations/org_document_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>"); diff --git a/app/views/users/reply_to_comment.js.erb b/app/views/users/reply_to_comment.js.erb index 22ae8e3fd..49a624e28 100644 --- a/app/views/users/reply_to_comment.js.erb +++ b/app/views/users/reply_to_comment.js.erb @@ -1,10 +1,10 @@ -if($("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id%>").length > 0) { - $("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'users/reply_to_comment', :locals => {:reply => @reply}) %>"); +if($("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id %>").length > 0) { + $("#comment_reply_<%=@parent_id %> #reply_message_<%= @reply.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/reply_to_comment', :locals => {:reply => @reply}) %>"); $("#comment_reply_<%=@parent_id %> #reply_iconup_<%=@reply.id %>").show(); $(function(){ - sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%= @reply.class.to_s %>"); + sd_create_editor_from_data(<%= @reply.id %>,null,"100%", "<%= @reply.class.to_s %>"); }); -}else if($("#comment_reply_<%=@parent_id %> #reply_to_message_<%= @reply.id%>").length >0) { - $("#comment_reply_<%=@parent_id %> #reply_to_message_<%= @reply.id%>").replaceWith("

    "); - $("#comment_reply_<%=@parent_id %> #reply_iconup_<%=@reply.id %>").hide(); +}else if($("#comment_reply_<%= @parent_id %> #reply_to_message_<%= @reply.id %>").length >0) { + $("#comment_reply_<%= @parent_id %> #reply_to_message_<%= @reply.id %>").replaceWith("

    "); + $("#comment_reply_<%= @parent_id %> #reply_iconup_<%= @reply.id %>").hide(); } \ No newline at end of file From 0629b31e53d6f59140ac71c55c554629fc0f93d5 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 22 Feb 2017 10:14:04 +0800 Subject: [PATCH 057/118] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=EF=BC=88=E6=AF=94=E5=A6=82=EF=BC=9A594?= =?UTF-8?q?=EF=BC=89=E5=88=87=E6=8D=A2=E7=89=88=E6=9C=AC=E5=BA=93=E5=88=86?= =?UTF-8?q?=E6=94=AF500=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 30 ++--- .../repositories/_latest_commit.html.erb | 14 +- app/views/repositories/show.html.erb | 124 ++++++++---------- 3 files changed, 75 insertions(+), 93 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index a955fa88b..b1e23a96a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -410,23 +410,21 @@ update if request.xhr? @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) else - unless @entries.blank? - @changesets_latest_coimmit = @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) - # @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) - # 总的提交数 - @changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count - # 获取默认分支 - @g_default_branch = @g_project.default_branch.nil? ? "master" : @g_project.default_branch + @changesets_latest_coimmit = @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) + # @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) + # 总的提交数 + @changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count + # 获取默认分支 + @g_default_branch = @g_project.default_branch.nil? ? "master" : @g_project.default_branch - @creator = @project.owner.to_s - gitlab_address = Redmine::Configuration['gitlab_address'] - gitlab_token = Gitlab.private_token - # token值加密解密 - token = aes_encrypt("priEn3UwXfJs3Pmy", gitlab_token) - # token值解密 - # gitlab_token = aes_dicrypt("priEn3UwXfJs3Pmy", token) - @zip_path = Gitlab.endpoint.to_s + "/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=" + token - end + @creator = @project.owner.to_s + gitlab_address = Redmine::Configuration['gitlab_address'] + gitlab_token = Gitlab.private_token + # token值加密解密 + token = aes_encrypt("priEn3UwXfJs3Pmy", gitlab_token) + # token值解密 + # gitlab_token = aes_dicrypt("priEn3UwXfJs3Pmy", token) + @zip_path = Gitlab.endpoint.to_s + "/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=" + token @creator = @project.owner.to_s gitlab_address = Redmine::Configuration['gitlab_address'] diff --git a/app/views/repositories/_latest_commit.html.erb b/app/views/repositories/_latest_commit.html.erb index 204196442..acce15cd8 100644 --- a/app/views/repositories/_latest_commit.html.erb +++ b/app/views/repositories/_latest_commit.html.erb @@ -1,11 +1,11 @@ -
    - <% if @changesets_latest_coimmit %> +<% if @changesets_latest_coimmit && @changesets_latest_coimmit.try(:time) %> +
    <%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.try(:author_email))), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> <%= link_to_user_mail(@changesets_latest_coimmit.try(:author_email), "fb fontGrey3 mr5 fl hidden maxwidth150 ml5") %>
    提交于 <%= time_tag(@changesets_latest_coimmit.try(:time)) %> 前:
    <%= @changesets_latest_coimmit.message %>
    - <% end %> - <% if @entry && @entry.kind == 'file' %> - <%= render :partial => 'link_to_functions' %> - <% end %> -
    \ No newline at end of file + <% if @entry && @entry.kind == 'file' %> + <%= render :partial => 'link_to_functions' %> + <% end %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index d8afa6a4c..bd8d48e9a 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -1,86 +1,70 @@ -<%#= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
    -
    - <% if @entries.nil? %> - <%# 未提交代码提示 %> -
    - <% if @entries.nil? && authorize_for('repositories', 'browse') %> -
    - 该版本库还没有上传代码! -
    - <% end %> - <% if @repository.type.to_s == "Repository::Gitlab" %> - 版本库地址:<%= @repos_url %> - <% else %> - 版本库地址:<%= h @repository.url %> - <% end %> -
    -
    - <% else %> -
      -
    • - <%=link_to "#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)}", - {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, - :rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"}, :class => "linkBlue fb" %> 提交 -
    • -
    • - <%= @repository.branches.count %>分支 -
    • -
    • - <%=link_to "贡献统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, - :creator => @creator, :default_branch => @g_default_branch ) %> -
    • -
    -
    -
    - <%= render :partial => 'navigation' %> -
    - ZIP下载 - <% if User.current.member_of?(@project) && @project.is_public? %> - <% if quality_analysis(User.current.try(:login), @repository.id).nil? %> - <%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fl ml10" %> - <% else %> - <%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fl ml10" %> - <% end %> - <% end %> - <% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %> - <%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fl ml10" %> - <% end %> - -
    - - - -
    -
    - -
    - <%= render :partial => 'latest_commit' %> -
    +
    +
      +
    • + <%=link_to "#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)}", + {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, + :rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"}, :class => "linkBlue fb" %> 提交 +
    • +
    • + <%= @repository.branches.count %>分支 +
    • +
    • + <%=link_to "贡献统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, + :creator => @creator, :default_branch => @g_default_branch ) %> +
    • +
    +
    +
    + <%= render :partial => 'navigation' %> +
    + ZIP下载 + <% if !@entries.blank? && User.current.member_of?(@project) && @project.is_public? %> + <% if quality_analysis(User.current.try(:login), @repository.id).nil? %> + <%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fl ml10" %> + <% else %> + <%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fl ml10" %> + <% end %> + <% end %> + <% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %> + <%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fl ml10" %> <% end %> - <% if !@entries.nil? && authorize_for('repositories', 'browse') %> +
    + + + +
    +
    + +
    + <%= render :partial => 'latest_commit' %> +
    + + <% if !@entries.blank? && authorize_for('repositories', 'browse') %> <%= render :partial => 'dir_list' %> + <% else %> + <%= render :partial => "projects/no_data" %> <% end %> <% memo = Memo.where(:id => 1232).first %> <% unless memo.nil? %> - <%=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2" target="_blank">如何提交代码 + <%=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2" target="_blank">如何提交代码 <% end %> <% unless @entries.blank? %> -
    - 导出统计结果: - <%= link_to "最近一周", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "week" }, :class => "linkBlue2" %> | - <%= link_to "最近一月", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "month" }, :class => "linkBlue2" %> -
    -
    +
    + 导出统计结果: + <%= link_to "最近一周", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "week" }, :class => "linkBlue2" %> | + <%= link_to "最近一月", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "month" }, :class => "linkBlue2" %> +
    +
    <% end %> - <%#= link_to "导出excel", {:controller => 'repositories', :action => 'export_rep_static', :rev => @rev}, :format => 'xls' %> - -
    + <%#= link_to "导出excel", {:controller => 'repositories', :action => 'export_rep_static', :rev => @rev}, :format => 'xls' %> + +
    <%# content_for :header_tags do %> - <%#= stylesheet_link_tag "scm" %> +<%#= stylesheet_link_tag "scm" %> <%# end %> <% html_title(l(:label_repository)) -%> From f41341a3d4b1ad4425d8eabd13d693ba848512b8 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 22 Feb 2017 10:35:33 +0800 Subject: [PATCH 058/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E6=88=90=E5=91=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 10 ++++++++++ app/views/courses/_new_member_list.html.erb | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index d801ecd9e..94affa11d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1237,6 +1237,16 @@ class User < Principal Thread.current[:current_user] ||= User.anonymous end + def user_real_extension + ue = self.user_extensions + if ue.nil? + ue = UserExtensions.new + ue.user_id = self.id + ue.save + end + ue + end + # Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only # one anonymous user per database. def self.anonymous diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index 67973dc65..f059ca4df 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -83,7 +83,7 @@ <%= link_to user.show_name, user_path(user), :class => 'fl sy_class_users_st_name' ,:title => "#{user.show_name}", :target => '_blank' %>
    - <% if @project.is_child_training_project? %> - - <% end %> + <% end %> From 006608dca838301cae9c6e72d3df715c3533a55f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 22 Feb 2017 16:30:16 +0800 Subject: [PATCH 063/118] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 3317f0829..fe00088b5 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -902,8 +902,8 @@ class ProjectsController < ApplicationController # 如果完成则发送下一个任务直到任务结束 # TrainingTask.status 1 成功,2 失败 def training_task_status - status = params[:status].to_i - task_id = params[:task_id] + status = params[:code].to_i + task_id = params[:taskId] stage = params[:stage].to_i @training_task = TrainingTask.find(task_id) original_project_id = Project.find(@training_task.project_id).try(:forked_from_project_id) From fa7b15db4727c5d526e473d310a0aa8ffa1f1f71 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 23 Feb 2017 09:32:13 +0800 Subject: [PATCH 064/118] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=A1=B5=E4=B8=8E=E8=B4=A6=E5=8F=B7=E6=9C=AA?= =?UTF-8?q?=E6=BF=80=E6=B4=BB=E6=8F=90=E7=A4=BA=E9=A1=B5=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E2=80=98=E6=9B=B4=E6=8D=A2=E9=82=AE=E7=AE=B1=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 8 +++ app/views/account/_change_user_email.html.erb | 72 +++++++++++++++++++ app/views/account/email_activation.html.erb | 16 +++-- app/views/account/email_valid.html.erb | 19 +++-- config/locales/commons/zh.yml | 1 + config/routes.rb | 1 + public/stylesheets/css/common.css | 13 ++++ 7 files changed, 118 insertions(+), 12 deletions(-) create mode 100644 app/views/account/_change_user_email.html.erb diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 9d8a5ecc5..4c7d578ba 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -279,6 +279,14 @@ class AccountController < ApplicationController render :json => result end + def change_email + user = User.find params[:user_id].to_i + user.update_attributes(:mail => params[:value]) + result = {:email => user.mail} + + render :json => result + end + def email_activation diff --git a/app/views/account/_change_user_email.html.erb b/app/views/account/_change_user_email.html.erb new file mode 100644 index 000000000..20eae1374 --- /dev/null +++ b/app/views/account/_change_user_email.html.erb @@ -0,0 +1,72 @@ +
    +
    +

    更换邮箱

    + +
    +
    +
    +
      + +
    • +
    • +  原邮箱  :  + <%= user.mail %> +
    • +
      +
    • +  新邮箱  :  + + +
    • + +
      +
    • + + 取  消 + 确  定 +
      +
    • +
    +
    +
    + \ No newline at end of file diff --git a/app/views/account/email_activation.html.erb b/app/views/account/email_activation.html.erb index d02715e43..1b1acbaeb 100644 --- a/app/views/account/email_activation.html.erb +++ b/app/views/account/email_activation.html.erb @@ -1,15 +1,17 @@
    +<% end %> + diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index 07363a0a5..3f758c599 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -40,6 +40,8 @@ <% when "Issue" %> <%= render :partial => 'projects/act_issues', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %> + <% when "TrainingTask" %> + <%= render :partial => 'projects/act_training_tasks', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %> <% when "Message" %> <%= render :partial => 'projects/act_messages', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :is_course => 1, :is_board => 0} %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 24b982b77..5ad7c3f5f 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -24,6 +24,7 @@
  • <%= link_to "资源库动态", {:controller => "projects", :action => "show", :type => "attachment"}, :class => "homepagePostTypeResource resourcesGrey" %>
  • <%= link_to "讨论区动态", {:controller => "projects", :action => "show", :type => "message"}, :class => "homepagePostTypeForum postTypeGrey" %>
  • +
  • <%= link_to "讨论区动态", {:controller => "projects", :action => "show", :type => "training_task"}, :class => "homepagePostTypeForum postTypeGrey" %>
  • diff --git a/app/views/training_tasks/_content_list.html.erb b/app/views/training_tasks/_content_list.html.erb index b304a35e8..37940eacc 100644 --- a/app/views/training_tasks/_content_list.html.erb +++ b/app/views/training_tasks/_content_list.html.erb @@ -12,7 +12,9 @@ step<%= activity.position %> <%= activity.subject.to_s %> - <% if activity.status == 0 %> + <% if activity.status == 1 %> + 已解决 + <% else %> 正在解决中 <% end %>
    From 8bd9fc81d67fd86f01e6550dd7afe15553daa95d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 23 Feb 2017 10:09:56 +0800 Subject: [PATCH 066/118] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E6=9C=AA=E6=BF=80?= =?UTF-8?q?=E6=B4=BB=E6=8F=90=E7=A4=BA=E9=A1=B5=E6=8F=90=E4=BA=A4=E7=95=99?= =?UTF-8?q?=E8=A8=80=E6=9C=BA=E5=88=B6=E4=BF=AE=E6=94=B9=EF=BC=88=E4=BB=8E?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=88=B0=E7=AE=A1=E7=90=86=E5=91=98=E7=95=99?= =?UTF-8?q?=E8=A8=80=E6=94=B9=E5=88=B0=E8=B4=B4=E5=90=A7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/email_activation.html.erb | 35 ++++++++++++++++++--- public/stylesheets/css/common.css | 17 +++++++++- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/app/views/account/email_activation.html.erb b/app/views/account/email_activation.html.erb index 1b1acbaeb..253867447 100644 --- a/app/views/account/email_activation.html.erb +++ b/app/views/account/email_activation.html.erb @@ -3,17 +3,20 @@ <%#= link_to l(:label_mail_resend), { :controller => 'account', :action => 'resendmail',:user => @user}, :class=>"email_verify_btn mt30 ml30", :remote => true, :method => 'get' %> -
    @@ -61,4 +64,26 @@ } }); } + function regex_mv_name() + { + var name = $.trim($("#subject").val()); + if(name.length == 0) + { + $("#mail_valid_feedback_tip").show(); + return false; + } + else + { + $("#mail_valid_feedback_tip").hide(); + return true; + } + } + + function f_submit() + { + if(regex_mv_name()){ + $("#new_memo").submit(); + } + } + diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 8e9af19f4..7a2e369af 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -437,4 +437,19 @@ input.radio-width90{ width: 90px; } #muban_popup_box label.pop_box_label_l {width: 100px; text-align: left; display: inline-block;} .sy_popup_con{ margin:30px auto 0;font-size:14px; width:330px;} .sy_popup_add li{ line-height:40px;} -.sy_popup_add label{ display:block; float:left; width:85px; text-align:right; line-height:40px;} \ No newline at end of file +.sy_popup_add label{ display:block; float:left; width:85px; text-align:right; line-height:40px;} +.email_prompt_mes{ border:1px solid #ccc; border-radius:5px; width:468px; height:60px; background:#fff;padding:5px; margin-bottom: 5px;} +a.btn{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 30px;line-height: 30px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } +a:hover.btn{background: #c3c3c3; color: #333;} +a.btn-green{background: #60b25e; color: #fff;} +a:hover.btn-green{background: #51a74f; color: #fff;} +a.btn-blue{background: #3b94d6; color: #fff;} +a:hover.btn-blue{background: #2788d0; color: #fff;} +.sy_popup_top{ background:#3b94d6; height:40px; -webkit-border-radius: 5px 5px 0px 0px; -moz-border-radius: 5px 5px 0px 0px; -o-border-radius: 5px 5px 0px 0px; border-radius: 5px 5px 0px 0px;} +.sy_popup_top h3{ font-size:18px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px;} +.sy_popup_top_tishi{ background:#ededed; } +.sy_popup_top_tishi h3{color:#616161; font-size:16px;} +.sy_popup_con02{ margin:30px auto 0; font-size:14px; text-align:center; width:360px;} +.sy_popup_con02 ul li p{ margin-bottom:15px; text-align:center; font-size:14px; color:#616161;} +.sy_popup_con02 a{ margin:0 auto;} +#sy_popup_box{ width:460px; background:#fff; padding-bottom:30px; border-radius:5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);} \ No newline at end of file From e1be2fda813e6ca506391bf461ae0345c0935136 Mon Sep 17 00:00:00 2001 From: Linda <2294690300@qq.com> Date: Thu, 23 Feb 2017 10:25:55 +0800 Subject: [PATCH 067/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=84=E6=98=BE=E7=A4=BA=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=A2=9E=E5=8A=A0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/_act_training_tasks.html.erb | 5 + db/schema.rb | 5306 ++++++++--------- public/stylesheets/css/common.css | 16 +- public/stylesheets/css/project.css | 2 + 4 files changed, 2648 insertions(+), 2681 deletions(-) diff --git a/app/views/projects/_act_training_tasks.html.erb b/app/views/projects/_act_training_tasks.html.erb index f60ac213b..738f4c9da 100644 --- a/app/views/projects/_act_training_tasks.html.erb +++ b/app/views/projects/_act_training_tasks.html.erb @@ -54,6 +54,11 @@
    <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> + + 提交测评。 + 当前任务正在后台测评中,稍后将显示您的任务完成情况...... + 本任务已通过测评,处于关闭状态。 +
    diff --git a/db/schema.rb b/db/schema.rb index 17dd60485..f8771be44 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,2673 +1,2633 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20170219025424) do - - create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false - t.integer "activity_container_id" - t.string "activity_container_type", :default => "" - t.datetime "created_at" - end - - add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" - add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" - add_index "activities", ["user_id"], :name => "index_activities_on_user_id" - - create_table "activity_notifies", :force => true do |t| - t.integer "activity_container_id" - t.string "activity_container_type" - t.integer "activity_id" - t.string "activity_type" - t.integer "notify_to" - t.datetime "created_on" - t.integer "is_read" - end - - add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" - add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" - add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" - - create_table "api_keys", :force => true do |t| - t.string "access_token" - t.datetime "expires_at" - t.integer "user_id" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" - add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - - create_table "applied_contests", :force => true do |t| - t.integer "contest_id" - t.integer "user_id" - t.string "role" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" - add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" - - create_table "applied_messages", :force => true do |t| - t.integer "user_id" - t.integer "applied_id" - t.string "applied_type" - t.integer "viewed", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "name" - t.integer "applied_user_id" - t.integer "role" - t.integer "project_id" - end - - create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "role", :default => 0 - end - - create_table "apply_add_schools", :force => true do |t| - t.string "name" - t.string "province" - t.string "city" - t.string "address" - t.string "remarks" - t.integer "school_id" - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - create_table "apply_homeworks", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" - add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" - - create_table "apply_project_masters", :force => true do |t| - t.integer "user_id" - t.string "apply_type" - t.integer "apply_id" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "apply_resources", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "attachment_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id" - t.string "container_type" - t.text "content" - t.integer "apply_user_id" - end - - create_table "article_homepages", :force => true do |t| - t.string "title" - t.text "content" - t.integer "user_id" - t.integer "homepage_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" - add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" - - create_table "at_messages", :force => true do |t| - t.integer "user_id" - t.integer "at_message_id" - t.string "at_message_type" - t.boolean "viewed", :default => false - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sender_id" - end - - add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" - - create_table "attachment_histories", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.string "filename", :default => "" - t.string "disk_filename", :default => "" - t.integer "filesize", :default => 0 - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "" - t.integer "downloads", :default => 0 - t.integer "author_id" - t.datetime "created_on" - t.text "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.integer "copy_from" - t.integer "quotes" - t.integer "version" - t.integer "attachment_id" - t.integer "is_publish", :default => 1 - t.date "publish_time" - end - - create_table "attachments", :force => true do |t| - t.integer "container_id" - t.string "container_type", :limit => 30 - t.string "filename", :default => "", :null => false - t.string "disk_filename", :default => "", :null => false - t.integer "filesize", :default => 0, :null => false - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "", :null => false - t.integer "downloads", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.text "description" - t.string "disk_directory" - t.integer "attachtype", :default => 1 - t.integer "is_public", :default => 1 - t.integer "copy_from" - t.integer "quotes" - t.integer "is_publish", :default => 1 - t.datetime "publish_time" - end - - add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" - add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" - add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" - - create_table "attachmentstypes", :force => true do |t| - t.integer "typeId", :null => false - t.string "typeName", :limit => 50 - end - - create_table "auth_sources", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 60, :default => "", :null => false - t.string "host", :limit => 60 - t.integer "port" - t.string "account" - t.string "account_password", :default => "" - t.string "base_dn" - t.string "attr_login", :limit => 30 - t.string "attr_firstname", :limit => 30 - t.string "attr_lastname", :limit => 30 - t.string "attr_mail", :limit => 30 - t.boolean "onthefly_register", :default => false, :null => false - t.boolean "tls", :default => false, :null => false - t.string "filter" - t.integer "timeout" - end - - add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" - - create_table "biding_projects", :force => true do |t| - t.integer "project_id" - t.integer "bid_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "bids", :force => true do |t| - t.string "name" - t.string "budget", :null => false - t.integer "author_id" - t.date "deadline" - t.text "description" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "commit" - t.integer "reward_type" - t.integer "homework_type" - t.integer "parent_id" - t.string "password" - t.integer "is_evaluation" - t.integer "proportion", :default => 60 - t.integer "comment_status", :default => 0 - t.integer "evaluation_num", :default => 3 - t.integer "open_anonymous_evaluation", :default => 1 - end - - create_table "blog_comments", :force => true do |t| - t.integer "blog_id", :null => false - t.integer "parent_id" - t.string "title", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comment_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "root_id" - end - - add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" - - create_table "blog_messages", :force => true do |t| - t.integer "user_id" - t.integer "blog_message_id" - t.integer "blog_id" - t.string "blog_message_type" - t.boolean "viewed", :default => false - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_operator_id" - end - - create_table "blogs", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.integer "position", :default => 1 - t.integer "article_count", :default => 0, :null => false - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comments_id" - t.integer "parent_id" - t.integer "author_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "homepage_id" - end - - create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false - t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false - t.integer "last_message_id" - t.integer "parent_id" - t.integer "course_id" - t.integer "org_subfield_id" - t.integer "contest_id" - t.integer "training_project_id" - end - - add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" - add_index "boards", ["project_id"], :name => "boards_project_id" - - create_table "bug_to_osps", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "changes", :force => true do |t| - t.integer "changeset_id", :null => false - t.string "action", :limit => 1, :default => "", :null => false - t.text "path", :null => false - t.text "from_path" - t.string "from_revision" - t.string "revision" - t.string "branch" - end - - add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" - - create_table "changeset_parents", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "parent_id", :null => false - end - - add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" - add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" - - create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false - t.string "committer" - t.datetime "committed_on", :null => false - t.text "comments" - t.date "commit_date" - t.string "scmid" - t.integer "user_id" - t.integer "project_id" - t.integer "type", :default => 0 - end - - add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" - add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true - add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" - add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" - add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" - - create_table "changesets_issues", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "issue_id", :null => false - end - - add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - - create_table "code_tests", :force => true do |t| - t.integer "homework_id" - t.integer "wait_time", :default => 0 - t.integer "language" - t.integer "status" - t.integer "time_used", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "student_work_id", :default => 0 - end - - create_table "comments", :force => true do |t| - t.string "commented_type", :limit => 30, :default => "", :null => false - t.integer "commented_id", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.text "comments" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "comments", ["author_id"], :name => "index_comments_on_author_id" - add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" - - create_table "commit_issues", :force => true do |t| - t.string "commit_id" - t.integer "issue_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "commits", :force => true do |t| - t.integer "repository_id" - t.string "version" - t.string "committer" - t.text "comments" - t.datetime "committed_on" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contest_activities", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_act_id" - t.string "contest_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" - add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" - - create_table "contest_member_roles", :force => true do |t| - t.integer "contest_member_id" - t.integer "role_id" - t.boolean "is_current", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" - add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" - - create_table "contest_members", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.boolean "is_collect", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" - add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" - - create_table "contest_messages", :force => true do |t| - t.integer "user_id" - t.integer "contest_id" - t.integer "contest_message_id" - t.string "contest_message_type" - t.boolean "viewed", :default => false - t.text "content" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" - add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" - - create_table "contestant_for_contests", :force => true do |t| - t.integer "student_id" - t.integer "contest_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" - add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" - - create_table "contestant_work_evaluation_distributions", :force => true do |t| - t.integer "user_id" - t.integer "contestant_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" - - create_table "contestant_work_projects", :force => true do |t| - t.integer "contest_id" - t.integer "work_id" - t.integer "contestant_work_id" - t.integer "project_id" - t.integer "user_id" - t.boolean "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" - add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" - add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" - add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" - - create_table "contestant_work_scores", :force => true do |t| - t.integer "contestant_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" - add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" - - create_table "contestant_works", :force => true do |t| - t.string "name" - t.text "description" - t.integer "work_id" - t.integer "user_id" - t.float "work_score" - t.integer "project_id" - t.integer "work_status" - t.datetime "commit_time" - t.boolean "is_delete", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "judge_score" - end - - add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" - add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" - add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" - - create_table "contests", :force => true do |t| - t.integer "user_id" - t.string "name" - t.text "description" - t.boolean "is_public" - t.boolean "is_delete", :default => false - t.integer "visits", :default => 0 - t.string "invite_code" - t.integer "invite_code_halt", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_activities", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_act_id" - t.string "course_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" - - create_table "course_attachments", :force => true do |t| - t.string "filename" - t.string "disk_filename" - t.integer "filesize" - t.string "content_type" - t.string "digest" - t.integer "downloads" - t.string "author_id" - t.string "integer" - t.string "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id", :default => 0 - end - - create_table "course_contributor_scores", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.integer "message_num", :default => 0 - t.integer "message_reply_num", :default => 0 - t.integer "news_reply_num", :default => 0 - t.integer "resource_num", :default => 0 - t.integer "journal_num", :default => 0 - t.integer "journal_reply_num", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "total_score", :default => 0 - t.integer "homework_journal_num", :default => 0 - t.integer "news_num", :default => 0 - end - - add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" - - create_table "course_groups", :force => true do |t| - t.string "name" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" - - create_table "course_homework_statistics", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "committed_work_num", :default => 0 - t.integer "un_commit_work_num", :default => 0 - t.integer "late_commit_work_num", :default => 0 - t.integer "absence_evaluation_work_num", :default => 0 - t.integer "un_evaluation_work_num", :default => 0 - t.integer "appeal_num", :default => 0 - t.float "average_score", :default => 0.0 - t.float "total_score", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_infos", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_messages", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_message_id" - t.string "course_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "content" - t.integer "status" - t.integer "apply_user_id" - t.integer "apply_result" - end - - add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" - add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" - - create_table "course_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "course_id" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "courses", :force => true do |t| - t.integer "tea_id" - t.string "name" - t.integer "state" - t.string "code" - t.integer "time" - t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "location" - t.string "term" - t.string "string" - t.string "password" - t.string "setup_time" - t.string "endup_time" - t.string "class_period" - t.integer "school_id" - t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 - t.integer "lft" - t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 - t.integer "end_time" - t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 - t.integer "syllabus_id" - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.integer "professional_level_id", :limit => 1 - t.integer "invite_code_halt", :limit => 1, :default => 0 - t.integer "os_allow", :default => 0 - end - - add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true - add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" - - create_table "custom_fields", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.string "field_format", :limit => 30, :default => "", :null => false - t.text "possible_values" - t.string "regexp", :default => "" - t.integer "min_length", :default => 0, :null => false - t.integer "max_length", :default => 0, :null => false - t.boolean "is_required", :default => false, :null => false - t.boolean "is_for_all", :default => false, :null => false - t.boolean "is_filter", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "searchable", :default => false - t.text "default_value" - t.boolean "editable", :default => true - t.boolean "visible", :default => true, :null => false - t.boolean "multiple", :default => false - end - - add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" - - create_table "custom_fields_projects", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "project_id", :default => 0, :null => false - end - - add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true - - create_table "custom_fields_trackers", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true - - create_table "custom_values", :force => true do |t| - t.string "customized_type", :limit => 30, :default => "", :null => false - t.integer "customized_id", :default => 0, :null => false - t.integer "custom_field_id", :default => 0, :null => false - t.text "value" - end - - add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" - add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - - create_table "data_exceptions", :force => true do |t| - t.string "message" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "delayed_jobs", :force => true do |t| - t.integer "priority", :default => 0, :null => false - t.integer "attempts", :default => 0, :null => false - t.text "handler", :null => false - t.text "last_error" - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" - t.string "locked_by" - t.string "queue" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - - create_table "disciplines", :force => true do |t| - t.string "name" - t.integer "professional_level_id", :limit => 1 - end - - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "documents", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "category_id", :default => 0, :null => false - t.string "title", :limit => 60, :default => "", :null => false - t.text "description" - t.datetime "created_on" - t.integer "user_id", :default => 0 - t.integer "is_public", :default => 1 - end - - add_index "documents", ["category_id"], :name => "index_documents_on_category_id" - add_index "documents", ["created_on"], :name => "index_documents_on_created_on" - add_index "documents", ["project_id"], :name => "documents_project_id" - - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 - t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false - end - - create_table "editor_of_documents", :force => true do |t| - t.integer "editor_id" - t.integer "org_document_comment_id" - t.datetime "created_at" - end - - create_table "enabled_modules", :force => true do |t| - t.integer "project_id" - t.string "name", :null => false - t.integer "course_id" - end - - add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" - - create_table "enumerations", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "is_default", :default => false, :null => false - t.string "type" - t.boolean "active", :default => true, :null => false - t.integer "project_id" - t.integer "parent_id" - t.string "position_name", :limit => 30 - end - - add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" - add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - - create_table "exercise_answers", :force => true do |t| - t.integer "user_id" - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_choices", :force => true do |t| - t.integer "exercise_question_id" - t.text "choice_text" - t.integer "choice_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_questions", :force => true do |t| - t.text "question_title" - t.integer "question_type" - t.integer "question_number" - t.integer "exercise_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_score" - end - - create_table "exercise_standard_answers", :force => true do |t| - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_users", :force => true do |t| - t.integer "user_id" - t.integer "exercise_id" - t.integer "score" - t.datetime "start_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "end_at" - t.integer "status" - t.integer "commit_status", :default => 0 - end - - create_table "exercises", :force => true do |t| - t.text "exercise_name" - t.text "exercise_description" - t.integer "course_id" - t.integer "exercise_status" - t.integer "user_id" - t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "publish_time" - t.datetime "end_time" - t.integer "show_result" - end - - create_table "first_pages", :force => true do |t| - t.string "web_title" - t.string "title" - t.text "description" - t.string "page_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sort_type" - t.integer "image_width", :default => 107 - t.integer "image_height", :default => 63 - t.integer "show_course", :default => 1 - t.integer "show_contest", :default => 1 - end - - create_table "forge_activities", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_act_id" - t.string "forge_act_type" - t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "training_project_id" - end - - add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" - add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" - - create_table "forge_messages", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_message_id" - t.string "forge_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "secret_key" - t.integer "status" - t.integer "operate_user_id" - end - - add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" - add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" - - create_table "forums", :force => true do |t| - t.string "name", :null => false - t.text "description" - t.integer "topic_count", :default => 0 - t.integer "memo_count", :default => 0 - t.integer "last_memo_id", :default => 0 - t.integer "creator_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sticky" - t.integer "locked" - end - - create_table "forwards", :force => true do |t| - t.integer "from_id" - t.string "from_type" - t.integer "to_id" - t.string "to_type" - t.datetime "created_at" - end - - create_table "groups_users", :id => false, :force => true do |t| - t.integer "group_id", :null => false - t.integer "user_id", :null => false - end - - add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - - create_table "homepages", :force => true do |t| - t.string "name" - t.integer "article_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" - - create_table "homework_attaches", :force => true do |t| - t.integer "bid_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - t.string "name" - t.text "description" - t.integer "state" - t.integer "project_id", :default => 0 - t.float "score", :default => 0.0 - t.integer "is_teacher_score", :default => 0 - end - - add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" - - create_table "homework_commons", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "homework_type", :default => 1 - t.string "late_penalty" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 - t.integer "anonymous_comment", :default => 0 - t.integer "quotes", :default => 0 - t.integer "is_open", :default => 0 - t.datetime "simi_time" - t.integer "score_open", :default => 1 - t.integer "anonymous_appeal", :default => 0 - end - - add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" - - create_table "homework_detail_groups", :force => true do |t| - t.integer "homework_common_id" - t.integer "min_num" - t.integer "max_num" - t.integer "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" - - create_table "homework_detail_manuals", :force => true do |t| - t.float "ta_proportion" - t.integer "comment_status" - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "absence_penalty", :default => 1 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "no_anon_penalty", :default => 1 - t.integer "appeal_penalty", :default => 0 - t.integer "ta_mode", :default => 1 - end - - create_table "homework_detail_programings", :force => true do |t| - t.string "language" - t.text "standard_code", :limit => 2147483647 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "ta_proportion", :default => 0.1 - t.integer "question_id" - end - - create_table "homework_evaluations", :force => true do |t| - t.string "user_id" - t.string "homework_attach_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "homework_for_courses", :force => true do |t| - t.integer "course_id" - t.integer "bid_id" - end - - add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" - add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" - - create_table "homework_tests", :force => true do |t| - t.text "input" - t.text "output" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "result" - t.text "error_msg" - end - - create_table "homework_users", :force => true do |t| - t.string "homework_attach_id" - t.string "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "innodb_monitor", :id => false, :force => true do |t| - t.integer "a" - end - - create_table "invite_lists", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "mail" - end - - create_table "issue_categories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.integer "assigned_to_id" - end - - add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" - add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" - - create_table "issue_relations", :force => true do |t| - t.integer "issue_from_id", :null => false - t.integer "issue_to_id", :null => false - t.string "relation_type", :default => "", :null => false - t.integer "delay" - end - - add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true - add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" - add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" - - create_table "issue_statuses", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_closed", :default => false, :null => false - t.boolean "is_default", :default => false, :null => false - t.integer "position", :default => 1 - t.integer "default_done_ratio" - end - - add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" - add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" - add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" - - create_table "issues", :force => true do |t| - t.integer "tracker_id", :null => false - t.integer "project_id", :null => false - t.string "subject", :default => "", :null => false - t.text "description" - t.date "due_date" - t.integer "category_id" - t.integer "status_id", :null => false - t.integer "assigned_to_id" - t.integer "priority_id", :null => false - t.integer "fixed_version_id" - t.integer "author_id", :null => false - t.integer "lock_version", :default => 0, :null => false - t.datetime "created_on" - t.datetime "updated_on" - t.date "start_date" - t.integer "done_ratio", :default => 0, :null => false - t.float "estimated_hours" - t.integer "parent_id" - t.integer "root_id" - t.integer "lft" - t.integer "rgt" - t.boolean "is_private", :default => false, :null => false - t.datetime "closed_on" - t.integer "project_issues_index" - end - - add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" - add_index "issues", ["author_id"], :name => "index_issues_on_author_id" - add_index "issues", ["category_id"], :name => "index_issues_on_category_id" - add_index "issues", ["created_on"], :name => "index_issues_on_created_on" - add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" - add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" - add_index "issues", ["project_id"], :name => "issues_project_id" - add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" - add_index "issues", ["status_id"], :name => "index_issues_on_status_id" - add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" - - create_table "join_in_competitions", :force => true do |t| - t.integer "user_id" - t.integer "competition_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "join_in_contests", :force => true do |t| - t.integer "user_id" - t.integer "bid_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "journal_details", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - - create_table "journal_replies", :id => false, :force => true do |t| - t.integer "journal_id" - t.integer "user_id" - t.integer "reply_id" - end - - add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" - add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" - add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" - - create_table "journals", :force => true do |t| - t.integer "journalized_id", :default => 0, :null => false - t.string "journalized_type", :limit => 30, :default => "", :null => false - t.integer "user_id", :default => 0, :null => false - t.text "notes" - t.datetime "created_on", :null => false - t.boolean "private_notes", :default => false, :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "journals", ["created_on"], :name => "index_journals_on_created_on" - add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" - add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" - add_index "journals", ["user_id"], :name => "index_journals_on_user_id" - - create_table "journals_for_messages", :force => true do |t| - t.integer "jour_id" - t.string "jour_type" - t.integer "user_id" - t.text "notes" - t.integer "status" - t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.string "m_parent_id" - t.boolean "is_readed" - t.integer "m_reply_count" - t.integer "m_reply_id" - t.integer "is_comprehensive_evaluation" - t.integer "private", :default => 0 - t.integer "root_id" - end - - add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" - - create_table "kindeditor_assets", :force => true do |t| - t.string "asset" - t.integer "file_size" - t.string "file_type" - t.integer "owner_id" - t.string "asset_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "owner_type", :default => 0 - end - - create_table "member_roles", :force => true do |t| - t.integer "member_id", :null => false - t.integer "role_id", :null => false - t.integer "inherited_from" - t.integer "is_current", :default => 1 - end - - add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" - add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" - - create_table "members", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "project_id", :default => 0 - t.datetime "created_on" - t.boolean "mail_notification", :default => false, :null => false - t.integer "course_id", :default => -1 - t.integer "course_group_id", :default => 0 - t.integer "is_collect", :default => 1 - end - - add_index "members", ["course_id"], :name => "index_members_on_course_id" - add_index "members", ["project_id"], :name => "index_members_on_project_id" - add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true - add_index "members", ["user_id"], :name => "index_members_on_user_id" - - create_table "memo_messages", :force => true do |t| - t.integer "user_id" - t.integer "forum_id" - t.integer "memo_id" - t.string "memo_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" - add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" - - create_table "memos", :force => true do |t| - t.integer "forum_id", :null => false - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false - t.integer "author_id", :null => false - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count", :default => 0 - t.integer "root_id" - end - - add_index "memos", ["root_id"], :name => "index_memos_on_root_id" - - create_table "message_alls", :force => true do |t| - t.integer "user_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" - add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" - - create_table "messages", :force => true do |t| - t.integer "board_id", :null => false - t.integer "parent_id" - t.string "subject", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "replies_count", :default => 0, :null => false - t.integer "last_reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.integer "quotes" - t.integer "status", :default => 0 - t.integer "root_id" - end - - add_index "messages", ["author_id"], :name => "index_messages_on_author_id" - add_index "messages", ["board_id"], :name => "messages_board_id" - add_index "messages", ["created_on"], :name => "index_messages_on_created_on" - add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" - add_index "messages", ["parent_id"], :name => "messages_parent_id" - add_index "messages", ["root_id"], :name => "index_messages_on_root_id" - - create_table "news", :force => true do |t| - t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" - t.text "description" - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false - t.integer "course_id" - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "contest_id" - end - - add_index "news", ["author_id"], :name => "index_news_on_author_id" - add_index "news", ["created_on"], :name => "index_news_on_created_on" - add_index "news", ["project_id"], :name => "news_project_id" - - create_table "no_uses", :force => true do |t| - t.integer "user_id", :null => false - t.string "no_use_type" - t.integer "no_use_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "notificationcomments", :force => true do |t| - t.string "notificationcommented_type" - t.integer "notificationcommented_id" - t.integer "author_id" - t.text "notificationcomments" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "onclick_times", :force => true do |t| - t.integer "user_id" - t.datetime "onclick_time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "open_id_authentication_associations", :force => true do |t| - t.integer "issued" - t.integer "lifetime" - t.string "handle" - t.string "assoc_type" - t.binary "server_url" - t.binary "secret" - end - - create_table "open_id_authentication_nonces", :force => true do |t| - t.integer "timestamp", :null => false - t.string "server_url" - t.string "salt", :null => false - end - - create_table "open_source_projects", :force => true do |t| - t.string "name" - t.text "description" - t.integer "commit_count", :default => 0 - t.integer "code_line", :default => 0 - t.integer "users_count", :default => 0 - t.date "last_commit_time" - t.string "url" - t.date "date_collected" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "option_numbers", :force => true do |t| - t.integer "user_id" - t.integer "memo" - t.integer "messages_for_issues" - t.integer "issues_status" - t.integer "replay_for_message" - t.integer "replay_for_memo" - t.integer "follow" - t.integer "tread" - t.integer "praise_by_one" - t.integer "praise_by_two" - t.integer "praise_by_three" - t.integer "tread_by_one" - t.integer "tread_by_two" - t.integer "tread_by_three" - t.integer "changeset" - t.integer "document" - t.integer "attachment" - t.integer "issue_done_ratio" - t.integer "post_issue" - t.integer "score_type" - t.integer "total_score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - end - - create_table "org_activities", :force => true do |t| - t.integer "user_id" - t.integer "org_act_id" - t.string "org_act_type" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_courses", :force => true do |t| - t.integer "organization_id" - t.integer "course_id" - t.datetime "created_at" - end - - create_table "org_document_comments", :force => true do |t| - t.text "title" - t.text "content" - t.integer "organization_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "status", :default => 0 - t.integer "root_id" - end - - add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" - - create_table "org_member_roles", :force => true do |t| - t.integer "org_member_id" - t.integer "role_id" - end - - create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_messages", :force => true do |t| - t.integer "user_id" - t.integer "sender_id" - t.integer "organization_id" - t.string "message_type" - t.integer "message_id" - t.integer "viewed" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - end - - create_table "org_projects", :force => true do |t| - t.integer "organization_id" - t.integer "project_id" - t.datetime "created_at" - end - - create_table "org_subfield_messages", :force => true do |t| - t.integer "org_subfield_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_subfields", :force => true do |t| - t.integer "organization_id" - t.integer "priority" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 1 - end - - create_table "organizations", :force => true do |t| - t.string "name" - t.text "description" - t.integer "creator_id" - t.integer "home_id" - t.boolean "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "allow_guest_download", :default => true - t.integer "visits", :default => 0 - t.integer "show_mode", :default => 0 - t.integer "allow_teacher", :default => 0 - end - - create_table "phone_app_versions", :force => true do |t| - t.string "version" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_answers", :force => true do |t| - t.integer "poll_question_id" - t.text "answer_text" - t.integer "answer_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_questions", :force => true do |t| - t.string "question_title" - t.integer "question_type" - t.integer "is_necessary" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_number" - t.integer "max_choices", :default => 0 - t.integer "min_choices", :default => 0 - end - - create_table "poll_users", :force => true do |t| - t.integer "user_id" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_votes", :force => true do |t| - t.integer "user_id" - t.integer "poll_question_id" - t.integer "poll_answer_id" - t.text "vote_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "polls", :force => true do |t| - t.string "polls_name" - t.string "polls_type" - t.integer "polls_group_id" - t.integer "polls_status" - t.integer "user_id" - t.datetime "published_at" - t.datetime "closed_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "polls_description" - t.integer "show_result", :default => 1 - end - - create_table "praise_tread_caches", :force => true do |t| - t.integer "object_id", :null => false - t.string "object_type" - t.integer "praise_num" - t.integer "tread_num" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "praise_treads", :force => true do |t| - t.integer "user_id", :null => false - t.integer "praise_tread_object_id" - t.string "praise_tread_object_type" - t.integer "praise_or_tread" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "principal_activities", :force => true do |t| - t.integer "user_id" - t.integer "principal_id" - t.integer "principal_act_id" - t.string "principal_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "professional_levels", :force => true do |t| - t.integer "level" - end - - create_table "professions", :force => true do |t| - t.string "name" - t.integer "discipline_id", :limit => 1 - end - - create_table "project_infos", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_scores", :force => true do |t| - t.string "project_id" - t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 - t.datetime "commit_time" - t.integer "pull_request_num", :default => 0 - t.integer "training_project_id", :default => -1 - end - - create_table "project_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "project_id" - t.integer "project_type" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - end - - add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" - - create_table "projecting_softapplictions", :force => true do |t| - t.integer "user_id" - t.integer "softapplication_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "identifier" - t.integer "status", :default => 1, :null => false - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "boards_count", :default => 0 - t.integer "news_count", :default => 0 - t.integer "acts_count", :default => 0 - t.integer "journals_count", :default => 0 - t.integer "boards_reply_count", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.text "script" - end - - add_index "projects", ["lft"], :name => "index_projects_on_lft" - add_index "projects", ["rgt"], :name => "index_projects_on_rgt" - - create_table "projects_trackers", :id => false, :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true - add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - - create_table "pull_requests", :force => true do |t| - t.integer "pull_request_id" - t.integer "gpid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - t.integer "project_id" - t.string "title" - end - - create_table "quality_analyses", :force => true do |t| - t.integer "project_id" - t.string "author_login" - t.string "rep_identifier" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sonar_version", :default => 0 - t.string "path" - t.string "branch" - t.string "language" - t.string "sonar_name" - end - - create_table "queries", :force => true do |t| - t.integer "project_id" - t.string "name", :default => "", :null => false - t.text "filters" - t.integer "user_id", :default => 0, :null => false - t.boolean "is_public", :default => false, :null => false - t.text "column_names" - t.text "sort_criteria" - t.string "group_by" - t.string "type" - end - - add_index "queries", ["project_id"], :name => "index_queries_on_project_id" - add_index "queries", ["user_id"], :name => "index_queries_on_user_id" - - create_table "relative_memo_to_open_source_projects", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "relative_memos", :force => true do |t| - t.integer "osp_id" - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false - t.integer "author_id" - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 - t.string "url" - t.string "username" - t.string "userhomeurl" - t.date "date_collected" - t.string "topic_resource" - end - - create_table "rep_statics", :force => true do |t| - t.integer "project_id" - t.integer "commits_num" - t.string "uname" - t.string "email" - t.integer "add" - t.integer "del" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "changeset" - end - - create_table "repositories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "url", :default => "", :null => false - t.string "login", :limit => 60, :default => "" - t.string "password", :default => "" - t.string "root_url", :default => "" - t.string "type" - t.string "path_encoding", :limit => 64 - t.string "log_encoding", :limit => 64 - t.text "extra_info" - t.string "identifier" - t.boolean "is_default", :default => false - t.boolean "hidden", :default => false - end - - add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - - create_table "roles", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "assignable", :default => true - t.integer "builtin", :default => 0, :null => false - t.text "permissions" - t.string "issues_visibility", :limit => 30, :default => "default", :null => false - end - - create_table "schools", :force => true do |t| - t.string "name" - t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "logo_link" - t.string "pinyin" - t.integer "school_type", :default => 0 - end - - create_table "secdomains", :force => true do |t| - t.integer "sub_type" - t.string "subname" - t.integer "pid", :default => 0 - t.string "desc" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_cached_ratings", :force => true do |t| - t.integer "cacheable_id", :limit => 8 - t.string "cacheable_type" - t.float "avg", :null => false - t.integer "cnt", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_rates", :force => true do |t| - t.integer "rater_id", :limit => 8 - t.integer "rateable_id" - t.string "rateable_type" - t.float "stars", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "is_teacher_score", :default => 0 - end - - create_table "settings", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "value" - t.datetime "updated_on" - end - - add_index "settings", ["name"], :name => "index_settings_on_name" - - create_table "shares", :force => true do |t| - t.date "created_on" - t.string "url" - t.string "title" - t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - t.integer "user_id" - t.string "description" - end - - create_table "shield_activities", :force => true do |t| - t.string "container_type" - t.integer "container_id" - t.string "shield_type" - t.integer "shield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "shield_wechat_messages", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.integer "shield_id" - t.string "shield_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "softapplications", :force => true do |t| - t.string "name" - t.text "description" - t.integer "app_type_id" - t.string "app_type_name" - t.string "android_min_version_available" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "contest_id" - t.integer "softapplication_id" - t.integer "is_public" - t.string "application_developers" - t.string "deposit_project_url" - t.string "deposit_project" - t.integer "project_id" - end - - create_table "sonar_errors", :force => true do |t| - t.integer "project_id" - t.string "jenkins_job_name" - t.text "output" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "ssos", :force => true do |t| - t.integer "user_id" - t.string "openid" - t.string "name" - t.string "password" - t.string "email" - t.integer "sex" - t.string "school" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" - - create_table "student_work_projects", :force => true do |t| - t.integer "homework_common_id" - t.integer "student_work_id" - t.integer "project_id" - t.integer "user_id" - t.integer "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "course_id" - end - - add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" - add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" - add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" - add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" - - create_table "student_work_tests", :force => true do |t| - t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 - t.text "results" - t.text "src" - end - - add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" - - create_table "student_works", :force => true do |t| - t.string "name" - t.text "description", :limit => 2147483647 - t.integer "homework_common_id" - t.integer "user_id" - t.float "final_score" - t.float "teacher_score" - t.float "student_score" - t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "late_penalty", :default => 0 - t.integer "absence_penalty", :default => 0 - t.float "system_score", :default => 0.0 - t.boolean "is_test", :default => false - t.integer "simi_id" - t.integer "simi_value" - t.float "work_score" - t.integer "work_status", :default => 0 - t.datetime "commit_time" - t.integer "is_delete", :default => 0 - t.integer "appeal_penalty", :default => 0 - end - - add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" - - create_table "student_works_evaluation_distributions", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "student_works_scores", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "appeal_status", :default => 0 - t.boolean "is_hidden", :default => false - end - - add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" - add_index "student_works_scores", ["user_id"], :name => "user_id" - - create_table "student_works_scores_appeals", :force => true do |t| - t.integer "student_works_score_id" - t.integer "user_id" - t.text "comment" - t.integer "appeal_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "students_for_courses", :force => true do |t| - t.integer "student_id" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" - add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" - - create_table "sub_document_comments", :force => true do |t| - t.text "content" - t.text "title" - t.integer "sub_domain_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.integer "locked" - t.integer "sticky" - t.integer "org_subfield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "sub_domains", :force => true do |t| - t.integer "org_subfield_id" - t.integer "priority", :default => 0 - t.string "name" - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "subfield_subdomain_dirs", :force => true do |t| - t.integer "org_subfield_id" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "syllabus_members", :force => true do |t| - t.integer "rank" - t.integer "syllabus_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" - add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" - add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" - - create_table "syllabuses", :force => true do |t| - t.string "title" - t.text "description" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "eng_name" - t.integer "syllabus_type" - t.integer "credit" - t.integer "hours" - t.integer "theory_hours" - t.integer "practice_hours" - t.string "applicable_major" - t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 - t.integer "professional_level_id", :limit => 1 - end - - add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" - end - - create_table "taggings", :force => true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context", :limit => 128 - t.datetime "created_at" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" - add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" - - create_table "tags", :force => true do |t| - t.string "name" - end - - create_table "teachers", :force => true do |t| - t.string "tea_name" - t.string "location" - t.integer "couurse_time" - t.integer "course_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "extra" - end - - create_table "time_entries", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "issue_id" - t.float "hours", :null => false - t.string "comments" - t.integer "activity_id", :null => false - t.date "spent_on", :null => false - t.integer "tyear", :null => false - t.integer "tmonth", :null => false - t.integer "tweek", :null => false - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" - add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" - add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" - add_index "time_entries", ["project_id"], :name => "time_entries_project_id" - add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - - create_table "tokens", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "value", :limit => 40, :default => "", :null => false - t.datetime "created_on", :null => false - end - - add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" - add_index "tokens", ["value"], :name => "tokens_value", :unique => true - - create_table "trackers", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_in_chlog", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "is_in_roadmap", :default => true, :null => false - t.integer "fields_bits", :default => 0 - end - - create_table "trackers_training_projects", :id => false, :force => true do |t| - t.integer "training_project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "trackers_training_projects", ["training_project_id"], :name => "projects_trackers_training_project_id" - - create_table "training_projects", :force => true do |t| - t.string "name", :limit => 30, :null => false - t.text "description" - t.string "homepage", :limit => 60 - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.integer "projects_count", :default => 0 - t.string "identifier", :null => false - t.integer "status", :default => 1 - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "training_tasks", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.string "subject" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "author_id" - t.integer "status", :limit => 1, :default => 0 - end - - create_table "user_actions", :force => true do |t| - t.integer "user_id" - t.string "action_type" - t.integer "action_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_activities", :force => true do |t| - t.string "act_type" - t.integer "act_id" - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" - - create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false - t.date "birthday" - t.string "brief_introduction" - t.integer "gender" - t.string "location" - t.string "occupation" - t.integer "work_experience" - t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "technical_title" - t.integer "identity" - t.string "student_id" - t.string "teacher_realname" - t.string "student_realname" - t.string "location_city" - t.integer "school_id" - t.string "description", :default => "" - end - - add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" - - create_table "user_feedback_messages", :force => true do |t| - t.integer "user_id" - t.integer "journals_for_message_id" - t.string "journals_for_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" - add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" - - create_table "user_grades", :force => true do |t| - t.integer "user_id", :null => false - t.integer "project_id", :null => false - t.float "grade", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" - add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" - add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" - - create_table "user_levels", :force => true do |t| - t.integer "user_id" - t.integer "level" - end - - create_table "user_preferences", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.text "others" - t.boolean "hide_mail", :default => false - t.string "time_zone" - end - - add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" - - create_table "user_score_details", :force => true do |t| - t.integer "current_user_id" - t.integer "target_user_id" - t.string "score_type" - t.string "score_action" - t.integer "user_id" - t.integer "old_score" - t.integer "new_score" - t.integer "current_user_level" - t.integer "target_user_level" - t.integer "score_changeable_obj_id" - t.string "score_changeable_obj_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "grade", :default => 0.0 - end - - add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" - add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" - add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "bindtype", :default => 0 - end - - create_table "users", :force => true do |t| - t.string "login", :default => "", :null => false - t.string "hashed_password", :limit => 40, :default => "", :null => false - t.string "firstname", :limit => 30, :default => "", :null => false - t.string "lastname", :default => "", :null => false - t.string "mail", :limit => 60, :default => "", :null => false - t.boolean "admin", :default => false, :null => false - t.integer "status", :default => 1, :null => false - t.datetime "last_login_on" - t.string "language", :limit => 5, :default => "" - t.integer "auth_source_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "type" - t.string "identity_url" - t.string "mail_notification", :default => "", :null => false - t.string "salt", :limit => 64 - t.integer "gid" - t.integer "visits", :default => 0 - t.integer "excellent_teacher", :default => 0 - t.integer "excellent_student", :default => 0 - end - - add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" - add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" - add_index "users", ["type"], :name => "index_users_on_type" - - create_table "versions", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :default => "", :null => false - t.string "description", :default => "" - t.date "effective_date" - t.datetime "created_on" - t.datetime "updated_on" - t.string "wiki_page_title" - t.string "status", :default => "open" - t.string "sharing", :default => "none", :null => false - t.integer "user_id" - end - - add_index "versions", ["project_id"], :name => "versions_project_id" - add_index "versions", ["sharing"], :name => "index_versions_on_sharing" - - create_table "visitors", :force => true do |t| - t.integer "user_id" - t.integer "master_id" - t.datetime "updated_on" - t.datetime "created_on" - end - - add_index "visitors", ["master_id"], :name => "index_visitors_master_id" - add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" - add_index "visitors", ["user_id"], :name => "index_visitors_user_id" - - create_table "watchers", :force => true do |t| - t.string "watchable_type", :default => "", :null => false - t.integer "watchable_id", :default => 0, :null => false - t.integer "user_id" - end - - add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" - add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" - add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" - - create_table "web_footer_companies", :force => true do |t| - t.string "name" - t.string "logo_size" - t.string "url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "web_footer_oranizers", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - - add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" - - create_table "wiki_content_versions", :force => true do |t| - t.integer "wiki_content_id", :null => false - t.integer "page_id", :null => false - t.integer "author_id" - t.binary "data", :limit => 2147483647 - t.string "compression", :limit => 6, :default => "" - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" - add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" - - create_table "wiki_contents", :force => true do |t| - t.integer "page_id", :null => false - t.integer "author_id" - t.text "text", :limit => 2147483647 - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" - add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" - - create_table "wiki_pages", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title", :null => false - t.datetime "created_on", :null => false - t.boolean "protected", :default => false, :null => false - t.integer "parent_id" - end - - add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" - add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" - add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" - - create_table "wiki_redirects", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title" - t.string "redirects_to" - t.datetime "created_on", :null => false - end - - add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" - add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" - - create_table "wikis", :force => true do |t| - t.integer "project_id", :null => false - t.string "start_page", :null => false - t.integer "status", :default => 1, :null => false - end - - add_index "wikis", ["project_id"], :name => "wikis_project_id" - - create_table "work_detail_groups", :force => true do |t| - t.integer "work_id" - t.integer "min_num" - t.integer "max_num" - t.boolean "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" - - create_table "work_detail_manuals", :force => true do |t| - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" - - create_table "workflows", :force => true do |t| - t.integer "tracker_id", :default => 0, :null => false - t.integer "old_status_id", :default => 0, :null => false - t.integer "new_status_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - t.boolean "assignee", :default => false, :null => false - t.boolean "author", :default => false, :null => false - t.string "type", :limit => 30 - t.string "field_name", :limit => 30 - t.string "rule", :limit => 30 - end - - add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" - add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" - add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" - add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - - create_table "works", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "work_type" - t.integer "contest_id" - t.boolean "is_delete", :default => false - t.boolean "score_open", :default => false - t.boolean "is_open", :default => false - t.integer "work_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "online_evaluation", :default => false - t.boolean "score_valid", :default => true - end - - add_index "works", ["contest_id"], :name => "index_works_on_contest_id" - add_index "works", ["user_id"], :name => "index_works_on_user_id" - - create_table "works_categories", :force => true do |t| - t.string "category" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "zip_packs", :force => true do |t| - t.integer "user_id" - t.integer "homework_id" - t.string "file_digest" - t.string "file_path" - t.integer "pack_times", :default => 1 - t.integer "pack_size", :default => 0 - t.text "file_digests" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - -end +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20170219070127) do + + create_table "activities", :force => true do |t| + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false + t.integer "activity_container_id" + t.string "activity_container_type", :default => "" + t.datetime "created_at" + end + + add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" + add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" + add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + + create_table "activity_notifies", :force => true do |t| + t.integer "activity_container_id" + t.string "activity_container_type" + t.integer "activity_id" + t.string "activity_type" + t.integer "notify_to" + t.datetime "created_on" + t.integer "is_read" + end + + add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" + add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" + add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" + + create_table "api_keys", :force => true do |t| + t.string "access_token" + t.datetime "expires_at" + t.integer "user_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" + add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + + create_table "applied_contests", :force => true do |t| + t.integer "contest_id" + t.integer "user_id" + t.string "role" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id" + add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id" + + create_table "applied_messages", :force => true do |t| + t.integer "user_id" + t.integer "applied_id" + t.string "applied_type" + t.integer "viewed", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "name" + t.integer "applied_user_id" + t.integer "role" + t.integer "project_id" + end + + create_table "applied_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "role", :default => 0 + end + + create_table "apply_add_schools", :force => true do |t| + t.string "name" + t.string "province" + t.string "city" + t.string "address" + t.string "remarks" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + create_table "apply_homeworks", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" + add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" + + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "apply_resources", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "attachment_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id" + t.string "container_type" + t.text "content" + t.integer "apply_user_id" + end + + create_table "article_homepages", :force => true do |t| + t.string "title" + t.text "content" + t.integer "user_id" + t.integer "homepage_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id" + add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id" + + create_table "at_messages", :force => true do |t| + t.integer "user_id" + t.integer "at_message_id" + t.string "at_message_type" + t.boolean "viewed", :default => false + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sender_id" + end + + add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" + + create_table "attachment_histories", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.string "filename", :default => "" + t.string "disk_filename", :default => "" + t.integer "filesize", :default => 0 + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "" + t.integer "downloads", :default => 0 + t.integer "author_id" + t.datetime "created_on" + t.text "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.integer "copy_from" + t.integer "quotes" + t.integer "version" + t.integer "attachment_id" + t.integer "is_publish", :default => 1 + t.date "publish_time" + end + + create_table "attachments", :force => true do |t| + t.integer "container_id" + t.string "container_type", :limit => 30 + t.string "filename", :default => "", :null => false + t.string "disk_filename", :default => "", :null => false + t.integer "filesize", :default => 0, :null => false + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "", :null => false + t.integer "downloads", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.text "description" + t.string "disk_directory" + t.integer "attachtype", :default => 1 + t.integer "is_public", :default => 1 + t.integer "copy_from" + t.integer "quotes" + t.integer "is_publish", :default => 1 + t.datetime "publish_time" + end + + add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" + add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" + add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" + + create_table "attachmentstypes", :force => true do |t| + t.integer "typeId", :null => false + t.string "typeName", :limit => 50 + end + + create_table "auth_sources", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 60, :default => "", :null => false + t.string "host", :limit => 60 + t.integer "port" + t.string "account" + t.string "account_password", :default => "" + t.string "base_dn" + t.string "attr_login", :limit => 30 + t.string "attr_firstname", :limit => 30 + t.string "attr_lastname", :limit => 30 + t.string "attr_mail", :limit => 30 + t.boolean "onthefly_register", :default => false, :null => false + t.boolean "tls", :default => false, :null => false + t.string "filter" + t.integer "timeout" + end + + add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" + + create_table "biding_projects", :force => true do |t| + t.integer "project_id" + t.integer "bid_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "bids", :force => true do |t| + t.string "name" + t.string "budget", :null => false + t.integer "author_id" + t.date "deadline" + t.text "description" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "commit" + t.integer "reward_type" + t.integer "homework_type" + t.integer "parent_id" + t.string "password" + t.integer "is_evaluation" + t.integer "proportion", :default => 60 + t.integer "comment_status", :default => 0 + t.integer "evaluation_num", :default => 3 + t.integer "open_anonymous_evaluation", :default => 1 + end + + create_table "blog_comments", :force => true do |t| + t.integer "blog_id", :null => false + t.integer "parent_id" + t.string "title", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comment_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "root_id" + end + + add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id" + + create_table "blog_messages", :force => true do |t| + t.integer "user_id" + t.integer "blog_message_id" + t.integer "blog_id" + t.string "blog_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_operator_id" + end + + create_table "blogs", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.integer "position", :default => 1 + t.integer "article_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comments_id" + t.integer "parent_id" + t.integer "author_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "homepage_id" + end + + create_table "boards", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false + t.string "description" + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false + t.integer "last_message_id" + t.integer "parent_id" + t.integer "course_id" + t.integer "org_subfield_id" + t.integer "contest_id" + end + + add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" + add_index "boards", ["project_id"], :name => "boards_project_id" + + create_table "bug_to_osps", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "changes", :force => true do |t| + t.integer "changeset_id", :null => false + t.string "action", :limit => 1, :default => "", :null => false + t.text "path", :null => false + t.text "from_path" + t.string "from_revision" + t.string "revision" + t.string "branch" + end + + add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" + + create_table "changeset_parents", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "parent_id", :null => false + end + + add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" + add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" + + create_table "changesets", :force => true do |t| + t.integer "repository_id", :null => false + t.string "revision", :null => false + t.string "committer" + t.datetime "committed_on", :null => false + t.text "comments" + t.date "commit_date" + t.string "scmid" + t.integer "user_id" + t.integer "project_id" + t.integer "type", :default => 0 + end + + add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" + add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true + add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" + add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" + add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" + + create_table "changesets_issues", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "issue_id", :null => false + end + + add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + + create_table "code_tests", :force => true do |t| + t.integer "homework_id" + t.integer "wait_time", :default => 0 + t.integer "language" + t.integer "status" + t.integer "time_used", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "student_work_id", :default => 0 + end + + create_table "comments", :force => true do |t| + t.string "commented_type", :limit => 30, :default => "", :null => false + t.integer "commented_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.text "comments" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "comments", ["author_id"], :name => "index_comments_on_author_id" + add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" + + create_table "commit_issues", :force => true do |t| + t.string "commit_id" + t.integer "issue_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "commits", :force => true do |t| + t.integer "repository_id" + t.string "version" + t.string "committer" + t.text "comments" + t.datetime "committed_on" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contest_activities", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_act_id" + t.string "contest_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id" + add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id" + + create_table "contest_member_roles", :force => true do |t| + t.integer "contest_member_id" + t.integer "role_id" + t.boolean "is_current", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id" + add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id" + + create_table "contest_members", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.boolean "is_collect", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id" + add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id" + + create_table "contest_messages", :force => true do |t| + t.integer "user_id" + t.integer "contest_id" + t.integer "contest_message_id" + t.string "contest_message_type" + t.boolean "viewed", :default => false + t.text "content" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" + add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" + + create_table "contestant_for_contests", :force => true do |t| + t.integer "student_id" + t.integer "contest_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id" + add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id" + + create_table "contestant_work_evaluation_distributions", :force => true do |t| + t.integer "user_id" + t.integer "contestant_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id" + + create_table "contestant_work_projects", :force => true do |t| + t.integer "contest_id" + t.integer "work_id" + t.integer "contestant_work_id" + t.integer "project_id" + t.integer "user_id" + t.boolean "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id" + add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id" + add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id" + add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id" + + create_table "contestant_work_scores", :force => true do |t| + t.integer "contestant_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id" + add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id" + + create_table "contestant_works", :force => true do |t| + t.string "name" + t.text "description" + t.integer "work_id" + t.integer "user_id" + t.float "work_score" + t.integer "project_id" + t.integer "work_status" + t.datetime "commit_time" + t.boolean "is_delete", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "judge_score" + end + + add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id" + add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" + add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" + + create_table "contests", :force => true do |t| + t.integer "user_id" + t.string "name" + t.text "description" + t.boolean "is_public" + t.boolean "is_delete", :default => false + t.integer "visits", :default => 0 + t.string "invite_code" + t.integer "invite_code_halt", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_activities", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_act_id" + t.string "course_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" + + create_table "course_attachments", :force => true do |t| + t.string "filename" + t.string "disk_filename" + t.integer "filesize" + t.string "content_type" + t.string "digest" + t.integer "downloads" + t.string "author_id" + t.string "integer" + t.string "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id", :default => 0 + end + + create_table "course_contributor_scores", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.integer "message_num", :default => 0 + t.integer "message_reply_num", :default => 0 + t.integer "news_reply_num", :default => 0 + t.integer "resource_num", :default => 0 + t.integer "journal_num", :default => 0 + t.integer "journal_reply_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "total_score", :default => 0 + t.integer "homework_journal_num", :default => 0 + t.integer "news_num", :default => 0 + end + + add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" + + create_table "course_groups", :force => true do |t| + t.string "name" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" + + create_table "course_homework_statistics", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "committed_work_num", :default => 0 + t.integer "un_commit_work_num", :default => 0 + t.integer "late_commit_work_num", :default => 0 + t.integer "absence_evaluation_work_num", :default => 0 + t.integer "un_evaluation_work_num", :default => 0 + t.integer "appeal_num", :default => 0 + t.float "average_score", :default => 0.0 + t.float "total_score", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_infos", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_messages", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_message_id" + t.string "course_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "content" + t.integer "status" + t.integer "apply_user_id" + t.integer "apply_result" + end + + add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" + add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" + + create_table "course_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "course_id" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "courses", :force => true do |t| + t.integer "tea_id" + t.string "name" + t.integer "state" + t.string "code" + t.integer "time" + t.string "extra" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "location" + t.string "term" + t.string "string" + t.string "password" + t.string "setup_time" + t.string "endup_time" + t.string "class_period" + t.integer "school_id" + t.text "description" + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 + t.integer "lft" + t.integer "rgt" + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 + t.integer "end_time" + t.string "end_term" + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 + t.integer "syllabus_id" + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 + end + + add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true + add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" + + create_table "custom_fields", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.string "field_format", :limit => 30, :default => "", :null => false + t.text "possible_values" + t.string "regexp", :default => "" + t.integer "min_length", :default => 0, :null => false + t.integer "max_length", :default => 0, :null => false + t.boolean "is_required", :default => false, :null => false + t.boolean "is_for_all", :default => false, :null => false + t.boolean "is_filter", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "searchable", :default => false + t.text "default_value" + t.boolean "editable", :default => true + t.boolean "visible", :default => true, :null => false + t.boolean "multiple", :default => false + end + + add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" + + create_table "custom_fields_projects", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "project_id", :default => 0, :null => false + end + + add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true + + create_table "custom_fields_trackers", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true + + create_table "custom_values", :force => true do |t| + t.string "customized_type", :limit => 30, :default => "", :null => false + t.integer "customized_id", :default => 0, :null => false + t.integer "custom_field_id", :default => 0, :null => false + t.text "value" + end + + add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" + add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + + create_table "data_exceptions", :force => true do |t| + t.string "message" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "delayed_jobs", :force => true do |t| + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + + create_table "delayed_jobs_20161218", :id => false, :force => true do |t| + t.integer "id", :default => 0, :null => false + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "documents", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "category_id", :default => 0, :null => false + t.string "title", :limit => 60, :default => "", :null => false + t.text "description" + t.datetime "created_on" + t.integer "user_id", :default => 0 + t.integer "is_public", :default => 1 + end + + add_index "documents", ["category_id"], :name => "index_documents_on_category_id" + add_index "documents", ["created_on"], :name => "index_documents_on_created_on" + add_index "documents", ["project_id"], :name => "documents_project_id" + + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 + t.string "File" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false + end + + create_table "editor_of_documents", :force => true do |t| + t.integer "editor_id" + t.integer "org_document_comment_id" + t.datetime "created_at" + end + + create_table "enabled_modules", :force => true do |t| + t.integer "project_id" + t.string "name", :null => false + t.integer "course_id" + end + + add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" + + create_table "enumerations", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "is_default", :default => false, :null => false + t.string "type" + t.boolean "active", :default => true, :null => false + t.integer "project_id" + t.integer "parent_id" + t.string "position_name", :limit => 30 + end + + add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" + add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + + create_table "exercise_answers", :force => true do |t| + t.integer "user_id" + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_choices", :force => true do |t| + t.integer "exercise_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "exercise_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_score" + end + + create_table "exercise_standard_answers", :force => true do |t| + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_users", :force => true do |t| + t.integer "user_id" + t.integer "exercise_id" + t.integer "score" + t.datetime "start_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "end_at" + t.integer "status" + t.integer "commit_status", :default => 0 + end + + create_table "exercises", :force => true do |t| + t.text "exercise_name" + t.text "exercise_description" + t.integer "course_id" + t.integer "exercise_status" + t.integer "user_id" + t.integer "time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "publish_time" + t.datetime "end_time" + t.integer "show_result" + end + + create_table "first_pages", :force => true do |t| + t.string "web_title" + t.string "title" + t.text "description" + t.string "page_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sort_type" + t.integer "image_width", :default => 107 + t.integer "image_height", :default => 63 + t.integer "show_course", :default => 1 + t.integer "show_contest", :default => 1 + end + + create_table "forge_activities", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_act_id" + t.string "forge_act_type" + t.integer "org_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" + add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" + + create_table "forge_messages", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_message_id" + t.string "forge_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "secret_key" + t.integer "status" + t.integer "operate_user_id" + end + + add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" + add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + + create_table "forums", :force => true do |t| + t.string "name", :null => false + t.text "description" + t.integer "topic_count", :default => 0 + t.integer "memo_count", :default => 0 + t.integer "last_memo_id", :default => 0 + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sticky" + t.integer "locked" + end + + create_table "forwards", :force => true do |t| + t.integer "from_id" + t.string "from_type" + t.integer "to_id" + t.string "to_type" + t.datetime "created_at" + end + + create_table "groups_users", :id => false, :force => true do |t| + t.integer "group_id", :null => false + t.integer "user_id", :null => false + end + + add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true + + create_table "homepages", :force => true do |t| + t.string "name" + t.integer "article_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id" + + create_table "homework_attaches", :force => true do |t| + t.integer "bid_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + t.string "name" + t.text "description" + t.integer "state" + t.integer "project_id", :default => 0 + t.float "score", :default => 0.0 + t.integer "is_teacher_score", :default => 0 + end + + add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + + create_table "homework_commons", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "homework_type", :default => 1 + t.string "late_penalty" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 + t.integer "quotes", :default => 0 + t.integer "is_open", :default => 0 + t.datetime "simi_time" + t.integer "score_open", :default => 1 + t.integer "anonymous_appeal", :default => 0 + end + + add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + + create_table "homework_detail_groups", :force => true do |t| + t.integer "homework_common_id" + t.integer "min_num" + t.integer "max_num" + t.integer "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" + + create_table "homework_detail_manuals", :force => true do |t| + t.float "ta_proportion" + t.integer "comment_status" + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "absence_penalty", :default => 1 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "no_anon_penalty", :default => 1 + t.integer "appeal_penalty", :default => 0 + t.integer "ta_mode", :default => 1 + end + + create_table "homework_detail_programings", :force => true do |t| + t.string "language" + t.text "standard_code", :limit => 2147483647 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "ta_proportion", :default => 0.1 + t.integer "question_id" + end + + create_table "homework_evaluations", :force => true do |t| + t.string "user_id" + t.string "homework_attach_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_for_courses", :force => true do |t| + t.integer "course_id" + t.integer "bid_id" + end + + add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" + add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + + create_table "homework_tests", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "result" + t.text "error_msg" + end + + create_table "homework_users", :force => true do |t| + t.string "homework_attach_id" + t.string "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "innodb_monitor", :id => false, :force => true do |t| + t.integer "a" + end + + create_table "invite_lists", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "mail" + end + + create_table "issue_categories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.integer "assigned_to_id" + end + + add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" + add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" + + create_table "issue_relations", :force => true do |t| + t.integer "issue_from_id", :null => false + t.integer "issue_to_id", :null => false + t.string "relation_type", :default => "", :null => false + t.integer "delay" + end + + add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true + add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" + add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" + + create_table "issue_statuses", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_closed", :default => false, :null => false + t.boolean "is_default", :default => false, :null => false + t.integer "position", :default => 1 + t.integer "default_done_ratio" + end + + add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" + add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" + add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" + + create_table "issues", :force => true do |t| + t.integer "tracker_id", :null => false + t.integer "project_id", :null => false + t.string "subject", :default => "", :null => false + t.text "description" + t.date "due_date" + t.integer "category_id" + t.integer "status_id", :null => false + t.integer "assigned_to_id" + t.integer "priority_id", :null => false + t.integer "fixed_version_id" + t.integer "author_id", :null => false + t.integer "lock_version", :default => 0, :null => false + t.datetime "created_on" + t.datetime "updated_on" + t.date "start_date" + t.integer "done_ratio", :default => 0, :null => false + t.float "estimated_hours" + t.integer "parent_id" + t.integer "root_id" + t.integer "lft" + t.integer "rgt" + t.boolean "is_private", :default => false, :null => false + t.datetime "closed_on" + t.integer "project_issues_index" + end + + add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" + add_index "issues", ["author_id"], :name => "index_issues_on_author_id" + add_index "issues", ["category_id"], :name => "index_issues_on_category_id" + add_index "issues", ["created_on"], :name => "index_issues_on_created_on" + add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" + add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" + add_index "issues", ["project_id"], :name => "issues_project_id" + add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" + add_index "issues", ["status_id"], :name => "index_issues_on_status_id" + add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" + + create_table "join_in_competitions", :force => true do |t| + t.integer "user_id" + t.integer "competition_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "join_in_contests", :force => true do |t| + t.integer "user_id" + t.integer "bid_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "journal_details", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + + create_table "journal_replies", :id => false, :force => true do |t| + t.integer "journal_id" + t.integer "user_id" + t.integer "reply_id" + end + + add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" + add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" + add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" + + create_table "journals", :force => true do |t| + t.integer "journalized_id", :default => 0, :null => false + t.string "journalized_type", :limit => 30, :default => "", :null => false + t.integer "user_id", :default => 0, :null => false + t.text "notes" + t.datetime "created_on", :null => false + t.boolean "private_notes", :default => false, :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "journals", ["created_on"], :name => "index_journals_on_created_on" + add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" + add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" + add_index "journals", ["user_id"], :name => "index_journals_on_user_id" + + create_table "journals_for_messages", :force => true do |t| + t.integer "jour_id" + t.string "jour_type" + t.integer "user_id" + t.text "notes" + t.integer "status" + t.integer "reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.string "m_parent_id" + t.boolean "is_readed" + t.integer "m_reply_count" + t.integer "m_reply_id" + t.integer "is_comprehensive_evaluation" + t.integer "private", :default => 0 + t.integer "root_id" + end + + add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id" + + create_table "kindeditor_assets", :force => true do |t| + t.string "asset" + t.integer "file_size" + t.string "file_type" + t.integer "owner_id" + t.string "asset_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "owner_type", :default => 0 + end + + create_table "member_roles", :force => true do |t| + t.integer "member_id", :null => false + t.integer "role_id", :null => false + t.integer "inherited_from" + t.integer "is_current", :default => 1 + end + + add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id" + add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id" + + create_table "members", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "project_id", :default => 0 + t.datetime "created_on" + t.boolean "mail_notification", :default => false, :null => false + t.integer "course_id", :default => -1 + t.integer "course_group_id", :default => 0 + t.integer "is_collect", :default => 1 + end + + add_index "members", ["course_id"], :name => "index_members_on_course_id" + add_index "members", ["project_id"], :name => "index_members_on_project_id" + add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true + add_index "members", ["user_id"], :name => "index_members_on_user_id" + + create_table "memo_messages", :force => true do |t| + t.integer "user_id" + t.integer "forum_id" + t.integer "memo_id" + t.string "memo_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type" + add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at" + + create_table "memos", :force => true do |t| + t.integer "forum_id", :null => false + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :null => false + t.integer "author_id", :null => false + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count", :default => 0 + t.integer "root_id" + end + + add_index "memos", ["root_id"], :name => "index_memos_on_root_id" + + create_table "message_alls", :force => true do |t| + t.integer "user_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" + add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" + + create_table "messages", :force => true do |t| + t.integer "board_id", :null => false + t.integer "parent_id" + t.string "subject", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "replies_count", :default => 0, :null => false + t.integer "last_reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.integer "quotes" + t.integer "status", :default => 0 + t.integer "root_id" + end + + add_index "messages", ["author_id"], :name => "index_messages_on_author_id" + add_index "messages", ["board_id"], :name => "messages_board_id" + add_index "messages", ["created_on"], :name => "index_messages_on_created_on" + add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" + add_index "messages", ["parent_id"], :name => "messages_parent_id" + add_index "messages", ["root_id"], :name => "index_messages_on_root_id" + + create_table "news", :force => true do |t| + t.integer "project_id" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" + t.text "description" + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.integer "comments_count", :default => 0, :null => false + t.integer "course_id" + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "contest_id" + end + + add_index "news", ["author_id"], :name => "index_news_on_author_id" + add_index "news", ["created_on"], :name => "index_news_on_created_on" + add_index "news", ["project_id"], :name => "news_project_id" + + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "notificationcomments", :force => true do |t| + t.string "notificationcommented_type" + t.integer "notificationcommented_id" + t.integer "author_id" + t.text "notificationcomments" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "open_id_authentication_associations", :force => true do |t| + t.integer "issued" + t.integer "lifetime" + t.string "handle" + t.string "assoc_type" + t.binary "server_url" + t.binary "secret" + end + + create_table "open_id_authentication_nonces", :force => true do |t| + t.integer "timestamp", :null => false + t.string "server_url" + t.string "salt", :null => false + end + + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "option_numbers", :force => true do |t| + t.integer "user_id" + t.integer "memo" + t.integer "messages_for_issues" + t.integer "issues_status" + t.integer "replay_for_message" + t.integer "replay_for_memo" + t.integer "follow" + t.integer "tread" + t.integer "praise_by_one" + t.integer "praise_by_two" + t.integer "praise_by_three" + t.integer "tread_by_one" + t.integer "tread_by_two" + t.integer "tread_by_three" + t.integer "changeset" + t.integer "document" + t.integer "attachment" + t.integer "issue_done_ratio" + t.integer "post_issue" + t.integer "score_type" + t.integer "total_score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + end + + create_table "org_activities", :force => true do |t| + t.integer "user_id" + t.integer "org_act_id" + t.string "org_act_type" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_courses", :force => true do |t| + t.integer "organization_id" + t.integer "course_id" + t.datetime "created_at" + end + + create_table "org_document_comments", :force => true do |t| + t.text "title" + t.text "content" + t.integer "organization_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "status", :default => 0 + t.integer "root_id" + end + + add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id" + + create_table "org_member_roles", :force => true do |t| + t.integer "org_member_id" + t.integer "role_id" + end + + create_table "org_members", :force => true do |t| + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_messages", :force => true do |t| + t.integer "user_id" + t.integer "sender_id" + t.integer "organization_id" + t.string "message_type" + t.integer "message_id" + t.integer "viewed" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + end + + create_table "org_projects", :force => true do |t| + t.integer "organization_id" + t.integer "project_id" + t.datetime "created_at" + end + + create_table "org_subfield_messages", :force => true do |t| + t.integer "org_subfield_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_subfields", :force => true do |t| + t.integer "organization_id" + t.integer "priority" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 1 + end + + create_table "organizations", :force => true do |t| + t.string "name" + t.text "description" + t.integer "creator_id" + t.integer "home_id" + t.boolean "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "allow_guest_download", :default => true + t.integer "visits", :default => 0 + t.integer "show_mode", :default => 0 + t.integer "allow_teacher", :default => 0 + end + + create_table "phone_app_versions", :force => true do |t| + t.string "version" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_answers", :force => true do |t| + t.integer "poll_question_id" + t.text "answer_text" + t.integer "answer_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_questions", :force => true do |t| + t.string "question_title" + t.integer "question_type" + t.integer "is_necessary" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_number" + t.integer "max_choices", :default => 0 + t.integer "min_choices", :default => 0 + end + + create_table "poll_users", :force => true do |t| + t.integer "user_id" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_votes", :force => true do |t| + t.integer "user_id" + t.integer "poll_question_id" + t.integer "poll_answer_id" + t.text "vote_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "polls", :force => true do |t| + t.string "polls_name" + t.string "polls_type" + t.integer "polls_group_id" + t.integer "polls_status" + t.integer "user_id" + t.datetime "published_at" + t.datetime "closed_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "polls_description" + t.integer "show_result", :default => 1 + end + + create_table "praise_tread_caches", :force => true do |t| + t.integer "object_id", :null => false + t.string "object_type" + t.integer "praise_num" + t.integer "tread_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "praise_treads", :force => true do |t| + t.integer "user_id", :null => false + t.integer "praise_tread_object_id" + t.string "praise_tread_object_type" + t.integer "praise_or_tread" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "principal_activities", :force => true do |t| + t.integer "user_id" + t.integer "principal_id" + t.integer "principal_act_id" + t.string "principal_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "professional_levels", :force => true do |t| + t.string "level" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_infos", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_scores", :force => true do |t| + t.string "project_id" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 + t.datetime "commit_time" + t.integer "pull_request_num", :default => 0 + end + + create_table "project_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "project_id" + t.integer "project_type" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + end + + add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" + + create_table "projecting_softapplictions", :force => true do |t| + t.integer "user_id" + t.integer "softapplication_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "projects", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false + t.integer "parent_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "identifier" + t.integer "status", :default => 1, :null => false + t.integer "lft" + t.integer "rgt" + t.boolean "inherit_members", :default => false, :null => false + t.integer "project_type" + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 + t.integer "user_id" + t.integer "dts_test", :default => 0 + t.string "enterprise_name" + t.integer "organization_id" + t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "publish_resource", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 + t.string "invite_code" + t.string "qrcode" + t.integer "qrcode_expiretime", :default => 0 + t.text "script" + t.integer "training_status", :limit => 1, :default => 0 + end + + add_index "projects", ["lft"], :name => "index_projects_on_lft" + add_index "projects", ["rgt"], :name => "index_projects_on_rgt" + + create_table "projects_trackers", :id => false, :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true + add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + + create_table "pull_requests", :force => true do |t| + t.integer "pull_request_id" + t.integer "gpid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + t.integer "project_id" + t.string "title" + end + + create_table "quality_analyses", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + + create_table "queries", :force => true do |t| + t.integer "project_id" + t.string "name", :default => "", :null => false + t.text "filters" + t.integer "user_id", :default => 0, :null => false + t.boolean "is_public", :default => false, :null => false + t.text "column_names" + t.text "sort_criteria" + t.string "group_by" + t.string "type" + end + + add_index "queries", ["project_id"], :name => "index_queries_on_project_id" + add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + + create_table "relative_memo_to_open_source_projects", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "relative_memos", :force => true do |t| + t.integer "osp_id" + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + t.string "username" + t.string "userhomeurl" + t.date "date_collected" + t.string "topic_resource" + end + + create_table "rep_statics", :force => true do |t| + t.integer "project_id" + t.integer "commits_num" + t.string "uname" + t.string "email" + t.integer "add" + t.integer "del" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "changeset" + end + + create_table "repositories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "url", :default => "", :null => false + t.string "login", :limit => 60, :default => "" + t.string "password", :default => "" + t.string "root_url", :default => "" + t.string "type" + t.string "path_encoding", :limit => 64 + t.string "log_encoding", :limit => 64 + t.text "extra_info" + t.string "identifier" + t.boolean "is_default", :default => false + t.boolean "hidden", :default => false + end + + add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + + create_table "roles", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "assignable", :default => true + t.integer "builtin", :default => 0, :null => false + t.text "permissions" + t.string "issues_visibility", :limit => 30, :default => "default", :null => false + end + + create_table "schools", :force => true do |t| + t.string "name" + t.string "province" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "logo_link" + t.string "pinyin" + t.integer "school_type", :default => 0 + end + + create_table "secdomains", :force => true do |t| + t.integer "sub_type" + t.string "subname" + t.integer "pid", :default => 0 + t.string "desc" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_cached_ratings", :force => true do |t| + t.integer "cacheable_id", :limit => 8 + t.string "cacheable_type" + t.float "avg", :null => false + t.integer "cnt", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_rates", :force => true do |t| + t.integer "rater_id", :limit => 8 + t.integer "rateable_id" + t.string "rateable_type" + t.float "stars", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "is_teacher_score", :default => 0 + end + + create_table "settings", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "value" + t.datetime "updated_on" + end + + add_index "settings", ["name"], :name => "index_settings_on_name" + + create_table "shares", :force => true do |t| + t.date "created_on" + t.string "url" + t.string "title" + t.integer "share_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + t.integer "user_id" + t.string "description" + end + + create_table "shield_activities", :force => true do |t| + t.string "container_type" + t.integer "container_id" + t.string "shield_type" + t.integer "shield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "shield_wechat_messages", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.integer "shield_id" + t.string "shield_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "softapplications", :force => true do |t| + t.string "name" + t.text "description" + t.integer "app_type_id" + t.string "app_type_name" + t.string "android_min_version_available" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "contest_id" + t.integer "softapplication_id" + t.integer "is_public" + t.string "application_developers" + t.string "deposit_project_url" + t.string "deposit_project" + t.integer "project_id" + end + + create_table "sonar_errors", :force => true do |t| + t.integer "project_id" + t.string "jenkins_job_name" + t.text "output" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "ssos", :force => true do |t| + t.integer "user_id" + t.string "openid" + t.string "name" + t.string "password" + t.string "email" + t.integer "sex" + t.string "school" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" + + create_table "student_work_projects", :force => true do |t| + t.integer "homework_common_id" + t.integer "student_work_id" + t.integer "project_id" + t.integer "user_id" + t.integer "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "course_id" + end + + add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" + add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" + add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" + add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" + + create_table "student_work_tests", :force => true do |t| + t.integer "student_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 + t.text "results" + t.text "src" + end + + add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" + + create_table "student_works", :force => true do |t| + t.string "name" + t.text "description", :limit => 2147483647 + t.integer "homework_common_id" + t.integer "user_id" + t.float "final_score" + t.float "teacher_score" + t.float "student_score" + t.float "teaching_asistant_score" + t.integer "project_id", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "late_penalty", :default => 0 + t.integer "absence_penalty", :default => 0 + t.float "system_score", :default => 0.0 + t.boolean "is_test", :default => false + t.integer "simi_id" + t.integer "simi_value" + t.float "work_score" + t.integer "work_status", :default => 0 + t.datetime "commit_time" + t.integer "is_delete", :default => 0 + t.integer "appeal_penalty", :default => 0 + end + + add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + + create_table "student_works_evaluation_distributions", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "student_works_scores", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "appeal_status", :default => 0 + t.boolean "is_hidden", :default => false + end + + add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" + add_index "student_works_scores", ["user_id"], :name => "user_id" + + create_table "student_works_scores_appeals", :force => true do |t| + t.integer "student_works_score_id" + t.integer "user_id" + t.text "comment" + t.integer "appeal_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "students_for_courses", :force => true do |t| + t.integer "student_id" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" + add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" + + create_table "sub_document_comments", :force => true do |t| + t.text "content" + t.text "title" + t.integer "sub_domain_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.integer "locked" + t.integer "sticky" + t.integer "org_subfield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "sub_domains", :force => true do |t| + t.integer "org_subfield_id" + t.integer "priority", :default => 0 + t.string "name" + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "subfield_subdomain_dirs", :force => true do |t| + t.integer "org_subfield_id" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "syllabus_members", :force => true do |t| + t.integer "rank" + t.integer "syllabus_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" + add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" + add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" + + create_table "syllabuses", :force => true do |t| + t.string "title" + t.text "description" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "eng_name" + t.integer "syllabus_type" + t.integer "credit" + t.integer "hours" + t.integer "theory_hours" + t.integer "practice_hours" + t.string "applicable_major" + t.string "pre_course" + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 + end + + add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" + + create_table "system_messages", :force => true do |t| + t.integer "user_id" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "description" + t.string "subject" + end + + create_table "taggings", :force => true do |t| + t.integer "tag_id" + t.integer "taggable_id" + t.string "taggable_type" + t.integer "tagger_id" + t.string "tagger_type" + t.string "context", :limit => 128 + t.datetime "created_at" + end + + add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" + add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" + + create_table "tags", :force => true do |t| + t.string "name" + end + + create_table "teachers", :force => true do |t| + t.string "tea_name" + t.string "location" + t.integer "couurse_time" + t.integer "course_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "extra" + end + + create_table "time_entries", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "issue_id" + t.float "hours", :null => false + t.string "comments" + t.integer "activity_id", :null => false + t.date "spent_on", :null => false + t.integer "tyear", :null => false + t.integer "tmonth", :null => false + t.integer "tweek", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" + add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" + add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" + add_index "time_entries", ["project_id"], :name => "time_entries_project_id" + add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" + + create_table "tokens", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "value", :limit => 40, :default => "", :null => false + t.datetime "created_on", :null => false + end + + add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" + add_index "tokens", ["value"], :name => "tokens_value", :unique => true + + create_table "trackers", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_in_chlog", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "is_in_roadmap", :default => true, :null => false + t.integer "fields_bits", :default => 0 + end + + create_table "training_tasks", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.string "subject" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "author_id" + t.integer "status", :limit => 1, :default => 0 + t.integer "position", :limit => 1, :default => 0 + end + + create_table "user_actions", :force => true do |t| + t.integer "user_id" + t.string "action_type" + t.integer "action_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_activities", :force => true do |t| + t.string "act_type" + t.integer "act_id" + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" + + create_table "user_extensions", :force => true do |t| + t.integer "user_id", :null => false + t.date "birthday" + t.string "brief_introduction" + t.integer "gender" + t.string "location" + t.string "occupation" + t.integer "work_experience" + t.integer "zip_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "technical_title" + t.integer "identity" + t.string "student_id" + t.string "teacher_realname" + t.string "student_realname" + t.string "location_city" + t.integer "school_id" + t.string "description", :default => "" + end + + add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" + + create_table "user_feedback_messages", :force => true do |t| + t.integer "user_id" + t.integer "journals_for_message_id" + t.string "journals_for_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" + add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" + + create_table "user_grades", :force => true do |t| + t.integer "user_id", :null => false + t.integer "project_id", :null => false + t.float "grade", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" + add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" + add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" + + create_table "user_levels", :force => true do |t| + t.integer "user_id" + t.integer "level" + end + + create_table "user_preferences", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.text "others" + t.boolean "hide_mail", :default => false + t.string "time_zone" + end + + add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" + + create_table "user_score_details", :force => true do |t| + t.integer "current_user_id" + t.integer "target_user_id" + t.string "score_type" + t.string "score_action" + t.integer "user_id" + t.integer "old_score" + t.integer "new_score" + t.integer "current_user_level" + t.integer "target_user_level" + t.integer "score_changeable_obj_id" + t.string "score_changeable_obj_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_scores", :force => true do |t| + t.integer "user_id", :null => false + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "active" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "grade", :default => 0.0 + end + + add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" + add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" + add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" + + create_table "user_wechats", :force => true do |t| + t.integer "subscribe" + t.string "openid" + t.string "nickname" + t.integer "sex" + t.string "language" + t.string "city" + t.string "province" + t.string "country" + t.string "headimgurl" + t.string "subscribe_time" + t.string "unionid" + t.string "remark" + t.integer "groupid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "bindtype", :default => 0 + end + + create_table "users", :force => true do |t| + t.string "login", :default => "", :null => false + t.string "hashed_password", :limit => 40, :default => "", :null => false + t.string "firstname", :limit => 30, :default => "", :null => false + t.string "lastname", :default => "", :null => false + t.string "mail", :limit => 60, :default => "", :null => false + t.boolean "admin", :default => false, :null => false + t.integer "status", :default => 1, :null => false + t.datetime "last_login_on" + t.string "language", :limit => 5, :default => "" + t.integer "auth_source_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "type" + t.string "identity_url" + t.string "mail_notification", :default => "", :null => false + t.string "salt", :limit => 64 + t.integer "gid" + t.integer "visits", :default => 0 + t.integer "excellent_teacher", :default => 0 + t.integer "excellent_student", :default => 0 + end + + add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" + add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" + add_index "users", ["type"], :name => "index_users_on_type" + + create_table "versions", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :default => "", :null => false + t.string "description", :default => "" + t.date "effective_date" + t.datetime "created_on" + t.datetime "updated_on" + t.string "wiki_page_title" + t.string "status", :default => "open" + t.string "sharing", :default => "none", :null => false + t.integer "user_id" + end + + add_index "versions", ["project_id"], :name => "versions_project_id" + add_index "versions", ["sharing"], :name => "index_versions_on_sharing" + + create_table "visitors", :force => true do |t| + t.integer "user_id" + t.integer "master_id" + t.datetime "updated_on" + t.datetime "created_on" + end + + add_index "visitors", ["master_id"], :name => "index_visitors_master_id" + add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" + add_index "visitors", ["user_id"], :name => "index_visitors_user_id" + + create_table "watchers", :force => true do |t| + t.string "watchable_type", :default => "", :null => false + t.integer "watchable_id", :default => 0, :null => false + t.integer "user_id" + end + + add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" + add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" + add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" + + create_table "web_footer_companies", :force => true do |t| + t.string "name" + t.string "logo_size" + t.string "url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "web_footer_oranizers", :force => true do |t| + t.string "name" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "wechat_logs", :force => true do |t| + t.string "openid", :null => false + t.text "request_raw" + t.text "response_raw" + t.text "session_raw" + t.datetime "created_at", :null => false + end + + add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" + + create_table "wiki_content_versions", :force => true do |t| + t.integer "wiki_content_id", :null => false + t.integer "page_id", :null => false + t.integer "author_id" + t.binary "data", :limit => 2147483647 + t.string "compression", :limit => 6, :default => "" + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" + add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" + + create_table "wiki_contents", :force => true do |t| + t.integer "page_id", :null => false + t.integer "author_id" + t.text "text", :limit => 2147483647 + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" + add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" + + create_table "wiki_pages", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title", :null => false + t.datetime "created_on", :null => false + t.boolean "protected", :default => false, :null => false + t.integer "parent_id" + end + + add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" + add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" + add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" + + create_table "wiki_redirects", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title" + t.string "redirects_to" + t.datetime "created_on", :null => false + end + + add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" + add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" + + create_table "wikis", :force => true do |t| + t.integer "project_id", :null => false + t.string "start_page", :null => false + t.integer "status", :default => 1, :null => false + end + + add_index "wikis", ["project_id"], :name => "wikis_project_id" + + create_table "work_detail_groups", :force => true do |t| + t.integer "work_id" + t.integer "min_num" + t.integer "max_num" + t.boolean "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" + + create_table "work_detail_manuals", :force => true do |t| + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" + + create_table "workflows", :force => true do |t| + t.integer "tracker_id", :default => 0, :null => false + t.integer "old_status_id", :default => 0, :null => false + t.integer "new_status_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + t.boolean "assignee", :default => false, :null => false + t.boolean "author", :default => false, :null => false + t.string "type", :limit => 30 + t.string "field_name", :limit => 30 + t.string "rule", :limit => 30 + end + + add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" + add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" + add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" + add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" + + create_table "works", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "work_type" + t.integer "contest_id" + t.boolean "is_delete", :default => false + t.boolean "score_open", :default => false + t.boolean "is_open", :default => false + t.integer "work_status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "online_evaluation", :default => false + t.boolean "score_valid", :default => true + end + + add_index "works", ["contest_id"], :name => "index_works_on_contest_id" + add_index "works", ["user_id"], :name => "index_works_on_user_id" + + create_table "works_categories", :force => true do |t| + t.string "category" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "zip_packs", :force => true do |t| + t.integer "user_id" + t.integer "homework_id" + t.string "file_digest" + t.string "file_path" + t.integer "pack_times", :default => 1 + t.integer "pack_size", :default => 0 + t.text "file_digests" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + +end diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 8e9af19f4..365c40984 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -144,7 +144,7 @@ a.c_blue{ color:#3b94d6;} a.c_eblue{color: #3784D3} a.c_setting_blue{color: #0781B4} a.c_dblue{ color:#09658c;} -a:hover.c_dblue{ color:#297fb8;} +a:hover.c_dblue{ color:#2788d0;} a.c_white{ color:#fff;} input.c_white { color:#fff} a.c_dorange{ color:#fd6e2a;} @@ -201,7 +201,7 @@ a:hover.c_grey{ color:#333;} .fontBlue {color:#3498db;} span.newsBlack {color:#4b4b4b; font-size:13px; font-weight:bold} a.underline {text-decoration:underline;} -a.fontBlue {color:#297fb8;} +a.fontBlue {color:#2788d0;} .fontBlue2 {color:#3b94d6 !important;} a.fontGrey {color:#cecece;} a.fontGrey2 {color:#888888;} @@ -211,11 +211,11 @@ a.link-black:hover {color:#3b94d6;} a.link-blue {color:#3b94d6;} a.linkOrange {color:#ff7143;} a.linkBlue {color:#3b94d6;} -a.linkBlue:hover {color:#297fb8;} +a.linkBlue:hover {color:#2788d0;} a.linkBlue2 {color:#3498db;} -a.linkBlue2:hover {color:#297fb8;} +a.linkBlue2:hover {color:#2788d0;} a.buttonBlue {background-color:#3b94d6;} -a.buttonBlue:hover {background-color:#297fb8;} +a.buttonBlue:hover {background-color:#2788d0;} a.linkGrey {color:#484848;} a.linkGrey:hover {color:#3b94d6;} a.linkGrey2 {color:#888888;} @@ -223,7 +223,7 @@ a.linkGrey2:hover {color:#484848;} a.linkGrey3 {color:#484848;} a.linkGrey3:hover {color:#000000;} a.linkGrey4 {color:#484848;} -a.linkGrey4:hover {color:#297fb8;} +a.linkGrey4:hover {color:#2788d0;} a.linkGrey5 {color:#484848;} a.linkGrey5:hover {color:#3498db !important;} a.linkGrey6 {color:#484848 !important;} @@ -231,7 +231,7 @@ a.linkGrey6:hover {color:#ffffff !important;} a.linkGrey7 {color:#888888;} a.linkGrey7:hover {color:#3b94d6;} a.bBlue {background-color:#3498db;} -a.bBlue:hover {background-color:#297fb8;} +a.bBlue:hover {background-color:#2788d0;} a.bGreen {background-color:#60b25e;} a.bGreen:hover {background-color:#51a74f;} a.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;} @@ -240,7 +240,7 @@ a.link_file_a{ background:url(/images/pic_file.png) 0 2px no-repeat; padding-lef a:hover.link_file_a{ background:url(/images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} a.link_file_a2{ background:url(/images/pic_file.png) 0 -15px no-repeat; padding-left: 20px;} a.submit_btn2 {background-color: #3b94d6; padding: 3px 5px; color: #ffffff;} -a.submit_btn2:hover {background-color: #297fb8;} +a.submit_btn2:hover {background-color: #2788d0;} /****翻页***/ .wlist{float:right;} .wlist li{float:left;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 059683919..4c8d89687 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -672,3 +672,5 @@ a:hover.pro-fenzhi-a{color:#3b94d6;} span.task-linebtn-green{color:#59af48; border: 1px solid #59af48;font-size: 12px; padding: 0 5px; border-radius: 3px;line-height: 14px;} .issues-table select.select-w50{ width: 50px;} span.task-step{ color:#ee4a20;font-style: italic; font-weight:bold; font-size:14px;} +.task-display-span,a.task-display-span{ display:inline-block; border-radius:3px; width: 100%; text-align: center; color: #fff; padding: 5px 0; } +.task-bgrey{background:#ccc;} From 9a3793ffa933d4e199c9847b7daf13eef9a79c90 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 23 Feb 2017 10:45:28 +0800 Subject: [PATCH 068/118] =?UTF-8?q?=E5=AE=8C=E6=88=90training=5Ftask=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/training_tasks_controller.rb | 131 ++---------------- .../projects/_act_training_tasks.html.erb | 4 +- app/views/training_tasks/_edit.html.erb | 0 app/views/training_tasks/_form.html.erb | 3 +- app/views/training_tasks/edit.html.erb | 15 ++ config/locales/zh.yml | 1 + 6 files changed, 28 insertions(+), 126 deletions(-) create mode 100644 app/views/training_tasks/_edit.html.erb create mode 100644 app/views/training_tasks/edit.html.erb diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index 8346dbc20..56ce9da79 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -108,7 +108,7 @@ class TrainingTasksController < ApplicationController @training_task.subject = params[:training_task][:subject] @training_task.description = params[:training_task][:description] @training_task.tracker_id = params[:training_task][:tracker_id] - @training_task.position = params[:training_sequence].to_i + @training_task.position = params[:training_task][:position].to_i if @training_task.save respond_to do |format| format.html { @@ -129,87 +129,23 @@ class TrainingTasksController < ApplicationController end def edit + @project_menu_type = 11 # 修改实例变量的值 - return unless update_issue_from_params - # issue 关联的commit - commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) - @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} - + return unless build_new_task_from_params respond_to do |format| - format.html {render :layout => 'base_projects' }#added by young + format.html {render :layout => 'base_projects' } format.xml { } end end # 用户编辑更改issue def update - # params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0 - # params[:fixed_version_id] = nil if params[:fixed_version_id].to_i == 0 - if params[:issue_detail] - issue = Issue.find(params[:id]) - issue = update_user_issue_detail(issue, params) - @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 - @issue.fixed_version_id = nil if @issue.fixed_version_id == 0 - saved = false - begin - @saved = @issue.save_issue_with_child_records(params, @time_entry) - rescue ActiveRecord::StaleObjectError - @conflict = true - if params[:last_journal_id] - @conflict_journals = @issue.journals_after(params[:last_journal_id]).all - @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) - end - end - end - if @saved - # 更新commit关联情况 - update_issue_commit params[:commit_ids] - #修改界面增加跟踪者 - watcherlist = @issue.watcher_users - select_users = [] - if params[:issue] - if params[:issue][:watcher_user_ids] - params[:issue][:watcher_user_ids].each do |user_id| - select_users << User.find(user_id) - end - end - end - select_users.each do |user| - if watcherlist.include? user - else - @issue.add_watcher user - end - end - watcherlist.each do |user| - if select_users.include? user - else - @issue.remove_watcher user - end - end - - render_attachment_warning_if_needed(@issue) - reply_id = params[:reference_user_id].to_i - if reply_id > 0 - JournalReply.add_reply(@issue.current_journal.id, reply_id, User.current.id) - end - #flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record? 去掉这个notice,因为现在更新都是ajax操作 + return unless build_new_task_from_params + @training_task.save_attachments(params[:attachments] || (params[:training_task] && params[:training_task][:uploads])) + if @training_task.update_attributes(params[:training_task]) respond_to do |format| format.js - format.html { redirect_to issue_url(@issue.id) } - format.api { render_api_ok } - end - else - respond_to do |format| - - format.js - format.html { render :action => 'edit' } - format.api { render_validation_errors(@issue) } + format.html{redirect_to training_task_url(@training_task)} end end end @@ -723,65 +659,16 @@ class TrainingTasksController < ApplicationController end end - # Used by #edit and #update to set some common instance variables - # from the params - # TODO: Refactor, not everything in here is needed by #edit - def update_issue_from_params - @edit_allowed = User.current.allowed_to?(:edit_issues, @project) - @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) - @time_entry.attributes = params[:time_entry] - - # 更新issue状态时,journal表产生记录,返回@current_journal - @issue.init_journal(User.current) - issue_attributes = params[:issue] - if issue_attributes && params[:conflict_resolution] - case params[:conflict_resolution] - when 'overwrite' - issue_attributes = issue_attributes.dup - issue_attributes.delete(:lock_version) - when 'add_notes' - issue_attributes = issue_attributes.slice(:notes) - when 'cancel' - redirect_to issue_url(@issue) - return false - end - end - - if params[:action] == "update" - senduser = User.find(params[:issue][:assigned_to_id]) - if senduser.id != User.current.id && @issue.assigned_to_id != params[:issue][:assigned_to_id].to_i - issue_id = @issue.id - issue_title = params[:issue][:subject] - priority_id = params[:issue][:priority_id] - ps = ProjectsService.new - ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id - end - end - - @issue.safe_attributes = issue_attributes - @priorities = IssuePriority.active - @allowed_statuses = @issue.new_statuses_allowed_to(User.current) - true - end - - # TODO: Refactor, lots of extra code in here - # TODO: Changing tracker on an existing issue should not trigger this def build_new_task_from_params if params[:id].blank? @training_task = TrainingTask.new @training_task.project = @project else - @training_task = @project.training_tasks.visible.find(params[:id]) + @training_task = @project.training_tasks.find(params[:id]) end @training_task.project = @project @training_task.author ||= User.current - # Tracker must be set before custom field values - @training_task.tracker ||= @project.trackers.find((params[:training_task] && params[:training_task][:tracker_id]) || params[:tracker_id] || :first) - if @training_task.tracker.nil? - render_error l(:error_no_tracker_in_project) - return false - end end def check_for_default_issue_status diff --git a/app/views/projects/_act_training_tasks.html.erb b/app/views/projects/_act_training_tasks.html.erb index f60ac213b..5bcbc829a 100644 --- a/app/views/projects/_act_training_tasks.html.erb +++ b/app/views/projects/_act_training_tasks.html.erb @@ -17,10 +17,10 @@
    • - <%#= link_to l(:button_edit), edit_issue_path(activity.id), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %> + <%= link_to l(:button_edit), edit_training_task_path(activity.id), :class => 'postOptionLink', :accesskey => accesskey(:edit) %>
    • - <%#= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %> + <%= link_to l(:button_delete), training_task_path(activity.id), :data => {:confirm => l(:text_trainig_task_destroy_confirmation)}, :method => :delete, :class => 'postOptionLink' %>
  • diff --git a/app/views/training_tasks/_edit.html.erb b/app/views/training_tasks/_edit.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/training_tasks/_form.html.erb b/app/views/training_tasks/_form.html.erb index 0b3245e74..a7dcee893 100644 --- a/app/views/training_tasks/_form.html.erb +++ b/app/views/training_tasks/_form.html.erb @@ -1,8 +1,7 @@
    • - - + <%= f.text_field :position, :no_label => true, :placeholder => "请输入序号(整数)", :onkeyup => "this.value=this.value.replace(/\D/g,'')", :onafterpaste => "this.value=this.value.replace(/\D/g,'')" %>
    • diff --git a/app/views/training_tasks/edit.html.erb b/app/views/training_tasks/edit.html.erb new file mode 100644 index 000000000..14732824b --- /dev/null +++ b/app/views/training_tasks/edit.html.erb @@ -0,0 +1,15 @@ +
      + <%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> + <% end %> + +
      +
      + <%= labelled_form_for @training_task, :html => {:id => 'project_training_form', :multipart => true} do |f| %> +
      + <%= render :partial => 'training_tasks/form', :locals => {:f => f} %> +
      + <% end %> +
      +
      +
      diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8027b4f78..83f7b6a69 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1003,6 +1003,7 @@ zh: text_status_changed_by_changeset: "已应用到变更列表 %{value}." text_time_logged_by_changeset: "已应用到修订版本 %{value}." text_issues_destroy_confirmation: '您确定要删除选中的问题吗?' + text_trainig_task_destroy_confirmation: '您确定要删除选中的任务吗?' text_default_administrator_account_changed: 默认的管理员帐号已改变 text_file_repository_writable: 附件路径可写 text_plugin_assets_writable: 插件的附件路径可写 From 6d14cb131a1bdfb00f468107734d843fce9f49c8 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 23 Feb 2017 13:39:44 +0800 Subject: [PATCH 069/118] =?UTF-8?q?=E9=97=AE=E5=90=A7=E5=8F=B3=E4=B8=8B?= =?UTF-8?q?=E8=A7=92=E8=B4=B4=E5=90=A7=E6=8E=92=E5=BA=8F=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=8F=91=E5=B8=83=E6=95=B0=E5=92=8C=E5=9B=9E?= =?UTF-8?q?=E5=B8=96=E6=95=B0=E4=B9=8B=E5=92=8C=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 8eff74041..0f5a55ab9 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -143,7 +143,7 @@ class ForumsController < ApplicationController reorder(order). preload(:author, {:last_reply => :author}). all - @forums = Forum.reorder("topic_count desc,updated_at desc") + @forums = Forum.find_by_sql("SELECT *,topic_count + memo_count tm FROM `forums` order by tm desc;") @my_forums_count = Memo.where("author_id =? and parent_id is null", User.current.id).count @my_memos_count = Memo.where("author_id =? and parent_id is not null", User.current.id).count @errors = params[:errors] From 727a6fd536e58e0dd75fd50148189b24f076fe88 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 23 Feb 2017 14:13:25 +0800 Subject: [PATCH 070/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/training_tasks_controller.rb | 335 +----------------- .../projects/_act_training_tasks.html.erb | 18 +- app/views/training_tasks/_detail.html.erb | 13 +- .../_training_task_details.html.erb | 15 + 4 files changed, 32 insertions(+), 349 deletions(-) create mode 100644 app/views/training_tasks/_training_task_details.html.erb diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index 56ce9da79..ad10d34c2 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -2,7 +2,7 @@ class TrainingTasksController < ApplicationController layout 'base_projects' - before_filter :find_project, :only => [:index, :new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete] + before_filter :find_project, :only => [:index, :new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete, :destroy] before_filter :allow_manager, :only => [] before_filter :allow_members, :only => [:new, :create] before_filter :build_new_task_from_params, :only => [:new, :create, :update_form] @@ -168,125 +168,15 @@ class TrainingTasksController < ApplicationController def update_form end - # Bulk edit/copy a set of issues - def bulk_edit - @issues.sort! - @copy = params[:copy].present? - @notes = params[:notes] - - if User.current.allowed_to?(:move_issues, @projects) - @allowed_projects = Issue.allowed_target_projects_on_move - if params[:issue] - @target_project = @allowed_projects.detect {|p| p.id.to_s == params[:issue][:project_id].to_s} - if @target_project - target_projects = [@target_project] - end - end - end - target_projects ||= @projects - - if @copy - @available_statuses = [IssueStatus.default] - else - @available_statuses = @issues.map(&:new_statuses_allowed_to).reduce(:&) - end - @custom_fields = target_projects.map{|p|p.all_issue_custom_fields}.reduce(:&) - @assignables = target_projects.map(&:assignable_users).reduce(:&) - @trackers = target_projects.map(&:trackers).reduce(:&) - @versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&) - @categories = target_projects.map {|p| p.issue_categories}.reduce(:&) - if @copy - @attachments_present = @issues.detect {|i| i.attachments.any?}.present? - @subtasks_present = @issues.detect {|i| !i.leaf?}.present? - end - - @safe_attributes = @issues.map(&:safe_attribute_names).reduce(:&) - render :layout => false if request.xhr? - end - - def bulk_update - @issues.sort! - @copy = params[:copy].present? - attributes = parse_params_for_bulk_issue_attributes(params) - - unsaved_issue_ids = [] - moved_issues = [] - - if @copy && params[:copy_subtasks].present? - # Descendant issues will be copied with the parent task - # Don't copy them twice - @issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}} - end - - @issues.each do |issue| - issue.reload - if @copy - issue = issue.copy({}, - :attachments => params[:copy_attachments].present?, - :subtasks => params[:copy_subtasks].present? - ) - end - journal = issue.init_journal(User.current, params[:notes]) - issue.safe_attributes = attributes - call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue }) - if issue.save - moved_issues << issue - else - # Keep unsaved issue ids to display them in flash error - unsaved_issue_ids << issue.id - end - end - set_flash_from_bulk_issue_save(@issues, unsaved_issue_ids) - - if params[:follow] - if @issues.size == 1 && moved_issues.size == 1 - redirect_to issue_url(moved_issues.first) - elsif moved_issues.map(&:project).uniq.size == 1 - redirect_to project_issues_url(moved_issues.map(&:project).first) - end - else - redirect_back_or_default _project_issues_path(@project) - end - end - def destroy - # 增加删除页面类型,如果是个人主页,则返回该主页,项目动态则返回项目动态页眉 - page_classify = params[:page_classify] unless params[:page_classify].nil? - page_id = params[:page_id] unless params[:page_id].nil? - @hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f - if @hours > 0 - case params[:todo] - when 'destroy' - # nothing to do - when 'nullify' - TimeEntry.update_all('issue_id = NULL', ['issue_id IN (?)', @issues]) - when 'reassign' - reassign_to = @project.issues.find_by_id(params[:reassign_to_id]) - if reassign_to.nil? - flash.now[:error] = l(:error_issue_not_found_in_project) - return - else - TimeEntry.update_all("issue_id = #{reassign_to.id}", ['issue_id IN (?)', @issues]) - end - else - # display the destroy form if it's a user request - return unless api_request? - end - end - @issues.each do |issue| - begin - issue.reload.destroy - rescue ::ActiveRecord::RecordNotFound # raised by #reload if issue no longer exists - # nothing to do, issue was already deleted (eg. by a parent) - end - end + return unless build_new_task_from_params + @training_task.destroy respond_to do |format| - if page_classify - format.html { redirect_back_or_default _project_issues_path(@project, page_classify, page_id) } + if params[:type] == "project_show" + format.html {redirect_to project_path(@project)} else - format.html { redirect_back_or_default _project_issues_path(@project) } + format.html {redirect_to project_training_tasks_path(@project)} end - format.api { render_api_ok } end end @@ -413,219 +303,6 @@ class TrainingTasksController < ApplicationController end end - def statistics - @project = Project.find(params[:id]) - params[:author_id].to_i != 0 ? (@author = User.find(params[:author_id].to_i).show_name) : @author = 0 - case params[:tracker_id].to_i - when 1 - @tracker = "缺陷" - when 2 - @tracker = "功能" - when 3 - @tracker = "支持" - when 4 - @tracker = "任务" - when 5 - @tracker = "周报" - when 0 - @tracker = 0 - end - params[:subject].blank? ? @search = 0 : @search = params[:subject] - params[:assigned_to_id].to_i != 0 ? (@assigned = User.find(params[:assigned_to_id].to_i).show_name) : @assigned = 0 - params[:fixed_version_id].to_i != 0 ? (@version = Version.find(params[:fixed_version_id].to_i).name) : @version = 0 - params[:done_ratio].to_i != -1 ? (@done = params[:done_ratio].to_i) : @done = -1 - case params[:priority_id].to_i - when 1 - @prior = "低" - when 2 - @prior = "正常" - when 3 - @prior = "高" - when 4 - @prior = "紧急" - when 5 - @prior = "立刻" - when 0 - @prior = 0 - end - case params[:status_id].to_i - when 1 - @status = "新增" - when 2 - @status = "正在解决" - when 3 - @status = "已解决" - when 4 - @status = "反馈" - when 5 - @status = "关闭" - when 6 - @status = "拒绝" - when 0 - @status = 0 - end - params[:issue_create_date_start].blank? ? @start_time = 0 : @start_time = params[:issue_create_date_start] - params[:issue_create_date_end].blank? ? @end_time = 0 : @end_time = params[:issue_create_date_end] - @filter_condition = true - @filter_condition = false if (@author == 0 && @tracker == 0 && @search == 0 && @assigned == 0 && @version == 0 && @done == -1 && @prior ==0 && @status == 0 && @start_time ==0 && @end_time) - if @project.nil? - render_404 - end - retrieve_query - sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) - sort_update(@query.sortable_columns) - @query.sort_criteria = sort_criteria.to_a - @project_base_tag = 'base_projects' - if @query.valid? - @tracker_id = params[:tracker_id] - @assign_to_id = params[:assigned_to_id] - @author_id = params[:author_id] - @priority_id = params[:priority_id] - @status_id = params[:status_id] - @subject = params[:subject] - @done_ratio = params[:done_ratio] - @fixed_version_id = params[:fixed_version_id] - @issue_count = @query.issue_count - @test = params[:test] - @project_sort = 'issues.updated_on desc' - if params[:test] != "0" - case @test - when "1" - @project_sort = 'issues.created_on desc' - when "2" - @project_sort = 'issues.created_on asc' - when "3" - @project_sort = 'issues.updated_on desc' - when "4" - @project_sort = 'issues.updated_on asc' - end - end - # 搜索结果 - # SELECT assigned_to_id, count(*) as ac FROM `issues` where project_id = @project.id group by assigned_to_id order by ac desc; - @issues_filter = @query.issues.sort_by{ |i| Issue.where(:project_id => @project.id , :assigned_to_id => i.assigned_to_id).count }.reverse - # @issues_filter = @query.issues(:order => @project_sort) - - # if params[:type] == 1 || params[:type].nil? - # @results = @issues_filter - # elsif params[:type] == "2" - # @results = @issues_filter.collect{|result| result.status_id !=5 } - # elsif params[:type] == "3" - # @results = @issues_filter.collect{|result| result.status_id !=5 } - # end - - #统计 - @results = {} - - #统计total - @alltotal = {} - for i in 0..5 do - @alltotal[i] = 0 - end - - @opentotal = {} - for i in 0..5 do - @opentotal[i] = 0 - end - - @closetotal = {} - for i in 0..5 do - @closetotal[i] = 0 - end - - #开启关闭 - @issue_open_count = 0 - @issue_close_count = 0 - - @issues_filter.each do |issue| - @alltotal[0] = @alltotal[0] + 1 - @alltotal[issue.tracker_id.to_i] = @alltotal[issue.tracker_id.to_i] + 1 - user_id = issue.assigned_to_id - if issue.assigned_to_id.nil? - user_id = 0 - end - - if !@results[user_id].nil? - @results[user_id][0] = @results[user_id][0] + 1 - @results[user_id][issue.tracker_id.to_i] = @results[user_id][issue.tracker_id.to_i] + 1 - - if issue.status_id.to_i == 5 - @issue_close_count = @issue_close_count + 1 - @results[user_id][12] = @results[user_id][12]+1 - @results[user_id][12+issue.tracker_id.to_i] = @results[user_id][12+issue.tracker_id.to_i]+1 - - @closetotal[0] = @closetotal[0] + 1 - @closetotal[issue.tracker_id.to_i] = @closetotal[issue.tracker_id.to_i] + 1 - else - @issue_open_count = @issue_open_count + 1 - @results[user_id][6] = @results[user_id][6]+1 - @results[user_id][6+issue.tracker_id.to_i] = @results[user_id][6+issue.tracker_id.to_i]+1 - - @opentotal[0] = @opentotal[0] + 1 - @opentotal[issue.tracker_id.to_i] = @opentotal[issue.tracker_id.to_i] + 1 - end - else - - @results[user_id] = {} - - tmpuser = User.find(user_id) - - @results[user_id][:name] = tmpuser.nil? ? "" : tmpuser.show_name - #所有的 - @results[user_id][0] = 1 - for i in 1..17 do - @results[user_id][i] = 0 - end - # @results[user_id][1] = 0 - # @results[user_id][2] = 0 - # @results[user_id][3] = 0 - # @results[user_id][4] = 0 - # @results[user_id][5] = 0 - @results[user_id][issue.tracker_id.to_i] = 1 - - #开启的 status_id = 12346 - # @results[user_id][6] = 0 - # @results[user_id][7] = 0 - # @results[user_id][8] = 0 - # @results[user_id][9] = 0 - # @results[user_id][10] = 0 - # @results[user_id][11] = 0 - - #关闭的 status_id = 5 - # @results[user_id][12] = 0 - # @results[user_id][13] = 0 - # @results[user_id][14] = 0 - # @results[user_id][15] = 0 - # @results[user_id][16] = 0 - # @results[user_id][17] = 0 - - if issue.status_id.to_i == 5 - @results[user_id][12] = 1 - @results[user_id][12+issue.tracker_id.to_i] = 1 - @issue_close_count = @issue_close_count+1 - - @closetotal[0] = @closetotal[0] + 1 - @closetotal[issue.tracker_id.to_i] = @closetotal[issue.tracker_id.to_i] + 1 - else - @issue_open_count = @issue_open_count+1 - @results[user_id][6] = 1 - @results[user_id][6+issue.tracker_id.to_i] = 1 - - @opentotal[0] = @opentotal[0] + 1 - @opentotal[issue.tracker_id.to_i] = @opentotal[issue.tracker_id.to_i] + 1 - end - - end - end - - respond_to do |format| - format.js - end - - else - render_404 - end - end - private def find_project diff --git a/app/views/projects/_act_training_tasks.html.erb b/app/views/projects/_act_training_tasks.html.erb index 1bc9ec80e..12825c4c7 100644 --- a/app/views/projects/_act_training_tasks.html.erb +++ b/app/views/projects/_act_training_tasks.html.erb @@ -20,27 +20,15 @@ <%= link_to l(:button_edit), edit_training_task_path(activity.id), :class => 'postOptionLink', :accesskey => accesskey(:edit) %>
    • - <%= link_to l(:button_delete), training_task_path(activity.id), :data => {:confirm => l(:text_trainig_task_destroy_confirmation)}, :method => :delete, :class => 'postOptionLink' %> + <%= link_to l(:button_delete), training_task_path(activity.id, :project_id => @project.id, :type => "project_show"), :data => {:confirm => l(:text_trainig_task_destroy_confirmation)}, :method => :delete, :class => 'postOptionLink' %>
    <% end %> -
    - <% if activity.status == 1 %> -
    - <% else %> -
    - <% end %> - step<%= activity.position %> - - <%= link_to activity.subject.to_s, training_task_url(activity), :class => "postGrey ml5 fl", :target => "_blank" %> - <% if activity.status == 1 %> - 已解决 - <% else %> - 正在解决中 - <% end %> +
    + <%= render :partial => "training_tasks/training_task_details", :locals => {:activity => activity} %>
    diff --git a/app/views/training_tasks/_detail.html.erb b/app/views/training_tasks/_detail.html.erb index e28fef9f2..9065952af 100644 --- a/app/views/training_tasks/_detail.html.erb +++ b/app/views/training_tasks/_detail.html.erb @@ -3,9 +3,9 @@ <%= link_to image_tag(url_to_avatar(@training_task.author), :width => 46, :height => 46), user_path(@training_task.author), :class => "ping_dispic" %>
    -

    - <%= @training_task.subject %>

    - +
    + <%= render :partial => "training_tasks/training_task_details", :locals => {:activity => @training_task, :project_id => @project.id} %> +

    由<%=link_to @training_task.author.show_name, user_path(@training_task.author), :class => "link-blue" %>添加于 <%= format_time(@training_task.created_at).html_safe %> @@ -14,12 +14,15 @@ - <%#= render :partial => 'action_menu' %> + <% if User.current.logged? && is_project_manager?(User.current.id, @project.id) || @training_task.author_id == User.current.id %> + <%= link_to l(:button_delete), training_task_path(@training_task.id, :project_id => @project.id), :data => {:confirm => l(:text_trainig_task_destroy_confirmation)}, :method => :delete, :class => 'talk_edit fr' %> + <%= link_to l(:button_edit), edit_training_task_path(@training_task), :class => 'talk_edit fr', :accesskey => accesskey(:edit) %> + <% end %> +
    <% if @training_task.description? || @training_task.attachments.any? -%>
    <% if @training_task.description? %> - <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> <%= textAreailizable @training_task, :description, :attachments => @training_task.attachments %> <% end %>
    diff --git a/app/views/training_tasks/_training_task_details.html.erb b/app/views/training_tasks/_training_task_details.html.erb new file mode 100644 index 000000000..9ef46f019 --- /dev/null +++ b/app/views/training_tasks/_training_task_details.html.erb @@ -0,0 +1,15 @@ +
    + <% if activity.status == 1 %> +
    + <% else %> +
    + <% end %> + step<%= activity.position %> + + <%= link_to activity.subject.to_s, training_task_url(activity), :class => "postGrey ml5 fl", :target => "_blank" %> + <% if activity.status == 1 %> + 已解决 + <% else %> + 正在解决中 + <% end %> +
    \ No newline at end of file From 0e482624075bc1c3d19b36ba962d22c1a300ac6d Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 23 Feb 2017 15:27:10 +0800 Subject: [PATCH 071/118] =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E8=AF=84=E6=B5=8Bajax=E5=B1=80=E9=83=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/_act_training_tasks.html.erb | 10 +++------ app/views/projects/task_execute.js.erb | 2 +- .../training_tasks/_action_status.html.erb | 22 ++++++++++++------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/views/projects/_act_training_tasks.html.erb b/app/views/projects/_act_training_tasks.html.erb index 12825c4c7..b83b78cc4 100644 --- a/app/views/projects/_act_training_tasks.html.erb +++ b/app/views/projects/_act_training_tasks.html.erb @@ -42,17 +42,13 @@
    <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> - - 提交测评。 - 当前任务正在后台测评中,稍后将显示您的任务完成情况...... - 本任务已通过测评,处于关闭状态。 - - -
    <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
    +
    + <%= render :partial => "training_tasks/action_status", :locals => {:activity => activity} %> +
    diff --git a/app/views/projects/task_execute.js.erb b/app/views/projects/task_execute.js.erb index 1dd2affac..13b034095 100644 --- a/app/views/projects/task_execute.js.erb +++ b/app/views/projects/task_execute.js.erb @@ -1 +1 @@ -$("#task_action_status_<%= @training_task.id %>").html('<%= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>'); \ No newline at end of file +$("#training_project_task_status_<%= @training_task.id %>").html('<%= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>'); \ No newline at end of file diff --git a/app/views/training_tasks/_action_status.html.erb b/app/views/training_tasks/_action_status.html.erb index 49876c3a3..1dd9b9714 100644 --- a/app/views/training_tasks/_action_status.html.erb +++ b/app/views/training_tasks/_action_status.html.erb @@ -1,8 +1,14 @@ -<% activity = activity.nil? ? local_assigns[:activity] : activity %> -<% if activity.status == 1 %> - 评测通过 -<% elsif activity.status == 2 %> - 评测中 -<% else %> - <%= link_to "提交评测", task_execute_project_path(@project, :training_task_id => activity.id), :class => "btn btn-blue", :remote => true %> -<% end %> +<%# activity = activity.nil? ? local_assigns[:activity] : activity %> +
    + <% if activity.status == 1 %> + 本任务已通过测评,处于关闭状态。 + <% elsif activity.status == 2 %> + 当前任务正在后台测评中,稍后将显示您的任务完成情况...... + <% else %> + <%= link_to "提交评测", task_execute_project_path(@project, :training_task_id => activity.id), :class => "task-display-span bBlue mt10", :remote => true %> + <% end %> +
    + + + + From 6bd160d642c87c32830c1e9a5b6461fa49959c45 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 23 Feb 2017 15:46:07 +0800 Subject: [PATCH 072/118] =?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/projects/task_execute.js.erb | 3 ++- app/views/training_tasks/_detail.html.erb | 6 +++--- .../training_tasks/_training_task_details.html.erb | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/views/projects/task_execute.js.erb b/app/views/projects/task_execute.js.erb index 13b034095..e6528db39 100644 --- a/app/views/projects/task_execute.js.erb +++ b/app/views/projects/task_execute.js.erb @@ -1 +1,2 @@ -$("#training_project_task_status_<%= @training_task.id %>").html('<%= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>'); \ No newline at end of file +$("#training_project_task_status_<%= @training_task.id %>").html('<%= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>'); +$("#training_task_details").html('<%= escape_javascript( render :partial => 'training_tasks/training_task_details', :locals => {:activity => @training_task, :project_id => @project.id}) %>'); \ No newline at end of file diff --git a/app/views/training_tasks/_detail.html.erb b/app/views/training_tasks/_detail.html.erb index 9065952af..7c272e1cb 100644 --- a/app/views/training_tasks/_detail.html.erb +++ b/app/views/training_tasks/_detail.html.erb @@ -10,7 +10,6 @@
    由<%=link_to @training_task.author.show_name, user_path(@training_task.author), :class => "link-blue" %>添加于 <%= format_time(@training_task.created_at).html_safe %> - <%= link_to "完成", complete_training_task_training_task_path(@training_task), :class => "sy_btn_green fr" %> @@ -32,9 +31,10 @@
    <%= render :partial => 'task_attachments', :locals => {:training_task => @training_task} %>
    - - <%#= render :partial => 'issues/attributes_show' %>
    +
    + <%= render :partial => "training_tasks/action_status", :locals => {:activity => @training_task} %> +
    From 03b7f91ed8956879ab23c057c06c615b9947b928 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 24 Feb 2017 20:28:23 +0800 Subject: [PATCH 107/118] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=EF=BC=9A=E5=A6=82=E5=9B=BE=E5=88=86=E7=BB=84=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E2=80=9C=E4=BD=9C=E5=93=81=E6=9C=80=E7=BB=88=E8=AF=84=E5=88=86?= =?UTF-8?q?=E2=80=9D=E6=98=BE=E7=A4=BA=E7=9A=84=E6=98=AF=E6=89=A3=E5=88=86?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E5=88=86=EF=BC=8C=E6=99=AE=E9=80=9A=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E6=98=BE=E7=A4=BA=E7=9A=84=E5=8D=B4=E6=98=AF=E6=89=A3?= =?UTF-8?q?=E5=88=86=E5=90=8E=E7=9A=84=E5=88=86=EF=BC=8C=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_un_work.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index e61d65bc2..04e48bf7d 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -129,7 +129,7 @@ 作品最终评分为  <%= student_work.final_score %> 
    - 迟交扣分 + 迟交扣分   <%= student_work.late_penalty %>  
    From a6bf791358fbffa2d7fc5d156963f7273e0de07c Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 24 Feb 2017 20:38:49 +0800 Subject: [PATCH 108/118] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=A6=82?= =?UTF-8?q?=E5=9B=BE=E5=88=86=E9=A1=B5=E5=BD=93=E5=89=8D=E9=A1=B5=E4=B8=BA?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E9=A1=B5=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E9=A1=B5=E5=BB=BA=E8=AE=AE=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 2f7d66ee0..b8c2c3880 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -199,7 +199,7 @@ class BoardsController < ApplicationController end else respond_to do |format| - format.js + format.js {render "show.js.erb"} format.html { if @project render :action => 'show', :layout => 'base_projects' From 5be7e048cfec737d4f15da1db69e1d09207e6384 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Feb 2017 21:21:48 +0800 Subject: [PATCH 109/118] =?UTF-8?q?=E6=B2=A1=E7=99=BB=E9=99=86=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8D=E5=85=81=E8=AE=B8=E5=BC=80=E5=90=AF=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 3 +++ .../attachments/_project_file_links.html.erb | 10 ++++++++++ app/views/projects/_applied_status.html.erb | 15 ++++++++------- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 0230e562a..c041a2753 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -827,6 +827,9 @@ class ProjectsController < ApplicationController # 已经实训过直接跳入 # def training_chiled_project_exec + if !User.current.logged? + return render_403 + end respond_to do |format| format.js end diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index a1a978a48..3e5457518 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -84,6 +84,16 @@ #:id => "attachments_" + attachment.id.to_s, :title => l(:button_delete) %> <% end %> + <% elsif attachment.container_type == 'TrainingTask' %> + <% if User.current == attachment.author %> + <%= link_to image_tag('delete.png'), attachment_path(attachment), + :data => {:confirm => l(:text_are_you_sure)}, + :method => :delete, + :class => 'delete', + #:remote => true, + #:id => "attachments_" + attachment.id.to_s, + :title => l(:button_delete) %> + <% end %> <% else %> <%= link_to image_tag('delete.png'), attachment_path(attachment), :data => {:confirm => l(:text_are_you_sure)}, diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb index 06bd2bf0b..cde6450a9 100644 --- a/app/views/projects/_applied_status.html.erb +++ b/app/views/projects/_applied_status.html.erb @@ -36,14 +36,15 @@
  • - <% if @project.is_training_project? && User.current.id != @project.user_id %> - <%= link_to "开始实训", training_chiled_project_exec_project_path(@project), :class => "sy_btn_green fr", :remote => true %> - <% else %> - <%= link_to "".html_safe+"Fork", forked_pop_project_path(@project), - :class=>"pro_new_topbtn_left fl", :remote => true %> - <%= project_fork_count %> + <% if User.current.logged? %> + <% if @project.is_training_project? && User.current.id != @project.user_id %> + <%= link_to "开始实训", training_chiled_project_exec_project_path(@project), :class => "sy_btn_green fr", :remote => true %> + <% else %> + <%= link_to "".html_safe+"Fork", forked_pop_project_path(@project), + :class=>"pro_new_topbtn_left fl", :remote => true %> + <%= project_fork_count %> + <% end %> <% end %> -
  • From 9f92eff1781c24c419b29acc6b30f0b28641915f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Feb 2017 22:09:25 +0800 Subject: [PATCH 110/118] =?UTF-8?q?task=E7=BC=96=E8=BE=91=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/training_tasks_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/training_tasks_controller.rb b/app/controllers/training_tasks_controller.rb index 5ec9ae841..7b49fd44f 100644 --- a/app/controllers/training_tasks_controller.rb +++ b/app/controllers/training_tasks_controller.rb @@ -149,7 +149,11 @@ class TrainingTasksController < ApplicationController def update return unless build_new_task_from_params @training_task.save_attachments(params[:attachments] || (params[:training_task] && params[:training_task][:uploads])) - if @training_task.update_attributes(params[:training_task]) + # params[:training_task][:position] = params[:training_task][:position].to_i + @training_task.position = params[:training_task][:position].to_i + @training_task.subject = params[:training_task][:subject] + @training_task.description = params[:training_task][:description] + if @training_task.save respond_to do |format| format.js format.html{redirect_to training_task_url(@training_task)} From 6e827a3a8c65a753625cc3f37c8ea1e66801d039 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 24 Feb 2017 22:16:35 +0800 Subject: [PATCH 111/118] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c041a2753..4e03e071c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -34,6 +34,9 @@ class ProjectsController < ApplicationController before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar] before_filter :file + + skip_before_filter :check_if_login_required, only: [:training_task_status] + # 除非项目内人员,不可查看成员, TODO: 完了写报表里去 # before_filter :memberAccess, only: :member From f459609c81348f4ec43f8aa68c95f7af018d17c4 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Feb 2017 11:08:37 +0800 Subject: [PATCH 112/118] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E9=AA=8C=E8=AF=81=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E5=90=8E=E6=B7=BB=E5=8A=A0=E5=AF=BC?= =?UTF-8?q?=E5=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 16 ++++++++-------- app/views/layouts/_base_project_top.html.erb | 6 +++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 4e03e071c..5370d2512 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -21,13 +21,14 @@ class ProjectsController < ApplicationController layout 'base_projects' before_filter :authorize1, :only => [:show] - menu_item :overview, :only => :show - menu_item :roadmap, :only => :roadmap - menu_item :settings, :only => :settings - menu_item :homework, :only => [:homework, :new_homework] - menu_item :feedback, :only => :feedback - menu_item :share, :only => :share - + # menu_item :overview, :only => :show + # menu_item :roadmap, :only => :roadmap + # menu_item :settings, :only => :settings + # menu_item :homework, :only => [:homework, :new_homework] + # menu_item :feedback, :only => :feedback + # menu_item :share, :only => :share + skip_before_filter :verify_authenticity_token, :only => [:training_task_status] + skip_before_filter :check_if_login_required, :only => [:training_task_status] before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise, :view_homework_attaches,:join_project, :project_home, :training_execute, :training_task_status] before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course] @@ -35,7 +36,6 @@ class ProjectsController < ApplicationController before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar] before_filter :file - skip_before_filter :check_if_login_required, only: [:training_task_status] # 除非项目内人员,不可查看成员, TODO: 完了写报表里去 # before_filter :memberAccess, only: :member diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index 18733a326..4e1433905 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -10,7 +10,11 @@
    <% unless @project.is_public? %><% end %> - <%=link_to "#{@project.owner.try(:show_name)}/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> + <% if @project.is_training_project? %> + <%=link_to "#{@project.owner.try(:show_name)}导师/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> + <% else %> + <%=link_to "#{@project.owner.try(:show_name)}/".html_safe, user_path(@project.owner), :class => "pro_new_username" %> + <% end %> <%=link_to @project.name, project_path(@project), :class => "pro_new_username break_word" %>
    From 011a0d7d36442fdc9310a405eff9d01adfb914a7 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Feb 2017 19:43:49 +0800 Subject: [PATCH 113/118] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=BA=8F=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5370d2512..5cb234d19 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -885,8 +885,9 @@ class ProjectsController < ApplicationController taskId = params[:training_task_id] jobName = @project.forked_from_project_id @training_task = TrainingTask.find(taskId) + position = @training_task.position if @training_task.status == 0 - params = {:jobName => "#{jobName}", :taskId => "#{taskId}"} + params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :position => "#{position}"} uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") begin res = uri_exec uri, params From 4127022891bfb9f4817c14cc03131b8e546167b1 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Feb 2017 19:55:47 +0800 Subject: [PATCH 114/118] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5cb234d19..a63d7904b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -885,9 +885,9 @@ class ProjectsController < ApplicationController taskId = params[:training_task_id] jobName = @project.forked_from_project_id @training_task = TrainingTask.find(taskId) - position = @training_task.position + step = @training_task.position if @training_task.status == 0 - params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :position => "#{position}"} + params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}"} uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") begin res = uri_exec uri, params From aec9a1dcce3e36d351771543ef80e820184b786f Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Feb 2017 20:37:02 +0800 Subject: [PATCH 115/118] =?UTF-8?q?msg=20=E8=A7=A3=E7=A0=81=EF=BC=9B=20?= =?UTF-8?q?=E4=BC=A0gitUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index a63d7904b..e7d562f30 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -886,8 +886,12 @@ class ProjectsController < ApplicationController jobName = @project.forked_from_project_id @training_task = TrainingTask.find(taskId) step = @training_task.position + original_project = Project.find(jobName) + rep_identify = Repository.where(:project_id => jobName, :type => "Repository::Gitlab").first.try(:identifier) + gitlab_address = Redmine::Configuration['gitlab_address'] + gitUrl = gitlab_address.to_s+"/"+original_project.owner.to_s+"/"+ rep_identify + "."+"git" if @training_task.status == 0 - params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}"} + params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}", :gitUrl => "#{gitUrl}"} uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") begin res = uri_exec uri, params @@ -939,7 +943,7 @@ class ProjectsController < ApplicationController def training_task_status status = params[:status].to_i task_id = params[:taskId] - message = params[:msg] + message = Base64.decode64(params[:msg]) begin @training_task = TrainingTask.find(task_id) # 如果已经执行成功过,则不重复执行 From e2280d5da77863030ae744d87562b922f4797f46 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Feb 2017 20:44:44 +0800 Subject: [PATCH 116/118] =?UTF-8?q?=E4=BC=A0gitlab=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e7d562f30..abcd4e924 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -886,10 +886,10 @@ class ProjectsController < ApplicationController jobName = @project.forked_from_project_id @training_task = TrainingTask.find(taskId) step = @training_task.position - original_project = Project.find(jobName) - rep_identify = Repository.where(:project_id => jobName, :type => "Repository::Gitlab").first.try(:identifier) + + rep_identify = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab").first.try(:identifier) gitlab_address = Redmine::Configuration['gitlab_address'] - gitUrl = gitlab_address.to_s+"/"+original_project.owner.to_s+"/"+ rep_identify + "."+"git" + gitUrl = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ rep_identify + "."+"git" if @training_task.status == 0 params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}", :gitUrl => "#{gitUrl}"} uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") From fce24d11a92839fc4886775604d6fa2f3d80c899 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Feb 2017 20:51:25 +0800 Subject: [PATCH 117/118] =?UTF-8?q?gitUrl=E8=BD=AC=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index abcd4e924..850c6e658 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -890,6 +890,7 @@ class ProjectsController < ApplicationController rep_identify = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab").first.try(:identifier) gitlab_address = Redmine::Configuration['gitlab_address'] gitUrl = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+ rep_identify + "."+"git" + gitUrl = Base64.encode64(gitUrl) if @training_task.status == 0 params = {:jobName => "#{jobName}", :taskId => "#{taskId}", :step => "#{step}", :gitUrl => "#{gitUrl}"} uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") From 3bda887144f5f52c9512812154048c7f86ff2622 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Feb 2017 22:50:34 +0800 Subject: [PATCH 118/118] =?UTF-8?q?=E4=BF=AE=E6=94=B9position=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 850c6e658..3b80bade0 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -961,8 +961,7 @@ class ProjectsController < ApplicationController ActiveRecord::Base.transaction do if position < original_tasks_count # 继续发布下一个任务 - position = position + 1 - publish_training_tasks original_project_id, @training_task.project_id, position + publish_training_tasks original_project_id, @training_task.project_id, position + 1 end @training_task.update_attribute(:status, 1) # 创建一条回复提醒
    名称名称 分支 语言 路径
    <%=link_to qa.sonar_name, project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %><%=link_to qa.sonar_name, project_quality_analysis_path(:resource_id => qa.sonar_name, :branch => (qa.branch.nil? ? "master" : qa.branch)), :class => "analysis-result-name fl fontBlue2 hidden" %> <%= qa.branch %> <%= qa.language %> <%= qa.path %> - <%= user.user_extensions.student_id %> + <%= user.user_real_extension.student_id %> <% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %> From 807129aeff6623f30d9b96cb15a9480135365752 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 22 Feb 2017 10:55:24 +0800 Subject: [PATCH 059/118] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=BA=8C=E7=BA=A7=E5=9B=9E=E5=A4=8D=E6=A0=B7?= =?UTF-8?q?=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/training_tasks/_training_tasks_reply_ke_form.html.erb | 2 +- app/views/users/_comment_reply_detail.html.erb | 2 +- app/views/users/_reply_to_comment.html.erb | 2 +- public/stylesheets/css/public.css | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/training_tasks/_training_tasks_reply_ke_form.html.erb b/app/views/training_tasks/_training_tasks_reply_ke_form.html.erb index b3eb316af..b01adf0e6 100644 --- a/app/views/training_tasks/_training_tasks_reply_ke_form.html.erb +++ b/app/views/training_tasks/_training_tasks_reply_ke_form.html.erb @@ -4,7 +4,7 @@ <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@training_task.author_id), :alt => "用户头像" %> -
    +
    <% if User.current.logged? %>
    <%= form_for('new_form', :url => add_reply_training_task_path(@training_task, :is_issue_show => true), :method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_comment_reply_detail.html.erb b/app/views/users/_comment_reply_detail.html.erb index 737a1a33c..587704075 100644 --- a/app/views/users/_comment_reply_detail.html.erb +++ b/app/views/users/_comment_reply_detail.html.erb @@ -1,7 +1,7 @@
    <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %>
    -
    +
    <%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
    diff --git a/app/views/users/_reply_to_comment.html.erb b/app/views/users/_reply_to_comment.html.erb index 35c27000c..31b01f3f1 100644 --- a/app/views/users/_reply_to_comment.html.erb +++ b/app/views/users/_reply_to_comment.html.erb @@ -6,7 +6,7 @@ <%= form_for('new_form',:url => {:controller => 'users', :action => 'reply_detail', :reply_id => reply.id, :type => @type, :is_project => @is_project, :user_activity_id => @user_activity_id},:method => "post", :remote => true) do |f| %>
    - +

    <% end%> diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index e8999a921..5ea8a0e42 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -864,6 +864,7 @@ a.content-username:hover{ color:#297fb8;} .orig_content{padding:5px 0px 5px 0px;line-height:24px; color:#333; word-wrap:break-word; } .orig_content img {max-width:100%;} .orig_right{ width:90%; margin-top:5px;} +.new_orig_right{ width:94%; margin-top:5px; } a.comment_ding_link{ height:24px;line-height:24px;display:inline-block;padding-left:2px;vertical-align:middle; color:#333; } a:hover.comment_ding_link{ color:#3b94d6;} .comment_ding_link span{display: inline-block;padding: 0 0px 0 8px;} From da4aaca1ea4f37c4efd2dcd5426b57cbe2ae558f Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 22 Feb 2017 12:26:56 +0800 Subject: [PATCH 060/118] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_show_messages_list.html.erb | 6 +++--- app/views/users/_join_contest_applied_message.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/_show_messages_list.html.erb b/app/views/layouts/_show_messages_list.html.erb index 6292db7d6..d51f5e9e1 100644 --- a/app/views/layouts/_show_messages_list.html.erb +++ b/app/views/layouts/_show_messages_list.html.erb @@ -132,7 +132,7 @@ role_str = "参赛者" end end %> -
  • <%= user.show_name%> <%= user.user_extensions.school_id.blank? ? "" : "来自"+user.user_extensions.school.name+"," %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%>
  • +
  • <%= user.show_name%> <%= user.user_extensions.school_id.blank? || user.user_extensions.school.nil? ? "" : "来自"+user.user_extensions.school.name+"," %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%>
  • <% elsif ma.contest_message_type == "JoinContest" and ma.status == 0 %>
  • <%=User.find(ma.contest_message_id).show_name %> 将您加入了竞赛:<%= ma.contest.name%>
  • <% elsif ma.contest_message_type == "JoinContest" and ma.status == 1 %> @@ -177,8 +177,8 @@ <% applied_contest = ma.applied %> <% contest = Contest.find applied_contest.contest_id %> <% message_user = User.find(applied_contest.user_id) %> - <% content = ''+message_user.show_name+' '+(message_user.user_extensions.school_id.blank? ? "" : "来自")+message_user.user_extensions.school.name+","+'申请以"'+ get_role_str(ma.role) + '"的身份加入竞赛:' + contest.name%> - <%= link_to content.html_safe, contest_path(contest.id), :title => "#{message_user.show_name} #{message_user.user_extensions.school_id.blank? ? '' : '来自'+message_user.user_extensions.school.name},申请以'#{get_role_str(ma.role)}'的身份加入竞赛:#{contest.name}", :target => '_blank' %> + <% content = ''+message_user.show_name+' '+(message_user.user_extensions.school_id.blank? || message_user.user_extensions.school.nil? ? "" : "来自"+message_user.user_extensions.school.name+",")+'申请以"'+ get_role_str(ma.role) + '"的身份加入竞赛:' + contest.name%> + <%= link_to content.html_safe, contest_path(contest.id), :title => "#{message_user.show_name} #{message_user.user_extensions.school_id.blank? || message_user.user_extensions.school.nil? ? '' : '来自'+message_user.user_extensions.school.name+","}申请以'#{get_role_str(ma.role)}'的身份加入竞赛:#{contest.name}", :target => '_blank' %> <% end %> <% elsif ma.class == ForgeMessage %> diff --git a/app/views/users/_join_contest_applied_message.html.erb b/app/views/users/_join_contest_applied_message.html.erb index 6ec2ab642..6ee35b1af 100644 --- a/app/views/users/_join_contest_applied_message.html.erb +++ b/app/views/users/_join_contest_applied_message.html.erb @@ -13,7 +13,7 @@ :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> - <%= message_user.user_extensions.school_id.blank? ? "" : "来自"+message_user.user_extensions.school.name+"," %> + <%= message_user.user_extensions.school_id.blank? || message_user.user_extensions.school.nil? ? "" : "来自"+message_user.user_extensions.school.name+"," %> 申请以"<%= get_role_str ma.role %>"的身份加入竞赛: From 3f105cefe75af467f65af7d1c2accb1cd15e1cb6 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 22 Feb 2017 12:33:45 +0800 Subject: [PATCH 061/118] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 6 +- app/controllers/repositories_controller.rb | 104 +++++++++++-------- app/views/layouts/_base_project_top.html.erb | 7 +- 3 files changed, 66 insertions(+), 51 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cd989ef2d..8a3445494 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -312,7 +312,11 @@ class ApplicationController < ActionController::Base def authorize_allowed(ctrl = params[:controller], action = params[:action], global = false) #modify by NWB if @project - allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project || @projects, :global => global) + if ctrl == "repositories" && action == "show" && @project.hidden_repo + allowed = User.current.admin? || (User.current.member_of?(@project) && !(role_of_members_in_project(@project.id, User.current.id) == "Reporter")) + else + allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project || @projects, :global => global) + end elsif @course allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @course || @courses, :global => global) else diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index b1e23a96a..dcc302158 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -40,7 +40,8 @@ class RepositoriesController < ApplicationController # before_filter :connect_gitlab, :only => [:quality_analysis, :commit_diff] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] - before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis, :commit_diff] + # before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis, :commit_diff] + before_filter :authorize_visible , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis, :commit_diff] # 版本库新增权限 # before_filter :show_rep, :only => [:show, :stats, :revisions, :revision, :diff, :commit_diff ] accept_rss_auth :revisions @@ -396,55 +397,55 @@ update redirect_to :controller => 'repositories', :action => 'show', :id => @project.id, to: 'gitlab' end + # 权限: + # 如果项目隐藏了版本库,则非项目成员及项目报告人员不能够访问版本库 + # 如果没有隐藏版本库,只要项目公开,其它成员都可以看到版本库 + # 项目关联了课程,课程的老师是可以看到版本库的 + # 超级管理员可以看到项目版本库 def show - if !User.current.admin? && (@project.hidden_repo && (role_of_members_in_project(@project.id, User.current.id) == "Reporter" || !is_project_member?(User.current.id, @project.id))) - render_403 - return + # 顶部导航 + @project_menu_type = 5 + + # TODO: the below will move to filter, done. + # 获取版本库目录结构 + @entries = @repository.entries(@path, @rev) + if request.xhr? + @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) else - # 顶部导航 - @project_menu_type = 5 + @changesets_latest_coimmit = @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) + # @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) + # 总的提交数 + @changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count + # 获取默认分支 + @g_default_branch = @g_project.default_branch.nil? ? "master" : @g_project.default_branch - # TODO: the below will move to filter, done. - # 获取版本库目录结构 - @entries = @repository.entries(@path, @rev) - if request.xhr? - @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) + @creator = @project.owner.to_s + gitlab_address = Redmine::Configuration['gitlab_address'] + gitlab_token = Gitlab.private_token + # token值加密解密 + token = aes_encrypt("priEn3UwXfJs3Pmy", gitlab_token) + # token值解密 + # gitlab_token = aes_dicrypt("priEn3UwXfJs3Pmy", token) + @zip_path = Gitlab.endpoint.to_s + "/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=" + token + + @creator = @project.owner.to_s + gitlab_address = Redmine::Configuration['gitlab_address'] + @repos_url = gitlab_address.to_s+"/" + @creator + "/" + @repository.identifier+"."+"git" + + # 一些数据的异步同步更新 + # 访问版本庫后更新project_score表数据;changeset_num为提交总数 + project_score = @project.project_score + if project_score.nil? + ProjectScore.create(:project_id => @project.id, :score => false) else - @changesets_latest_coimmit = @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) - # @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path) - # 总的提交数 - @changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count - # 获取默认分支 - @g_default_branch = @g_project.default_branch.nil? ? "master" : @g_project.default_branch - - @creator = @project.owner.to_s - gitlab_address = Redmine::Configuration['gitlab_address'] - gitlab_token = Gitlab.private_token - # token值加密解密 - token = aes_encrypt("priEn3UwXfJs3Pmy", gitlab_token) - # token值解密 - # gitlab_token = aes_dicrypt("priEn3UwXfJs3Pmy", token) - @zip_path = Gitlab.endpoint.to_s + "/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=" + token - - @creator = @project.owner.to_s - gitlab_address = Redmine::Configuration['gitlab_address'] - @repos_url = gitlab_address.to_s+"/" + @creator + "/" + @repository.identifier+"."+"git" - - # 一些数据的异步同步更新 - # 访问版本庫后更新project_score表数据;changeset_num为提交总数 - project_score = @project.project_score - if project_score.nil? - ProjectScore.create(:project_id => @project.id, :score => false) - else - project_score.update_column(:changeset_num, @changesets_all_count) - end - # 更新提交时间,用于课程 - unless @changesets_latest_coimmit.blank? - update_commits_date(@project, @changesets_latest_coimmit) - end - - render :layout => 'base_projects' + project_score.update_column(:changeset_num, @changesets_all_count) end + # 更新提交时间,用于课程 + unless @changesets_latest_coimmit.blank? + update_commits_date(@project, @changesets_latest_coimmit) + end + + render :layout => 'base_projects' end end @@ -696,6 +697,19 @@ update end end + def authorize_visible + allowed = authorize_allowed(params[:controller], params[:action], global = false) + if allowed || User.current.admin? || (@project.hidden_repo && User.current.member_of?(@project) && !role_of_members_in_project(@project.id, User.current.id) == "Reporter") + true + else + if @project && @project.archived? + render_403 :message => :notice_not_authorized_archived_project + else + deny_access + end + end + end + private # 更新项目统计数 def update_commits_count project, count diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index d28aacb25..1e1c80bce 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -49,11 +49,8 @@ <%= link_to project_file_num > 0 ? "#{l(:project_module_files)}#{switch_integer_into_k project_file_num}".html_safe : l(:project_module_files), project_files_path(@project), :class => "pro_new_proname", :title => "#{project_file_num}" %> <% end %> - <% if visible_repository?(@project) %> - <% if User.current.admin? || (is_project_member?(User.current.id, @project.id) && role_of_members_in_project(@project.id, User.current.id) != "Reporter" ) %> -
  • <%= link_to @project.project_score.changeset_num.to_i > 0 ? "#{l(:project_module_repository)}#{switch_integer_into_k project_score.changeset_num}".html_safe : "#{l(:project_module_repository)}",({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).try(:identifier)}), :class => "pro_new_proname", :title => "#{project_score.changeset_num}" %> -
  • - <% end %> + <% if !@project.enabled_modules.where("name = 'repository'").empty? && !Repository.where(:project_id => @project.id, :type => "Repository::Gitlab").first.nil? %> +
  • <%= link_to @project.project_score.changeset_num.to_i > 0 ? "#{l(:project_module_repository)}#{switch_integer_into_k project_score.changeset_num}".html_safe : "#{l(:project_module_repository)}",({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).try(:identifier)}), :class => "pro_new_proname", :title => "#{project_score.changeset_num}" %>
  • <% end %> <% unless @project.gpid.nil? %> From eeba0c362d0c96b343594a375532f0447fc7ca0c Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 22 Feb 2017 15:49:37 +0800 Subject: [PATCH 062/118] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=80=E4=BA=9Bajax=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 72 +++++++++++-------- app/views/projects/task_execute.js.erb | 1 + .../projects/training_task_status.js.erb | 1 + .../training_tasks/_action_status.html.erb | 8 +++ .../training_tasks/_content_list.html.erb | 18 ++--- 5 files changed, 64 insertions(+), 36 deletions(-) create mode 100644 app/views/projects/task_execute.js.erb create mode 100644 app/views/projects/training_task_status.js.erb create mode 100644 app/views/training_tasks/_action_status.html.erb diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 92b0efecc..3317f0829 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -29,7 +29,7 @@ class ProjectsController < ApplicationController 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, :project_home, :training_execute] + :view_homework_attaches,:join_project, :project_home, :training_execute, :training_task_status] 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] @@ -848,19 +848,21 @@ class ProjectsController < ApplicationController @notice = "重新开启实训成功" end + # TrainintTask.status 0:评测中 1:评测成功 2:评测惊醒中 def task_execute taskId = params[:training_task_id] jobName = @project.forked_from_project_id - params = {:jobName => "#{jobName}", :taskId => "#{taskId}"} - uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") - begin - task = TrainingTask.find(taskId) - respond_message = uri_exec uri, params - # status 标注第几步已完成,0表示未完成 - task.update_attribute(:status, position) - return - rescue - @message = "失败,请联系系统管理员" + @training_task = TrainingTask.find(taskId) + if @training_task.status == 0 + params = {:jobName => "#{jobName}", :taskId => "#{taskId}"} + uri = URI.parse("http://123.59.135.74:9999/jenkins-exec/api/buildJob") + begin + respond_message = uri_exec uri, params + @training_task.update_attribute(:status, 2) + return + rescue + @message = "失败,请联系系统管理员" + end end end @@ -889,7 +891,7 @@ class ProjectsController < ApplicationController forked_count = @project.forked_count.to_i + 1 @project.update_attributes(:forked_count => forked_count) # 发布实训任务,只发布实训任务的第一个 - publish_training_tasks(@project, new_training_project) + publish_training_tasks(@project.id, new_training_project.id, 1) end end end @@ -898,39 +900,38 @@ class ProjectsController < ApplicationController # 需要传Task ID # 判断任务是否完成 # 如果完成则发送下一个任务直到任务结束 - # status 1 成功,2 失败 + # TrainingTask.status 1 成功,2 失败 def training_task_status status = params[:status].to_i task_id = params[:task_id] stage = params[:stage].to_i - training_task = TrainingTask.find(task_id) - origianl_project = Project.find(training_task.project_id) - original_tasks_count = origianl_project.training_tasks.count - position = training_task.try(:position) + 1 - if status == 1 && position <= original_tasks_count - position = training_task.position + 1 - + @training_task = TrainingTask.find(task_id) + original_project_id = Project.find(@training_task.project_id).try(:forked_from_project_id) + original_project = Project.find(original_project_id) + original_tasks_count = original_project.training_tasks.count + position = @training_task.try(:position) + 1 + # 测试,默认成功 + if position <= original_tasks_count # 继续下一个任务 - TrainingTask.where(:project_id => origianl_project.id, :position => position) - publish_training_tasks original_project, new_training_project - training_task.update_attribute(:status, training_task.try(:position)) + publish_training_tasks original_project_id, @training_task.project_id, position + @training_task.update_attribute(:status, 1) end end # 实训开启成功后,发布第一个任务 # REDO:失败后提醒用户,及相关处理 - def publish_training_tasks original_project, new_training_project - original_task = TrainingTask.where(:project_id => original_project.id, :position => 1).first + def publish_training_tasks original_project_id, new_training_project_id, position + original_task = TrainingTask.where(:project_id => original_project_id, :position => position).first training_task = TrainingTask.new training_task.save_attachments(params[:attachments] || (params[:training_task] && params[:training_task][:uploads])) training_task.subject = original_task.subject training_task.description = original_task.description training_task.position = original_task.position - training_task.project_id = new_training_project.id + training_task.project_id = new_training_project_id training_task.author_id = User.current.id if training_task.save respond_to do |format| - format.html{redirect_to project_training_tasks_url(:project_id => new_training_project.id)} + format.html{redirect_to project_training_tasks_url(:project_id => new_training_project_id)} end else raise "create task failed" @@ -952,7 +953,7 @@ class ProjectsController < ApplicationController project.forked_from_project_id = tproject.id project.enabled_module_names = tproject.enabled_module_names if project.save - project.update_attribute(:training_status,1) + project.update_attribute(:training_status,2) r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first m = Member.new(:user => User.current, :roles => [r]) if ProjectScore.where("project_id=?", project.id).first.nil? @@ -975,6 +976,21 @@ class ProjectsController < ApplicationController end end + # 判断用户是否已经fork过该项目 + def has_forked?(project, user) + projects = Project.where("user_id =?", user) + projects.map(&:forked_from_project_id).detect{|s| s == @project.id}.nil? ? true : false + end + + def copy_repository(project, gproject) + repository = Repository.factory('Git') + repository.project_id = project.id + repository.type = 'Repository::Gitlab' + repository.url = gproject.name + repository.identifier = gproject.name + repository = repository.save + end + # 资源库fork弹框 def forked_pop respond_to do |format| diff --git a/app/views/projects/task_execute.js.erb b/app/views/projects/task_execute.js.erb new file mode 100644 index 000000000..1dd2affac --- /dev/null +++ b/app/views/projects/task_execute.js.erb @@ -0,0 +1 @@ +$("#task_action_status_<%= @training_task.id %>").html('<%= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>'); \ No newline at end of file diff --git a/app/views/projects/training_task_status.js.erb b/app/views/projects/training_task_status.js.erb new file mode 100644 index 000000000..1dd2affac --- /dev/null +++ b/app/views/projects/training_task_status.js.erb @@ -0,0 +1 @@ +$("#task_action_status_<%= @training_task.id %>").html('<%= escape_javascript( render :partial => 'training_tasks/action_status', :locals => {:activity => @training_task}) %>'); \ No newline at end of file diff --git a/app/views/training_tasks/_action_status.html.erb b/app/views/training_tasks/_action_status.html.erb new file mode 100644 index 000000000..49876c3a3 --- /dev/null +++ b/app/views/training_tasks/_action_status.html.erb @@ -0,0 +1,8 @@ +<% activity = activity.nil? ? local_assigns[:activity] : activity %> +<% if activity.status == 1 %> + 评测通过 +<% elsif activity.status == 2 %> + 评测中 +<% else %> + <%= link_to "提交评测", task_execute_project_path(@project, :training_task_id => activity.id), :class => "btn btn-blue", :remote => true %> +<% end %> diff --git a/app/views/training_tasks/_content_list.html.erb b/app/views/training_tasks/_content_list.html.erb index a64dffc79..b304a35e8 100644 --- a/app/views/training_tasks/_content_list.html.erb +++ b/app/views/training_tasks/_content_list.html.erb @@ -1,10 +1,10 @@ <% unless activity.author.nil? %>
    - <% if activity.status == 0 %> -
    - <% elsif activity.status == 1 %> + <% if activity.status == 1 %>
    + <% else %> +
    <% end %>
    @@ -29,11 +29,13 @@ <%= activity.journals.count %> <% end %>
    - <%= link_to "提交评测", task_execute_project_path(@project, :training_task_id => activity.id), :class => "btn btn-blue", :remote => true %> - + <% if @project.is_child_training_project? %> +
    + <%= render :partial => 'action_status', :locals => {:activity => activity} %> +
    + <% end %> +