-
-
<%=syllabus.title %>
+
+ <%=link_to syllabus.title, syllabus_path(syllabus.id), :class => 'syllabus_courses_title fl', :target => '_blank' %>
更新时间:<%=format_date syllabus.updated_at %>
创建老师:<%=syllabus.user.show_name %>
diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css
index f6a8e8e6e..5880e5c30 100644
--- a/public/stylesheets/syllabus.css
+++ b/public/stylesheets/syllabus.css
@@ -88,7 +88,7 @@ input.syllabus_input_min{
.syllabus_box{ width:750px; border:1px solid #e7e7e7; background-color:#fff;}
.syllabus_courses_list{ padding:15px; border-bottom:1px solid #e7e7e7; cursor:pointer;}
.syllabus_courses_list:hover{ background:#f6fafd;}
-.syllabus_courses_title{ font-size:16px; color:#333; width:650px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
+.syllabus_courses_title{ font-size:16px; color:#333 !important; width:650px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sy_p_grey{ margin-left:25px; color:#888; margin-top:5px; font-size:12px;}
.syllabus_class_box{ padding-left:43px; background:#f6f6f6;}
.syllabus_class_list{ padding:12px 0 12px 15px; height:44px;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7; position:relative;}
From 252851b4adc7eb0e74f23ff6ceeb74af803b6484 Mon Sep 17 00:00:00 2001
From: cxt
Date: Mon, 5 Sep 2016 16:36:43 +0800
Subject: [PATCH 015/104] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AF=BC=E8=88=AA?=
=?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_syllabus.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/layouts/base_syllabus.html.erb b/app/views/layouts/base_syllabus.html.erb
index 9bd4a25c0..445af2a8b 100644
--- a/app/views/layouts/base_syllabus.html.erb
+++ b/app/views/layouts/base_syllabus.html.erb
@@ -41,9 +41,9 @@
位置:
- <%= link_to User.current, user_path(User.current.id), :class => 'sy_cgrey', :target => '_blank' %>
+ <%= link_to @syllabus.user.show_name, user_path(@syllabus.user), :class => 'sy_cgrey', :target => '_blank' %>
>
- <%= link_to '课程', user_courselist_user_path(User.current.id), :class => "sy_cgrey", :target => '_blank' %>
+ <%= link_to '课程', user_courselist_user_path(@syllabus.user), :class => "sy_cgrey", :target => '_blank' %>
>
<%= link_to @syllabus.title, syllabus_path(@syllabus.id), :class => "sy_cgrey" %>
From cdd4dfcf09fbf4e2481dbe89e8af413cf10aa9fc Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 5 Sep 2016 16:55:56 +0800
Subject: [PATCH 016/104] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E4=B8=AD=EF=BC=9A=E7=A7=81=E6=9C=89=E9=A1=B9=E7=9B=AE=E5=AF=B9?=
=?UTF-8?q?=E9=9D=9E=E6=88=90=E5=91=98=E6=98=BE=E7=A4=BA=EF=BC=8C=E9=9D=9E?=
=?UTF-8?q?=E6=88=90=E5=91=98=E4=B8=8D=E7=82=B9=E5=87=BB=E8=BF=9B=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 8 +-
app/views/users/_project_list.html.erb | 33 +-
db/schema.rb | 4660 ++++++++++++------------
3 files changed, 2358 insertions(+), 2343 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index d16e82a23..73436395f 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -3516,11 +3516,15 @@ class UsersController < ApplicationController
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
#limit = 5
- @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
+ # 用户的所有项目
+ # @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
+ @my_projects = @user.projects.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_projects_count = @my_projects.count
- @my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
+ #@my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
+ @my_joined_projects = @user.projects.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_joined_projects_count = @my_joined_projects.count
+
respond_to do |format|
format.html {render :layout => 'new_base_user'}
end
diff --git a/app/views/users/_project_list.html.erb b/app/views/users/_project_list.html.erb
index 77f9aaf5b..4fa78f45d 100644
--- a/app/views/users/_project_list.html.erb
+++ b/app/views/users/_project_list.html.erb
@@ -1,19 +1,25 @@
<% unless projects.empty? %>
<% if @type.to_i == 2 %>
- <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
+ :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
<% else %>
- <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
+ :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
<% end %>
- <%= link_to "人气", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
+ <%= link_to "人气", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
+ :class => "sortTxt fr", :remote => true %>
<% if @type.to_i == 1 %>
- <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
+ :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
<% else %>
- <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
+ :class => "sortdownbtn sort_no fr", :remote => true %>
<% end %>
- <%= link_to "时间", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %>
+ <%= link_to "时间", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
+ :class => "sortTxt fr", :remote => true %>
<% end %>
-
<%=@user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "参与"%>的项目
+
<%= @user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "参与"%>的项目
@@ -21,7 +27,7 @@
<% if list_type == 1 %>
<%=@user == User.current ? "您" : "他" %>还没有创建项目~~
- <%= link_to "创建项目", new_project_path(:host=> Setting.host_name), :target => "_blank", :class => "sy_btn_green ml5 mt5" if @user == User.current %>
+ <%= link_to "创建项目", new_project_path(:host => Setting.host_name), :target => "_blank", :class => "sy_btn_green ml5 mt5" if @user == User.current %>
<% else %>
<%=@user == User.current ? "您" : "他" %>还没有加入项目~~
@@ -31,16 +37,18 @@
<% else %>
<% projects.each_with_index do |project, i| %>
+ <% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public %>
-
+
<%=render :partial => 'collect_project', :locals => {:project => project} %>
- <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
+ <%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank',
+ :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有班级不可访问") %>
<% unless project.is_public? %>
私有
<% end %>
<% projectUser = User.where("id=?",project.user_id).first %>
- <%=link_to "创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)} ".html_safe, user_path(projectUser) %>
+ <%= link_to "创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)} ".html_safe, user_path(projectUser) %>
@@ -58,7 +66,8 @@
<% end %>
<% if count > 5 %>
<% end %>
<% end %>
diff --git a/db/schema.rb b/db/schema.rb
index b5bd5f778..043bf70d7 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,2329 +1,2331 @@
-# 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 => 20160830090214) 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_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 "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.string "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.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.date "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
- 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"
- 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 "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_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 "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.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
- 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
-
- 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
-
- 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"
- 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 "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"
- 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"
- 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 "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"
- 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
- 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
- end
-
- 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", ["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
- end
-
- 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
- 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"
-
- 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"
- 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
- end
-
- 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"
- 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 "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"
- 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 "commits_count", :default => 0
- t.integer "publish_resource", :default => 0
- t.integer "issues_count", :default => 0
- t.integer "attachments_count", :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"
- 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
- 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
- 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
-
- 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"
- 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
- 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 "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
-
- 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
- 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 "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_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 => 20160830090214) 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_messages", :force => true do |t|
+ t.integer "user_id"
+ t.integer "applied_id"
+ t.string "applied_type"
+ t.integer "viewed"
+ t.integer "status"
+ 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 "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.string "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.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.date "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
+ 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"
+ 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 "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_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 "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.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
+ 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
+
+ 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
+
+ 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"
+ 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 "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"
+ 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"
+ 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 "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"
+ 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
+ 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
+ end
+
+ 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", ["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
+ end
+
+ 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
+ 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"
+
+ 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"
+ 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
+ end
+
+ 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"
+ 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 "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"
+ 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 "commits_count", :default => 0
+ t.integer "publish_resource", :default => 0
+ t.integer "issues_count", :default => 0
+ t.integer "attachments_count", :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"
+ 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
+ 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
+ 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
+
+ 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"
+ 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
+ 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 "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
+
+ 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
+ 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 "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_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 1e7f3db946e0630b01014dc16089ed0517b3f56c Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 6 Sep 2016 15:07:43 +0800
Subject: [PATCH 017/104] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=EF=BC=9A=E7=BB=84=E5=86=85=E6=AF=8F=E4=B8=AA=E6=88=90=E5=91=98?=
=?UTF-8?q?=E9=83=BD=E5=A4=8D=E5=88=B6=E4=B8=80=E4=BB=BD=E7=BB=84=E9=95=BF?=
=?UTF-8?q?=E7=9A=84=E4=BD=9C=E4=B8=9A=EF=BC=8C=E5=BE=97=E5=88=86=E7=9B=B8?=
=?UTF-8?q?=E5=90=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 150 +++++++++---------
app/controllers/users_controller.rb | 2 +-
app/helpers/student_work_helper.rb | 7 +
app/models/student_work.rb | 11 +-
.../student_work/_evaluation_un_work.html.erb | 6 +-
.../student_work/_evaluation_work.html.erb | 6 +-
app/views/student_work/_show.html.erb | 7 +-
...20160905084821_group_homework_copy_work.rb | 24 +++
db/schema.rb | 2 +-
9 files changed, 130 insertions(+), 85 deletions(-)
create mode 100644 db/migrate/20160905084821_group_homework_copy_work.rb
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 64f85b5db..dd454d17d 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -410,11 +410,11 @@ class StudentWorkController < ApplicationController
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?)
if @order == 'lastname'
- @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
+ @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
- @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
+ @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else
- @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
+ @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
end
@show_all = true
elsif User.current.member_of_course?(@course)
@@ -476,11 +476,11 @@ class StudentWorkController < ApplicationController
else
if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?)
if @order == 'lastname'
- @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
+ @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
- @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
+ @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else
- @stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name
+ @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name
end
@show_all = true
elsif User.current.member_of_course?(@course)
@@ -613,33 +613,23 @@ class StudentWorkController < ApplicationController
student_work.work_status = 1
end
if student_work.save
- if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
- @student_work_project.student_work_id = student_work.id
- @student_work_project.save
- members = params[:group_member_ids].split(',')
- for i in 1 .. members.count-1
- stu_project = StudentWorkProject.new
- stu_project.homework_common_id = @homework.id
- stu_project.student_work_id = student_work.id
- stu_project.project_id = @student_work_project.project_id
- stu_project.user_id = members[i].to_i
- stu_project.is_leader = 0
+ if @homework.homework_type == 3
+ if @homework.homework_detail_group.base_on_project == 1
+ @student_work_project.student_work_id = student_work.id
+ @student_work_project.save
+ elsif @homework.homework_detail_group.base_on_project == 0
+ stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => student_work.project_id, :user_id => student_work.user_id, :is_leader => 1)
stu_project.save
end
- elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
members = params[:group_member_ids].split(',')
- for i in 0 .. members.count-1
- stu_project = StudentWorkProject.new
- stu_project.homework_common_id = @homework.id
- stu_project.student_work_id = student_work.id
- stu_project.project_id = -1
- stu_project.user_id = members[i].to_i
- if i == 0
- stu_project.is_leader = 1
- else
- stu_project.is_leader = 0
+ for i in 1 .. members.count-1
+ stu_work = @homework.student_works.where("user_id = #{members[i].to_i} and work_status = 0").first
+ stu_work ||= StudentWork.new
+ stu_work.update_attributes(:name => student_work.name, :description => student_work.description, :project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time)
+ if stu_work.save
+ stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
+ stu_project.save
end
- stu_project.save
end
end
@homework.update_column(:updated_at, Time.now)
@@ -687,20 +677,19 @@ class StudentWorkController < ApplicationController
if @homework.homework_type == 3
@student_work_project = @homework.student_work_projects.where("user_id=?",User.current.id).first
student_work_projects = @homework.student_work_projects.where("student_work_id=? and is_leader =?",@work.id,0)
+ user_ids = student_work_projects.empty? ? "(-1)" : "(" + student_work_projects.map{|stu|stu.user_id}.join(",") + ")"
+ student_works = @homework.student_works.where("user_id in #{user_ids}")
+ student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
student_work_projects.delete_all
members = params[:group_member_ids].split(',')
for i in 1 .. members.count-1
- stu_project = StudentWorkProject.new
- stu_project.homework_common_id = @homework.id
- stu_project.student_work_id = @work.id
- if @homework.homework_detail_group.base_on_project == 1
- stu_project.project_id = @student_work_project.project_id
- else @homework.homework_detail_group.base_on_project == 0
- stu_project.project_id = -1
+ stu_work = @homework.student_works.where("user_id = #{members[i].to_i} and work_status = 0").first
+ stu_work ||= StudentWork.new
+ stu_work.update_attributes(:name => @work.name, :description => @work.description, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time)
+ if stu_work.save
+ stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => @work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
+ stu_project.save
end
- stu_project.user_id = members[i].to_i
- stu_project.is_leader = 0
- stu_project.save
end
end
@@ -735,28 +724,25 @@ class StudentWorkController < ApplicationController
def destroy
if @homework.homework_type == 3
- if @work.destroy
- if @homework.homework_detail_group.base_on_project == 1
- pros = @work.student_work_projects.where("is_leader = 0")
- pros.each do |pro|
- pro.destroy
- end
- project = @work.student_work_projects.where("is_leader = 1").first
- project.update_attributes(:student_work_id => nil)
- elsif @homework.homework_detail_group.base_on_project == 0
- @work.student_work_projects.each do |pro2|
- pro2.destroy
- end
- end
+ pros = @work.student_work_projects.where("is_leader = 0")
+ user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
+ student_works = @homework.student_works.where("user_id in #{user_ids}")
+ student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
+ pros.delete_all
+
+ project = @work.student_work_projects.where("is_leader = 1").first
+ if @homework.homework_detail_group.base_on_project == 1
+ project.update_attributes(:student_work_id => nil)
+ else
+ project.destroy
end
- else
- @work.attachments.destroy_all
- @work.student_works_scores.destroy_all
- @work.course_messages.destroy_all
- @work.student_work_tests.destroy_all
- @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil)
- @work.update_column("work_score",nil)
end
+ @work.attachments.destroy_all
+ @work.student_works_scores.destroy_all
+ @work.course_messages.destroy_all
+ @work.student_work_tests.destroy_all
+ @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
+ @work.update_column("work_score",nil)
respond_to do |format|
format.html {
redirect_to student_work_index_url(:homework => @homework.id)
@@ -786,25 +772,23 @@ class StudentWorkController < ApplicationController
def retry_work
if @homework.homework_type == 3
- if @work.destroy
- if @homework.homework_detail_group.base_on_project == 1
- pros = @work.student_work_projects.where("is_leader = 0")
- pros.each do |pro|
- pro.destroy
- end
- project = @work.student_work_projects.where("is_leader = 1").first
- project.update_attributes(:student_work_id => nil)
- elsif @homework.homework_detail_group.base_on_project == 0
- @work.student_work_projects.each do |pro2|
- pro2.destroy
- end
- end
+ pros = @work.student_work_projects.where("is_leader = 0")
+ user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
+ student_works = @homework.student_works.where("user_id in #{user_ids}")
+ student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
+ pros.delete_all
+
+ project = @work.student_work_projects.where("is_leader = 1").first
+ if @homework.homework_detail_group.base_on_project == 1
+ project.update_attributes(:student_work_id => nil)
+ else
+ project.destroy
end
- elsif @homework.homework_type == 1
- @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil)
- @work.attachments.destroy_all
- @work.course_messages.destroy_all
end
+
+ @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
+ @work.attachments.destroy_all
+ @work.course_messages.destroy_all
@student_work = StudentWork.new
respond_to do |format|
format.js
@@ -1096,9 +1080,13 @@ class StudentWorkController < ApplicationController
#创建作业的关联项目
def student_work_project
+ @work = @homework.student_works.where("user_id = #{User.current.id} and work_status = 0").first
+ if @work
+ @work.update_column('project_id', params[:projectName].to_i)
+ end
@project = StudentWorkProject.new
@project.homework_common_id = @homework.id
- @project.project_id = (Project.find params[:projectName].to_i).id
+ @project.project_id = params[:projectName].to_i
@project.user_id = User.current.id
@project.is_leader = 1
if @project.save
@@ -1147,6 +1135,10 @@ class StudentWorkController < ApplicationController
end
def cancel_relate_project
+ @work = @homework.student_works.where("user_id = #{User.current.id} and work_status = 0").first
+ if @work
+ @work.update_column('project_id', 0)
+ end
relate_pro = StudentWorkProject.where("user_id = #{User.current.id} and homework_common_id = #{@homework.id}").first
if relate_pro.destroy
@user_activity_id = params[:user_activity_id].to_i
@@ -1586,6 +1578,10 @@ class StudentWorkController < ApplicationController
end
end
end
+ if homework.homework_type == 3
+ student_works = group_student_works student_work, homework
+ student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
+ end
end
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 5aab1df49..4d2b4794c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1115,7 +1115,7 @@ class UsersController < ApplicationController
homework_detail_programing.save if homework_detail_programing
homework_detail_group.save if homework_detail_group
- if homework.homework_type != 3 && homework_detail_manual.comment_status == 1
+ if homework_detail_manual.comment_status == 1
create_works_list homework
end
diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb
index 2ecb5516f..1e7df6466 100644
--- a/app/helpers/student_work_helper.rb
+++ b/app/helpers/student_work_helper.rb
@@ -158,4 +158,11 @@ module StudentWorkHelper
end
return status
end
+
+ def group_student_works student_work, homework
+ pros = student_work.student_work_projects.where("is_leader = 0")
+ user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
+ student_works = homework.student_works.where("user_id in #{user_ids}")
+ return student_works
+ end
end
\ No newline at end of file
diff --git a/app/models/student_work.rb b/app/models/student_work.rb
index 183570081..35308ca05 100644
--- a/app/models/student_work.rb
+++ b/app/models/student_work.rb
@@ -1,4 +1,4 @@
-#学生提交作品表
+#学生提交作品表 #work_status :0 未提交 1 已提交 2 迟交 3 分组作品复制的组员作品
class StudentWork < ActiveRecord::Base
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time
@@ -13,7 +13,8 @@ class StudentWork < ActiveRecord::Base
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
has_many :attachments, :dependent => :destroy
- scope :has_committed, lambda{where("work_status != 0")}
+ scope :has_committed, lambda{where("work_status != 0 and work_status != 3")}
+ scope :no_copy, lambda{where("work_status != 3")}
before_destroy :delete_praise
before_save :set_program_score, :set_src
@@ -169,6 +170,12 @@ class StudentWork < ActiveRecord::Base
end
end
end
+ if homework.homework_type == 3
+ pros = student_work.student_work_projects.where("is_leader = 0")
+ user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
+ student_works = homework.student_works.where("user_id in #{user_ids}")
+ student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
+ end
end
end
diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb
index ed0ba5542..bb87bfde1 100644
--- a/app/views/student_work/_evaluation_un_work.html.erb
+++ b/app/views/student_work/_evaluation_un_work.html.erb
@@ -26,7 +26,11 @@
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word"%>
- <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
+ <% if student_work.project_id == 0 || student_work.project_id.nil?%>
+
+ <% elsif student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb
index c5db6a99f..06bc110b2 100644
--- a/app/views/student_work/_evaluation_work.html.erb
+++ b/app/views/student_work/_evaluation_work.html.erb
@@ -26,7 +26,11 @@
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word"%>
- <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
+ <% if student_work.project_id == 0 || student_work.project_id.nil?%>
+
+ --
+
+ <% elsif student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index f6c0e25d0..9f65376e3 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -46,13 +46,16 @@
<% if @homework.homework_detail_group.base_on_project == 1 %>
关联项目:
- <% if work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
+ <% if work.project_id == 0 || work.project_id.nil? %>
+ 暂无
+ <% elsif work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
<%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
+ (综合评分:<%=static_project_score(work.project.project_score).to_i %> )
<% else %>
<%=work.project.name %>
+ (综合评分:<%=static_project_score(work.project.project_score).to_i %> )
<% end %>
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
- (综合评分:<%=static_project_score(work.project.project_score).to_i %> )
<% end %>
<% end%>
diff --git a/db/migrate/20160905084821_group_homework_copy_work.rb b/db/migrate/20160905084821_group_homework_copy_work.rb
new file mode 100644
index 000000000..b97d38aa8
--- /dev/null
+++ b/db/migrate/20160905084821_group_homework_copy_work.rb
@@ -0,0 +1,24 @@
+class GroupHomeworkCopyWork < ActiveRecord::Migration
+ def up
+ homeworks = HomeworkCommon.where("homework_type = 3")
+ count = homeworks.count / 30 + 2
+ transaction do
+ for i in 1 ... count do i
+ homeworks.page(i).per(30).each do |homework|
+ homework.student_works.each do |stu|
+ stu.student_work_projects.each do |stu_pro|
+ if stu_pro.is_leader == 0
+ new_stu = StudentWork.new(:name => stu.name, :description => stu.description, :homework_common_id =>homework.id, :user_id => stu_pro.user_id, :final_score => stu.final_score, :teacher_score => stu.teacher_score, :student_score => stu.student_score, :teaching_asistant_score => stu.teaching_asistant_score,
+ :project_id => stu.project_id, :late_penalty => stu.late_penalty,:absence_penalty => stu.absence_penalty,:work_score => stu.work_score,:work_status => 3,:commit_time => stu.commit_time)
+ new_stu.save
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b5bd5f778..b8f931eed 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 => 20160830090214) do
+ActiveRecord::Schema.define(:version => 20160905084821) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
From 17f6b9c28611ba31c93f4dcbffd321ba01860b95 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 6 Sep 2016 15:17:49 +0800
Subject: [PATCH 018/104] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2=E7=9A=84=E8=A2=AB=E7=95=99=E8=A8=80=E5=86=85=E5=AE=B9?=
=?UTF-8?q?=E5=8A=A0=E4=B8=8A=E2=80=9CRE:=20=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/admin/leave_messages.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/admin/leave_messages.html.erb b/app/views/admin/leave_messages.html.erb
index 986823faa..a9acba903 100644
--- a/app/views/admin/leave_messages.html.erb
+++ b/app/views/admin/leave_messages.html.erb
@@ -62,9 +62,9 @@
<%case journal.jour_type %>
<% when 'Principal' %>
- <%= link_to(strip_html(journal.notes), feedback_path(journal.jour_id)) %>
+ <%= link_to(journal.m_parent_id.nil? ? strip_html(journal.notes) : 'RE: ' + strip_html(journal.notes), feedback_path(journal.jour_id)) %>
<% when 'Course' %>
- <%= link_to(strip_html(journal.notes), course_feedback_path(journal.jour_id)) %>
+ <%= link_to(journal.m_parent_id.nil? ? strip_html(journal.notes) : 'RE: ' + strip_html(journal.notes), course_feedback_path(journal.jour_id)) %>
<% end %>
From bf4c6d049c8c90742d75df4cd782ec2c0e68047d Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 6 Sep 2016 16:38:29 +0800
Subject: [PATCH 019/104] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=88=86=E7=BB=84?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E4=B8=8D=E5=88=9B=E5=BB=BA=E4=BD=9C?=
=?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 37 +++++++++++-----------
app/controllers/users_controller.rb | 2 +-
app/models/student_work.rb | 2 +-
3 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index dd454d17d..34bc889fd 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -623,9 +623,7 @@ class StudentWorkController < ApplicationController
end
members = params[:group_member_ids].split(',')
for i in 1 .. members.count-1
- stu_work = @homework.student_works.where("user_id = #{members[i].to_i} and work_status = 0").first
- stu_work ||= StudentWork.new
- stu_work.update_attributes(:name => student_work.name, :description => student_work.description, :project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time)
+ stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description, :homeowrk_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time)
if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
stu_project.save
@@ -679,13 +677,11 @@ class StudentWorkController < ApplicationController
student_work_projects = @homework.student_work_projects.where("student_work_id=? and is_leader =?",@work.id,0)
user_ids = student_work_projects.empty? ? "(-1)" : "(" + student_work_projects.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
- student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
+ student_works.delete_all
student_work_projects.delete_all
members = params[:group_member_ids].split(',')
for i in 1 .. members.count-1
- stu_work = @homework.student_works.where("user_id = #{members[i].to_i} and work_status = 0").first
- stu_work ||= StudentWork.new
- stu_work.update_attributes(:name => @work.name, :description => @work.description, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time)
+ stu_work = StudentWork.new(:name => @work.name, :description => @work.description, :homework_common_id => @homework.id, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time)
if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => @work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
stu_project.save
@@ -727,7 +723,7 @@ class StudentWorkController < ApplicationController
pros = @work.student_work_projects.where("is_leader = 0")
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
- student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
+ student_works.delete_all
pros.delete_all
project = @work.student_work_projects.where("is_leader = 1").first
@@ -736,13 +732,15 @@ class StudentWorkController < ApplicationController
else
project.destroy
end
+ @work.destroy
+ else
+ @work.attachments.destroy_all
+ @work.student_works_scores.destroy_all
+ @work.course_messages.destroy_all
+ @work.student_work_tests.destroy_all
+ @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
+ @work.update_column("work_score",nil)
end
- @work.attachments.destroy_all
- @work.student_works_scores.destroy_all
- @work.course_messages.destroy_all
- @work.student_work_tests.destroy_all
- @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil,:final_score => nil,:teacher_score => nil,:student_score => nil,:teaching_asistant_score => nil,:system_score => 0,:work_score => nil, :project_id => 0)
- @work.update_column("work_score",nil)
respond_to do |format|
format.html {
redirect_to student_work_index_url(:homework => @homework.id)
@@ -784,11 +782,12 @@ class StudentWorkController < ApplicationController
else
project.destroy
end
+ @work.destroy
+ else
+ @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
+ @work.attachments.destroy_all
+ @work.course_messages.destroy_all
end
-
- @work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
- @work.attachments.destroy_all
- @work.course_messages.destroy_all
@student_work = StudentWork.new
respond_to do |format|
format.js
@@ -1127,7 +1126,7 @@ class StudentWorkController < ApplicationController
end
all_students = User.where("id in #{all_student_ids}")
student_work_id = @homework.student_work_projects.where("user_id=? and student_work_id is not null",User.current.id).first.nil? ? -1 : @homework.student_work_projects.where("user_id=?",User.current.id).first.student_work_id
- @commit_student_ids = @homework.student_work_projects.where("student_work_id != #{student_work_id}").map{|student| student.user_id}
+ @commit_student_ids = @homework.student_works.has_committed.where("id != #{student_work_id}").map{|student| student.user_id}
@users = searchstudent_by_name all_students,name
respond_to do |format|
format.js
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 4d2b4794c..5aab1df49 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1115,7 +1115,7 @@ class UsersController < ApplicationController
homework_detail_programing.save if homework_detail_programing
homework_detail_group.save if homework_detail_group
- if homework_detail_manual.comment_status == 1
+ if homework.homework_type != 3 && homework_detail_manual.comment_status == 1
create_works_list homework
end
diff --git a/app/models/student_work.rb b/app/models/student_work.rb
index 35308ca05..59e5b76bc 100644
--- a/app/models/student_work.rb
+++ b/app/models/student_work.rb
@@ -32,7 +32,7 @@ class StudentWork < ActiveRecord::Base
private
def set_program_score
- if homework_common.is_program_homework? #编程作业,学生提交作品后计算系统得分
+ if self.homework_common.is_program_homework? #编程作业,学生提交作品后计算系统得分
#根据最后一次测试计算得分
unless last_test
self.system_score = 0
From e2aef371141c3dbac9845663c7dfd34c33971edb Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 6 Sep 2016 17:06:31 +0800
Subject: [PATCH 020/104] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E7=9A=84=E6=8F=90=E4=BA=A4=E5=87=BA=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 34bc889fd..8e0a07288 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -623,7 +623,7 @@ class StudentWorkController < ApplicationController
end
members = params[:group_member_ids].split(',')
for i in 1 .. members.count-1
- stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description, :homeowrk_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time)
+ stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description,:user_id =>members[i].to_i, :homework_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => student_work.commit_time)
if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
stu_project.save
@@ -681,7 +681,7 @@ class StudentWorkController < ApplicationController
student_work_projects.delete_all
members = params[:group_member_ids].split(',')
for i in 1 .. members.count-1
- stu_work = StudentWork.new(:name => @work.name, :description => @work.description, :homework_common_id => @homework.id, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time)
+ stu_work = StudentWork.new(:name => @work.name, :description => @work.description,:user_id=> members[i].to_i, :homework_common_id => @homework.id, :project_id => @work.project_id, :late_penalty => @work.late_penalty,:work_status => 3, :commit_time => @work.commit_time)
if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => @work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => members[i].to_i, :is_leader => 0)
stu_project.save
From 99e63b1477063665fa2dc888d164ee2cd7b4ff62 Mon Sep 17 00:00:00 2001
From: Tim
Date: Tue, 6 Sep 2016 17:22:38 +0800
Subject: [PATCH 021/104] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E6=8E=A8=E8=8D=90?=
=?UTF-8?q?=E6=95=B0=E5=AD=97block=E9=A2=9C=E8=89=B2=E5=AD=97=E4=BD=93?=
=?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9B=E6=B5=8B=E9=AA=8C=E5=AD=A6=E5=8F=B7?=
=?UTF-8?q?=E8=B6=85=E5=87=BA=E7=9C=81=E7=95=A5=E5=8F=B7=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/exercise/_student_table.html.erb | 140 ++++++++++-----------
public/stylesheets/syllabus.css | 4 +-
2 files changed, 72 insertions(+), 72 deletions(-)
diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb
index bdfd2c96f..c917cb03e 100644
--- a/app/views/exercise/_student_table.html.erb
+++ b/app/views/exercise/_student_table.html.erb
@@ -1,71 +1,71 @@
-
-
- 序号
-
- 姓名
- 学号
- 班级
-
-
- <%= link_to "时间",'',:class => "c_dark f14 fb" ,:remote => true%>
-
-
- <%= link_to "成绩",'',:class => "c_dark f14 fb",:remote => true%>
-
-
-
- <% @exercise_users_list.each_with_index do |exercise, index|%>
-
- <%=index + 1 %>
-
- <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
-
-
- <%=exercise.user.show_name %>
-
-
- <%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
-
-
- --
-
-
-
- <% if exercise.created_at%>
- <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
- <% if @exercise.end_time <= exercise.created_at %>
- [未答]
- <% end %>
- <% end %>
-
-
- <%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
-
-
-
-
-
-
-<% end%>
+
+
+ 序号
+
+ 姓名
+ 学号
+ 班级
+
+
+ <%= link_to "时间",'',:class => "c_dark f14 fb" ,:remote => true%>
+
+
+ <%= link_to "成绩",'',:class => "c_dark f14 fb",:remote => true%>
+
+
+
+ <% @exercise_users_list.each_with_index do |exercise, index|%>
+
+ <%=index + 1 %>
+
+ <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
+
+
+ <%=exercise.user.show_name %>
+
+
+ <%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
+
+
+ --
+
+
+
+ <% if exercise.created_at%>
+ <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
+ <% if @exercise.end_time <= exercise.created_at %>
+ [未答]
+ <% end %>
+ <% end %>
+
+
+ <%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
+
+
+
+
+
+
+<% end%>
\ No newline at end of file
diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css
index f6a8e8e6e..c92db8b76 100644
--- a/public/stylesheets/syllabus.css
+++ b/public/stylesheets/syllabus.css
@@ -566,9 +566,9 @@ a:hover.sy_btn_orange{
a.sy_class_ltitle{display: block; font-size: 14px; width: 185px; color:#888; }
a:hover.sy_class_ltitle{ color:#333;}
.sy_cir_grey{
- font-size:12px;
+ font-size:11px;
padding: 0 10px;
- background: #dbdbdb;
+ background: #eee;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
From 7b2ce93acc22ae0370db4adf72a9a3a6762d163f Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 6 Sep 2016 17:51:13 +0800
Subject: [PATCH 022/104] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98?=
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 8e0a07288..791d9e398 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -1126,7 +1126,7 @@ class StudentWorkController < ApplicationController
end
all_students = User.where("id in #{all_student_ids}")
student_work_id = @homework.student_work_projects.where("user_id=? and student_work_id is not null",User.current.id).first.nil? ? -1 : @homework.student_work_projects.where("user_id=?",User.current.id).first.student_work_id
- @commit_student_ids = @homework.student_works.has_committed.where("id != #{student_work_id}").map{|student| student.user_id}
+ @commit_student_ids = @homework.student_works.where("id != #{student_work_id}").map{|student| student.user_id}
@users = searchstudent_by_name all_students,name
respond_to do |format|
format.js
From 7b2943c37ae4232590233624b7b62eef606a9b51 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 6 Sep 2016 18:01:16 +0800
Subject: [PATCH 023/104] =?UTF-8?q?=E9=87=8D=E8=AF=95?=
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 791d9e398..d1835408f 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -773,7 +773,7 @@ class StudentWorkController < ApplicationController
pros = @work.student_work_projects.where("is_leader = 0")
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
- student_works.update_all(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
+ student_works.delete_all
pros.delete_all
project = @work.student_work_projects.where("is_leader = 1").first
From 5433e6d7144ed9d3651c10a397ac4da060aa69df Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 09:29:06 +0800
Subject: [PATCH 024/104] =?UTF-8?q?=E5=A4=9A=E9=87=8D=E8=A7=92=E8=89=B2?=
=?UTF-8?q?=EF=BC=8C=E6=95=99=E5=B8=88/=E5=8A=A9=E6=95=99=E6=9F=A5?=
=?UTF-8?q?=E7=9C=8B=E8=87=AA=E5=B7=B1=E4=BD=9C=E4=B8=BA=E5=AD=A6=E7=94=9F?=
=?UTF-8?q?=E8=BA=AB=E4=BB=BD=E6=97=B6=E6=8F=90=E4=BA=A4=E7=9A=84=E4=BD=9C?=
=?UTF-8?q?=E5=93=81=EF=BC=8C=E8=BF=BD=E5=8A=A0=E9=99=84=E4=BB=B6=E9=87=8D?=
=?UTF-8?q?=E5=A4=8D=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_revise_attachment.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/student_work/_revise_attachment.html.erb b/app/views/student_work/_revise_attachment.html.erb
index cd7ddc917..b2d473c0e 100644
--- a/app/views/student_work/_revise_attachment.html.erb
+++ b/app/views/student_work/_revise_attachment.html.erb
@@ -14,7 +14,7 @@
<% end %>
- <% if work.user == User.current %>
+ <% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %>
追加修订附件
From e0845430308868dbc76b44a93a30f77e6fe2c1eb Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 10:45:22 +0800
Subject: [PATCH 025/104] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=97=B6=E7=BB=99=E5=87=BA=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F?=
=?UTF-8?q?=E5=92=8C=E5=8F=91=E5=B8=83=E6=97=A5=E6=9C=9F=E7=9A=84=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/users/_user_homework_form.html.erb | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index 99b9812cc..9457ae3ed 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -164,20 +164,20 @@
<% unless edit_mode %>
<% end %>
- <% if edit_mode %>
+ <%# if edit_mode %>
截止日期:
- <% end %>
+ <%# end %>
-
+
<% if homework.homework_detail_manual.comment_status.to_i < 2 %>
<%= calendar_for('homework_end_time')%>
<% end %>
- <% if edit_mode %>
+ <%# if edit_mode %>
发布日期(可选):
- <% end %>
+ <%# end %>
-
+
<% if homework.homework_detail_manual.comment_status.to_i == 0 %>
<%= calendar_for('homework_publish_time')%>
<% end %>
From 95824e3b6b951adb1e6e5a341f40277855489c76 Mon Sep 17 00:00:00 2001
From: Tim
Date: Wed, 7 Sep 2016 11:24:38 +0800
Subject: [PATCH 026/104] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8D=E7=A7=B0=E6=AD=A3=E7=A1=AE=E9=94=99?=
=?UTF-8?q?=E8=AF=AF=E7=A4=BA=E4=BE=8B=EF=BC=8C=E8=AF=BE=E7=A8=8B=E8=AF=B4?=
=?UTF-8?q?=E6=98=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/syllabuses/new.html.erb | 54 ++++++++++++++++---------------
public/stylesheets/css/common.css | 6 +++-
2 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/app/views/syllabuses/new.html.erb b/app/views/syllabuses/new.html.erb
index ced8a3d66..38b00ac5c 100644
--- a/app/views/syllabuses/new.html.erb
+++ b/app/views/syllabuses/new.html.erb
@@ -1,27 +1,29 @@
-
-
新建课程
-
-
+
+
新建课程
+
+
\ No newline at end of file
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index c275aec90..88f3e4cba 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -607,4 +607,8 @@ a:hover.sy_btn_blue{ background: #2788d0;}
.is_public_checkbox{margin-left: 15px;margin-right: 10px;}
.author_name{color: #3ca5c6 !important;}
.ke-container-default{max-width: 100%;}
-.borderRadius {border-radius:5px;}
\ No newline at end of file
+.borderRadius {border-radius:5px;}
+
+/*状态提示图标*/
+.success-icon {background:url("/images/icons_ziliao.png") 0 -28px no-repeat; padding-left:25px;}
+.error-icon {background:url("/images/icons_ziliao.png") 0 -56px no-repeat; padding-left:25px;}
\ No newline at end of file
From e6ddb3cec040c4feee785c42d5292ce0de73c9ea Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 11:30:26 +0800
Subject: [PATCH 027/104] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=E8=BF=87=E6=BB=A4=E4=B8=AD=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E5=85=A8=E9=83=A8=E5=8A=A8=E6=80=81=E8=A6=81=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E5=85=B3=E8=81=94=E7=9A=84?=
=?UTF-8?q?=E6=89=80=E6=9C=89=E5=8A=A8=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 71 +++++------------------------
app/views/users/show.html.erb | 6 +--
2 files changed, 14 insertions(+), 63 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 5aab1df49..18090c400 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1691,9 +1691,12 @@ class UsersController < ApplicationController
when "current_user"
container_type = 'Principal'
act_type = 'Principal'
+ when "all"
+ container_type = 'all'
+ act_type = 'all'
end
end
- if container_type != '' && act_type != ''
+ if container_type != '' && container_type != 'all'
if container_type == 'Course'
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
elsif container_type == 'Project'
@@ -1709,69 +1712,19 @@ class UsersController < ApplicationController
else
if User.current != @user
blog_ids = "("+@user.blog.id.to_s+")"
- sql = "user_id = #{@user.id} and((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
- "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
- "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
- "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids}))"
else
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
- sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
- "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
- "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
- "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
+ end
+ sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
+ "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
+ "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
+ "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
+ if container_type != 'all' && User.current != @user
+ sql = "user_id = #{@user.id} and(" + sql + ")"
end
end
+
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
- # if params[:type].present?
- # case params[:type]
- # when "course_homework"
- # @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
- # when "course_news"
- # @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
- # when "course_message"
- # @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
- # when "course_poll"
- # @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
- # when "course_journals"
- # @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
- # when "project_issue"
- # @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
- # when "project_message"
- # @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
- # when "user_journals"
- # @user_activities = UserActivity.where("container_type = 'Principal' and act_type= 'JournalsForMessage' and container_id = #{@user.id}").order('updated_at desc').limit(10).offset(@page * 10)
- # when "current_user"
- # @user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10)
- # else
- # if @user == User.current
- # blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
- # else
- # blog_ids = "("+@user.blog.id.to_s+")"
- # end
- # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
- # "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
- # "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
- # "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
- # end
- # else
- # # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
- # # blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
- # # 减少数据库交互
- # if @user == User.current
- # watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
- # user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
- # else
- # user_ids = "(" + @user.id.to_s + ")"
- # end
- # watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}")
- # blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")"
- #
- # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
- # "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
- # "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
- # "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
- # end
- # @user_activities = paginateHelper @user_activities,500
@type = params[:type]
respond_to do |format|
format.js
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 5ae593ddf..e920af7bf 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -34,10 +34,8 @@
更多
<%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
- <% if @user == User.current %>
- <%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
- <% end %>
- <%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
+ <%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
+ <%= link_to "全部动态", {:controller => "users", :action => "show", :type => "all"}, :class =>"homepagePostTypeAll postTypeGrey"%>
From bec09a7f1c3b65ebfa4534baec74327f78aefe50 Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 14:03:20 +0800
Subject: [PATCH 028/104] =?UTF-8?q?=E4=B8=BAstudent=5Fwork=5Ftests?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B4=A2=E5=BC=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/migrate/20160907055119_add_index_to_student_work_tests.rb | 5 +++++
db/schema.rb | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20160907055119_add_index_to_student_work_tests.rb
diff --git a/db/migrate/20160907055119_add_index_to_student_work_tests.rb b/db/migrate/20160907055119_add_index_to_student_work_tests.rb
new file mode 100644
index 000000000..75d36ce8d
--- /dev/null
+++ b/db/migrate/20160907055119_add_index_to_student_work_tests.rb
@@ -0,0 +1,5 @@
+class AddIndexToStudentWorkTests < ActiveRecord::Migration
+ def change
+ add_index :student_work_tests, :student_work_id
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b5bd5f778..04111767e 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 => 20160830090214) do
+ActiveRecord::Schema.define(:version => 20160907055119) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -1829,6 +1829,8 @@ ActiveRecord::Schema.define(:version => 20160830090214) do
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
From d8bc6a51fcec013e42171eb90e1722908842eee1 Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 15:14:10 +0800
Subject: [PATCH 029/104] =?UTF-8?q?=E5=8A=A0=E7=B4=A2=E5=BC=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...0160907061917_add_index_to_course_contributor_scores.rb | 7 +++++++
db/schema.rb | 7 ++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20160907061917_add_index_to_course_contributor_scores.rb
diff --git a/db/migrate/20160907061917_add_index_to_course_contributor_scores.rb b/db/migrate/20160907061917_add_index_to_course_contributor_scores.rb
new file mode 100644
index 000000000..5deb98469
--- /dev/null
+++ b/db/migrate/20160907061917_add_index_to_course_contributor_scores.rb
@@ -0,0 +1,7 @@
+class AddIndexToCourseContributorScores < ActiveRecord::Migration
+ def change
+ add_index :course_contributor_scores, [:course_id, :user_id]
+ add_index :members, :course_id
+ add_index :course_groups, :course_id
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 04111767e..d50361193 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 => 20160907055119) do
+ActiveRecord::Schema.define(:version => 20160907061917) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -517,6 +517,8 @@ ActiveRecord::Schema.define(:version => 20160907055119) do
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"
@@ -524,6 +526,8 @@ ActiveRecord::Schema.define(:version => 20160907055119) do
t.datetime "updated_at", :null => false
end
+ add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id"
+
create_table "course_infos", :force => true do |t|
t.integer "course_id"
t.integer "user_id"
@@ -1140,6 +1144,7 @@ ActiveRecord::Schema.define(:version => 20160907055119) do
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"
From 0ae4d26ec0f82430423685c3640ce45330f43f5f Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 15:22:15 +0800
Subject: [PATCH 030/104] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=A4=A7=E7=BA=B2?=
=?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9=E5=8C=BA=E5=9F=9F=E5=BA=94=E8=AF=A5?=
=?UTF-8?q?=E5=92=8C=E4=B8=8B=E9=9D=A2=E7=9A=84=E5=9B=9E=E5=A4=8D=E5=8C=BA?=
=?UTF-8?q?=E5=9F=9F=E7=9A=84=E5=AE=BD=E5=BA=A6=E4=B8=80=E8=87=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/syllabus.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css
index 5880e5c30..101ff23a6 100644
--- a/public/stylesheets/syllabus.css
+++ b/public/stylesheets/syllabus.css
@@ -41,7 +41,7 @@ input.syllabus_input_min{
border: 1px solid #dddddd;
}
.sy_tab_con{
- width:740px; padding:20px 20px 0 20px; position:relative;
+ width:720px; padding:20px 28px 0 32px; position:relative;
}
.syllabuscon_title{
color:#000; text-align:center;
From 775ed1912900f905bcb91cba34c029ddd72a91c7 Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 15:26:15 +0800
Subject: [PATCH 031/104] =?UTF-8?q?admin=E7=95=8C=E9=9D=A2-=E7=8F=AD?=
=?UTF-8?q?=E7=BA=A7=E5=88=97=E8=A1=A8=EF=BC=9A=E8=AF=BE=E7=A8=8B=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E4=B8=AD=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=B7=B2=E7=BB=8F?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E7=8F=AD=E7=BA=A7=EF=BC=8C=E5=85=A8?=
=?UTF-8?q?=E9=83=A8=E7=8F=AD=E7=BA=A7=E5=88=97=E8=A1=A8=E4=B8=AD=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E5=B7=B2=E7=BB=8F=E5=88=A0=E9=99=A4=E7=9A=84=E7=8F=AD?=
=?UTF-8?q?=E7=BA=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/admin/syllabuses.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/admin/syllabuses.html.erb b/app/views/admin/syllabuses.html.erb
index 5098131da..d24f7d39a 100644
--- a/app/views/admin/syllabuses.html.erb
+++ b/app/views/admin/syllabuses.html.erb
@@ -58,7 +58,7 @@
<%= format_date(syllabus.created_at) %>
- <% courses = syllabus.courses %>
+ <% courses = syllabus.courses.not_deleted %>
<% courses.each do |course| %>
From 49e8a6f1ff0ddeed2cad9fbb3118a394008ac6cf Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 7 Sep 2016 15:45:12 +0800
Subject: [PATCH 032/104] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=8C=BF=E8=AF=84?=
=?UTF-8?q?=E6=97=B6=EF=BC=9A=E5=AD=A6=E7=94=9F=E7=82=B9=E5=87=BB=E4=BD=9C?=
=?UTF-8?q?=E4=B8=9A=E5=88=97=E8=A1=A8=E4=B8=AD=E2=80=9C=E8=BF=BD=E5=8A=A0?=
=?UTF-8?q?=E9=99=84=E4=BB=B6=E2=80=9D=EF=BC=8C=E8=BF=9B=E5=85=A5=E4=BD=9C?=
=?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E5=90=8E=E8=A6=81=E9=BB=98=E8=AE=A4?=
=?UTF-8?q?=E6=89=93=E5=BC=80=E8=87=AA=E5=B7=B1=E6=8F=90=E4=BA=A4=E7=9A=84?=
=?UTF-8?q?=E4=BD=9C=E5=93=81=E4=B8=94=E5=BC=B9=E5=87=BA=E8=BF=BD=E5=8A=A0?=
=?UTF-8?q?=E9=99=84=E4=BB=B6=E7=9A=84=E5=BC=B9=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_student_work_list.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb
index e05df2892..dbde6d24c 100644
--- a/app/views/student_work/_student_work_list.html.erb
+++ b/app/views/student_work/_student_work_list.html.erb
@@ -50,7 +50,7 @@
{
$("#homework_info_show").show();
}
- <% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id %>
+ <% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id || (@is_evaluation && @is_focus == 1) %>
<% if @message_student_work_id %>
<% work = @homework.student_works.where("id =?", @message_student_work_id).first %>
<% else %>
From 3efc158fb5ba4ea90831b01f233c67a871925ac0 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 8 Sep 2016 10:54:41 +0800
Subject: [PATCH 033/104] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=EF=BC=9A=E5=BD=93=E5=B7=B2=E7=BB=8F=E5=8F=91=E5=B8=83=E4=BA=86?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=86=8D=E5=8E=BB=E7=BC=96=E8=BE=91=E4=BD=9C?=
=?UTF-8?q?=E4=B8=9A=E6=97=B6=EF=BC=8C=E7=8E=B0=E5=9C=A8=E6=98=AF=E2=80=9C?=
=?UTF-8?q?=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4=E2=80=9D=E5=B0=B1=E4=B8=8D?=
=?UTF-8?q?=E8=83=BD=E5=86=8D=E7=BC=96=E8=BE=91=E4=BA=86=EF=BC=8C=E5=BB=BA?=
=?UTF-8?q?=E8=AE=AE=E4=BB=A3=E7=A0=81=E5=88=A4=E6=96=AD=E5=8F=AA=E6=9C=89?=
=?UTF-8?q?=E5=BD=93=E5=AD=A6=E7=94=9F=E5=B7=B2=E7=BB=8F=E6=8F=90=E4=BA=A4?=
=?UTF-8?q?=E4=BA=86=E4=BD=9C=E5=93=81=E6=88=96=E5=85=B3=E8=81=94=E4=BA=86?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=89=8D=E7=A6=81=E6=AD=A2=E5=86=8D=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4=EF=BC=8C=E4=B8=94?=
=?UTF-8?q?=E8=A6=81=E7=BB=99=E5=87=BA=E5=BF=85=E8=A6=81=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/my/clear_user_avatar_temp.js.erb | 4 ++--
app/views/users/_user_homework_form.html.erb | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/app/views/my/clear_user_avatar_temp.js.erb b/app/views/my/clear_user_avatar_temp.js.erb
index 1d1ef48f0..3278adcb5 100644
--- a/app/views/my/clear_user_avatar_temp.js.erb
+++ b/app/views/my/clear_user_avatar_temp.js.erb
@@ -2,7 +2,7 @@
$('#ajax-modal').html($("#nh_tx_dialog_html").html());
showModal('ajax-modal','460px');
$('#ajax-modal').siblings().hide();
- $('#ajax-modal').parent().removeClass("alert_praise");
- //$('#ajax-modal').parent().css("top","").css("left","");
+ $('#ajax-modal').parent().removeClass("alert_praise").removeClass("copyCoursePopup");
+ $('#ajax-modal').parent().css("top","30%").css("left","40%");
$('#ajax-modal').parent().addClass("alert_box");
$('#ajax-modal').parent().css("border", "3px solid #269ac9").css("border-radius", "0").css(" -webkit-border-radius", "0").css(" -moz-border-radius", "0");
\ No newline at end of file
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index 9457ae3ed..b3f9970c6 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -177,8 +177,9 @@
发布日期(可选):
<%# end %>
-
- <% if homework.homework_detail_manual.comment_status.to_i == 0 %>
+ <% allow_edit = homework.student_works.has_committed.count == 0 && homework.student_work_projects.count ==0 %>
+
+ <% if allow_edit %>
<%= calendar_for('homework_publish_time')%>
<% end %>
From ab0863c9fb14101020a2848da9add22f8009cf25 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 8 Sep 2016 13:59:48 +0800
Subject: [PATCH 034/104] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9A=84=E9=82=80?=
=?UTF-8?q?=E8=AF=B7=E7=A0=81=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_course_base_info.html.erb | 10 +++++++++-
app/views/layouts/base_courses.html.erb | 2 +-
public/stylesheets/css/public.css | 4 ++++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb
index 65c065672..7cd55b47b 100644
--- a/app/views/layouts/_course_base_info.html.erb
+++ b/app/views/layouts/_course_base_info.html.erb
@@ -84,4 +84,12 @@
<% end %>
-
\ No newline at end of file
+
+<% if is_teacher %>
+
+
+
+
请将邀请码告诉学生和教辅
+
他们可以主动加入班级
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 572efcb07..2c72e3e2e 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -50,7 +50,7 @@
-
+
<%=render :partial => 'layouts/course_base_info' %>
diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css
index 9565a9e26..1c2d1d0d9 100644
--- a/public/stylesheets/css/public.css
+++ b/public/stylesheets/css/public.css
@@ -1454,4 +1454,8 @@ a:hover.sy_btn_green{ background: #51a74f;}
.resource_tip_box em {display:block; border-width:10px; position:absolute;top:35px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
.resource_tip_box span {display:block; border-width:10px; position:absolute;top:35px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
+/*邀请码提示框*/
+.invite_code_tip_box {position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-185px; top:50px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
+.invite_code_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
+.invite_code_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
From d8e04e792396a12f5eef5d6bf4e43f0e583790b8 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 8 Sep 2016 14:04:40 +0800
Subject: [PATCH 035/104] =?UTF-8?q?=E6=9A=82=E6=97=B6=E9=9A=90=E8=97=8F?=
=?UTF-8?q?=E2=80=9C=E5=A4=8D=E5=88=B6=E7=8F=AD=E7=BA=A7=E2=80=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_course_base_info.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb
index 7cd55b47b..1be6e5ac8 100644
--- a/app/views/layouts/_course_base_info.html.erb
+++ b/app/views/layouts/_course_base_info.html.erb
@@ -18,7 +18,7 @@
<%= link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => @course},:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗", :class => "sy_class_option" %>
- <%= link_to "复制班级", copy_course_course_path(@course.id),:remote=>true, :class => "sy_class_option" %>
+
<% if @course.syllabus %>
<%= link_to "进入课程", syllabus_path(@course.syllabus), :class => "sy_class_option", :target => "_blank" %>
<% end %>
From cf25dc8dfd66f54dd424b1862841ae41e5732df9 Mon Sep 17 00:00:00 2001
From: cxt
Date: Thu, 8 Sep 2016 15:00:20 +0800
Subject: [PATCH 036/104] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=9A=84=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 2 +-
app/views/users/_project_list.html.erb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 73436395f..e0fa253b3 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -3518,7 +3518,7 @@ class UsersController < ApplicationController
# 用户的所有项目
# @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
- @my_projects = @user.projects.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
+ @my_projects = @user.projects.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_projects_count = @my_projects.count
#@my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
diff --git a/app/views/users/_project_list.html.erb b/app/views/users/_project_list.html.erb
index 4fa78f45d..9aeb39ab5 100644
--- a/app/views/users/_project_list.html.erb
+++ b/app/views/users/_project_list.html.erb
@@ -37,13 +37,13 @@
<% else %>
<% projects.each_with_index do |project, i| %>
- <% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public %>
+ <% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public == 1 %>
<%=render :partial => 'collect_project', :locals => {:project => project} %>
<%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank',
- :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有班级不可访问") %>
+ :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %>
<% unless project.is_public? %>
私有
<% end %>
From 08c64d2ac7528c6657c5705a8d85963e7e42a810 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 8 Sep 2016 15:38:01 +0800
Subject: [PATCH 037/104] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E5=BB=BA?=
=?UTF-8?q?=E5=8F=8A=E5=A4=8D=E5=88=B6issue=E6=97=B6=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E5=8F=96=E6=B6=88=E6=B2=A1=E5=8F=8D=E5=BA=94=E7=9A=84=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/views/issues/_form.html.erb | 9 +-
db/schema.rb | 424 +++++++++++++++++++++++++++++++-
2 files changed, 419 insertions(+), 14 deletions(-)
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb
index c0b933e2a..51a6c3b9e 100644
--- a/app/views/issues/_form.html.erb
+++ b/app/views/issues/_form.html.erb
@@ -79,4 +79,11 @@
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %>
确定
- 取消
+<% if params[:action] == "new" %>
+ <% if @copy_from %>
+ <%= link_to "取消", issue_path(@copy_from), :class => "grey_btn fl mr50 ml10" %>
+ <% end %>
+<% else %>
+ 取消
+<% end %>
+
diff --git a/db/schema.rb b/db/schema.rb
index b8f931eed..ed06b709c 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -52,6 +52,28 @@ ActiveRecord::Schema.define(:version => 20160905084821) 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 "application_settings", :force => true do |t|
+ t.integer "default_projects_limit"
+ t.boolean "signup_enabled"
+ t.boolean "signin_enabled"
+ t.boolean "gravatar_enabled"
+ t.text "sign_in_text"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "home_page_url"
+ t.integer "default_branch_protection", :default => 2
+ t.boolean "twitter_sharing_enabled", :default => true
+ t.text "restricted_visibility_levels"
+ t.boolean "version_check_enabled", :default => true
+ t.integer "max_attachment_size", :default => 10, :null => false
+ t.integer "default_project_visibility"
+ t.integer "default_snippet_visibility"
+ t.text "restricted_signup_domains"
+ t.boolean "user_oauth_applications", :default => true
+ t.string "after_sign_out_path"
+ t.integer "session_expire_delay", :default => 10080, :null => false
+ end
+
create_table "applied_messages", :force => true do |t|
t.integer "user_id"
t.integer "applied_id"
@@ -60,16 +82,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
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"
+ t.string "name"
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
+ t.integer "role", :default => 0
+ t.integer "applied_user_id"
end
create_table "apply_add_schools", :force => true do |t|
@@ -184,6 +207,20 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.string "typeName", :limit => 50
end
+ create_table "audit_events", :force => true do |t|
+ t.integer "author_id", :null => false
+ t.string "type", :null => false
+ t.integer "entity_id", :null => false
+ t.string "entity_type", :null => false
+ t.text "details"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id"
+ add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type"
+ add_index "audit_events", ["type"], :name => "index_audit_events_on_type"
+
create_table "auth_sources", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false
t.string "name", :limit => 60, :default => "", :null => false
@@ -281,6 +318,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
add_index "boards", ["project_id"], :name => "boards_project_id"
+ create_table "broadcast_messages", :force => true do |t|
+ t.text "message", :null => false
+ t.datetime "starts_at"
+ t.datetime "ends_at"
+ t.integer "alert_type"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "color"
+ t.string "font"
+ end
+
create_table "bug_to_osps", :force => true do |t|
t.integer "osp_id"
t.integer "relative_memo_id"
@@ -310,14 +358,16 @@ ActiveRecord::Schema.define(:version => 20160905084821) 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"
@@ -597,8 +647,11 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.string "qrcode"
end
+ add_index "courses", ["id"], :name => "id", :unique => true
add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true
add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id"
+ add_index "courses", ["tea_id"], :name => "tea_id"
+ add_index "courses", ["visits"], :name => "visits"
create_table "custom_fields", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false
@@ -661,6 +714,15 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
+ create_table "deploy_keys_projects", :force => true do |t|
+ t.integer "deploy_key_id", :null => false
+ t.integer "project_id", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id"
+
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
@@ -710,6 +772,16 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "created_at"
end
+ create_table "emails", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.string "email", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true
+ add_index "emails", ["user_id"], :name => "index_emails_on_user_id"
+
create_table "enabled_modules", :force => true do |t|
t.integer "project_id"
t.string "name", :null => false
@@ -732,6 +804,25 @@ ActiveRecord::Schema.define(:version => 20160905084821) 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 "events", :force => true do |t|
+ t.string "target_type"
+ t.integer "target_id"
+ t.string "title"
+ t.text "data"
+ t.integer "project_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "action"
+ t.integer "author_id"
+ end
+
+ add_index "events", ["action"], :name => "index_events_on_action"
+ add_index "events", ["author_id"], :name => "index_events_on_author_id"
+ add_index "events", ["created_at"], :name => "index_events_on_created_at"
+ add_index "events", ["project_id"], :name => "index_events_on_project_id"
+ add_index "events", ["target_id"], :name => "index_events_on_target_id"
+ add_index "events", ["target_type"], :name => "index_events_on_target_type"
+
create_table "exercise_answers", :force => true do |t|
t.integer "user_id"
t.integer "exercise_question_id"
@@ -834,6 +925,15 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
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 "forked_project_links", :force => true do |t|
+ t.integer "forked_to_project_id", :null => false
+ t.integer "forked_from_project_id", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true
+
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.text "description"
@@ -963,6 +1063,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "updated_at", :null => false
end
+ create_table "identities", :force => true do |t|
+ t.string "extern_uid"
+ t.string "provider"
+ t.integer "user_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id"
+ add_index "identities", ["user_id"], :name => "index_identities_on_user_id"
+
create_table "invite_lists", :force => true do |t|
t.integer "project_id"
t.integer "user_id"
@@ -1109,6 +1220,20 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "private", :default => 0
end
+ create_table "keys", :force => true do |t|
+ t.integer "user_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.text "key"
+ t.string "title"
+ t.string "type"
+ t.string "fingerprint"
+ t.boolean "public", :default => false, :null => false
+ end
+
+ add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id"
+ add_index "keys", ["user_id"], :name => "index_keys_on_user_id"
+
create_table "kindeditor_assets", :force => true do |t|
t.string "asset"
t.integer "file_size"
@@ -1120,6 +1245,27 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "owner_type", :default => 0
end
+ create_table "label_links", :force => true do |t|
+ t.integer "label_id"
+ t.integer "target_id"
+ t.string "target_type"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id"
+ add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type"
+
+ create_table "labels", :force => true do |t|
+ t.string "title"
+ t.string "color"
+ t.integer "project_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "labels", ["project_id"], :name => "index_labels_on_project_id"
+
create_table "member_roles", :force => true do |t|
t.integer "member_id", :null => false
t.integer "role_id", :null => false
@@ -1172,6 +1318,47 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "viewed_count", :default => 0
end
+ create_table "merge_request_diffs", :force => true do |t|
+ t.string "state"
+ t.text "st_commits", :limit => 2147483647
+ t.text "st_diffs", :limit => 2147483647
+ t.integer "merge_request_id", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true
+
+ create_table "merge_requests", :force => true do |t|
+ t.string "target_branch", :null => false
+ t.string "source_branch", :null => false
+ t.integer "source_project_id", :null => false
+ t.integer "author_id"
+ t.integer "assignee_id"
+ t.string "title"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "milestone_id"
+ t.string "state"
+ t.string "merge_status"
+ t.integer "target_project_id", :null => false
+ t.integer "iid"
+ t.text "description"
+ t.integer "position", :default => 0
+ t.datetime "locked_at"
+ end
+
+ add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id"
+ add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id"
+ add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id"
+ add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at"
+ add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id"
+ add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch"
+ add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id"
+ add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch"
+ add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true
+ add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title"
+
create_table "message_alls", :force => true do |t|
t.integer "user_id"
t.integer "message_id"
@@ -1206,6 +1393,39 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
add_index "messages", ["parent_id"], :name => "messages_parent_id"
+ create_table "milestones", :force => true do |t|
+ t.string "title", :null => false
+ t.integer "project_id", :null => false
+ t.text "description"
+ t.date "due_date"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "state"
+ t.integer "iid"
+ end
+
+ add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id"
+ add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date"
+ add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true
+ add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id"
+
+ create_table "namespaces", :force => true do |t|
+ t.string "name", :null => false
+ t.string "path", :null => false
+ t.integer "owner_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "type"
+ t.string "description", :default => "", :null => false
+ t.string "avatar"
+ end
+
+ add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id"
+ add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true
+ add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id"
+ add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true
+ add_index "namespaces", ["type"], :name => "index_namespaces_on_type"
+
create_table "news", :force => true do |t|
t.integer "project_id"
t.string "title", :limit => 60, :default => "", :null => false
@@ -1231,6 +1451,31 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "updated_at", :null => false
end
+ create_table "notes", :force => true do |t|
+ t.text "note"
+ t.string "noteable_type"
+ t.integer "author_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "project_id"
+ t.string "attachment"
+ t.string "line_code"
+ t.string "commit_id"
+ t.integer "noteable_id"
+ t.boolean "system", :default => false, :null => false
+ t.text "st_diff", :limit => 2147483647
+ end
+
+ add_index "notes", ["author_id"], :name => "index_notes_on_author_id"
+ add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id"
+ add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id"
+ add_index "notes", ["created_at"], :name => "index_notes_on_created_at"
+ add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type"
+ add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type"
+ add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type"
+ add_index "notes", ["project_id"], :name => "index_notes_on_project_id"
+ add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at"
+
create_table "notificationcomments", :force => true do |t|
t.string "notificationcommented_type"
t.integer "notificationcommented_id"
@@ -1240,6 +1485,49 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "updated_at", :null => false
end
+ create_table "oauth_access_grants", :force => true do |t|
+ t.integer "resource_owner_id", :null => false
+ t.integer "application_id", :null => false
+ t.string "token", :null => false
+ t.integer "expires_in", :null => false
+ t.text "redirect_uri", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "revoked_at"
+ t.string "scopes"
+ end
+
+ add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true
+
+ create_table "oauth_access_tokens", :force => true do |t|
+ t.integer "resource_owner_id"
+ t.integer "application_id"
+ t.string "token", :null => false
+ t.string "refresh_token"
+ t.integer "expires_in"
+ t.datetime "revoked_at"
+ t.datetime "created_at", :null => false
+ t.string "scopes"
+ end
+
+ add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true
+ add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id"
+ add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true
+
+ create_table "oauth_applications", :force => true do |t|
+ t.string "name", :null => false
+ t.string "uid", :null => false
+ t.string "secret", :null => false
+ t.text "redirect_uri", :null => false
+ t.string "scopes", :default => "", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "owner_id"
+ t.string "owner_type"
+ end
+
+ add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type"
+ add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true
+
create_table "onclick_times", :force => true do |t|
t.integer "user_id"
t.datetime "onclick_time"
@@ -1397,6 +1685,23 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "allow_teacher", :default => 0
end
+ create_table "permissions", :force => true do |t|
+ t.string "controller", :limit => 30, :default => "", :null => false
+ t.string "action", :limit => 30, :default => "", :null => false
+ t.string "description", :limit => 60, :default => "", :null => false
+ t.boolean "is_public", :default => false, :null => false
+ t.integer "sort", :default => 0, :null => false
+ t.boolean "mail_option", :default => false, :null => false
+ t.boolean "mail_enabled", :default => false, :null => false
+ end
+
+ create_table "permissions_roles", :id => false, :force => true do |t|
+ t.integer "permission_id", :default => 0, :null => false
+ t.integer "role_id", :default => 0, :null => false
+ end
+
+ add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
+
create_table "phone_app_versions", :force => true do |t|
t.string "version"
t.text "description"
@@ -1479,6 +1784,11 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "updated_at", :null => false
end
+ create_table "project_import_data", :force => true do |t|
+ t.integer "project_id"
+ t.text "data"
+ end
+
create_table "project_infos", :force => true do |t|
t.integer "project_id"
t.integer "user_id"
@@ -1571,6 +1881,16 @@ ActiveRecord::Schema.define(:version => 20160905084821) 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 "protected_branches", :force => true do |t|
+ t.integer "project_id", :null => false
+ t.string "name", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "developers_can_push", :default => false, :null => false
+ end
+
+ add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id"
+
create_table "pull_requests", :force => true do |t|
t.integer "pull_request_id"
t.integer "gpid"
@@ -1727,6 +2047,25 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "is_teacher_score", :default => 0
end
+ create_table "services", :force => true do |t|
+ t.string "type"
+ t.string "title"
+ t.integer "project_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.boolean "active", :default => false, :null => false
+ t.text "properties"
+ t.boolean "template", :default => false
+ t.boolean "push_events", :default => true
+ t.boolean "issues_events", :default => true
+ t.boolean "merge_requests_events", :default => true
+ t.boolean "tag_push_events", :default => true
+ t.boolean "note_events", :default => true, :null => false
+ end
+
+ add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id"
+ add_index "services", ["project_id"], :name => "index_services_on_project_id"
+
create_table "settings", :force => true do |t|
t.string "name", :default => "", :null => false
t.text "value"
@@ -1765,6 +2104,26 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "updated_at", :null => false
end
+ create_table "snippets", :force => true do |t|
+ t.string "title"
+ t.text "content", :limit => 2147483647
+ t.integer "author_id", :null => false
+ t.integer "project_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "file_name"
+ t.datetime "expires_at"
+ t.string "type"
+ t.integer "visibility_level", :default => 0, :null => false
+ end
+
+ add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id"
+ add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id"
+ add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at"
+ add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at"
+ add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id"
+ add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level"
+
create_table "softapplications", :force => true do |t|
t.string "name"
t.text "description"
@@ -1845,9 +2204,9 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "absence_penalty", :default => 0
t.float "system_score", :default => 0.0
t.boolean "is_test", :default => false
+ t.float "work_score"
t.integer "simi_id"
t.integer "simi_value"
- t.float "work_score"
t.integer "work_status", :default => 0
t.datetime "commit_time"
end
@@ -1897,13 +2256,13 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
create_table "sub_domains", :force => true do |t|
t.integer "org_subfield_id"
- t.integer "priority", :default => 0
+ t.integer "priority"
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
+ t.integer "hide"
+ t.integer "status"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "subfield_subdomain_dirs", :force => true do |t|
@@ -1913,6 +2272,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "updated_at", :null => false
end
+ create_table "subscriptions", :force => true do |t|
+ t.integer "user_id"
+ t.integer "subscribable_id"
+ t.string "subscribable_type"
+ t.boolean "subscribed"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true
+
create_table "syllabuses", :force => true do |t|
t.string "title"
t.text "description"
@@ -2174,6 +2544,17 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
add_index "users", ["id", "type"], :name => "index_users_on_id_and_type"
add_index "users", ["type"], :name => "index_users_on_type"
+ create_table "users_star_projects", :force => true do |t|
+ t.integer "project_id", :null => false
+ t.integer "user_id", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id"
+ add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true
+ add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id"
+
create_table "versions", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.string "name", :default => "", :null => false
@@ -2225,6 +2606,23 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.datetime "updated_at", :null => false
end
+ create_table "web_hooks", :force => true do |t|
+ t.string "url"
+ t.integer "project_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "type", :default => "ProjectHook"
+ t.integer "service_id"
+ t.boolean "push_events", :default => true, :null => false
+ t.boolean "issues_events", :default => false, :null => false
+ t.boolean "merge_requests_events", :default => false, :null => false
+ t.boolean "tag_push_events", :default => false
+ t.boolean "note_events", :default => false, :null => false
+ end
+
+ add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id"
+ add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id"
+
create_table "wechat_logs", :force => true do |t|
t.string "openid", :null => false
t.text "request_raw"
From 6dbb2e4e94414906eac61c0b81de251b44238561 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 8 Sep 2016 16:03:32 +0800
Subject: [PATCH 038/104] =?UTF-8?q?Pull=20request=E6=95=B0=E9=87=8F?=
=?UTF-8?q?=E4=B8=BA0=E7=9A=84=E6=97=B6=E5=80=99=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E5=9C=A8=E6=9B=B4=E5=A4=9A=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 8 +++++++-
app/views/projects/_development_group.html.erb | 2 +-
app/views/projects/_tools_expand.html.erb | 5 +++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 3c125a185..b08b777df 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -832,7 +832,13 @@ module ApplicationHelper
atts.count > 0 ? true :false
end
- # 必须是项目成,项目必须提交过代码
+ # 如果Pull Request数量为0就显示在更多中
+ def allow_show_pull_request project
+ g = Gitlab.client
+ count = g.merge_requests(project.gpid).count
+ end
+
+ # 必须是项目成员,项目必须提交过代码
def allow_pull_request project
return false if project.gpid.nil?
g = Gitlab.client
diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb
index 17742f023..e6f3ad3da 100644
--- a/app/views/projects/_development_group.html.erb
+++ b/app/views/projects/_development_group.html.erb
@@ -41,7 +41,7 @@
<% end %>
-<% if allow_pull_request(@project) %>
+<% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) > 0 %>
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
<% if User.current.member_of?(@project) %>
diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb
index 6facde36b..50f633264 100644
--- a/app/views/projects/_tools_expand.html.erb
+++ b/app/views/projects/_tools_expand.html.erb
@@ -1,3 +1,8 @@
+
+ <% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) == 0 %>
+ <%= link_to "Pull Requests", project_pull_requests_path(@project) %>
+ <% end %>
+
<% unless @project.enabled_modules.where("name = 'news'").empty? %>
<%= link_to l(:project_module_news), project_news_index_path(@project) %>
From 2c719feacdde51013fb3e294636d7a3fdfa54871 Mon Sep 17 00:00:00 2001
From: Tim
Date: Thu, 8 Sep 2016 18:34:35 +0800
Subject: [PATCH 039/104] =?UTF-8?q?=E6=97=A0=E7=94=A8=E7=9A=84=E5=86=85?=
=?UTF-8?q?=E8=81=94=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/blogs/index.html.erb | 385 ++++++++++++++++-----------------
app/views/boards/show.html.erb | 1 -
2 files changed, 192 insertions(+), 194 deletions(-)
diff --git a/app/views/blogs/index.html.erb b/app/views/blogs/index.html.erb
index f473ab534..8ad845c16 100644
--- a/app/views/blogs/index.html.erb
+++ b/app/views/blogs/index.html.erb
@@ -1,193 +1,192 @@
-
-
-<%= import_ke(enable_at: false, prettify: false) %>
-
-
-<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @topics, :page => 0, :user => @user} %>
-
-
-
-
+
+
+<%= import_ke(enable_at: false, prettify: false) %>
+
+
+<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @topics, :page => 0, :user => @user} %>
+
+
+
+
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index 6cc755b61..ac50c0ee9 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -1,7 +1,6 @@
-
+
我的作业
diff --git a/app/views/users/my_homeworks.html.erb b/app/views/users/my_homeworks.html.erb
index ccf06adfd..f7d031d95 100644
--- a/app/views/users/my_homeworks.html.erb
+++ b/app/views/users/my_homeworks.html.erb
@@ -9,7 +9,7 @@
window.location.href = url;
}
-
+
我的作业
diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css
index 31464673e..8c55bd102 100644
--- a/public/stylesheets/css/structure.css
+++ b/public/stylesheets/css/structure.css
@@ -596,6 +596,9 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
.user_sub_menu li a:hover,.user_sub_menu li a:target { color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;}
.user_sub_menu li a:hover,.user_sub_menu li a:target{}
.user_sub_menu li:last-child a { }
+.user_sub_menu li p {padding:0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;}
+.user_sub_menu li p:hover {background:#fff;}
+.user_sub_menu li p:hover a {background:#fff;}
.users_accordion li > .user_sub_menu {
display: none;
}
@@ -634,6 +637,7 @@ a.user_navmorebox .user_icons_closeclass{
height:10px;
background:url(/images/user/icons_user_leftnav.png) -25px -347px no-repeat;
}
+.show-all-sub {position:absolute; top:18px; right:15px;}
/* 个人主页左侧导航更多功能 */
.user_navmore_box {position:absolute; width:15px; height:15px; right:13px; top:17px; cursor:pointer;}
.user_navmore_box ul li:hover ul {display:block; }
diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css
index 82b77c393..9ec9aa270 100644
--- a/public/stylesheets/syllabus.css
+++ b/public/stylesheets/syllabus.css
@@ -563,7 +563,7 @@ a:hover.sy_btn_orange{
font-weight:normal;
}
.sy_sq_orange{ display: block;width: 15px; height: 15px; background:#f79981; color: #fff; text-align:center; line-height: 15px;}
-a.sy_class_ltitle{display: block; font-size: 14px; width: 185px; color:#888; }
+a.sy_class_ltitle{font-size: 14px; color:#888; }
a:hover.sy_class_ltitle{ color:#333;}
.sy_cir_grey{
font-size:11px;
From 547e786a10a2e39b30613f77349ae832615dd965 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 9 Sep 2016 15:54:51 +0800
Subject: [PATCH 056/104] =?UTF-8?q?=E2=80=9C=E5=85=A8=E9=83=A8=E2=80=9D?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/new_base_user.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb
index b9ca67362..f38b4d531 100644
--- a/app/views/layouts/new_base_user.html.erb
+++ b/app/views/layouts/new_base_user.html.erb
@@ -163,7 +163,7 @@
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
- 全部
+ <%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "linkGrey2" %>
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
@@ -191,7 +191,7 @@
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
- 全部
+ <%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => 'linkGrey2'%>
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
From 00e6549beca68e25eb02f9dcc2ee9b3dc7e7d8e4 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 15:56:40 +0800
Subject: [PATCH 057/104] =?UTF-8?q?=E8=A7=A3=E5=86=B3issue=E8=AF=A6?=
=?UTF-8?q?=E6=83=85=E6=80=A7=E8=83=BDN+1=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index b97699058..03f9c2f7c 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -132,16 +132,13 @@ class IssuesController < ApplicationController
User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!}
end
- # 缺陷状态更新
- query_journals = @issue.journals
- query_journals.each do |query_journal|
- query_journal.forge_messages.each do |f|
- if User.current.id == f.user_id
- f.update_attributes(:viewed => true)
- end
- end
- end
- # 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 ASC").all
@journals.each_with_index {|j,i| j.indice = i+1}
From 2307c0c3c0b07aa9b35ef6b1e6175cd303c8d191 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Fri, 9 Sep 2016 16:00:51 +0800
Subject: [PATCH 058/104] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E2=80=9C=E5=85=AC=E5=BC=80"?=
=?UTF-8?q?=E5=AD=97=E6=A0=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_project_list.html.erb | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/app/views/users/_project_list.html.erb b/app/views/users/_project_list.html.erb
index 828f4f7ac..b13f37874 100644
--- a/app/views/users/_project_list.html.erb
+++ b/app/views/users/_project_list.html.erb
@@ -44,9 +44,10 @@
<%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank',
:class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %>
- <% unless project.is_public? %>
- 私有
- <% end %>
+ <%# unless project.is_public? %>
+
+ <%# end %>
+ <%= project.is_public? ? '公开' : '私有' %>
<% projectUser = User.where("id=?",project.user_id).first %>
<%= link_to "创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)} ".html_safe, user_path(projectUser) %>
From 3a6237a6e4800d4f3e2ea090e3a6439593c4e0b8 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 16:32:15 +0800
Subject: [PATCH 059/104] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8C=E7=A8=8B?=
=?UTF-8?q?=E7=A2=91=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/helpers/application_helper.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 14ccb6dca..94b0b2c6e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -417,11 +417,11 @@ module ApplicationHelper
end
# status_id:3、已解决 5、已关闭
if issue.status_id == 3
- s = link_to text, issue_path(issue), :class => "text_line_s", :title => title
+ s = link_to text, issue_path(issue), :class => "text_line_s fl", :title => title
elsif issue.status_id == 5
- s = link_to text, issue_path(issue), :class => "text_line_s del_line", :title => title
+ s = link_to text, issue_path(issue), :class => "text_line_s del_line fl", :title => title
else
- s = link_to text, issue_path(issue), :class => "c_blue", :title => title
+ s = link_to text, issue_path(issue), :class => "c_blue fl", :title => title
end
s << h(": #{subject} ".html_safe) if subject
s = h("#{issue.project} - ") + s if options[:project]
@@ -840,7 +840,7 @@ module ApplicationHelper
# 必须是项目成员,项目必须提交过代码
def allow_pull_request project
- return false if project.gpid.nil?
+ return 0 if project.gpid.nil?
g = Gitlab.client
count = g.user_static(project.gpid, :rev => "master").count
count
From 502bd9f451eed8cbeb72b425e1d65b2ff248cab1 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 16:37:24 +0800
Subject: [PATCH 060/104] =?UTF-8?q?=E9=87=8C=E7=A8=8B=E7=A2=91=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F=E8=BF=87=E9=95=BF=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/versions/index.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb
index dd3d9d9b8..eec93c86c 100644
--- a/app/views/versions/index.html.erb
+++ b/app/views/versions/index.html.erb
@@ -47,7 +47,7 @@
<% issues.each do |issue| -%>
<%= link_to_issue_version(issue, :project => (@project != issue.project)) %>
- 指派给:<%= link_to "#{User.find(issue.try(:assigned_to_id)).show_name}", user_path(issue.try(:assigned_to_id)), :class => "c_blue hidden" %>
+ 指派给:<%= link_to "#{User.find(issue.try(:assigned_to_id)).show_name}", user_path(issue.try(:assigned_to_id)), :class => "c_blue hidden fr", :style => "width:50px;" %>
<% end -%>
From d44aea1ce1b8726cc7c4c6871b36c8333602c1c4 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 9 Sep 2016 16:44:22 +0800
Subject: [PATCH 061/104] =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E7=8F=AD=E7=BA=A7?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E9=BB=91=E7=82=B9=E6=94=B9=E6=88=90?=
=?UTF-8?q?=E7=81=B0=E8=89=B2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_user_courses.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index 21858fbea..746064020 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -4,7 +4,7 @@
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
From 8c9514146027043ac6de498a7612b6ef5cf6e00c Mon Sep 17 00:00:00 2001
From: Tim
Date: Fri, 9 Sep 2016 16:48:43 +0800
Subject: [PATCH 062/104] =?UTF-8?q?=E4=BE=A7=E5=AF=BC=E8=88=AA=E7=AE=AD?=
=?UTF-8?q?=E5=A4=B4=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/css/structure.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css
index 8c55bd102..0675f51e4 100644
--- a/public/stylesheets/css/structure.css
+++ b/public/stylesheets/css/structure.css
@@ -599,6 +599,7 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
.user_sub_menu li p {padding:0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;}
.user_sub_menu li p:hover {background:#fff;}
.user_sub_menu li p:hover a {background:#fff;}
+.user_sub_menu li p:hover,.user_sub_menu li p:target {color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;}
.users_accordion li > .user_sub_menu {
display: none;
}
From 3d68e8963a07c86debc6a3d6c43a75c0016b28ac Mon Sep 17 00:00:00 2001
From: Tim
Date: Fri, 9 Sep 2016 17:11:51 +0800
Subject: [PATCH 063/104] =?UTF-8?q?=E4=BE=A7=E5=AF=BC=E8=88=AA=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E5=92=8C=E7=8F=AD=E7=BA=A7=E8=B6=85=E9=95=BF=E6=97=B6?=
=?UTF-8?q?=EF=BC=8C=E7=9C=81=E7=95=A5=E5=8F=B7=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_user_courses.html.erb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index 21858fbea..0d54fc06a 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -2,10 +2,10 @@
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
-
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
From f9a905a344425e02c9cd388470fe9a66555bc1ca Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Fri, 9 Sep 2016 17:22:10 +0800
Subject: [PATCH 064/104] =?UTF-8?q?issue=E8=AF=A6=E6=83=85=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E5=9B=9E=E5=A4=8D=EF=BC=8C=E7=82=B9=E5=87=BB=E9=99=84?=
=?UTF-8?q?=E4=BB=B6=E7=9B=B4=E6=8E=A5=E4=B8=8B=E8=BD=BD=EF=BC=88=E5=BA=94?=
=?UTF-8?q?=E8=AF=A5=E6=98=AF=E9=A2=84=E8=A7=88=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/_jounal_refresh.js.erb | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/app/views/issues/_jounal_refresh.js.erb b/app/views/issues/_jounal_refresh.js.erb
index df3d605f4..db5a068bf 100644
--- a/app/views/issues/_jounal_refresh.js.erb
+++ b/app/views/issues/_jounal_refresh.js.erb
@@ -1,8 +1,5 @@
-$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue}) %>");
-$("#issue_detail_show").html('<%= escape_javascript(render :partial => 'issues/detail') %>')
-$("#issue_edit_show").html('<%= escape_javascript(render :partial => 'issues/edit') %>')
-$("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => @issue}) %>");
-sd_create_editor_from_data(<%= @issue.id %>, null, "100%", "<%= @issue.class.name %>");
+
+location.reload();
issue_desc_editor = KindEditor.create('#issue_description',
{"width":"85%",
"resizeType":0,
@@ -17,5 +14,3 @@ issue_desc_editor = KindEditor.create('#issue_description',
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
-$(".homepagePostReplyBannerCount").html('<%= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
-sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%= @issue.class.name %>");
\ No newline at end of file
From 121537bfcbdf9a8fd1fc315eddbc1c600e73515d Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 17:22:38 +0800
Subject: [PATCH 065/104] =?UTF-8?q?=E6=B6=88=E6=81=AF404=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_forum.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/users/_user_message_forum.html.erb b/app/views/users/_user_message_forum.html.erb
index 4757aa401..4544fd651 100644
--- a/app/views/users/_user_message_forum.html.erb
+++ b/app/views/users/_user_message_forum.html.erb
@@ -1,5 +1,5 @@
<% if ma.class == MemoMessage %>
- <% if ma.memo_type == "Memo" %>
+ <% if ma.memo_type == "Memo" && ma.memo %>
<%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author), :target => '_blank' %>
From 7fd73348a611b3b09b744cf094d57c52a813bfdc Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 17:41:09 +0800
Subject: [PATCH 066/104] =?UTF-8?q?=E6=B6=88=E6=81=AF404=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_forum.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/users/_user_message_forum.html.erb b/app/views/users/_user_message_forum.html.erb
index 4544fd651..5d6c5bcad 100644
--- a/app/views/users/_user_message_forum.html.erb
+++ b/app/views/users/_user_message_forum.html.erb
@@ -1,5 +1,5 @@
<% if ma.class == MemoMessage %>
- <% if ma.memo_type == "Memo" && ma.memo %>
+ <% if ma.memo_type == "Memo" && !ma.memo.nil? && !ma.memo.author.nil? %>
<%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author), :target => '_blank' %>
From ddb369928fcbfac96e35bacdb22a3470d6959af9 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 17:44:41 +0800
Subject: [PATCH 067/104] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_show_messages_list.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/_show_messages_list.html.erb b/app/views/layouts/_show_messages_list.html.erb
index 584970f16..2d6da0770 100644
--- a/app/views/layouts/_show_messages_list.html.erb
+++ b/app/views/layouts/_show_messages_list.html.erb
@@ -138,7 +138,7 @@
<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>
<% end %>
<% elsif ma.class == MemoMessage %>
- <% if ma.memo_type == "Memo" %>
+ <% if ma.memo_type == "Memo" && !ma.memo.nil? && !ma.memo.author.nil? %>
<%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%>"><%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%>
<% end %>
<% elsif ma.class == UserFeedbackMessage %>
From 34a1bb0b49567cb3085a4c87e30a1587d121353f Mon Sep 17 00:00:00 2001
From: Tim
Date: Fri, 9 Sep 2016 17:54:54 +0800
Subject: [PATCH 068/104] =?UTF-8?q?=E4=BE=A7=E5=AF=BC=E8=88=AA=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=EF=BC=8C=E7=8F=AD=E7=BA=A7=E5=90=8D=E7=A7=B0=E8=BF=87?=
=?UTF-8?q?=E9=95=BF=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_user_courses.html.erb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index d1699b776..7e3249a55 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -104,4 +104,13 @@
$("#user_show_more_course").hide();
$('#user_hide_course').show();
}
+
+ $(".course_list_menu").each(function(){
+ var courseWidth = $(this).children().eq(0).width();
+ var classWidth = 160 -courseWidth;
+ console.log(courseWidth, classWidth);
+ if(courseWidth < 80){
+ $(this).children().eq(2).css("max-width",classWidth + "px");
+ }
+ })
From 1fe8b35fc9305bff968069ba8ef82aca4edabfb6 Mon Sep 17 00:00:00 2001
From: Tim
Date: Fri, 9 Sep 2016 17:58:21 +0800
Subject: [PATCH 069/104] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=90=8D=E7=A7=B0?=
=?UTF-8?q?=EF=BC=8C=E7=8F=AD=E7=BA=A7=E5=90=8D=E7=A7=B0=E8=BF=87=E9=95=BF?=
=?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=9C=81=E7=95=A5=E5=8F=B7=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_user_courses.html.erb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index 7e3249a55..754cfd10b 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -3,9 +3,9 @@
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
@@ -107,7 +107,7 @@
$(".course_list_menu").each(function(){
var courseWidth = $(this).children().eq(0).width();
- var classWidth = 160 -courseWidth;
+ var classWidth = 170 -courseWidth;
console.log(courseWidth, classWidth);
if(courseWidth < 80){
$(this).children().eq(2).css("max-width",classWidth + "px");
From 61836dbe937774316e3edb8cb05faa81924c7653 Mon Sep 17 00:00:00 2001
From: cxt
Date: Fri, 9 Sep 2016 18:02:47 +0800
Subject: [PATCH 070/104] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E6=8A=A5500?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/organizations_controller.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 56ffc77e2..2b31cae13 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -88,7 +88,7 @@ class OrganizationsController < ApplicationController
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
project_ids = (@organization.projects.map(&:id) - shield_project_ids) << 0
- course_ids = (@organization.courses.map(&:id) - shield_course_ids) << 0
+ course_ids = (@organization.courses.not_deleted.map(&:id) - shield_course_ids) << 0
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
@project_acts = get_project_activities_org @organization, project_ids
@course_acts = get_course_activities_org @organization, course_ids
@@ -140,7 +140,7 @@ class OrganizationsController < ApplicationController
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0
- course_ids = (@organization.courses.map(&:id)-shield_course_ids) << 0
+ course_ids = (@organization.courses.not_deleted.map(&:id)-shield_course_ids) << 0
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
case params[:type]
when nil
From a3f444819ee34c9e00f1c796f5336100cc913a0e Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 12 Sep 2016 10:52:43 +0800
Subject: [PATCH 071/104] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=90=8D=E5=AD=97=E5=A4=AA=E9=95=BF=E6=8E=92=E7=89=88=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/schema.rb | 31 ++++++++++++++++--------------
public/stylesheets/css/project.css | 2 +-
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/db/schema.rb b/db/schema.rb
index 4b188ecbb..443e8c426 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 => 20160907061917) do
+ActiveRecord::Schema.define(:version => 20160907080621) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -56,10 +56,10 @@ ActiveRecord::Schema.define(:version => 20160907061917) do
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.integer "viewed"
+ t.integer "status"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.string "name"
t.integer "applied_user_id"
t.integer "role"
@@ -157,13 +157,13 @@ ActiveRecord::Schema.define(:version => 20160907061917) do
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 "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.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.string "description"
t.string "disk_directory"
@@ -173,6 +173,7 @@ ActiveRecord::Schema.define(:version => 20160907061917) do
t.integer "quotes"
t.integer "is_publish", :default => 1
t.date "publish_time"
+ t.boolean "init_file", :default => false
end
add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
@@ -310,14 +311,16 @@ ActiveRecord::Schema.define(:version => 20160907061917) 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"
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 454fce294..d2be2e16c 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -549,7 +549,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
.merge-discussion-input textarea {width:720px; height:80px; font-size:13px; line-height:16px; color:#484848; padding:5px;}
/*新版项目列表新增*/
-.new_project_title{ font-size:16px; color:#333; max-width:560px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
+.new_project_title{ font-size:16px; color:#333; max-width:480px; font-weight:normal;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.icons_project_list{ width:8px; height:8px; border:2px solid #fff; background:#3b94d6;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;-webkit-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5);box-shadow: 0px 2px 5px rgba(146, 153, 169, 0.5); }
.icons_project_favorite {background: url(/images/syllabus/sy_icons_star.png) 0px 0px no-repeat; width:20px; height:20px; display:block; float:left;}
.icons_project_star{background: url(/images/syllabus/sy_icons_star.png) 0px -27px no-repeat; width:20px; height:20px; display:block; float:left;}
From 8626692367c000423796af63273e166fe2c6651d Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 13 Sep 2016 14:47:05 +0800
Subject: [PATCH 072/104] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=EF=BC=9A?=
=?UTF-8?q?=E7=BC=96=E8=BE=91issue=E5=90=8E=E7=82=B9=E5=87=BB=E7=A1=AE?=
=?UTF-8?q?=E5=AE=9A=E6=8C=89=E9=92=AE=EF=BC=8C=E5=8D=B4=E8=BF=98=E6=98=AF?=
=?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/_edit.html.erb | 2 +-
app/views/issues/_jounal_refresh.js.erb | 7 +++++++
app/views/issues/update.js.erb | 9 +++++++++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index ccd37dc91..ea15af42e 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -3,7 +3,7 @@
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %>
-<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true, :remote => true} do |f| %>
+<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>
diff --git a/app/views/issues/_jounal_refresh.js.erb b/app/views/issues/_jounal_refresh.js.erb
index db5a068bf..5ccbf69d2 100644
--- a/app/views/issues/_jounal_refresh.js.erb
+++ b/app/views/issues/_jounal_refresh.js.erb
@@ -1,3 +1,8 @@
+/* $("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue}) %>");
+$("#issue_detail_show").html('<%#= escape_javascript(render :partial => 'issues/detail') %>');
+$("#issue_edit_show").html('<%#= escape_javascript(render :partial => 'issues/edit') %>');
+$("#div_issue_attachment_<%#=@issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => @issue}) %>");
+sd_create_editor_from_data(<%#= @issue.id %>, null, "100%", "<%#= @issue.class.name %>");*/
location.reload();
issue_desc_editor = KindEditor.create('#issue_description',
@@ -14,3 +19,5 @@ issue_desc_editor = KindEditor.create('#issue_description',
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
+// $(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
+// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#= @issue.class.name %>");
\ No newline at end of file
diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb
index 733066d38..bcf4c3077 100644
--- a/app/views/issues/update.js.erb
+++ b/app/views/issues/update.js.erb
@@ -1,4 +1,13 @@
<% if @saved %>
+/*$("#issue_detail").replaceWith('<%#= escape_javascript(render :partial => 'issues/detail') %>');
+$("#issue_edit").replaceWith('<%#= escape_javascript(render :partial => 'issues/edit') %>');
+
+$("#issue_detail").show();
+$("#issue_edit").hide();
+
+$("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
+sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#=@issue.class.name%>");
+$(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');*/
location.reload();
//edit里的编辑器貌似显示不出来,所以手动js生成。
issue_desc_editor = KindEditor.create('#issue_description',
From 390f68aad6df5e3edce942f6119727dc635d25ca Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 13 Sep 2016 14:57:45 +0800
Subject: [PATCH 073/104] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=80=A7=E8=83=BD=E6=8F=90=E5=8D=87=EF=BC=88?=
=?UTF-8?q?=E4=B8=BB=E8=A6=81=E6=98=AF=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2=E5=87=8F=E5=B0=91=EF=BC=8C=E5=BB=BA=E7=AB=8B=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E7=B4=A2=E5=BC=95=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 38 ++++---------------
.../student_work/_evaluation_title.html.erb | 2 +-
.../_evaluation_un_title.html.erb | 2 +-
...63446_add_index_to_student_works_scores.rb | 6 +++
4 files changed, 15 insertions(+), 33 deletions(-)
create mode 100644 db/migrate/20160913063446_add_index_to_student_works_scores.rb
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index d1835408f..0dffd7b66 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -338,41 +338,17 @@ class StudentWorkController < ApplicationController
end
def index
- # 作业消息状态更新
- @homework.course_messages.each do |homework_message|
- if User.current.id == homework_message.user_id && homework_message.viewed == 0
- homework_message.update_attributes(:viewed => true) if homework_message.viewed == 0
- end
- end
-
- #修改作品提示消息更新
- student_work_messages = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, StudentWork.name, 0)
- student_work_messages.each do |message|
- message.update_attribute(:viewed, true)
- end
-
+ # 作业消息状态更新?
+ homeworkcommon_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_message_id => @homework.id, :course_message_type => "HomeWorkCommon")
+ homeworkcommon_messages.update_all(:viewed => true)
+ studentwork_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_id => @homework.course, :course_message_type => "StudentWork")
+ studentwork_messages.update_all(:viewed => true)
# 作品打分消息状态更新
studentworks_scores = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "StudentWorksScore", 0)
- studentworks_scores.each do |studentworks_score|
- studentworks_score.update_attributes(:viewed => true) if studentworks_score.viewed == 0
- end
+ studentworks_scores.update_all(:viewed => true)
# 作品评论消息状态更新
journals_for_teacher = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "JournalsForMessage", 0)
- journals_for_teacher.each do |journal_for_teacher|
- journal_for_teacher.update_attributes(:viewed => true)
- end
- #不能参与作业匿评消息状态更新
- no_evaluation = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =? and status =?", User.current.id, @homework.course, "StudentWork", 0, 0)
- no_evaluation.update_all(:viewed => true)
- # 作品留言
- # 消息end
- #设置作业对应的forge_messages表的viewed字段
- query_student_work = @homework.course_messages
- query_student_work.each do |query|
- if User.current.id == query.user_id
- query.update_attributes(:viewed => true)
- end
- end
+ journals_for_teacher.update_all(:viewed => true)
##################################################################################################################
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group]
@homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc")
diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb
index 55e1b57c1..397e4ba46 100644
--- a/app/views/student_work/_evaluation_title.html.erb
+++ b/app/views/student_work/_evaluation_title.html.erb
@@ -29,7 +29,7 @@
我的评分
- <% @stundet_works.each_with_index do |student_work, i|%>
+ <% @stundet_works.includes(:user => {:user_extensions => []}, :project => {}).each_with_index do |student_work, i|%>
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%>
diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb
index 4fdd6384f..4091911fe 100644
--- a/app/views/student_work/_evaluation_un_title.html.erb
+++ b/app/views/student_work/_evaluation_un_title.html.erb
@@ -74,7 +74,7 @@
<%# end %>
- <% @stundet_works.each_with_index do |student_work, i| %>
+ <% @stundet_works.includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).each_with_index do |student_work, i| %>
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i} %>
diff --git a/db/migrate/20160913063446_add_index_to_student_works_scores.rb b/db/migrate/20160913063446_add_index_to_student_works_scores.rb
new file mode 100644
index 000000000..f21843289
--- /dev/null
+++ b/db/migrate/20160913063446_add_index_to_student_works_scores.rb
@@ -0,0 +1,6 @@
+class AddIndexToStudentWorksScores < ActiveRecord::Migration
+ def change
+ add_index :student_works_scores, :user_id, name: 'user_id'
+ add_index :student_works_scores, :student_work_id, name: 'student_work_id'
+ end
+end
From 9002844188e3dacc0e3b424ea7b0efe54d443703 Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 13 Sep 2016 16:18:57 +0800
Subject: [PATCH 074/104] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=8F=91=E5=B8=83?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_common_controller.rb | 1 +
app/controllers/users_controller.rb | 2 +-
app/helpers/application_helper.rb | 18 +++
app/views/homework_common/edit.html.erb | 14 +++
app/views/users/_user_group_attr.html.erb | 52 ++++----
.../users/_user_homework_attachment.html.erb | 11 --
app/views/users/_user_homework_form.html.erb | 116 +++++++++---------
.../users/_user_programing_attr.html.erb | 83 ++++++++-----
app/views/users/user_select_homework.js.erb | 10 +-
public/javascripts/course.js | 51 ++++++++
public/javascripts/new_user.js | 51 ++++++++
public/stylesheets/css/common.css | 1 +
12 files changed, 275 insertions(+), 135 deletions(-)
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 6704f7401..0fddd7e6c 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -85,6 +85,7 @@ class HomeworkCommonController < ApplicationController
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
@homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id]
+ @homework.homework_type = params[:homework_type].to_i || @homework.homework_type
anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 0
if anonymous != @homework.anonymous_comment
if anonymous == 1
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 559f29235..2a91b75ae 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1052,7 +1052,7 @@ class UsersController < ApplicationController
else
homework.publish_time = params[:homework_common][:publish_time]
end
- homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0
+ homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
homework.homework_type = params[:homework_type].to_i || 1
homework.late_penalty = 10
homework.teacher_priority = 1
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 94b0b2c6e..a370f226c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -3521,3 +3521,21 @@ def get_forge_act_message(act, type)
format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
end
+#作业类型
+def homework_type_option
+ type = []
+ option1 = []
+ option1 << "普通作业"
+ option1 << 1
+ option2 = []
+ option2 << "编程作业"
+ option2 << 2
+ option3 = []
+ option3 << "分组作业"
+ option3 << 3
+ type << option1
+ type << option2
+ type << option3
+ type
+end
+
diff --git a/app/views/homework_common/edit.html.erb b/app/views/homework_common/edit.html.erb
index 1bd71e7a9..4a3de027b 100644
--- a/app/views/homework_common/edit.html.erb
+++ b/app/views/homework_common/edit.html.erb
@@ -41,6 +41,20 @@
+ <% committed_work_count = @homework.student_works.has_committed.count %>
+ <% stu_pro_count = @homework.student_work_projects.count %>
+ <% if committed_work_count != 0 %>
+ <% if @homework.homework_type == 1 %>
+
已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型。
+ <% elsif @homework.homework_type == 2 %>
+
已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和测试集。
+ <% elsif @homework.homework_type == 3 %>
+
已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置。
+ <% end %>
+ <% elsif stu_pro_count != 0 && @homework.homework_type == 3 %>
+
已有<%=stu_pro_count %>个学生关联项目,不允许再修改作业类型。
+ <% end %>
+
<%= form_for @homework do |f| %>
diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb
index 6d09f6896..4596ef411 100644
--- a/app/views/users/_user_group_attr.html.erb
+++ b/app/views/users/_user_group_attr.html.erb
@@ -1,27 +1,27 @@
-
分组设置
-
-
-
每组最小人数:
-
人
-
+
+
分组设置:
+
每组最小人数:
+ />人
+
+
每组最大人数:
+ />人
+
+
+
+
+
+ />
+ 基于项目实施
+
+
提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计
+
+
+
-
- 每组最大人数:
- 人
-
-
-
-
-
-
- 基于项目实施
-
-
提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计
-
-
-
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb
index 6051d8de9..4f35326b0 100644
--- a/app/views/users/_user_homework_attachment.html.erb
+++ b/app/views/users/_user_homework_attachment.html.erb
@@ -71,17 +71,6 @@
上传附件
<%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true %>
- <% if defined?(has_program) && has_program %>
-
- <% end %>
- <% if defined?(has_group) && has_group %>
-
- <% end %>
<% content_for :header_tags do %>
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index b3f9970c6..231c78b91 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -1,3 +1,4 @@
+<% not_allow_select = edit_mode && homework.student_works.has_committed.count != 0 %>
<% content_for :header_tags do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
@@ -5,14 +6,31 @@
-
-
-
-
-
-
-
-
<% unless edit_mode %>
+
\ No newline at end of file
diff --git a/app/views/student_work/_group_member_work.html.erb b/app/views/student_work/_group_member_work.html.erb
new file mode 100644
index 000000000..bfe25c982
--- /dev/null
+++ b/app/views/student_work/_group_member_work.html.erb
@@ -0,0 +1,11 @@
+<% user_ids = student_work.student_work_projects.empty? ? "(-1)" : "(" + student_work.student_work_projects.map{|st| st.user_id}.join(",") + ")" %>
+<% student_work_groups = @homework.student_works.where("user_id in #{user_ids}").order("created_at asc") %>
+<% anon_count = student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
+<% student_work_groups.each_with_index do |st, j| %>
+
+ <%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %>
+
+ <% if j != 0 %>
+
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/student_work/_group_work_show.html.erb b/app/views/student_work/_group_work_show.html.erb
new file mode 100644
index 000000000..00e90b2d0
--- /dev/null
+++ b/app/views/student_work/_group_work_show.html.erb
@@ -0,0 +1,145 @@
+
+
+ <% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
+ <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
+ <% is_my_work = pro && pro.student_work_id == work.id%>
+
+
+ 上交时间:
+ <%=format_time work.created_at %>
+
+
+ <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
+
+
+ <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
+
+
+ <%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
+
+ <% end%>
+ <% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
+
+
+ <%= render :partial => 'student_work_praise',:locals => {:work => work} %>
+
+ <% end%>
+
+
+
+
+ <% if work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
+
+
+ 参与人员:
+ <%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
+ <% members = work.student_work_projects.where("is_leader = 0") %>
+ <% members.each do |member| if !members.empty? %>
+ 、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
+ <% end %>
+ <% end %>
+
+ <% if @homework.homework_detail_group.base_on_project == 1 %>
+
+ 关联项目:
+ <% if work.project_id == 0 || work.project_id.nil? %>
+ 暂无
+ <% elsif work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
+ <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
+ (综合评分:<%=static_project_score(work.project.project_score).to_i %> )
+ <% else %>
+ <%=work.project.name %>
+ (综合评分:<%=static_project_score(work.project.project_score).to_i %> )
+ <% end %>
+ <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
+
+ <% end %>
+
+ 内容:
+
+ <%= work.description.html_safe if work.description%>
+
+
+
+
+ 附件:
+ <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
+ <% if com_attachments.empty?%>
+ 尚未提交附件
+ <% else%>
+
+ <%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
+
+ <% end%>
+
+
+ <% end%>
+
+
+ <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
+
+
+ <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
+
+ <% end%>
+
+
+
+
+
+ <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
+
+
+
+
+ <%student_work_scores.each do |student_score|%>
+
+ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
+
+ <% end%>
+
+
+
+
收起
+
+
+
\ No newline at end of file
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index 9f65376e3..feab67800 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -7,6 +7,8 @@
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
<% is_my_work = pro && pro.student_work_id == work.id%>
<% end %>
+ <% is_member_work = @homework.homework_type == 3 && work.student_work_projects.empty? %>
+ <% if !is_member_work %>
上交时间:
@@ -31,8 +33,7 @@
-
- <% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
+ <% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
参与人员:
@@ -58,42 +59,55 @@
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
<% end %>
- <% end%>
+ <% end%>
-
- 内容:
-
- <%= work.description.html_safe if work.description%>
-
-
-
-
- 附件:
- <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
- <% if com_attachments.empty?%>
+
+ 内容:
+
+ <%= work.description.html_safe if work.description%>
+
+
+
+
+ 附件:
+ <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
+ <% if com_attachments.empty?%>
尚未提交附件
- <% else%>
+ <% else%>
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
- <% end%>
-
-
-
- <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
+ <% end%>
+
+
+
+ <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
- <% end%>
-
-
+ <% end%>
+
+
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
+ <% else %>
+
+ <% end %>
<%student_work_scores.each do |student_score|%>
@@ -101,6 +115,9 @@
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
<% end%>
+ <% if is_member_work && student_work_scores.empty? %>
+
暂无评分
+ <% end %>
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb
index dbde6d24c..73f37602b 100644
--- a/app/views/student_work/_student_work_list.html.erb
+++ b/app/views/student_work/_student_work_list.html.erb
@@ -36,11 +36,19 @@
- <% if @is_evaluation && !@stundet_works.empty?%>
- <%= render :partial => "evaluation_title"%>
- <% else%>
- <%= render :partial => "evaluation_un_title"%>
- <% end%>
+ <% if @homework.homework_type != 3%>
+ <% if @is_evaluation && !@stundet_works.empty? %>
+ <%= render :partial => "evaluation_title"%>
+ <% else%>
+ <%= render :partial => "evaluation_un_title"%>
+ <% end%>
+ <% else %>
+ <% if !@is_teacher && @is_evaluation && !@stundet_works.empty? %>
+ <%= render :partial => "evaluation_title"%>
+ <% else %>
+ <%= render :partial => "evaluation_un_group"%>
+ <% end%>
+ <% end %>
diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb
index c961fb077..6acf9eb45 100644
--- a/app/views/student_work/add_score.js.erb
+++ b/app/views/student_work/add_score.js.erb
@@ -11,8 +11,18 @@ var num = $("#work_num_<%= @work.id%>").html();
$("#score_list_<%= @work.id%>").removeAttr("style");
<% if @is_teacher %>
- $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
- $("#work_num_<%= @work.id%>").html(num);
+ <% if @homework.homework_type == 3 %>
+ <% if @is_group_leader %>
+ $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_work', :locals => {:student_work => @work}) %>");
+ $("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>");
+ <% else %>
+ <% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
+ $("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count}) %>");
+ <% end %>
+ <% else %>
+ $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
+ $("#work_num_<%= @work.id%>").html(num);
+ <% end %>
<% else %>
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
$("#work_num_<%= @work.id%>").html(num);
diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css
index 77f7fdfe2..952273eab 100644
--- a/public/stylesheets/css/courses.css
+++ b/public/stylesheets/css/courses.css
@@ -234,6 +234,7 @@ a.hworkExport {background:url(/images/homepage_icon2.png) -10px -401px no-repeat
a.hworkSetting {background:url(/images/homepage_icon2.png) -10px -450px no-repeat; padding-left:23px;}
.hworkInfor {font-size:12px; color:#269ac9; width:80px; height:40px; vertical-align:middle; float:left; line-height:40px; text-align:center; font-weight:bold;}
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px; z-index:99;}
+.g_infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:10px;margin-left: 80px; z-index:99;}
.problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;}
.rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;}
.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;}
diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css
index d4ba7b86c..1c0ffc2ef 100644
--- a/public/stylesheets/css/public.css
+++ b/public/stylesheets/css/public.css
@@ -1459,3 +1459,7 @@ a:hover.sy_btn_green{ background: #51a74f;}
.invite_code_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
.invite_code_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
+/*flex布局*/
+.flex-container {display:flex;}
+.flex-cell {flex:1;}
+.flex-cell:last-child {text-align:right;}
From 7210eefe1d8715be040ad822ee0636fccd560887 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 14 Sep 2016 18:51:32 +0800
Subject: [PATCH 093/104] =?UTF-8?q?1156=E9=A1=B9=E7=9B=AE=E8=AE=A8?=
=?UTF-8?q?=E8=AE=BA=E5=8C=BA=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/users/_project_boardlist.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb
index 3ba0244d9..e0e2fddf8 100644
--- a/app/views/users/_project_boardlist.html.erb
+++ b/app/views/users/_project_boardlist.html.erb
@@ -43,7 +43,7 @@
- 发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
+ 发帖人:<%=(u.try(:realname) != " " ? u.try(:lastname) + u.try(:firstname) : u.try(:login)) unless u.nil? %>
更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %>
<% all_comments = []%>
From a0f4cc1c0c1d385eedcfd43d8ff83e237b317bb7 Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 14 Sep 2016 19:27:12 +0800
Subject: [PATCH 094/104] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=BC=96=E7=A8=8B?=
=?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E7=9A=84=E6=8F=90=E4=BA=A4=E9=AA=8C?=
=?UTF-8?q?=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/javascripts/course.js | 7 ++++---
public/javascripts/new_user.js | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 703624a9c..b9d02d18e 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -857,13 +857,14 @@ function regex_group_attr(){
//验证编程作业的参数
function regex_program_attr() {
+ var result = true;
$.each($('#programHomework textarea.InputBox'), function(i, val){
- if ($(val).val().length<=0) {
+ if (result && $(val).val().length<=0) {
$(val)[0].focus();
- return false;
+ result = false;
}
});
- return true;
+ return result;
}
function regexHomeworkCommonName()
diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js
index 7a7abc737..314850332 100644
--- a/public/javascripts/new_user.js
+++ b/public/javascripts/new_user.js
@@ -236,13 +236,14 @@ function regex_group_attr(){
//验证编程作业的参数
function regex_program_attr() {
+ var result = true;
$.each($('#programHomework textarea.InputBox'), function(i, val){
- if ($(val).val().length<=0) {
+ if (result && $(val).val().length<=0) {
$(val)[0].focus();
- return false;
+ result = false;
}
});
- return true;
+ return result;
}
//老师导入作业时查询作业
From 020018fd3183ff56c58fddb83814f80ddd9ec08a Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 14 Sep 2016 19:31:14 +0800
Subject: [PATCH 095/104] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E7=9A=84=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/homework_common/index.html.erb | 4 ++--
.../student_work/_evaluation_un_group_member_work.html.erb | 4 ++--
app/views/student_work/_show.html.erb | 2 +-
public/stylesheets/css/courses.css | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb
index 167ae98f0..3a171f642 100644
--- a/app/views/homework_common/index.html.erb
+++ b/app/views/homework_common/index.html.erb
@@ -3,13 +3,13 @@
$("#homework_name").val("");
$("#homework_publish_time").val("");
$("#homework_end_time").val("");
- document.getElementById("anonymous_comment").checked = true;
$("#course_id").val($("#option_select").val());
+ $("#homeworkSetting").addClass("undis");
+ $("#homeworkSetting").html("");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>");
//homework_description_editor.html("");
$("#homework_name_span").text("");
$("#homework_end_time_span").text("");
- $("#homework_end_time_span").text("");
$("#homework_course_id_span").text("");
$("#homework_editor").toggle();
}
diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb
index 63e515f89..13b5b003d 100644
--- a/app/views/student_work/_evaluation_un_group_member_work.html.erb
+++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb
@@ -23,7 +23,7 @@
<%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%>
<% if @homework.anonymous_comment == 0 %>
-
+
<% if st.student_score.nil? %>
未参与
<% else %>
@@ -45,7 +45,7 @@
<% end %>
<% score = st.work_score %>
-
+
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb
index feab67800..a45eca30b 100644
--- a/app/views/student_work/_show.html.erb
+++ b/app/views/student_work/_show.html.erb
@@ -115,7 +115,7 @@
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
<% end%>
- <% if is_member_work && student_work_scores.empty? %>
+ <% if is_member_work && student_work_scores.empty? && !@is_teacher %>
暂无评分
<% end %>
diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css
index 952273eab..7ce5405e7 100644
--- a/public/stylesheets/css/courses.css
+++ b/public/stylesheets/css/courses.css
@@ -234,7 +234,7 @@ a.hworkExport {background:url(/images/homepage_icon2.png) -10px -401px no-repeat
a.hworkSetting {background:url(/images/homepage_icon2.png) -10px -450px no-repeat; padding-left:23px;}
.hworkInfor {font-size:12px; color:#269ac9; width:80px; height:40px; vertical-align:middle; float:left; line-height:40px; text-align:center; font-weight:bold;}
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px; z-index:99;}
-.g_infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:10px;margin-left: 80px; z-index:99;}
+.g_infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; left:0; z-index:99;}
.problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;}
.rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;}
.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;}
From e8cca255a0eb229bfcab0bcb0985960a0f3789c2 Mon Sep 17 00:00:00 2001
From: Tim
Date: Wed, 14 Sep 2016 19:44:46 +0800
Subject: [PATCH 096/104] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B1=95=E5=BC=80=E6=95=88=E6=9E=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../student_work/_evaluation_un_group.html.erb | 17 +++++++++++++++--
.../_evaluation_un_group_member_work.html.erb | 6 +++---
.../_evaluation_un_group_work.html.erb | 2 +-
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/app/views/student_work/_evaluation_un_group.html.erb b/app/views/student_work/_evaluation_un_group.html.erb
index d48d1a492..91907aadf 100644
--- a/app/views/student_work/_evaluation_un_group.html.erb
+++ b/app/views/student_work/_evaluation_un_group.html.erb
@@ -5,9 +5,22 @@
-
+
<%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %>
<% end %>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb
index 63e515f89..1debbad0e 100644
--- a/app/views/student_work/_evaluation_un_group_member_work.html.erb
+++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb
@@ -1,7 +1,7 @@
-
+
- <%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40"),user_activities_path(st.user), :class => "fl") %>
+ <%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
<% if !st.student_work_projects.empty? %>
<%= st.user.show_name %>
@@ -67,8 +67,8 @@
+
<%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击查看详情' %>
-
<%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击查看详情' %>
+<% end %>
\ No newline at end of file
From 7b9ba6a1f7f6da26329cdf5932233df23c8486bf Mon Sep 17 00:00:00 2001
From: Tim
Date: Wed, 14 Sep 2016 20:46:23 +0800
Subject: [PATCH 101/104] =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8F=8D=E9=A6=88?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_new_feedback.html.erb | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb
index 2bdb554ce..db90c47c4 100644
--- a/app/views/layouts/_new_feedback.html.erb
+++ b/app/views/layouts/_new_feedback.html.erb
@@ -41,9 +41,11 @@
-
-
提 问
-
+
+
+
提 问
+
+
From abdc08c7afb9ff49efc231701b1a5bf6ce974b47 Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 14 Sep 2016 20:58:15 +0800
Subject: [PATCH 102/104] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E6=97=B6=E5=B7=A6=E4=BE=A7=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=AF=B9?=
=?UTF-8?q?=E5=BA=94=E7=8F=AD=E7=BA=A7=E7=9A=84=E5=AF=BC=E8=88=AA=E6=A0=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_common_controller.rb | 8 ++++++++
app/controllers/student_work_controller.rb | 4 ++--
app/views/student_work/edit.html.erb | 2 ++
app/views/student_work/new.html.erb | 6 ++++--
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 5e290d678..b8c6a4a0a 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -85,6 +85,14 @@ class HomeworkCommonController < ApplicationController
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
@homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id]
+ if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type
+ if @homework.homework_type == 2
+ @homework.homework_detail_programing.destroy if @homework.homework_detail_programing
+ @homework.homework_tests.destroy_all
+ elsif @homework.homework_type == 3
+ @homework.homework_detail_group.destroy if @homework.homework_detail_group
+ end
+ end
@homework.homework_type = params[:homework_type].to_i || @homework.homework_type
anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
if anonymous != @homework.anonymous_comment
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index a6dec8161..e8c061b5c 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -571,7 +571,7 @@ class StudentWorkController < ApplicationController
@student_work = StudentWork.new
#end
respond_to do |format|
- format.html{ render :layout => "new_base_user"}
+ format.html{ render :layout => "base_courses"}
end
end
@@ -657,7 +657,7 @@ class StudentWorkController < ApplicationController
render_403
else
respond_to do |format|
- format.html{ render :layout => "new_base_user"}
+ format.html{ render :layout => "base_courses"}
end
end
end
diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb
index 931cdc1de..657bdf486 100644
--- a/app/views/student_work/edit.html.erb
+++ b/app/views/student_work/edit.html.erb
@@ -2,6 +2,7 @@
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %>
+
+
-
\ No newline at end of file
+
+
From 0d12acd42a16f84576835b338abcd84c647d617b Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 14 Sep 2016 21:11:20 +0800
Subject: [PATCH 103/104] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../_evaluation_un_group.html.erb | 2 +-
.../_evaluation_un_group_work.html.erb | 2 +-
.../student_work/_group_work_show.html.erb | 145 ------------------
3 files changed, 2 insertions(+), 147 deletions(-)
delete mode 100644 app/views/student_work/_group_work_show.html.erb
diff --git a/app/views/student_work/_evaluation_un_group.html.erb b/app/views/student_work/_evaluation_un_group.html.erb
index 91907aadf..75614a909 100644
--- a/app/views/student_work/_evaluation_un_group.html.erb
+++ b/app/views/student_work/_evaluation_un_group.html.erb
@@ -1,6 +1,6 @@
<% @stundet_works.each_with_index do |student_work, i| %>
-
+
<%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %>
diff --git a/app/views/student_work/_evaluation_un_group_work.html.erb b/app/views/student_work/_evaluation_un_group_work.html.erb
index 3c3a02281..5ce2545e7 100644
--- a/app/views/student_work/_evaluation_un_group_work.html.erb
+++ b/app/views/student_work/_evaluation_un_group_work.html.erb
@@ -1,5 +1,5 @@
-
+
<%=student_work.name %>
diff --git a/app/views/student_work/_group_work_show.html.erb b/app/views/student_work/_group_work_show.html.erb
deleted file mode 100644
index 00e90b2d0..000000000
--- a/app/views/student_work/_group_work_show.html.erb
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
- <% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
- <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
- <% is_my_work = pro && pro.student_work_id == work.id%>
-
-
- 上交时间:
- <%=format_time work.created_at %>
-
-
- <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
-
-
- <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
-
-
- <%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
-
- <% end%>
- <% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
-
-
- <%= render :partial => 'student_work_praise',:locals => {:work => work} %>
-
- <% end%>
-
-
-
-
- <% if work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
-
-
- 参与人员:
- <%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
- <% members = work.student_work_projects.where("is_leader = 0") %>
- <% members.each do |member| if !members.empty? %>
- 、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
- <% end %>
- <% end %>
-
- <% if @homework.homework_detail_group.base_on_project == 1 %>
-
- 关联项目:
- <% if work.project_id == 0 || work.project_id.nil? %>
- 暂无
- <% elsif work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
- <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
- (综合评分:<%=static_project_score(work.project.project_score).to_i %> )
- <% else %>
- <%=work.project.name %>
- (综合评分:<%=static_project_score(work.project.project_score).to_i %> )
- <% end %>
- <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
-
- <% end %>
-
- 内容:
-
- <%= work.description.html_safe if work.description%>
-
-
-
-
- 附件:
- <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
- <% if com_attachments.empty?%>
- 尚未提交附件
- <% else%>
-
- <%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
-
- <% end%>
-
-
- <% end%>
-
-
- <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
-
-
- <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
-
- <% end%>
-
-
-
-
-
- <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
-
-
-
-
- <%student_work_scores.each do |student_score|%>
-
- <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
-
- <% end%>
-
-
-
-
收起
-
-
-
\ No newline at end of file
From cfc5a2457c1895d232c699591ef5c97695a141c1 Mon Sep 17 00:00:00 2001
From: huang
Date: Sat, 17 Sep 2016 11:26:29 +0800
Subject: [PATCH 104/104] =?UTF-8?q?=E8=AF=BE=E7=A8=8B500=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/courses_helper.rb | 37 ++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 39c61a318..f119e0e69 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -14,21 +14,30 @@ module CoursesHelper
# 推荐的精品课程
- def excellent_course_recommend current_course
- q = "%#{current_course.name.strip}%"
- recomment_courses = []
- # 推荐过程过滤掉自身
- sql = "SELECT distinct c.* FROM course_activities cs, courses c where cs.course_id = c.id
- and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;"
- ex_courses = Course.find_by_sql(sql)
- # 使用课程的tag去和课程名称进行匹配
- c_courses = ex_courses.select{|ex_course| ex_course.tags.any?{|tag| q.include?(tag.to_s)}}
- if c_courses.count < 3
- results = c_courses.length == 0 ? ex_courses.first(3) : (c_courses + ex_courses.first(3 - ex_courses.count))
- else
- results = c_courses.first(3)
+ def excellent_course_recommend new_course
+ q = "%#{new_course.name.strip}%"
+ result = find_excelletn_course(q, new_course)
+ end
+
+ # 查询符合条件的精品课程
+ # 用新课程名去匹配精品课程中按课程名和Tag名
+ def find_excelletn_course keywords, current_course
+ # 获取tag匹配结果ID
+ a_tags = []
+ Course.where("is_excellent =? and is_public =?", 1, 1).each do |ec|
+ if ec.tags.any?{|value| current_course.name.include?(value.to_s)}
+ a_tags << ec.id
+ end
end
- results
+ # 课程本身不能搜索显示自己
+ excellent_ids = a_tags.uniq.delete_if{|i| i == current_course.id}
+ sql = "SELECT distinct c.id FROM course_activities cs, courses c where cs.course_id = c.id
+ and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;"
+ default_ids = Course.find_by_sql(sql).flatten.map { |c| c.id }
+ excellent_ids << default_ids.flatten
+ arr_result = excellent_ids.flatten.uniq.first(3)
+ excellent_courses = Course.find(arr_result)
+ return excellent_courses
end
# 判断精品课程是否可见,非课程成员无法查看私有课程