+ <%= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>
请求将
<%= @request.source_branch %> 合并至
<%= @request.target_branch %>
-
<% if @commits_count == 0 && @changes_count == 0 %>
<%= @request.source_branch %>没有新内容可以合并至<%= @request.target_branch %>
@@ -21,29 +24,42 @@
<% else %>
<% if @request.state == "merged" %>
-
<%#= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>于<%= time_tag(@request.created_at) %> 前合并
-
改动已合并至<%= @request.target_branch %>
+ <% if accept_user(@request.id).blank? %>
+
改动已合并至<%= @request.target_branch %>
+ <% else %>
+
<%= link_to User.find(accept_user(@request.id).user_id), user_path(accept_user(@request.id).user_id), :class => "link-blue" %> 于 <%= time_tag(accept_user(@request.id).created_at) %> 前合并
+ <% end %>
<% else %>
<% if is_project_manager?(User.current.id, @project.id) %>
- <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
+ <% if @request.state == "closed" %>
+ 该请求已被关闭
+ <% else %>
+ <%= link_to "接受请求", accept_pull_request_project_pull_request_path(@request.id, :project_id => @project.id), :class => "BlueCirBtn", :remote => true %>
+ <% end %>
<% end %>
<% end %>
-
+
- <%= link_to "提交#{@commits_count} ".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => 1), :remote => true, :class => "active" %>
- <%= link_to "改动#{@changes_count} ".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => 2), :remote => true %>
+ <%= link_to "留言#{@comments_count} ".html_safe, pull_request_comments_project_pull_request_path(@request.id, :project_id => @project.id, :type => "1"), :remote => true, :class => "active" %>
+ <%= link_to "提交#{@commits_count} ".html_safe, pull_request_commits_project_pull_request_path(@request.id, :project_id => @project.id, :type => "2"), :remote => true %>
+ <%= link_to "改动#{@changes_count} ".html_safe, pull_request_changes_project_pull_request_path(@request.id, :project_id => @project.id, :type => "3"), :remote => true %>
-
根据最近提交时间排列
-
+ <% if @type == nil || @type == "1" %>
+
+ <%= render :partial => "pull_requests/pull_request_comments" %>
+
+ <% end %>
+
<%= render :partial => "pull_requests/pull_request_commits" %>
-
+
<%= render :partial => "pull_requests/pull_request_changes" %>
+
<% end %>
@@ -51,19 +67,13 @@
\ No newline at end of file
diff --git a/app/views/pull_requests/index.html.erb b/app/views/pull_requests/index.html.erb
index f9f7fe4db..78c4759aa 100644
--- a/app/views/pull_requests/index.html.erb
+++ b/app/views/pull_requests/index.html.erb
@@ -2,6 +2,7 @@
<%= link_to "待处理#{@requests_opened_count} ".html_safe, project_pull_requests_path(:type => "1"), :remote => true %>
<%= link_to "已处理#{@requests_merged_count} ".html_safe, project_pull_requests_path(:type => "2"), :remote => true %>
+ <%= link_to "已关闭#{@requests_closed_count} ".html_safe, project_pull_requests_path(:type => "3"), :remote => true %>
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
@@ -12,6 +13,7 @@
<%= render "pull_requests/pull_requests_list" %>
+
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
index 990a193cc..3f73f3b9d 100644
--- a/app/views/users/_user_homework_detail.html.erb
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -146,9 +146,9 @@
<% if homework_common.student_works.has_committed.count != 0 %>
- <% sw = homework_common.student_works.has_committed.reorder("created_at desc").first %>
+ <% sw = homework_common.student_works.has_committed.reorder("commit_time desc").first %>
- # <%=time_from_now sw.created_at %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
+ # <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
<% end %>
@@ -302,7 +302,7 @@
<% count=homework_common.journals_for_messages.count %>
- <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => -1, :is_in_course => is_in_course,:course_activity=>-1} %>
+ <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => homework_common.id, :is_in_course => is_in_course,:course_activity=>-1} %>
<% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index 3f6836614..99b9812cc 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -10,6 +10,9 @@
} else {
$("#anonymous_comment").attr('checked',false);
}
+ if($.trim($("#base_on_project").val()) == 1) {
+ $("#base_on_project").attr('checked','checked');
+ }
<% if edit_mode && homework.is_program_homework? %>
$("#BluePopupBox a.BlueCirBtn").click();
<% end %>
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 98ed3d1dc..40f25d429 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -601,7 +601,7 @@
申请班级:<%= Course.find(ma.course_id).name%>
班级描述:
-
<%= Course.find(ma.course_id).description.html_safe %>
+
<%= Course.find(ma.course_id).description.nil? ? "" : Course.find(ma.course_id).description.html_safe %>
申请职位:<%= ma.content == '9' ? "教师" : "教辅"%>
<%= time_tag(ma.created_at).html_safe %>
diff --git a/app/views/users/_user_project_list.html.erb b/app/views/users/_user_project_list.html.erb
index 6124b82d8..77db8bc3e 100644
--- a/app/views/users/_user_project_list.html.erb
+++ b/app/views/users/_user_project_list.html.erb
@@ -1,3 +1,86 @@
+
+
项目列表
+
+
+ <% @projects.each do |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%>
+ <% 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) %>
+
+
+
+
更新时间:<%= format_date(project.updated_on) %>
+
+
+ <%= link_to project.members.count, member_project_path(project), :class => "c_blue" %>成员 |
+ <%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %>问题 |
+ <%= link_to project.project_score.attach_num, file_project_path(project), :class => "c_blue" %>资源
+
+
+
+
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+ <% @projects.each do |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%>
+ <% 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) %>
+
+
+
+
更新时间:<%= format_date(project.updated_on) %>
+
+
+ <%= link_to project.members.count, member_project_path(project), :class => "c_blue" %>成员 |
+ <%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %>问题 |
+ <%= link_to project.project_score.attach_num, file_project_path(project), :class => "c_blue" %>资源
+
+
+
+
+
+ <% end %>
+
+
+
+
+
+
项目列表
diff --git a/app/views/users/show_homework_detail.js.erb b/app/views/users/show_homework_detail.js.erb
index cbb0cf057..b3dff264a 100644
--- a/app/views/users/show_homework_detail.js.erb
+++ b/app/views/users/show_homework_detail.js.erb
@@ -3,5 +3,5 @@
$("#choose_courses_notice").html("");
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'users/homework_repository_detail') %>";
- pop_box_new(htmlvalue,820,155);
+ pop_box_new(htmlvalue,820,800);
<% end %>
\ No newline at end of file
diff --git a/app/views/users/sort_project_list.js.erb b/app/views/users/sort_project_list.js.erb
new file mode 100644
index 000000000..bacb3849e
--- /dev/null
+++ b/app/views/users/sort_project_list.js.erb
@@ -0,0 +1,5 @@
+<% if @list_type.to_i == 1 %>
+$("#user_projects_list").html('<%= escape_javascript(render :partial => 'users/project_list', :locals => {:projects => @projects, :list_type => 1, :count => @projects_count}) %>');
+<% else %>
+$("#user_join_projects_list").html('<%= escape_javascript(render :partial => 'users/project_list', :locals => {:projects => @projects, :list_type => 2, :count => @projects_count}) %>');
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb
index fb7abdd01..47bdc9126 100644
--- a/app/views/users/user_fanslist.html.erb
+++ b/app/views/users/user_fanslist.html.erb
@@ -27,9 +27,19 @@
<%# end %>
<%= l(:label_no_data) %>
+
+
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%>
+
+
+
+
+
+
+
+
+
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
-
diff --git a/app/views/users/user_projectlist.html.erb b/app/views/users/user_projectlist.html.erb
index fb1b5b501..0605cb2f3 100644
--- a/app/views/users/user_projectlist.html.erb
+++ b/app/views/users/user_projectlist.html.erb
@@ -1 +1,39 @@
-<%= render :partial => 'users/user_project_list'%>
+
+
项目列表
+ <%= render :partial => 'users/my_projects'%>
+
+ <%= render :partial => 'users/my_joined_projects'%>
+
+
+
+
diff --git a/app/views/users/user_projects4show.js.erb b/app/views/users/user_projects4show.js.erb
index c19a79c81..f8b1a57df 100644
--- a/app/views/users/user_projects4show.js.erb
+++ b/app/views/users/user_projects4show.js.erb
@@ -1 +1 @@
-$("#user_show_more_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_projects',:locals => {:projects => @projects,:user => @user, :page => @page} )%>");
+$("#user_show_more_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_projects',:locals => {:projects => @projects,:user => @user, :page => @page, :all_count => @all_count} )%>");
diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb
index 8c31c2106..7175f0a1e 100644
--- a/app/views/wechats/user_activities.html.erb
+++ b/app/views/wechats/user_activities.html.erb
@@ -17,7 +17,8 @@
window.g_debug = false; //调试标志,如果在本地请置为true
window.apiUrl = '/api/v1/';
window.g_redirect_path = '<%= @path %>';
- window.g_localhost = "<%= Setting.protocol%>://"+"<%= Setting.host_name%>";
+ window.g_localhost = "<%= Setting.protocol %>"+ "://"+"<%= Setting.host_name%>";
+ window.g_appid = "<%= @appid %>";
<% if @course_id %>
window.g_courseid = <%= @course_id %>;
<% elsif @project_id %>
diff --git a/config/initializers/configuration.yml b/config/initializers/configuration.yml
new file mode 100644
index 000000000..38cb9b927
--- /dev/null
+++ b/config/initializers/configuration.yml
@@ -0,0 +1,241 @@
+# = Redmine configuration file
+#
+# Each environment has it's own configuration options. If you are only
+# running in production, only the production block needs to be configured.
+# Environment specific configuration options override the default ones.
+#
+# Note that this file needs to be a valid YAML file.
+# DO NOT USE TABS! Use 2 spaces instead of tabs for identation.
+#
+# == Outgoing email settings (email_delivery setting)
+#
+# === Common configurations
+#
+# ==== Sendmail command
+#
+# production:
+# email_delivery:
+# delivery_method: :sendmail
+#
+# ==== Simple SMTP server at localhost
+#
+# production:
+# email_delivery:
+# delivery_method: :smtp
+# smtp_settings:
+# address: smtp.163.com
+# port: 25
+#
+# ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
+#
+# production:
+# email_delivery:
+# delivery_method: :smtp
+# smtp_settings:
+# address: smtp.gmail.com
+# port: 587
+# authentication: :login
+# domain: 'foo.com'
+# user_name: senluowanxiangt@gmail.com
+# password: 1913TXBja
+#
+# ==== SMTP server at example.com using PLAIN authentication
+#
+# production:
+# email_delivery:
+# delivery_method: :smtp
+# smtp_settings:
+# address: smtp.gmail.com
+# port: 587
+# authentication: :plain
+# domain: 'example.com'
+# user_name: senluowanxiangt@gmail.com
+# password: 1913TXBja
+#
+# ==== SMTP server at using TLS (GMail)
+#
+# This might require some additional configuration. See the guides at:
+# http://www.redmine.org/projects/redmine/wiki/EmailConfiguration
+#
+# production:
+# email_delivery:
+# delivery_method: :smtp
+# smtp_settings:
+# enable_starttls_auto: true
+# address: smtp.gmail.com
+# port: 587
+# domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps
+# authentication: :plain
+# user_name: senluowanxiangt@gmail.com
+# password: 1913TXBja
+#
+#
+# === More configuration options
+#
+# See the "Configuration options" at the following website for a list of the
+# full options allowed:
+#
+# http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer
+
+
+
+default:
+ email_delivery:
+ delivery_method: :smtp
+ smtp_settings:
+ address: mail.trustie.net
+ port: 25
+ domain: mail.trustie.net
+ authentication: :login
+ user_name: "mail@trustie.net"
+ password: "loong2010"
+
+ # Absolute path to the directory where attachments are stored.
+ # The default is the 'files' directory in your Redmine instance.
+ # Your Redmine instance needs to have write permission on this
+ # directory.
+ # Examples:
+ # attachments_storage_path: /var/redmine/files
+ # attachments_storage_path: D:/redmine/files
+ attachments_storage_path:
+
+ # Configuration of the autologin cookie.
+ # autologin_cookie_name: the name of the cookie (default: autologin)
+ # autologin_cookie_path: the cookie path (default: /)
+ # autologin_cookie_secure: true sets the cookie secure flag (default: false)
+ autologin_cookie_name: "autologin_trustie"
+ autologin_cookie_path:
+ autologin_cookie_secure:
+
+ # Configuration of SCM executable command.
+ #
+ # Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
+ # On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
+ #
+ # On Windows + JRuby 1.6.2, path which contains spaces does not work.
+ # For example, "C:\Program Files\TortoiseHg\hg.exe".
+ # If you want to this feature, you need to install to the path which does not contains spaces.
+ # For example, "C:\TortoiseHg\hg.exe".
+ #
+ # Examples:
+ # scm_subversion_command: svn # (default: svn)
+ # scm_mercurial_command: C:\Program Files\TortoiseHg\hg.exe # (default: hg)
+ # scm_git_command: /usr/local/bin/git # (default: git)
+ # scm_cvs_command: cvs # (default: cvs)
+ # scm_bazaar_command: bzr.exe # (default: bzr)
+ # scm_darcs_command: darcs-1.0.9-i386-linux # (default: darcs)
+ #
+ scm_subversion_command:
+ scm_mercurial_command:
+ scm_git_command:
+ scm_cvs_command:
+ scm_bazaar_command:
+ scm_darcs_command:
+
+ # Absolute path to the SCM commands errors (stderr) log file.
+ # The default is to log in the 'log' directory of your Redmine instance.
+ # Example:
+ # scm_stderr_log_file: /var/log/redmine_scm_stderr.log
+ scm_stderr_log_file:
+
+ # Key used to encrypt sensitive data in the database (SCM and LDAP passwords).
+ # If you don't want to enable data encryption, just leave it blank.
+ # WARNING: losing/changing this key will make encrypted data unreadable.
+ #
+ # If you want to encrypt existing passwords in your database:
+ # * set the cipher key here in your configuration file
+ # * encrypt data using 'rake db:encrypt RAILS_ENV=production'
+ #
+ # If you have encrypted data and want to change this key, you have to:
+ # * decrypt data using 'rake db:decrypt RAILS_ENV=production' first
+ # * change the cipher key here in your configuration file
+ # * encrypt data using 'rake db:encrypt RAILS_ENV=production'
+ database_cipher_key:
+
+ # Set this to false to disable plugins' assets mirroring on startup.
+ # You can use `rake redmine:plugins:assets` to manually mirror assets
+ # to public/plugin_assets when you install/upgrade a Redmine plugin.
+ #
+ #mirror_plugins_assets_on_startup: false
+
+ # Your secret key for verifying cookie session data integrity. If you
+ # change this key, all old sessions will become invalid! Make sure the
+ # secret is at least 30 characters and all random, no regular words or
+ # you'll be exposed to dictionary attacks.
+ #
+ # If you have a load-balancing Redmine cluster, you have to use the
+ # same secret token on each machine.
+ #secret_token: 'change it to a long random string'
+
+ # Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to
+ # the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
+ imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert'
+
+ # Configuration of RMagcik font.
+ #
+ # Redmine uses RMagcik in order to export gantt png.
+ # You don't need this setting if you don't install RMagcik.
+ #
+ # In CJK (Chinese, Japanese and Korean),
+ # in order to show CJK characters correctly,
+ # you need to set this configuration.
+ #
+ # Because there is no standard font across platforms in CJK,
+ # you need to set a font installed in your server.
+ #
+ # This setting is not necessary in non CJK.
+ #
+ # Examples for Japanese:
+ # Windows:
+ # rmagick_font_path: C:\windows\fonts\msgothic.ttc
+ # Linux:
+ # rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
+ #
+ rmagick_font_path:
+
+ # Maximum number of simultaneous AJAX uploads
+ #max_concurrent_ajax_uploads: 2
+ #pic_types: "bmp,jpeg,jpg,png,gif"
+
+ repository_root_path: '/tmp/htdocs'
+ judge_server: 'http://judge.trustie.net/'
+
+ # Gitlab url
+ gitlab_address: 'https://git.trustie.net'
+ # Sonar url
+ sonar_address: 'http://sonar.trustie.net'
+ #Jenkins url
+ jenkins_address: 'http://jenins.trustie.net'
+ jenkins_username: 'temp'
+ jenkins_password: '123123'
+
+# specific configuration options for production environment
+# that overrides the default ones
+production:
+ # CJK support
+ rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
+ judge_server: 'http://192.168.80.21:8080/'
+ repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs'
+ cookie_domain: ".trustie.net"
+ email_delivery:
+ delivery_method: :smtp
+ smtp_settings:
+ address: mail.trustie.net
+ port: 25
+ domain: mail.trustie.net
+ authentication: :login
+ user_name: "mail@trustie.net"
+ password: "loong2010"
+
+# specific configuration options for development environment
+# that overrides the default ones
+development:
+ email_delivery:
+ delivery_method: :smtp
+ smtp_settings:
+ address: mail.trustie.net
+ port: 25
+ domain: mail.trustie.net
+ authentication: :login
+ user_name: "mail@trustie.net"
+ password: "loong2010"
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index 91cc96791..792ff35fd 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -456,4 +456,9 @@ zh:
# 版本库迁移
label_repository_migrate_dec: 注意:Trustie版本库近期进行了一次大的改造,历史版本需要转换成新的版本,输入新的版本库名,即可完成转换。 转换过程可能需要等待一段时间。
- label_repository_name_dec: 版本库名仅小写字母(a-z)、数字、破折号(-)和下划线(_)可以使用,长度必须在 1 到 254 个字符之间,一旦保存,标识无法修改。
\ No newline at end of file
+ label_repository_name_dec: 版本库名仅小写字母(a-z)、数字、破折号(-)和下划线(_)可以使用,长度必须在 1 到 254 个字符之间,一旦保存,标识无法修改。
+
+ # pull requests
+ label_state_open: 待处理
+ label_state_closed: 关闭
+ label_state_merged: 已合并
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 1340e7aa6..59aca719b 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2156,6 +2156,6 @@ zh:
label_blog_comment_template: 您的博客有新回复了。
label_new_blog_template: 有新博客了。
label_new_issue_template: 有新的问题动态了。
- label_new_notice_template: 您的课程有新通知了。
+ label_new_notice_template: 您的班级有新通知了。
#edit yk
label_code_work_tests: 代码测试列表
diff --git a/config/routes.rb b/config/routes.rb
index 5527212fd..6cbc0812d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -626,6 +626,7 @@ RedmineApp::Application.routes.draw do
match 'user_projectlist', :to => 'users#user_projectlist', :via => :get, :as => "user_projectlist"
match 'sort_syllabus_list', :to => 'users#sort_syllabus_list', :via => :get, :as => "sort_syllabus_list"
+ match 'sort_project_list', :to => 'users#sort_project_list', :via => :get, :as => "sort_project_list"
get 'edit_brief_introduction'
get "user_resource"
@@ -816,6 +817,9 @@ RedmineApp::Application.routes.draw do
get 'accept_pull_request'
get 'pull_request_commits'
get 'pull_request_changes'
+ get 'update_pull_request'
+ get 'pull_request_comments'
+ post 'create_pull_request_comment'
end
end
@@ -1339,6 +1343,7 @@ RedmineApp::Application.routes.draw do
get :user_activities
post :bind
post :get_bind
+ post :is_bind
end
end
diff --git a/config/wechat.yml.template b/config/wechat.yml.template
index 68e6ed62e..e6b942f09 100644
--- a/config/wechat.yml.template
+++ b/config/wechat.yml.template
@@ -23,6 +23,11 @@ default: &default
create_class_notice: "2GtJJGzzNlNy2i0UrsjEDlvfSVIUXQfSo47stpcQAVw"
create_project_notice: "jYu0iimbDpgWYZaTLXioZe2lvqoWTdKnUPyphTJ1mxs"
project_review_notice: "kdb-8UlMjTc3z51Qcf8g2vY4i_nE4OGKZAucdQma_2E"
+ join_project_notice: "TtXvy0XMIQyCgpnXHhoB8t-x0QIfy-78gAJXsGf9afg"
+
+ auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities"
+ auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
+ auto_openid_url_3: "&connect_redirect=1#wechat_redirect"
production:
<<: *default
diff --git a/config/wechat.yml.test b/config/wechat.yml.test
index 8dbd9850f..c0676cc26 100644
--- a/config/wechat.yml.test
+++ b/config/wechat.yml.test
@@ -23,6 +23,11 @@ default: &default
create_class_notice: "9CDIvHIKiGwPEQWRw_-wieec1o50tMXQPPZIfECKu0I"
create_project_notice: "R2ZaQKJfDJgujPcHWPzadKHIRkIyj2CjX2o_qIuRqig"
project_review_notice: "ip192wVXTav3qchgUn9_7B6lFfTlCZjwL7A1tncTOuc"
+ join_project_notice: "3KnMQEMUCmQWkB5JvzrpmguEwnN8bvUHUdpOTudxv_M"
+
+ auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities"
+ auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
+ auto_openid_url_3: "&connect_redirect=1#wechat_redirect"
production:
<<: *default
diff --git a/db/migrate/20160810080942_add_commit_time_to_student_work.rb b/db/migrate/20160810080942_add_commit_time_to_student_work.rb
new file mode 100644
index 000000000..2301d7db8
--- /dev/null
+++ b/db/migrate/20160810080942_add_commit_time_to_student_work.rb
@@ -0,0 +1,16 @@
+class AddCommitTimeToStudentWork < ActiveRecord::Migration
+ def change
+ add_column :student_works, :commit_time, :datetime
+
+ count = StudentWork.all.count / 30 + 2
+ transaction do
+ for i in 1 ... count do i
+ StudentWork.page(i).per(30).each do |work|
+ if work.work_status != 0
+ work.update_column("commit_time", work.created_at)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/db/migrate/20160810081337_create_pull_requests.rb b/db/migrate/20160810081337_create_pull_requests.rb
new file mode 100644
index 000000000..f84cf7af9
--- /dev/null
+++ b/db/migrate/20160810081337_create_pull_requests.rb
@@ -0,0 +1,11 @@
+class CreatePullRequests < ActiveRecord::Migration
+ def change
+ create_table :pull_requests do |t|
+ t.integer :pull_request_id
+ t.integer :gpid
+ t.integer :user_id
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20160811084401_add_bindtype_to_user_wechats.rb b/db/migrate/20160811084401_add_bindtype_to_user_wechats.rb
new file mode 100644
index 000000000..6cba9e675
--- /dev/null
+++ b/db/migrate/20160811084401_add_bindtype_to_user_wechats.rb
@@ -0,0 +1,5 @@
+class AddBindtypeToUserWechats < ActiveRecord::Migration
+ def change
+ add_column :user_wechats, :bindtype, :integer, :default => 0
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index ee840b3e7..47b3bf210 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,2716 +1,2724 @@
-# 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 => 20160729124833) 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 "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"
- 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 "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 "applied_user_id"
- 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 "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
- 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 "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"
- 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", ["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
- 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 "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"
- 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 "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
- 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 "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"
- 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 "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"
- 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 "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"
- 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 "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"
- 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 "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
- 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
- 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 "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"
- 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 "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
- 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 "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"
- t.integer "author_id"
- t.text "notificationcomments"
- t.datetime "created_at", :null => false
- 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"
- 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 "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"
- 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_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"
- 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 "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 "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 "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"
- 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 "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"
- 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.float "work_score"
- t.integer "simi_id"
- t.integer "simi_value"
- t.integer "work_status", :default => 0
- end
-
- add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
-
- create_table "student_works_evaluation_distributions", :force => true do |t|
- t.integer "student_work_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "student_works_scores", :force => true do |t|
- t.integer "student_work_id"
- t.integer "user_id"
- t.integer "score"
- t.text "comment"
- t.integer "reviewer_role"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- 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"
- t.string "name"
- t.string "field_type"
- 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|
- t.integer "org_subfield_id"
- t.string "name"
- t.datetime "created_at", :null => false
- 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"
- 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
- 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 "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
- 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 "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"
- 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 => 20160810081337) 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 "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"
+ 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 "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 "applied_user_id"
+ 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 "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
+ 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 "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"
+ 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", ["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
+ 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 "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"
+ 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 "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
+ 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 "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"
+ 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 "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"
+ 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 "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"
+ 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 "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"
+ 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 "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
+ 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
+ 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 "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"
+ 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 "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
+ 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 "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"
+ t.integer "author_id"
+ t.text "notificationcomments"
+ t.datetime "created_at", :null => false
+ 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"
+ 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 "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"
+ 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_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"
+ 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 "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"
+ 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 "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"
+ 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 "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"
+ 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.float "work_score"
+ t.integer "simi_id"
+ t.integer "simi_value"
+ t.integer "work_status", :default => 0
+ end
+
+ add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
+
+ create_table "student_works_evaluation_distributions", :force => true do |t|
+ t.integer "student_work_id"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "student_works_scores", :force => true do |t|
+ t.integer "student_work_id"
+ t.integer "user_id"
+ t.integer "score"
+ t.text "comment"
+ t.integer "reviewer_role"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ 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"
+ t.string "name"
+ t.string "field_type"
+ 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|
+ t.integer "org_subfield_id"
+ t.string "name"
+ t.datetime "created_at", :null => false
+ 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"
+ 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
+ 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 "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
+ 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 "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"
+ 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
diff --git a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb
index 2006c58bf..0ac95b391 100644
--- a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb
+++ b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb
@@ -64,8 +64,8 @@ class Gitlab::Client
# @option options [Integer] :assignee_id The ID of a user to assign merge request.
# @option options [String] :state_event New state (close|reopen|merge).
# @return [Gitlab::ObjectifiedHash] Information about updated merge request.
- def update_merge_request(project, id, options={})
- put("/projects/#{project}/merge_request/#{id}", :body => options)
+ def update_merge_request(project, id, gid, options={})
+ put("/projects/#{project}/merge_request/#{id}?user_id=#{gid}", :body => options)
end
# Adds a comment to a merge request.
@@ -78,8 +78,8 @@ class Gitlab::Client
# @param [Integer] id The ID of a merge request.
# @param [String] note The content of a comment.
# @return [Gitlab::ObjectifiedHash] Information about created merge request comment.
- def create_merge_request_comment(project, id, note)
- post("/projects/#{project}/merge_request/#{id}/comments", :body => {:note => note})
+ def create_merge_request_comment(project, id, note, gid)
+ post("/projects/#{project}/merge_request/#{id}/comments?user_id=#{gid}", :body => {:note => note})
end
# Get a list of merge request commits.
diff --git a/lib/wechat/lib/wechat/api.rb b/lib/wechat/lib/wechat/api.rb
index 5cb457b9f..f267f8b69 100644
--- a/lib/wechat/lib/wechat/api.rb
+++ b/lib/wechat/lib/wechat/api.rb
@@ -7,6 +7,7 @@ module Wechat
class Api < ApiBase
API_BASE = 'https://api.weixin.qq.com/cgi-bin/'
OAUTH2_BASE = 'https://api.weixin.qq.com/sns/oauth2/'
+ OAUTH2_USERINFO = 'https://api.weixin.qq.com/sns/'
def initialize(appid, secret, token_file, timeout, skip_verify_ssl, jsapi_ticket_file)
@client = Client.new(API_BASE, timeout, skip_verify_ssl)
@@ -120,5 +121,23 @@ module Wechat
}
get 'access_token', params: params, base: OAUTH2_BASE
end
+
+ def web_auth_access_token(web_access_token, openid)
+ get 'auth', params: { access_token: web_access_token, openid: openid }, base: OAUTH2_BASE
+ end
+
+ def web_refresh_access_token(user_refresh_token)
+ params = {
+ appid: access_token.appid,
+ grant_type: 'refresh_token',
+ refresh_token: user_refresh_token
+ }
+ get 'refresh_token', params: params, base: OAUTH2_BASE
+ end
+
+ def web_userinfo(web_access_token, openid, lang = 'zh_CN')
+ get 'userinfo', params: { access_token: web_access_token, openid: openid, lang: lang }, base: OAUTH2_USERINFO
+ end
+
end
end
diff --git a/lib/wechat/lib/wechat/api_base.rb b/lib/wechat/lib/wechat/api_base.rb
index b873251f7..1fa3c4f7b 100644
--- a/lib/wechat/lib/wechat/api_base.rb
+++ b/lib/wechat/lib/wechat/api_base.rb
@@ -1,6 +1,6 @@
module Wechat
class ApiBase
- attr_reader :access_token, :client, :jsapi_ticket
+ attr_reader :access_token, :client, :jsapi_ticket, :auth_access_token
MP_BASE = 'https://mp.weixin.qq.com/cgi-bin/'
@@ -42,7 +42,7 @@ module Wechat
def with_access_token(params = {}, tries = 2)
params ||= {}
- yield(params.merge(access_token: access_token.token))
+ yield(params.reverse_merge(access_token: access_token.token))
rescue AccessTokenExpiredError
access_token.refresh
retry unless (tries -= 1).zero?
diff --git a/lib/wechat/lib/wechat/token/auth_access_token.rb b/lib/wechat/lib/wechat/token/auth_access_token.rb
new file mode 100644
index 000000000..5b58e261c
--- /dev/null
+++ b/lib/wechat/lib/wechat/token/auth_access_token.rb
@@ -0,0 +1,21 @@
+require 'wechat/token/access_token_base'
+
+module Wechat
+ module Token
+ class AuthAccessToken < AccessTokenBase
+
+ # def refresh
+ # params = {
+ # appid: access_token.appid,
+ # grant_type: 'refresh_token',
+ # refresh_token: user_refresh_token
+ # }
+ # data = client.get 'oauth2/refresh_token', params: params, base: OAUTH2_BASE
+ # write_token_to_file(data)
+ # read_token_from_file
+ # end
+
+ end
+ end
+end
+
diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html
index fbdfb1152..a4aa9a4c7 100644
--- a/public/assets/wechat/activities.html
+++ b/public/assets/wechat/activities.html
@@ -26,8 +26,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -64,8 +63,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -100,8 +98,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -136,7 +133,7 @@
-
{{act.author.realname}} 创建了{{act.course_project_name}} | 班级
+
{{act.author.real_name}} 创建了{{act.course_project_name}} | 班级
{{act.latest_update}}
@@ -153,8 +150,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -192,8 +188,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -226,7 +221,7 @@
-
{{act.author.realname}} 创建了{{act.course_project_name}} | 项目
+
{{act.author.real_name}} 创建了{{act.course_project_name}} | 项目
{{act.latest_update}}
@@ -243,8 +238,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -280,8 +274,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -326,8 +319,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -364,8 +356,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -400,8 +391,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -436,7 +426,7 @@
-
{{act.author.realname}} 创建了{{act.course_project_name}} | 班级
+
{{act.author.real_name}} 创建了{{act.course_project_name}} | 班级
{{act.latest_update}}
@@ -460,8 +450,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -499,8 +488,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -533,7 +521,7 @@
-
{{act.author.realname}} 创建了{{act.course_project_name}} | 项目
+
{{act.author.real_name}} 创建了{{act.course_project_name}} | 项目
{{act.latest_update}}
diff --git a/public/assets/wechat/app.html b/public/assets/wechat/app.html
index 74af26cfe..d49caedd5 100644
--- a/public/assets/wechat/app.html
+++ b/public/assets/wechat/app.html
@@ -37,6 +37,8 @@
+
+
diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html
index ee9e968d2..c1e2fd2fd 100644
--- a/public/assets/wechat/blog_detail.html
+++ b/public/assets/wechat/blog_detail.html
@@ -8,7 +8,7 @@
- {{blog.user.realname}}
+ {{blog.user.real_name}}
@@ -25,20 +25,20 @@
{{blog.praise_count}}
{{blog.praise_count}}
-
-
+
- {{journal.user.realname}}
+ {{journal.user.real_name}}
{{journal.lasted_comment}}
@@ -48,7 +48,7 @@
↓ ↑ 点击展开更多楼层
- {{reply_bottom.user.realname}}
+ {{reply_bottom.user.real_name}}
{{reply_bottom.lasted_comment}}
@@ -73,7 +73,7 @@
-
+
提交
提交
diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html
index 051adba7e..e720c90c9 100644
--- a/public/assets/wechat/class.html
+++ b/public/assets/wechat/class.html
@@ -31,7 +31,7 @@
授课老师
-
{{reviewer.name}}
+
{{reviewer.name}}
待审批 ▶
@@ -47,7 +47,7 @@
我的同学
diff --git a/public/assets/wechat/class_list.html b/public/assets/wechat/class_list.html
index ece31ceeb..9ac70cc0a 100644
--- a/public/assets/wechat/class_list.html
+++ b/public/assets/wechat/class_list.html
@@ -10,7 +10,7 @@
{{course.name}}
- >
+ >
{{course.member_count}}人
@@ -25,7 +25,7 @@
{{course.name}}
- >
+ >
{{course.member_count}}人
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html
index 9ef7bc429..3d7444c95 100644
--- a/public/assets/wechat/course_discussion.html
+++ b/public/assets/wechat/course_discussion.html
@@ -5,10 +5,11 @@
-
+
- {{journal.user.realname}}
+ {{journal.user.real_name}}
{{journal.lasted_comment}}
@@ -47,7 +48,7 @@
↓ ↑ 点击展开更多楼层
- {{reply_bottom.user.realname}}
+ {{reply_bottom.user.real_name}}
{{reply_bottom.lasted_comment}}
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html
index b2771100b..95eeda60b 100644
--- a/public/assets/wechat/course_notice.html
+++ b/public/assets/wechat/course_notice.html
@@ -4,10 +4,11 @@
-
+
- {{comments.author.realname}}
+ {{comments.author.real_name}}
{{comments.created_on}}
diff --git a/public/assets/wechat/edit_class_member.html b/public/assets/wechat/edit_class_member.html
index c20ed5acb..f27ab76cb 100644
--- a/public/assets/wechat/edit_class_member.html
+++ b/public/assets/wechat/edit_class_member.html
@@ -2,7 +2,7 @@
角色变更
-
{{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}
+
{{current_edit_member.user.realname == "" ? current_edit_member.user.name : current_edit_member.user.realname}}
角色
教师
diff --git a/public/assets/wechat/edit_project_member.html b/public/assets/wechat/edit_project_member.html
index 8677844b7..51294f43e 100644
--- a/public/assets/wechat/edit_project_member.html
+++ b/public/assets/wechat/edit_project_member.html
@@ -2,7 +2,7 @@
角色变更
-
{{current_edit_member.user.real_name == "" ? current_edit_member.user.name : current_edit_member.user.real_name}}
+
{{current_edit_member.user.real_name == "" ? current_edit_member.user.name : current_edit_member.user.real_name}}
角色
管理人员
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html
index 599774dfc..77aa0a48d 100644
--- a/public/assets/wechat/homework_detail.html
+++ b/public/assets/wechat/homework_detail.html
@@ -4,10 +4,11 @@
+
私有内容,请谨慎传播
-
-
+
- {{journal.user.realname}}
+ {{journal.user.real_name}}
{{journal.lasted_comment}}
@@ -51,7 +52,7 @@
↓ ↑ 点击展开更多楼层
- {{reply_bottom.user.realname}}
+ {{reply_bottom.user.real_name}}
{{reply_bottom.lasted_comment}}
@@ -73,7 +74,7 @@
-
+
提交
提交
diff --git a/public/assets/wechat/invite_code.html b/public/assets/wechat/invite_code.html
index a1b225fc9..3aaa00bbe 100644
--- a/public/assets/wechat/invite_code.html
+++ b/public/assets/wechat/invite_code.html
@@ -11,6 +11,8 @@
1.点击右上角"发送给朋友",邀请同学加入班级
2.长按二维码,通过“识别图中二维码”功能加入班级
- 3.通过“加入班级”菜单输入邀请码加入班级(长按邀请码可以复制哦~)
+ 3.通过“加入班级”菜单输入邀请码加入班级(长按邀请码可以复制哦~)
+ 4.扫码默认以学生身份加入班级
+
\ No newline at end of file
diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html
index 852103b81..14df1cfb1 100644
--- a/public/assets/wechat/issue_detail.html
+++ b/public/assets/wechat/issue_detail.html
@@ -4,11 +4,12 @@
-
+
- {{journal.user.realname}}
+ {{journal.user.real_name}}
{{journal.created_on}}
diff --git a/public/assets/wechat/join_project.html b/public/assets/wechat/join_project.html
index c2c0ec993..61be93cfd 100644
--- a/public/assets/wechat/join_project.html
+++ b/public/assets/wechat/join_project.html
@@ -9,6 +9,13 @@
开发人员
报告人员
+
+
提示
+
+ • 管理人员、开发人员角色需要项目管理员审批
+ • 报告人员角色无需管理员审批
+
+
取消
确定
diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html
index 78760da71..b94bca8b2 100644
--- a/public/assets/wechat/jour_message_detail.html
+++ b/public/assets/wechat/jour_message_detail.html
@@ -3,11 +3,12 @@
-
+
- {{journal.user.realname}}
+ {{journal.user.real_name}}
{{journal.lasted_comment}}
@@ -46,7 +47,7 @@
↓ ↑ 点击展开更多楼层
- {{reply_bottom.user.realname}}
+ {{reply_bottom.user.real_name}}
{{reply_bottom.lasted_comment}}
diff --git a/public/assets/wechat/login.html b/public/assets/wechat/login.html
index 61c9b9de3..05d844ca8 100644
--- a/public/assets/wechat/login.html
+++ b/public/assets/wechat/login.html
@@ -17,7 +17,7 @@
-
+
diff --git a/public/assets/wechat/login_tip.html b/public/assets/wechat/login_tip.html
new file mode 100644
index 000000000..82bb6d906
--- /dev/null
+++ b/public/assets/wechat/login_tip.html
@@ -0,0 +1,13 @@
+
+
+
+
提示
+
+
+ • 您的回复内容已提交
+ • 想要实时接收动态、加入社区? 长按二维码,关注公众号
+
+
+
+
+
diff --git a/public/assets/wechat/project.html b/public/assets/wechat/project.html
index 0ea8a3117..733f0899d 100644
--- a/public/assets/wechat/project.html
+++ b/public/assets/wechat/project.html
@@ -15,8 +15,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -54,8 +53,7 @@
-
{{act.author.realname}}
-
{{act.author.nickname}}
+
{{act.author.real_name}}
@@ -88,7 +86,7 @@
-
{{act.author.realname}} 创建了{{act.course_project_name}} | 项目
+
{{act.author.real_name}} 创建了{{act.course_project_name}} | 项目
{{act.latest_update}}
@@ -110,30 +108,30 @@
管理人员({{project_master_members.length}})
-
{{user.real_name == "" ? user.name : user.real_name }}
+
{{user.real_name == "" ? user.name : user.real_name }}
待审批 ▶
开发人员({{project_develop_members.length}})
-
{{user.real_name == "" ? user.name : user.real_name}}
+
{{user.real_name == "" ? user.name : user.real_name}}
待审批 ▶
报告人员({{project_report_members.length}})
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html
index cc3d4b1c8..fef0a2f6e 100644
--- a/public/assets/wechat/project_discussion.html
+++ b/public/assets/wechat/project_discussion.html
@@ -4,10 +4,11 @@
-
+
- {{journal.user.realname}}
+ {{journal.user.real_name}}
{{journal.lasted_comment}}
@@ -47,7 +48,7 @@
↓ ↑ 点击展开更多楼层
- {{reply_bottom.user.realname}}
+ {{reply_bottom.user.real_name}}
{{reply_bottom.lasted_comment}}
diff --git a/public/assets/wechat/project_invite_code.html b/public/assets/wechat/project_invite_code.html
index a17b8fe85..7685d7aef 100644
--- a/public/assets/wechat/project_invite_code.html
+++ b/public/assets/wechat/project_invite_code.html
@@ -11,6 +11,8 @@
1.点击右上角"发送给朋友",邀请朋友加入项目
2.长按二维码,通过“识别图中二维码”功能加入项目
- 3.通过“加入项目”菜单输入邀请码加入项目(长按邀请码可以复制哦~)
+ 3.通过“加入项目”菜单输入邀请码加入项目(长按邀请码可以复制哦~)
+ 4.扫码默认以报告人员身份加入项目
+
\ No newline at end of file
diff --git a/public/assets/wechat/project_list.html b/public/assets/wechat/project_list.html
index 1d385dabf..d9313b6a7 100644
--- a/public/assets/wechat/project_list.html
+++ b/public/assets/wechat/project_list.html
@@ -7,7 +7,7 @@
{{project.name}}
- >
+ >
{{project.member_count}}人
@@ -20,7 +20,7 @@
{{project.name}}
- >
+ >
{{project.member_count}}人
diff --git a/public/assets/wechat/reg.html b/public/assets/wechat/reg.html
index 26a17931f..f42108202 100644
--- a/public/assets/wechat/reg.html
+++ b/public/assets/wechat/reg.html
@@ -27,9 +27,10 @@
diff --git a/public/assets/wechat/review_class_member.html b/public/assets/wechat/review_class_member.html
index 06ce99018..e066c48f0 100644
--- a/public/assets/wechat/review_class_member.html
+++ b/public/assets/wechat/review_class_member.html
@@ -3,7 +3,7 @@
{{current_course.name}}
-
{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}
+
{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}
角色
教师
diff --git a/public/assets/wechat/review_project_member.html b/public/assets/wechat/review_project_member.html
index d50a04fa4..bcbbb50b6 100644
--- a/public/assets/wechat/review_project_member.html
+++ b/public/assets/wechat/review_project_member.html
@@ -3,7 +3,7 @@
{{current_project.name}}
-
{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}
+
{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}
角色
管理人员
diff --git a/public/images/wechat/trustie_QR.jpg b/public/images/wechat/trustie_QR.jpg
new file mode 100644
index 000000000..2b0c38f8b
Binary files /dev/null and b/public/images/wechat/trustie_QR.jpg differ
diff --git a/public/images/wechat/wx_logo.jpg b/public/images/wechat/wx_logo.jpg
new file mode 100644
index 000000000..8faeef27a
Binary files /dev/null and b/public/images/wechat/wx_logo.jpg differ
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index cfeb4b341..504fea3cb 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1495,12 +1495,12 @@ function pop_up_box(value,tWidth,tTop,tLeft){
// 公共弹框样式
function pop_box_new(value, Width, Height){
w = ($(window).width() - Width)/2;
- h = ($(window).height() - Height)/2 - 100;
+ h = ($(window).height() - Height)/2;
$("#ajax-modal").html(value);
showModal('ajax-modal', Width + 'px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
- $('#ajax-modal').css({"padding":"0"});
+ $('#ajax-modal').css({"padding":"0","overflow":"hidden"});
$('#ajax-modal').parent().attr("id","popupWrap");
//拖拽
@@ -1552,7 +1552,10 @@ function pop_box_new(value, Width, Height){
document.onmousemove = null;
}
- new Drag("popupWrap");
+ $(".sy_popup_con").mousedown(function(event){
+ event.stopPropagation();
+ new Drag("popupWrap");
+ });
}
// 公共提示弹框样式
diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js
index 8db3fbc20..1013dd749 100644
--- a/public/javascripts/new_user.js
+++ b/public/javascripts/new_user.js
@@ -38,7 +38,6 @@ function edit_user_introduction(url){
function show_more_course(url){
$.get(
url,
- { page: $("#course_page_num").val() },
function (data) {
}
);
@@ -48,7 +47,6 @@ function show_more_course(url){
function show_more_project(url){
$.get(
url,
- { page: $("#project_page_num").val() },
function (data) {
}
diff --git a/public/javascripts/syllabus.js b/public/javascripts/syllabus.js
index 24b997496..0319bd4d1 100644
--- a/public/javascripts/syllabus.js
+++ b/public/javascripts/syllabus.js
@@ -2,7 +2,6 @@
function show_more_course(url){
$.get(
url,
- { page: $("#course_page_num").val() },
function (data) {
}
);
diff --git a/public/javascripts/wechat/controllers/activity.js b/public/javascripts/wechat/controllers/activity.js
index 7066da4d9..e646da5b9 100644
--- a/public/javascripts/wechat/controllers/activity.js
+++ b/public/javascripts/wechat/controllers/activity.js
@@ -2,6 +2,10 @@
app.controller('ActivityController',
['$anchorScroll', '$location','$scope', '$http', '$timeout', 'auth', 'rms', 'common','alertService',
function($anchorScroll, $location,$scope, $http, $timeout, auth, rms, common, alertService){
+
+// common.checkLogin();
+
+
$scope.replaceUrl = function(url){
return url;
};
@@ -142,7 +146,7 @@ app.controller('ActivityController',
rms.save("activities",$scope.activities);
rms.save("course_activities",$scope.course_activities);
rms.save("project_activities",$scope.project_activities);
- $location.path('/'+type+'/'+act_id);
+ $location.path("/"+type).search({id: act_id});
};
$scope.addPraise = function(act){
diff --git a/public/javascripts/wechat/controllers/blog.js b/public/javascripts/wechat/controllers/blog.js
index 5fb61151d..21c1cf345 100644
--- a/public/javascripts/wechat/controllers/blog.js
+++ b/public/javascripts/wechat/controllers/blog.js
@@ -7,6 +7,7 @@ app.controller('BlogController',
scope: $scope,
type: 'blog_comments',
replyType: 'BlogComment',
+ urlName: 'blog_comment',
loadCallback: function(data){
console.log(data.data);
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js
index 04807b2dd..d372f6826 100644
--- a/public/javascripts/wechat/controllers/class.js
+++ b/public/javascripts/wechat/controllers/class.js
@@ -1,181 +1,185 @@
-app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms', function($scope, config, $http, auth, $location, $routeParams,alertService,rms){
-
- var vm = $scope;
- var courseid = $routeParams.id;
- var tag = $routeParams.tag;
-
-
- var getUsers = function(){
- if(vm.teachers.length<=0){
- $http.get(config.apiUrl + 'courses/teachers?token='+auth.token()+'&course_id='+courseid).then(
- function(response) {
- console.log(response.data);
- vm.teachers = response.data.data;
- }
- )
- }
-
- if(vm.course.is_creator){
- if(vm.reviewers.length<=0){
- $http.get(config.apiUrl + 'courses/reviewers?token='+auth.token()+'&course_id='+courseid).then(
- function(response) {
- console.log(response.data);
- vm.reviewers = response.data.data;
- }
- )
- }
- }
-
- if(vm.students.length<=0){
- $http.get(config.apiUrl + 'courses/students?token='+auth.token()+'&course_id='+courseid).then(
- function(response) {
- console.log(response.data);
- vm.students = response.data.data;
- }
- )
- }
- }
-
- var getResources = function(){
- if(vm.resources.length<=0){
- $http.post(config.apiUrl + "courses/"+courseid+"/attachments",
- {token: auth.token(), name: ''}
- ).then(function(response){
- vm.resources = response.data.data;
- vm.resources_tag = true;
- });
- }
- }
-
- var getHomeworks = function(){
- if(vm.homeworks.length <=0){
- $http.get(config.apiUrl + "courses/homeworks/"+courseid+"?token="+auth.token()).then(function(response){
- vm.homeworks = response.data.data;
- console.log(response.data);
- vm.homeworks_tag = true;
- });
- }
- }
-
- var getExercises = function(){
- if(vm.exercises.length <=0){
- $http.get(config.apiUrl + "courses/"+courseid+"/exercises?token="+auth.token()).then(function(response){
- vm.exercises = response.data.data;
- console.log(response.data);
- vm.exercises_tag = true;
- });
- }
- }
-
-
- vm.isTeacher = false;
- vm.currentTab = 1;
- vm.tab = function(index){
- vm.currentTab = index;
- vm.searchText = '';
-
- vm.showClassMate = false;
- vm.showResources = false;
- vm.showHomework = false;
- vm.showTestcase = false;
- vm.resources_tag = false;
- vm.homeworks_tag = false;
- vm.exercises_tag = false;
-
- if(vm.isTeacher){
- if(index == 1){ //课件
- getResources();
- vm.showResources = true;
- } else if(index==2){ //作业
- getHomeworks();
- vm.showHomework = true;
- } else if(index==3){ //小测验
- getExercises();
- vm.showTestcase = true;
- } else if(index==4){ //学生管理
- getUsers();
- vm.showClassMate = true;
- }
-
- } else {
- if(index == 2){
- getUsers();
- vm.showClassMate = true;
- } else if(index==1){
- getResources();
- vm.showResources = true;
- }
- }
- }
-
- vm.course = {};
- vm.students = [];
- vm.teachers = [];
- vm.reviewers = []; //待审批
- vm.resources = [];
- vm.homeworks = [];
- vm.exercises = [];
-
- //发送类别 1课件 2作业 3测验
- vm.myresource_sendIndex = rms.get('myresource_sendIndex') || 1;
-
- vm.alertService = alertService.create();
-
- vm.invite = function(){
- $location.path("/invite_code").search({id: courseid});
- };
-
- vm.sendFile = function(r,index){
- vm.myresource_sendIndex = index;
- rms.save('myresource_sendIndex',index);
- $location.path("/send_class_list").search({id: r.id});
- }
-
- $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
- function(response) {
- console.log(response.data);
-
- if (response.data.status == 0){
- vm.course = response.data.data;
- resetMenu(vm.course.current_user_is_teacher);
- if(tag){
- vm.tab(4);
- tag = null;
- }
- else{
- vm.tab(1);
- }
- }
- else{
- vm.alertService.showMessage('提示', response.data.message);
- }
-
- }
- );
-
-
- var resetMenu = function(is_teacher){
- vm.isTeacher = is_teacher;
- if(is_teacher){
- vm.menus = ["课件", "作业", "测验", "成员管理"];
- } else {
- vm.menus = ['课件', "我的同学"];
- }
-
- }
-
- vm.onSetting = function(user){
- rms.save('current_edit_member', user);
- $location.path("/edit_class_member").search({id: courseid,user_id: user.id});
- };
-
- vm.review = function(user){
- rms.save('current_review_member', user);
- rms.save('current_course', vm.course);
-
- $location.path("/review_class_member").search({id: courseid,user_id: user.id});
- }
-
-
-
+app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms','common', function($scope, config, $http, auth, $location, $routeParams,alertService,rms,common){
+// common.checkLogin();
+
+ var vm = $scope;
+ var courseid = $routeParams.id;
+ var tag = $routeParams.tag;
+
+
+ var getUsers = function(){
+ if(vm.teachers.length<=0){
+ $http.get(config.apiUrl + 'courses/teachers?token='+auth.token()+'&course_id='+courseid).then(
+ function(response) {
+ console.log(response.data);
+ vm.teachers = response.data.data;
+ }
+ )
+ }
+
+ if(vm.course.is_creator){
+ if(vm.reviewers.length<=0){
+ $http.get(config.apiUrl + 'courses/reviewers?token='+auth.token()+'&course_id='+courseid).then(
+ function(response) {
+ console.log(response.data);
+ vm.reviewers = response.data.data;
+ }
+ )
+ }
+ }
+
+ if(vm.students.length<=0){
+ $http.get(config.apiUrl + 'courses/students?token='+auth.token()+'&course_id='+courseid).then(
+ function(response) {
+ console.log(response.data);
+ vm.students = response.data.data;
+ }
+ )
+ }
+ }
+
+ var getResources = function(){
+ if(vm.resources.length<=0){
+ $http.post(config.apiUrl + "courses/"+courseid+"/attachments",
+ {token: auth.token(), name: ''}
+ ).then(function(response){
+ vm.resources = response.data.data;
+ vm.resources_tag = true;
+ });
+ }
+ }
+
+ var getHomeworks = function(){
+ if(vm.homeworks.length <=0){
+ $http.get(config.apiUrl + "courses/homeworks/"+courseid+"?token="+auth.token()).then(function(response){
+ vm.homeworks = response.data.data;
+ console.log(response.data);
+ vm.homeworks_tag = true;
+ });
+ }
+ }
+
+ var getExercises = function(){
+ if(vm.exercises.length <=0){
+ $http.get(config.apiUrl + "courses/"+courseid+"/exercises?token="+auth.token()).then(function(response){
+ vm.exercises = response.data.data;
+ console.log(response.data);
+ vm.exercises_tag = true;
+ });
+ }
+ }
+
+
+ vm.isTeacher = false;
+ vm.currentTab = 1;
+ vm.tab = function(index){
+ vm.currentTab = index;
+ vm.searchText = '';
+
+ vm.showClassMate = false;
+ vm.showResources = false;
+ vm.showHomework = false;
+ vm.showTestcase = false;
+ vm.resources_tag = false;
+ vm.homeworks_tag = false;
+ vm.exercises_tag = false;
+
+ if(vm.isTeacher){
+ if(index == 1){ //课件
+ getResources();
+ vm.showResources = true;
+ } else if(index==2){ //作业
+ getHomeworks();
+ vm.showHomework = true;
+ } else if(index==3){ //小测验
+ getExercises();
+ vm.showTestcase = true;
+ } else if(index==4){ //学生管理
+ getUsers();
+ vm.showClassMate = true;
+ }
+
+ } else {
+ if(index == 2){
+ getUsers();
+ vm.showClassMate = true;
+ } else if(index==1){
+ getResources();
+ vm.showResources = true;
+ }
+ }
+ rms.save("tab_num",index);
+ }
+
+ vm.tabRecord = rms.get('tab_num') || 1;
+
+ vm.course = {};
+ vm.students = [];
+ vm.teachers = [];
+ vm.reviewers = []; //待审批
+ vm.resources = [];
+ vm.homeworks = [];
+ vm.exercises = [];
+
+ //发送类别 1课件 2作业 3测验
+ vm.myresource_sendIndex = rms.get('myresource_sendIndex') || 1;
+
+ vm.alertService = alertService.create();
+
+ vm.invite = function(){
+ $location.path("/invite_code").search({id: courseid});
+ };
+
+ vm.sendFile = function(r,index){
+ vm.myresource_sendIndex = index;
+ rms.save('myresource_sendIndex',index);
+ $location.path("/send_class_list").search({id: r.id});
+ }
+
+ $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
+ function(response) {
+ console.log(response.data);
+
+ if (response.data.status == 0){
+ vm.course = response.data.data;
+ resetMenu(vm.course.current_user_is_teacher,vm.tabRecord);
+ if(tag){
+ vm.tab(4);
+ tag = null;
+ }
+ else{
+ vm.tab(vm.tabRecord);
+ }
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+ }
+
+ }
+ );
+
+
+ var resetMenu = function(is_teacher){
+ vm.isTeacher = is_teacher;
+ if(is_teacher){
+ vm.menus = ["课件", "作业", "测验", "成员管理"];
+ } else {
+ vm.menus = ['课件', "我的同学"];
+ }
+
+ }
+
+ vm.onSetting = function(user){
+ rms.save('current_edit_member', user);
+ $location.path("/edit_class_member").search({id: courseid,user_id: user.id});
+ };
+
+ vm.review = function(user){
+ rms.save('current_review_member', user);
+ rms.save('current_course', vm.course);
+
+ $location.path("/review_class_member").search({id: courseid,user_id: user.id});
+ }
+
+
+
}]);
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/class_list.js b/public/javascripts/wechat/controllers/class_list.js
index 48e778f9d..cc5250970 100644
--- a/public/javascripts/wechat/controllers/class_list.js
+++ b/public/javascripts/wechat/controllers/class_list.js
@@ -3,8 +3,10 @@
*/
-app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms',
- function ($scope, config, auth, $http, $location, alertService,rms) {
+app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms','common',
+ function ($scope, config, auth, $http, $location, alertService,rms,common) {
+// common.checkLogin();
+
var vm = $scope;
vm.syllabuses = rms.get('syllabuses') || [];
diff --git a/public/javascripts/wechat/controllers/course_notice.js b/public/javascripts/wechat/controllers/course_notice.js
index 77d2e6ab0..9f9ba83d6 100644
--- a/public/javascripts/wechat/controllers/course_notice.js
+++ b/public/javascripts/wechat/controllers/course_notice.js
@@ -6,8 +6,10 @@ app.controller('CourseNoticeController', ['$scope', '$http', '$routeParams', 'au
scope: $scope,
type: 'newss',
replyType: 'News',
+ urlName: 'course_notice',
loadCallback: function(data){
$scope.news = data.data;
+ $scope.is_public = data.is_public;
},
replyCallback: function(){
}
diff --git a/public/javascripts/wechat/controllers/discussion.js b/public/javascripts/wechat/controllers/discussion.js
index 60bfb3ee3..21e842d0f 100644
--- a/public/javascripts/wechat/controllers/discussion.js
+++ b/public/javascripts/wechat/controllers/discussion.js
@@ -5,6 +5,7 @@ app.controller('DiscussionController', ['$scope', '$http', '$routeParams', 'auth
scope: $scope,
type: 'messages',
replyType: 'Message',
+ urlName: 'discussion',
loadCallback: function(data){
console.log(data.data);
@@ -16,6 +17,7 @@ app.controller('DiscussionController', ['$scope', '$http', '$routeParams', 'auth
if (page == 0){
$scope.discussion = data.data;
$scope.page = 0;
+ $scope.is_public = data.is_public;
}
else{
$scope.discussion.all_children = $scope.discussion.all_children.concat(data.data.all_children);
diff --git a/public/javascripts/wechat/controllers/edit_class.js b/public/javascripts/wechat/controllers/edit_class.js
index 0a09ce1e3..d61c25353 100644
--- a/public/javascripts/wechat/controllers/edit_class.js
+++ b/public/javascripts/wechat/controllers/edit_class.js
@@ -1,6 +1,8 @@
-app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
+app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
var vm = $scope;
vm.syllabus = rms.get('current_edit_syllobus');
diff --git a/public/javascripts/wechat/controllers/edit_class_member.js b/public/javascripts/wechat/controllers/edit_class_member.js
index b3c28ea0b..e00e36f20 100644
--- a/public/javascripts/wechat/controllers/edit_class_member.js
+++ b/public/javascripts/wechat/controllers/edit_class_member.js
@@ -1,6 +1,8 @@
-app.controller('EditClassMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
+app.controller('EditClassMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
var vm = $scope;
// vm.current_edit_member = rms.get('current_edit_member');
diff --git a/public/javascripts/wechat/controllers/edit_project_member.js b/public/javascripts/wechat/controllers/edit_project_member.js
index 3fd24f04e..511db35bb 100644
--- a/public/javascripts/wechat/controllers/edit_project_member.js
+++ b/public/javascripts/wechat/controllers/edit_project_member.js
@@ -1,6 +1,8 @@
-app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
+app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
var vm = $scope;
// vm.current_edit_member = rms.get('current_edit_member');
diff --git a/public/javascripts/wechat/controllers/homework.js b/public/javascripts/wechat/controllers/homework.js
index 2898fc27f..f61f2be1d 100644
--- a/public/javascripts/wechat/controllers/homework.js
+++ b/public/javascripts/wechat/controllers/homework.js
@@ -5,6 +5,7 @@ app.controller('HomeworkController', ['$scope', '$http', '$routeParams', 'auth',
scope: $scope,
type: 'whomeworks',
replyType: 'HomeworkCommon',
+ urlName: 'homework',
loadCallback: function(data){
console.log(data.data);
@@ -16,6 +17,7 @@ app.controller('HomeworkController', ['$scope', '$http', '$routeParams', 'auth',
if (page == 0){
$scope.homework = data.data;
$scope.page = 0;
+ $scope.is_public = data.is_public;
}
else{
$scope.homework.all_children = $scope.homework.all_children.concat(data.data.all_children);
diff --git a/public/javascripts/wechat/controllers/invite_code.js b/public/javascripts/wechat/controllers/invite_code.js
index db8b99ae7..50c14c0c3 100644
--- a/public/javascripts/wechat/controllers/invite_code.js
+++ b/public/javascripts/wechat/controllers/invite_code.js
@@ -13,9 +13,12 @@ app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config
console.log(response.data);
vm.course = response.data.data;
- var desc = "班级邀请:"+vm.course.name+" 班级";
+ var desc = "您的好友邀请您加入班级:【"+vm.course.name+"】,和小伙伴一起踏上便捷的学习之旅吧!";
+ var link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+window.g_appid+
+ "&redirect_uri="+window.g_localhost+"/wechat/user_activities?id="+vm.course.id+
+ "&response_type=code&scope=snsapi_base&state=invite_code&connect_redirect=1#wechat_redirect";
- common.wxConfig("",desc,"");
+ common.wxConfig("",desc,"",link);
// wx.ready(function(){
// wx.onMenuShareTimeline({
diff --git a/public/javascripts/wechat/controllers/issue.js b/public/javascripts/wechat/controllers/issue.js
index ae0cc4450..131fab6f6 100644
--- a/public/javascripts/wechat/controllers/issue.js
+++ b/public/javascripts/wechat/controllers/issue.js
@@ -5,9 +5,11 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c
scope: $scope,
type: 'issues',
replyType: 'Issue',
+ urlName: 'issues',
loadCallback: function(data){
console.log(data);
$scope.issue = data.data;
+ $scope.is_public = data.is_public;
},
replyCallback: function(){
}
diff --git a/public/javascripts/wechat/controllers/join_class.js b/public/javascripts/wechat/controllers/join_class.js
index 3f1a28387..1a9710bc1 100644
--- a/public/javascripts/wechat/controllers/join_class.js
+++ b/public/javascripts/wechat/controllers/join_class.js
@@ -1,6 +1,8 @@
-app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx){
+app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx,common){
+// common.checkLogin();
+
var vm = $scope;
// vm.current_edit_member = rms.get('current_edit_member');
diff --git a/public/javascripts/wechat/controllers/join_project.js b/public/javascripts/wechat/controllers/join_project.js
index f27c535c5..d942e8859 100644
--- a/public/javascripts/wechat/controllers/join_project.js
+++ b/public/javascripts/wechat/controllers/join_project.js
@@ -1,6 +1,8 @@
-app.controller('JoinProjectController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx){
+app.controller('JoinProjectController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','wx','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,wx,common){
+// common.checkLogin();
+
var vm = $scope;
// vm.current_edit_member = rms.get('current_edit_member');
diff --git a/public/javascripts/wechat/controllers/journals.js b/public/javascripts/wechat/controllers/journals.js
index 23f3b908b..0570e695f 100644
--- a/public/javascripts/wechat/controllers/journals.js
+++ b/public/javascripts/wechat/controllers/journals.js
@@ -4,6 +4,7 @@ app.controller('JournalsController', ['$scope', '$http', '$routeParams', 'auth',
scope: $scope,
type: 'journal_for_messages',
replyType: 'JournalsForMessage',
+ urlName: 'journal_for_message',
loadCallback: function(data){
console.log(data.data);
@@ -15,6 +16,7 @@ app.controller('JournalsController', ['$scope', '$http', '$routeParams', 'auth',
if (page == 0){
$scope.message = data.data;
$scope.page = 0;
+ $scope.is_public = data.is_public;
}
else{
$scope.message.all_children = $scope.message.all_children.concat(data.data.all_children);
diff --git a/public/javascripts/wechat/controllers/login.js b/public/javascripts/wechat/controllers/login.js
index f8e87a93f..ea86a71a2 100644
--- a/public/javascripts/wechat/controllers/login.js
+++ b/public/javascripts/wechat/controllers/login.js
@@ -1,6 +1,8 @@
app.controller('LoginController', ['$scope', '$http', '$location', '$routeParams', 'alertService', 'config','auth','session','wx',
function ($scope, $http, $location, $routeParams, alertService, config, auth,session, wx) {
+ var tag = $routeParams.tag;
+
// 登录页不用显示菜音
wx.ready(function(){
wx.hideOptionMenu();
@@ -39,7 +41,13 @@ app.controller('LoginController', ['$scope', '$http', '$location', '$routeParams
vm.loginFailed = (response.data.status != 0);
if (!$scope.loginFailed) { //绑定成功
vm.alertService.showMessage('提示', response.data.message, function(){
- wx.closeWindow();
+ if(tag){
+ window.history.back();
+ tag = null;
+ }
+ else{
+ wx.closeWindow();
+ }
});
} else {
vm.alertService.showMessage('出错了', response.data.message);
diff --git a/public/javascripts/wechat/controllers/login_tip..js b/public/javascripts/wechat/controllers/login_tip..js
new file mode 100644
index 000000000..a719abf79
--- /dev/null
+++ b/public/javascripts/wechat/controllers/login_tip..js
@@ -0,0 +1,7 @@
+app.controller('LoginTipController', ['$scope', '$http', '$location', 'alertService','$location',
+ function ($scope, $http, $location, alertService, $location) {
+ $scope.bindWx = function(){
+ $location.path("/login").search({tag:1});
+ };
+
+ }]);
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js
index b5489c065..089b63dfc 100644
--- a/public/javascripts/wechat/controllers/myresource.js
+++ b/public/javascripts/wechat/controllers/myresource.js
@@ -1,4 +1,6 @@
-app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$location', 'rms', function($scope, $http, auth, config, $location,rms){
+app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$location', 'rms','common', function($scope, $http, auth, config, $location,rms,common){
+// common.checkLogin();
+
var vm = $scope;
// vm.menus = ['课件', '作业', '测验'];
vm.menus = ['课件', '作业'];
diff --git a/public/javascripts/wechat/controllers/new_class.js b/public/javascripts/wechat/controllers/new_class.js
index 5e9f339a1..54bc396b6 100644
--- a/public/javascripts/wechat/controllers/new_class.js
+++ b/public/javascripts/wechat/controllers/new_class.js
@@ -1,6 +1,8 @@
-app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','rms', function($scope, $http, auth, config, alertService, $location,rms){
+app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','rms','common', function($scope, $http, auth, config, alertService, $location,rms,common){
+// common.checkLogin();
+
var vm = $scope;
vm.alertService = alertService.create();
diff --git a/public/javascripts/wechat/controllers/new_project.js b/public/javascripts/wechat/controllers/new_project.js
index 6eb6a1caa..03a1b451f 100644
--- a/public/javascripts/wechat/controllers/new_project.js
+++ b/public/javascripts/wechat/controllers/new_project.js
@@ -1,6 +1,8 @@
-app.controller('NewProjectController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','rms', function($scope, $http, auth, config, alertService, $location,rms){
+app.controller('NewProjectController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','rms','common', function($scope, $http, auth, config, alertService, $location,rms,common){
+// common.checkLogin();
+
var vm = $scope;
vm.alertService = alertService.create();
diff --git a/public/javascripts/wechat/controllers/project.js b/public/javascripts/wechat/controllers/project.js
index f4a3b5c5c..08987e491 100644
--- a/public/javascripts/wechat/controllers/project.js
+++ b/public/javascripts/wechat/controllers/project.js
@@ -1,4 +1,6 @@
app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'auth','$location','$routeParams','alertService','rms','common', function($scope, config, $http,$timeout, auth, $location, $routeParams,alertService,rms,common){
+// common.checkLogin();
+
$scope.replaceUrl = function(url){
return url;
};
@@ -115,7 +117,8 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
rms.save("project_activities",vm.project_activities);
rms.save('project_has_more', vm.project_has_more);
rms.save("project",vm.project);
- $location.path('/'+type+'/'+act_id);
+// $location.path('/'+type+'/'+act_id);
+ $location.path("/"+type).search({id: act_id});
};
//切换 按钮
diff --git a/public/javascripts/wechat/controllers/project_invite_code.js b/public/javascripts/wechat/controllers/project_invite_code.js
index dea2e9d64..a68bf430b 100644
--- a/public/javascripts/wechat/controllers/project_invite_code.js
+++ b/public/javascripts/wechat/controllers/project_invite_code.js
@@ -13,9 +13,12 @@ app.controller('ProjectInviteCodeController', ['$scope','$http', '$routeParams',
console.log(response.data);
vm.project = response.data.data;
- var desc = "项目邀请:"+vm.project.name+" 项目";
+ var desc = "您的好友邀请您加入项目:【"+vm.project.name+"】,和小伙伴一起踏上便捷的研发之旅吧!";
+ var link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+window.g_appid+
+ "&redirect_uri="+window.g_localhost+"/wechat/user_activities?id="+vm.project.id+
+ "&response_type=code&scope=snsapi_base&state=project_invite_code&connect_redirect=1#wechat_redirect";
- common.wxConfig("",desc,"");
+ common.wxConfig("",desc,"",link);
// wx.ready(function(){
// wx.onMenuShareTimeline({
diff --git a/public/javascripts/wechat/controllers/project_list.js b/public/javascripts/wechat/controllers/project_list.js
index 6ff7495e4..e716de0a9 100644
--- a/public/javascripts/wechat/controllers/project_list.js
+++ b/public/javascripts/wechat/controllers/project_list.js
@@ -3,8 +3,10 @@
*/
-app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms',
- function ($scope, config, auth, $http, $location, alertService,rms) {
+app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$location', 'alertService','rms','common',
+ function ($scope, config, auth, $http, $location, alertService,rms,common) {
+// common.checkLogin();
+
var vm = $scope;
// vm.projects = rms.get('projects') || [];
vm.projects = [];
diff --git a/public/javascripts/wechat/controllers/reg.js b/public/javascripts/wechat/controllers/reg.js
index 9600e9dbf..1247cd931 100644
--- a/public/javascripts/wechat/controllers/reg.js
+++ b/public/javascripts/wechat/controllers/reg.js
@@ -1,5 +1,5 @@
-app.controller('RegController', ['$scope', '$http', '$location', 'alertService','$location',
- function ($scope, $http, $location, alertService, $location) {
+app.controller('RegController', ['$scope', '$http', '$location', 'alertService','$location','wx',
+ function ($scope, $http, $location, alertService, $location,wx) {
var vm = $scope;
vm.errDialog = alertService.create();
@@ -35,7 +35,8 @@ app.controller('RegController', ['$scope', '$http', '$location', 'alertService',
} else {
vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){
// $location.path("/activities");
- window.WeixinJSBridge.call('closeWindow');
+// window.WeixinJSBridge.call('closeWindow');
+ wx.closeWindow();
});
}
}, function (response) {
diff --git a/public/javascripts/wechat/controllers/review_class_member.js b/public/javascripts/wechat/controllers/review_class_member.js
index 44704c32d..aee8d683a 100644
--- a/public/javascripts/wechat/controllers/review_class_member.js
+++ b/public/javascripts/wechat/controllers/review_class_member.js
@@ -1,6 +1,8 @@
-app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
+app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
var vm = $scope;
// vm.current_edit_member = rms.get('current_edit_member');
@@ -78,6 +80,11 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
};
vm.goClassMemberList = function(){
- $location.path("/class").search({id: course_id,tag: 1});
+ if(vm.current_course.is_member){
+ $location.path("/class").search({id: course_id,tag: 1});
+ }
+ else{
+ $location.path("/class_list");
+ }
};
}] );
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/review_project_member.js b/public/javascripts/wechat/controllers/review_project_member.js
index 2428c09d0..5c652050f 100644
--- a/public/javascripts/wechat/controllers/review_project_member.js
+++ b/public/javascripts/wechat/controllers/review_project_member.js
@@ -1,6 +1,8 @@
-app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms', function($scope, $http, auth, config, alertService, $location,$routeParams, rms){
+app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
var vm = $scope;
// vm.current_edit_member = rms.get('current_edit_member');
@@ -90,6 +92,11 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con
rms.save("review_master_members",[]);
rms.save("review_develop_members",[]);
rms.save("tab_num",null);
- $location.path("/project").search({id: project_id,tag: 1});
+ if(vm.current_project.is_member){
+ $location.path("/project").search({id: project_id,tag: 1});
+ }
+ else{
+ $location.path("/project_list")
+ }
};
}] );
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/send_class_list.js b/public/javascripts/wechat/controllers/send_class_list.js
index bc81cfc08..ead0860f5 100644
--- a/public/javascripts/wechat/controllers/send_class_list.js
+++ b/public/javascripts/wechat/controllers/send_class_list.js
@@ -1,4 +1,6 @@
-app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', 'rms', function($scope, $http, $routeParams, config, auth, alertService,rms){
+app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', 'rms','common', function($scope, $http, $routeParams, config, auth, alertService,rms,common){
+// common.checkLogin();
+
var vm = $scope;
var send_id = $routeParams.id;
diff --git a/public/javascripts/wechat/directives/at_delete_link.js b/public/javascripts/wechat/directives/at_delete_link.js
new file mode 100644
index 000000000..15190c327
--- /dev/null
+++ b/public/javascripts/wechat/directives/at_delete_link.js
@@ -0,0 +1,17 @@
+/**
+ * Created by ttang on 2016/8/10.
+ */
+app.directive('atDeleteLink',["$timeout",function(timer){
+ return{
+ restrict: 'A',
+ scope: {},
+ link: function(scope, element){
+ timer(function(){
+ $(".at a").each(function(){
+ var atText = $(this).text();
+ $(this).parent().html(atText);
+ });
+ })
+ }
+ }
+}]);
diff --git a/public/javascripts/wechat/directives/form_validate.js b/public/javascripts/wechat/directives/form_validate.js
index 553560c56..7b5657428 100644
--- a/public/javascripts/wechat/directives/form_validate.js
+++ b/public/javascripts/wechat/directives/form_validate.js
@@ -7,4 +7,18 @@ app.directive('pwdconfirm', function(){
}
}
}
+});
+
+app.directive('unconfirm', function(){
+ return {
+ require: 'ngModel',
+ link: function(scope, elm, attrs, ctrl){
+ ctrl.$validators.unconfirm = function(modelValue, viewValue) {
+ if(viewValue == ""){
+ return true;
+ }
+ return (/^[a-zA-Z\d]\w{0,23}[a-zA-Z\d]{0,1}$/.test(viewValue));
+ }
+ }
+ }
});
\ No newline at end of file
diff --git a/public/javascripts/wechat/directives/input_focus.js b/public/javascripts/wechat/directives/input_focus.js
new file mode 100644
index 000000000..38cc01ec9
--- /dev/null
+++ b/public/javascripts/wechat/directives/input_focus.js
@@ -0,0 +1,14 @@
+/**
+ * Created by ttang on 2016/8/10.
+ */
+app.directive('inputFocus',function(){
+ return{
+ restrict: 'A',
+ scope: {},
+ link: function(scope, element){
+ element.on('click',function(){
+ $("#postInput1").focus();
+ });
+ }
+ }
+});
\ No newline at end of file
diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js
index 7ac0a3bdb..1c40c9c10 100644
--- a/public/javascripts/wechat/others/factory.js
+++ b/public/javascripts/wechat/others/factory.js
@@ -1,394 +1,466 @@
-app.factory('alertService', function(){
- function Alert(){
- this.title = null;
- this.message = null;
- this.visible = null;
- this.cb = null;
- this.invite = "";
- }
-
- Alert.prototype.showMessage = function(title, msg, cb){
- this.message = msg;
- this.title = title;
- this.visible = true;
- this.cb = cb;
- this.invite = "";
- }
-
- Alert.prototype.dismiss = function(){
- this.message = null;
- this.title = null;
- this.visible = false;
- this.invite = "";
- if(this.cb) {this.cb();}
- }
-
- return {
- create: function(){
- return new Alert();
- }
- }
-});
-
-app.factory('wx', ['$window', function($window){
- var wechat = $window.wx;
- return wechat;
-}]);
-
-app.factory('auth', ['$http','$routeParams', '$q', 'session', 'config',function($http,$routeParams, $q, session,config){
- //是否已经绑定
- var isBind = function(){
- var defer = $q.defer();
-
- var token = getToken();
- if(token && token.length>10){
- defer.resolve(token);
- } else {
- var code = window.g_code || $routeParams.code || session.get("code");
- $http.post(
- '/wechat/get_bind',
- {} ///不用传code了,都由服务器来处理
- ).then(function(response){
- if(response.data.status!=0){
- defer.reject(response.data.message);
- }else {
- session.save("token", response.data.token);
- defer.resolve(response.data.token);
- }
- }).catch(function(e){
- defer.reject(e);
- });
- }
-
- return defer.promise;
- }
-
- var getToken = function(){
- return 'token';//session.get("token");
- }
- return {get_bind: isBind, token: getToken};
-}]);
-
-app.factory("session", function(){
- return {
- save: function(key,value){
- sessionStorage.setItem(key,value);
- },
- get: function(key){
- return sessionStorage.getItem(key);
- }
- }
-});
-
-app.factory('rms', function(){
- var _saveStorage = {};
- var save = function(key, value){
- _saveStorage[key] = value;
- };
-
- var get = function(key){
- return _saveStorage[key];
- };
-
- return {save: save, get: get};
-});
-
-app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx', function($http, auth, $routeParams,rms,config,wx){
- var addCommonReply = function(id, type, data, cb){
-
- if(!data.comment || data.comment.length<=0){
- return;
- }
-
- var temp = data.comment.replace(/\n/g,' ');
-
- var userInfo = {
- type: type,
- content: temp,
- token: auth.token()
- };
- //回复按钮禁用
- data.disabled = true;
-
- $http({
- method: 'POST',
- url: apiUrl+ "new_comment/"+id,
- data: userInfo
- }).then(function successCallback(response) {
- //alert("提交成功");
- //数据提交完成,回复按钮启用
- data.disabled = false;
- if(typeof cb === 'function'){
- cb();
- }
-
- //保证内外回复数一致
- activities = rms.get("activities") || [];
- course_activities = rms.get("course_activities") || [];
- project_activities = rms.get("project_activities") || [];
- for(var i in activities){
- if(activities[i].act_id == id){
- activities[i].reply_count += 1;
- break;
- }
- }
- for(var i in course_activities){
- if(course_activities[i].act_id == id){
- course_activities[i].reply_count += 1;
- break;
- }
- }
- for(var i in project_activities){
- if(project_activities[i].act_id == id){
- project_activities[i].reply_count += 1;
- break;
- }
- }
- rms.save("activities",activities);
- rms.save("course_activities",course_activities);
- rms.save("project_activities",project_activities);
-
- }, function errorCallback(response) {
- });
- };
-
-// var loadCommonData = function(id, type,replytype,page){
-// return $http({
-// method: 'GET',
-// url: apiUrl+ type + "/" + id+"?token="+auth.token(),
-// })
-// };
-
- var loadCommonData = function(id, type,replytype,page){
- return $http({
- method: 'POST',
- url: apiUrl+ type + "/" + id,
- dataType: 'jsonp',
- data:{token:auth.token(),type:replytype,page:page}
- })
- };
-
- var addCommonPraise = function(act){
-// act.praise_count += 1;
-// act.has_praise = true;
-
- $http({
- method: 'POST',
- url: apiUrl + "praise/" + act.act_id,
- data:{token:auth.token(),type:act.act_type}
- }).then(function successCallback(response) {
- console.log(response.data);
- }, function errorCallback(response) {
- });
-
- };
-
- var decreaseCommonPraise = function(act){
-// act.praise_count -= 1;
-// act.has_praise = false;
- $http({
- method: 'POST',
- url: apiUrl + "praise/" + act.act_id,
- data:{token:auth.token(),type:act.act_type}
- }).then(function successCallback(response) {
- console.log(response.data);
- }, function errorCallback(response) {
- });
- };
-
- var init = function(args){
- args.scope.formData = {comment: ''};
- var loadData = function(id,replytype,page){
- loadCommonData(id, args.type,replytype,page).then(function successCallback(response) {
- console.log(response.data);
- //--------------分享内容定制-------------
- var tmptile = "分享动态";
- var imgUrl = "";
-
- if(response.data.data.title){
- tmptile = response.data.data.title;
- }
-
- var tmpname = "匿名用户";
-
- if(response.data.data.user){
- tmpname = response.data.data.user.realname;
- imgUrl = window.g_localhost+response.data.data.user.img_url;
- }
-
- if(response.data.data.author){
- tmpname = response.data.data.author.realname;
- imgUrl = window.g_localhost+response.data.data.author.img_url;
- }
-
- var desc = ""
- if(response.data.data.content){
- desc = response.data.data.content.replace(/<[^>]+>/g,"").replace(/\s*/g,"").replace(/ /g,"");
- }
-
- if(response.data.data.description){
- desc = response.data.data.description.replace(/<[^>]+>/g,"").replace(/\s*/g,"").replace(/ /g,"");
- }
-
- if(desc.length > 30){
- desc = desc.substring(0,30)+"...";
- }
-
- var title = tmpname+":"+tmptile;
- console.log("desc = "+desc);
- console.log("imgUrl= "+imgUrl);
-
- wxConfig(title,desc,imgUrl);
-
- //--------------分享内容定制-------------
- args.loadCallback(response.data);
- }, function errorCallback(response) {
- });
- };
-
- loadData(args.id,0,0);
- args.scope.addReply = function(data){
- console.log(data.comment);
- addCommonReply(args.id, args.replyType, data, function(){
- args.scope.formData = {comment: ''};
- loadData(args.id,0,0);
- if(typeof args.replyCallback === 'function'){
- args.replyCallback();
- }
- });
- };
-
-// 动态详情界面点赞与动态界面的数据要同步 保证进入详情点赞后出来显示一致
- args.scope.addPraise = function(act){
- activities = rms.get("activities") || [];
- course_activities = rms.get("course_activities") || [];
- project_activities = rms.get("project_activities") || [];
- for(var i in activities){
- if(activities[i].act_id == act.act_id){
- activities[i].praise_count += 1;
- activities[i].has_praise = true;
- break;
- }
- }
- for(var i in course_activities){
- if(course_activities[i].act_id == act.act_id){
- course_activities[i].praise_count += 1;
- course_activities[i].has_praise = true;
- break;
- }
- }
- for(var i in project_activities){
- if(project_activities[i].act_id == act.act_id){
- project_activities[i].praise_count += 1;
- project_activities[i].has_praise = true;
- break;
- }
- }
- rms.save("activities",activities);
- rms.save("course_activities",course_activities);
- rms.save("project_activities",project_activities);
-
- act.praise_count += 1;
- act.has_praise = true;
- addCommonPraise(act);
- };
-
- args.scope.decreasePraise = function(act){
- activities = rms.get("activities") || [];
- course_activities = rms.get("course_activities") || [];
- project_activities = rms.get("project_activities") || [];
- for(var i in activities){
- if(activities[i].act_id == act.act_id){
- activities[i].praise_count -= 1;
- activities[i].has_praise = false;
- break;
- }
- }
- for(var i in course_activities){
- if(course_activities[i].act_id == act.act_id){
- course_activities[i].praise_count -= 1;
- course_activities[i].has_praise = false;
- break;
- }
- }
- for(var i in project_activities){
- if(project_activities[i].act_id == act.act_id){
- project_activities[i].praise_count -= 1;
- project_activities[i].has_praise = false;
- break;
- }
- }
- rms.save("activities",activities);
- rms.save("course_activities",course_activities);
- rms.save("project_activities",project_activities);
-
- act.praise_count -= 1;
- act.has_praise = false;
- decreaseCommonPraise(act);
- };
-
- args.scope.showMoreReply = function(replytype,data){
- if(!data.page){
- data.page = 1;
- }
- else{
- data.page = data.page + 1;
- }
-
- loadCommonData(data.id, args.type,replytype,data.page).then(function successCallback(response) {
- args.loadCallback(response.data);
- }, function errorCallback(response) {
- });
- };
-
- args.scope.commentreply_path = config.rootPath+ 'templates/comment_reply.html';
-
- };
-
- var wxConfig = function(title,desc,imgUrl){
-
- if(title == null || title == ""){
- title = 'Trustie创新实践平台';
- }
-
- if(desc == null || desc == ""){
- desc = 'Trustie创新实践平台';
- }
-
- if(imgUrl == null || imgUrl == ""){
- imgUrl = 'http://www.trustie.net/images/logo2.png';
- }
-
- wx.ready(function(){
- wx.onMenuShareTimeline({
- title: title, // 分享标题
-// link: 'http://www.trustie.net/', // 分享链接
- imgUrl: imgUrl, // 分享图标
- success: function () {
- console.log("share successed.");
- },
- cancel: function () {
- console.log("share canceled.");
- }
- });
-
- wx.onMenuShareAppMessage({
- title: title, // 分享标题
- desc: desc, // 分享描述
-// link: '', // 分享链接
-// imgUrl: '', // 分享图标
- imgUrl: imgUrl, // 分享图标
-// type: '', // 分享类型,music、video或link,不填默认为link
-// dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
- success: function () {
- // 用户确认分享后执行的回调函数
- },
- cancel: function () {
- // 用户取消分享后执行的回调函数
- }
- });
- });
- };
-
- return {init: init, addCommonReply: addCommonReply, loadCommonData: loadCommonData, addCommonPraise: addCommonPraise, decreaseCommonPraise: decreaseCommonPraise, wxConfig: wxConfig};
-}]);
+app.factory('alertService', function(){
+ function Alert(){
+ this.title = null;
+ this.message = null;
+ this.visible = null;
+ this.cb = null;
+ this.invite = "";
+ }
+
+ Alert.prototype.showMessage = function(title, msg, cb){
+ this.message = msg;
+ this.title = title;
+ this.visible = true;
+ this.cb = cb;
+ this.invite = "";
+ }
+
+ Alert.prototype.dismiss = function(){
+ this.message = null;
+ this.title = null;
+ this.visible = false;
+ this.invite = "";
+ if(this.cb) {this.cb();}
+ }
+
+ return {
+ create: function(){
+ return new Alert();
+ }
+ }
+});
+
+app.factory('wx', ['$window', function($window){
+ var wechat = $window.wx;
+ return wechat;
+}]);
+
+app.factory('auth', ['$http','$routeParams', '$q', 'session', 'config',function($http,$routeParams, $q, session,config){
+ //是否已经绑定
+ var isBind = function(){
+ var defer = $q.defer();
+
+ var token = getToken();
+ if(token && token.length>10){
+ defer.resolve(token);
+ } else {
+ var code = window.g_code || $routeParams.code || session.get("code");
+ $http.post(
+ '/wechat/get_bind',
+ {} ///不用传code了,都由服务器来处理
+ ).then(function(response){
+ if(response.data.status!=0){
+ defer.reject(response.data.message);
+ }else {
+ session.save("token", response.data.token);
+ defer.resolve(response.data.token);
+ }
+ }).catch(function(e){
+ defer.reject(e);
+ });
+ }
+
+ return defer.promise;
+ }
+
+ var getToken = function(){
+ return 'token';//session.get("token");
+ }
+ return {get_bind: isBind, token: getToken};
+}]);
+
+app.factory("session", function(){
+ return {
+ save: function(key,value){
+ sessionStorage.setItem(key,value);
+ },
+ get: function(key){
+ return sessionStorage.getItem(key);
+ }
+ }
+});
+
+app.factory('rms', function(){
+ var _saveStorage = {};
+ var save = function(key, value){
+ _saveStorage[key] = value;
+ };
+
+ var get = function(key){
+ return _saveStorage[key];
+ };
+
+ return {save: save, get: get};
+});
+
+app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$location', function($http, auth, $routeParams,rms,config,wx,$location){
+ var addCommonReply = function(id, type, data,args, cb){
+ //先判断有没有绑定
+// $http.post(
+// '/wechat/is_bind',
+// {} ///不用传code了,都由服务器来处理
+// ).then(function(response){
+// console.log(response.data);
+// if(response.data.status != 0){
+// $location.path("/login_tip");
+// }
+// });
+
+ if(!data.comment || data.comment.length<=0){
+ return;
+ }
+
+ var temp = data.comment.replace(/\n/g,' ');
+
+ var userInfo = {
+ type: type,
+ content: temp,
+ token: auth.token()
+ };
+ //回复按钮禁用
+ data.disabled = true;
+
+ $http({
+ method: 'POST',
+ url: apiUrl+ "new_comment/"+id,
+ data: userInfo
+ }).then(function successCallback(response) {
+ //alert("提交成功");
+ //数据提交完成,回复按钮启用
+ console.log(response);
+ if(response.data.status == -1){
+ console.log("回复失败!");
+ data.comment = "";
+ if(response.data.tip == 0){
+ args.scope.replytip = "您不是该私有班级成员,不能回复";
+ }
+ else{
+ args.scope.replytip = "您不是该私有项目成员,不能回复";
+ }
+ return;
+ }
+
+ data.disabled = false;
+ if(typeof cb === 'function'){
+ cb(response.data.subscribe);
+ }
+
+ //保证内外回复数一致
+ activities = rms.get("activities") || [];
+ course_activities = rms.get("course_activities") || [];
+ project_activities = rms.get("project_activities") || [];
+ for(var i in activities){
+ if(activities[i].act_id == id){
+ activities[i].reply_count += 1;
+ break;
+ }
+ }
+ for(var i in course_activities){
+ if(course_activities[i].act_id == id){
+ course_activities[i].reply_count += 1;
+ break;
+ }
+ }
+ for(var i in project_activities){
+ if(project_activities[i].act_id == id){
+ project_activities[i].reply_count += 1;
+ break;
+ }
+ }
+ rms.save("activities",activities);
+ rms.save("course_activities",course_activities);
+ rms.save("project_activities",project_activities);
+
+ }, function errorCallback(response) {
+ });
+ };
+
+// var loadCommonData = function(id, type,replytype,page){
+// return $http({
+// method: 'GET',
+// url: apiUrl+ type + "/" + id+"?token="+auth.token(),
+// })
+// };
+
+ var loadCommonData = function(id, type,replytype,page){
+ return $http({
+ method: 'POST',
+ url: apiUrl+ type + "/" + id,
+ dataType: 'jsonp',
+ data:{token:auth.token(),type:replytype,page:page}
+ })
+ };
+
+ var addCommonPraise = function(act){
+// act.praise_count += 1;
+// act.has_praise = true;
+
+ $http({
+ method: 'POST',
+ url: apiUrl + "praise/" + act.act_id,
+ data:{token:auth.token(),type:act.act_type}
+ }).then(function successCallback(response) {
+ console.log(response.data);
+ }, function errorCallback(response) {
+ });
+
+ };
+
+ var decreaseCommonPraise = function(act){
+// act.praise_count -= 1;
+// act.has_praise = false;
+ $http({
+ method: 'POST',
+ url: apiUrl + "praise/" + act.act_id,
+ data:{token:auth.token(),type:act.act_type}
+ }).then(function successCallback(response) {
+ console.log(response.data);
+ }, function errorCallback(response) {
+ });
+ };
+
+ var init = function(args){
+ args.scope.replytip = "输入回复内容~";
+ args.scope.formData = {comment: ''};
+ var loadData = function(id,replytype,page){
+ loadCommonData(id, args.type,replytype,page).then(function successCallback(response) {
+ console.log(response.data);
+ //--------------分享内容定制-------------
+ var tmptile = "分享动态";
+ var imgUrl = "";
+
+ if(response.data.data.title){
+ tmptile = response.data.data.title;
+ }
+
+ var tmpname = "匿名用户";
+
+ if(response.data.data.user){
+ tmpname = response.data.data.user.realname;
+ imgUrl = window.g_localhost+response.data.data.user.img_url;
+ }
+
+ if(response.data.data.author){
+ tmpname = response.data.data.author.realname;
+ imgUrl = window.g_localhost+response.data.data.author.img_url;
+ }
+
+ var desc = ""
+ if(response.data.data.content){
+ desc = response.data.data.content.replace(/<[^>]+>/g,"").replace(/\s*/g,"").replace(/ /g,"");
+ }
+
+ if(response.data.data.description){
+ desc = response.data.data.description.replace(/<[^>]+>/g,"").replace(/\s*/g,"").replace(/ /g,"");
+ }
+
+ if(desc.length > 30){
+ desc = desc.substring(0,30)+"...";
+ }
+
+ var title = tmpname+":"+tmptile;
+ console.log("desc = "+desc);
+ console.log("imgUrl= "+imgUrl);
+
+ var link = "";
+
+ if(args.urlName == "discussion"){
+ var urlName = response.data.type_name + "_discussion";
+ link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+window.g_appid +
+ "&redirect_uri="+window.g_localhost+"/wechat/user_activities?id="+response.data.data.act_id+
+ "&response_type=code&scope=snsapi_userinfo&state="+urlName+"&connect_redirect=1#wechat_redirect";
+ }
+ else{
+ link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+window.g_appid +
+ "&redirect_uri="+window.g_localhost+"/wechat/user_activities?id="+response.data.data.act_id+
+ "&response_type=code&scope=snsapi_userinfo&state="+args.urlName+"&connect_redirect=1#wechat_redirect";
+ }
+
+// if(args.urlName == "discussion"){
+// var urlName = response.data.type_name + "_discussion";
+// link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d" +
+// "&redirect_uri=https://test.forge.trustie.net/wechat/user_activities?id="+response.data.data.act_id+
+// "&response_type=code&scope=snsapi_base&state="+urlName+"&connect_redirect=1#wechat_redirect";
+// }
+// else{
+// link = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d" +
+// "&redirect_uri=https://test.forge.trustie.net/wechat/user_activities?id="+response.data.data.act_id+
+// "&response_type=code&scope=snsapi_base&state="+args.urlName+"&connect_redirect=1#wechat_redirect";
+// }
+
+ console.log("link= "+link);
+
+ wxConfig(title,desc,imgUrl,link);
+
+ //--------------分享内容定制-------------
+ args.loadCallback(response.data);
+ }, function errorCallback(response) {
+ });
+ };
+
+ loadData(args.id,0,0);
+ args.scope.addReply = function(data){
+ console.log(data.comment);
+ addCommonReply(args.id, args.replyType, data,args, function(subscribe){
+ args.scope.formData = {comment: ''};
+ if(subscribe == 0){
+ $location.path("/login_tip");
+ return;
+ }
+ else{
+ loadData(args.id,0,0);
+ }
+
+ if(typeof args.replyCallback === 'function'){
+ args.replyCallback();
+ }
+ });
+ };
+
+// 动态详情界面点赞与动态界面的数据要同步 保证进入详情点赞后出来显示一致
+ args.scope.addPraise = function(act){
+ activities = rms.get("activities") || [];
+ course_activities = rms.get("course_activities") || [];
+ project_activities = rms.get("project_activities") || [];
+ for(var i in activities){
+ if(activities[i].act_id == act.act_id){
+ activities[i].praise_count += 1;
+ activities[i].has_praise = true;
+ break;
+ }
+ }
+ for(var i in course_activities){
+ if(course_activities[i].act_id == act.act_id){
+ course_activities[i].praise_count += 1;
+ course_activities[i].has_praise = true;
+ break;
+ }
+ }
+ for(var i in project_activities){
+ if(project_activities[i].act_id == act.act_id){
+ project_activities[i].praise_count += 1;
+ project_activities[i].has_praise = true;
+ break;
+ }
+ }
+ rms.save("activities",activities);
+ rms.save("course_activities",course_activities);
+ rms.save("project_activities",project_activities);
+
+ act.praise_count += 1;
+ act.has_praise = true;
+ addCommonPraise(act);
+ };
+
+ args.scope.decreasePraise = function(act){
+ activities = rms.get("activities") || [];
+ course_activities = rms.get("course_activities") || [];
+ project_activities = rms.get("project_activities") || [];
+ for(var i in activities){
+ if(activities[i].act_id == act.act_id){
+ activities[i].praise_count -= 1;
+ activities[i].has_praise = false;
+ break;
+ }
+ }
+ for(var i in course_activities){
+ if(course_activities[i].act_id == act.act_id){
+ course_activities[i].praise_count -= 1;
+ course_activities[i].has_praise = false;
+ break;
+ }
+ }
+ for(var i in project_activities){
+ if(project_activities[i].act_id == act.act_id){
+ project_activities[i].praise_count -= 1;
+ project_activities[i].has_praise = false;
+ break;
+ }
+ }
+ rms.save("activities",activities);
+ rms.save("course_activities",course_activities);
+ rms.save("project_activities",project_activities);
+
+ act.praise_count -= 1;
+ act.has_praise = false;
+ decreaseCommonPraise(act);
+ };
+
+ args.scope.showMoreReply = function(replytype,data){
+ if(!data.page){
+ data.page = 1;
+ }
+ else{
+ data.page = data.page + 1;
+ }
+
+ loadCommonData(data.id, args.type,replytype,data.page).then(function successCallback(response) {
+ args.loadCallback(response.data);
+ }, function errorCallback(response) {
+ });
+ };
+
+ args.scope.commentreply_path = config.rootPath+ 'templates/comment_reply.html';
+
+ };
+
+ var wxConfig = function(title,desc,imgUrl,link){
+
+ if(title == null || title == ""){
+ title = 'Trustie创新实践平台';
+ }
+
+ if(desc == null || desc == ""){
+ desc = 'Trustie创新实践平台';
+ }
+
+ if(imgUrl == null || imgUrl == ""){
+ imgUrl = window.g_localhost+'/images/wechat/wx_logo.jpg';
+ }
+
+ wx.ready(function(){
+ wx.onMenuShareTimeline({
+ title: title, // 分享标题
+ link: link, // 分享链接
+ imgUrl: imgUrl, // 分享图标
+ success: function () {
+ console.log("share successed.");
+ },
+ cancel: function () {
+ console.log("share canceled.");
+ }
+ });
+
+ wx.onMenuShareAppMessage({
+ title: title, // 分享标题
+ desc: desc, // 分享描述
+ link: link, // 分享链接
+// imgUrl: '', // 分享图标
+ imgUrl: imgUrl, // 分享图标
+// type: '', // 分享类型,music、video或link,不填默认为link
+// dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
+ success: function () {
+ // 用户确认分享后执行的回调函数
+ },
+ cancel: function () {
+ // 用户取消分享后执行的回调函数
+ }
+ });
+ });
+ };
+
+ var checkLogin = function(){
+ $http.post(
+ '/wechat/is_bind',
+ {} ///不用传code了,都由服务器来处理
+ ).then(function(response){
+ console.log(response.data);
+ if(response.data.status != 0){
+ $location.path("/login");
+ return;
+ }
+ });
+ };
+
+ return {init: init, addCommonReply: addCommonReply, loadCommonData: loadCommonData, addCommonPraise: addCommonPraise, decreaseCommonPraise: decreaseCommonPraise, wxConfig: wxConfig, checkLogin: checkLogin};
+}]);
diff --git a/public/javascripts/wechat/others/routes.js b/public/javascripts/wechat/others/routes.js
index 70d1491f4..7311c66c1 100644
--- a/public/javascripts/wechat/others/routes.js
+++ b/public/javascripts/wechat/others/routes.js
@@ -23,13 +23,13 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
controller: 'RegController'
})
.when('/activites', makeRoute('activities.html', 'ActivityController'))
- .when('/issues/:id', makeRoute('issue_detail.html', 'IssueController'))
- .when('/project_discussion/:id', makeRoute('project_discussion.html', 'DiscussionController'))
- .when('/homework/:id', makeRoute('homework_detail.html', 'HomeworkController'))
- .when('/course_notice/:id', makeRoute('course_notice.html', 'CourseNoticeController'))
- .when('/course_discussion/:id', makeRoute('course_discussion.html', 'DiscussionController'))
- .when('/journal_for_message/:id', makeRoute('jour_message_detail.html', 'JournalsController'))
- .when('/blog_comment/:id', makeRoute('blog_detail.html', 'BlogController'))
+ .when('/issues', makeRoute('issue_detail.html', 'IssueController'))
+ .when('/project_discussion', makeRoute('project_discussion.html', 'DiscussionController'))
+ .when('/homework', makeRoute('homework_detail.html', 'HomeworkController'))
+ .when('/course_notice', makeRoute('course_notice.html', 'CourseNoticeController'))
+ .when('/course_discussion', makeRoute('course_discussion.html', 'DiscussionController'))
+ .when('/journal_for_message', makeRoute('jour_message_detail.html', 'JournalsController'))
+ .when('/blog_comment', makeRoute('blog_detail.html', 'BlogController'))
.when('/class', makeRoute('class.html', 'ClassController'))
.when('/new_class', makeRoute('new_class.html', 'NewClassController'))
.when('/edit_class', makeRoute('edit_class.html', 'EditClassController'))
@@ -47,6 +47,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
.when('/project_invite_code', {templateUrl: rootPath + 'project_invite_code.html', controller: 'ProjectInviteCodeController'})
.when('/join_project', makeRoute('join_project.html', 'JoinProjectController'))
.when('/review_project_member', makeRoute('review_project_member.html', 'ReviewProjectMemberController'))
+ .when('/login_tip', makeRoute('login_tip.html', 'LoginTipController'))
.otherwise({
redirectTo: '/activites'
});
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index f704a3f0d..fbce13354 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -4,7 +4,7 @@
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
div,img,tr,td,table{ border:0;}
-table,tr,td{border:0;cellspacing:0; cellpadding:0;}
+table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
blockquote {
border:1px solid #d4d4d4;
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 4c4019593..1c7563a58 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -160,9 +160,9 @@ div.thumbnails div {background:#fff;display:inline-block;margin-right:2px;}
.repos_files ul:hover{ background:#ffffdd;}
.repos_t_c li{ text-align:center;}
.pic_stats{display:block; background:url(/images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
-.tree-age{width:10%; text-align:right;}
+.tree-age{width:15%; text-align:right;}
.tree-author{width:10%; text-align:left;}
-.tree-comments{width:40%; text-align:left;}
+.tree-comments{width:35%; text-align:left;}
/* 里程碑 */
.roadmap_box{ background:#f8f8f8; width:648px; padding:10px; margin-top:5px; border:1px solid #ddd; color:#555;}
@@ -372,7 +372,7 @@ tr.entry td.filename_no_report { width: 40%; }
tr.entry td.size { text-align: right; font-size: 90%; }
tr.entry td.revision, tr.entry td.author { text-align: center; }
tr.entry td.age { text-align: right; }
-tr.entry.file td.filename a { margin-center: 16px; }
+tr.entry.file td.filename a { }
tr.entry.file td.filename_no_report a { margin-left: 16px; }
tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}
@@ -511,8 +511,9 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
.analysis-result-name {width:200px;}
.analysis-result-version {width:90px; text-align:right;}
.analysis-result-loc {width:60px; text-align:right;}
-.analysis-result-debt {width:160px; text-align:right;}
+.analysis-result-debt {width:80px; text-align:right;}
.analysis-result-time {width:150px; text-align:right;}
+.analysis-result-edit {width:80px; text-align:right;}
.analysis-name-icon {background:url(/images/code-analysis-icon.png) -2px -148px no-repeat; width:16px; height:16px; display:inline-block; vertical-align:middle;}
@@ -523,7 +524,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
.project-merge-banner li a {padding:14px; font-size:14px; color:#555; display:inline-block;}
.project-number-dot {display:inline-block; min-width:10px; padding:3px 5px; font-size:12px; color:#888; line-height:1; vertical-align:middle; white-space:nowrap; text-align:center; background-color:#eee; border-radius:10px; margin-left:5px;}
.project-merge-content {}
-.project-merge-content li {padding:10px; margin:0 -10px; background-color:#f9f9f9; border-bottom:1px solid #e5e5e5;}
+.project-merge-content>li {padding:10px; margin:0 -10px; background-color:#f9f9f9; border-bottom:1px solid #e5e5e5;}
.no-merge-content {padding:10px 15px; color:#888;}
.new-merge-request {border-bottom:1px solid #ddd; padding-bottom:10px;}
.new-merge-wrap {font-size:13px; color:#484848; border-bottom:1px solid #ddd; padding:10px 0;}
@@ -540,4 +541,42 @@ a:hover.upload_btn_grey{background:#8a8a8a;}
.merge-commit-code {width:150px; float:left; text-align:right;}
.merge-show {margin:-10px -10px 0 -10px; padding:10px; line-height:36px; border-bottom:1px solid #ddd;}
.open-status {color:#fff; padding:0 16px; background-color:#3b94d6; border-radius:2px; display:inline-block;}
-.merge-commit-option {padding:12px; border:1px solid #ddd; background-color:#f9f9f9; border-radius:2px;}
\ No newline at end of file
+.merge-commit-option {padding:12px; border:1px solid #ddd; background-color:#f9f9f9; border-radius:2px;}
+.merge-discussion-content {font-size:13px; color: #484848; margin:0 -10px; padding:10px; border-bottom:1px solid #ddd;}
+.merge-discussion-detail {font-size:13px; line-height:1.5em; color:#484848; margin-top:10px;}
+.merge-discussion-automatic {background-color:#fdfdfd;}
+.merge-discussion-input {margin:0 -10px; padding:10px; background-color:#f8f8f8;}
+.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; }
+.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); }
+.new_projectlist_more{ text-align:center;}
+.new_projectlist_more a:hover{ color:#3b94d6;}
+/*新版项目引用的新版课程大纲中的公共样式*/
+.icons_tishi{
+ width: 110px;
+ height: 110px;
+ margin: 135px auto 20px;
+}
+.sy_tab_con_p{
+ font-size: 16px;
+ text-align: center;
+ margin-bottom:100px;
+ color:#888;
+}
+a.sy_btn_green{
+ display:inline-block;
+ color: #fff;
+ background: #60b25e;
+ text-align: center;
+ font-size: 12px;
+ padding:0 15px;
+ height: 30px;
+ line-height: 30px;
+ -webkit-border-radius:3px;
+ -moz-border-radius:3px;
+ -o-border-radius:3px;
+ border-radius:3px;
+}
+a:hover.sy_btn_green{ background: #51a74f;}
\ No newline at end of file
diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css
index 44b1165c6..1d2c106e2 100644
--- a/public/stylesheets/css/structure.css
+++ b/public/stylesheets/css/structure.css
@@ -1,5 +1,3 @@
-/*将header.css文件和public.css,new_user.css中的内容统一*/
-
@charset "utf-8";
/* CSS Document */
@@ -34,7 +32,7 @@ a:hover.search_btn{ background: #0fa9bb;}
a.parent {background: url(/images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;}
a.parent:hover {background: url(/images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;}
a.linkToOrange:hover {color:#fe7d68;}
-#userInfo ul li {positon: relative;}
+#userInfo ul li {position: relative;}
#userInfo ul li ul {display:none;}
#userInfo ul li:hover ul {display:block; position:absolute;}
#userInfo ul li:hover ul li ul {display:none;}
@@ -383,7 +381,7 @@ ul.subNavArrow:hover li ul {display:block;}
.currentDd{color:#0781b4;}
.currentDt{background-color:#fff;}
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
-.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
+.navContent li a{display:block;width:240px;height:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
a.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:18px; padding:0px 5px; padding-top:2px; display:block; margin-top:2px; margin-bottom:5px; float:right; margin-right:5px;line-height:1.4 !important;}
@@ -474,6 +472,7 @@ a.f_grey:hover {color:#000000;}
.shadowbox_news_list{ max-height:400px; overflow:hidden;}
.shadowbox_news_list a{ color:#999;}
.shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;}
+.shadowbox_news_list li:last-child {border-bottom:none;}
.shadowbox_news_list li:hover{ background-color:#eee;}
span.shadowbox_news_user{ color:#3b94d6;}
a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;}
diff --git a/public/stylesheets/sy_public.css b/public/stylesheets/sy_public.css
index e1d3eaf38..deeb36c15 100644
--- a/public/stylesheets/sy_public.css
+++ b/public/stylesheets/sy_public.css
@@ -234,7 +234,7 @@ a.sy_icons_close{
.hw_popup_top a.hw_icons_close{display:block;width:26px; height:26px;background: url(../images/hw/icons_hw.png) 0 -95px no-repeat; transition: all 0s linear;}
.hw_popup_top a:hover.hw_icons_close{background: url(../images/hw/icons_hw.png) -41px -95px no-repeat; }
.hw_popup_con{ width:770px; max-height:770px; margin:0 auto;}
-.hw_popup_txt{width:770px; max-height:700px; margin:15px auto;overflow:auto;}
+.hw_popup_txt{width:770px; max-height:680px; margin:15px auto;overflow:auto;}
/* 题库发送弹框 */
.hw_sendpopup_box{ width:460px;background:#fff;padding-bottom:15px;-webkit-border-radius:5px;-moz-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);-moz-box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5);}
.hw_sendpopup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;}
diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css
index 703c68c61..9e6a9817d 100644
--- a/public/stylesheets/syllabus.css
+++ b/public/stylesheets/syllabus.css
@@ -324,9 +324,10 @@ a.sy_class_option:hover {
height:110px;
}
.sy_class_id{
- width:110px;
- height:80px;
- background:#f1f1f1;
+ width:108px;
+ height:78px;
+ border:1px solid #f1f1f1;
+ background:#fff;
text-align:center;
padding-top:30px;
}
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css
index 8eabdd420..7375fc80c 100644
--- a/public/stylesheets/weui/weixin.css
+++ b/public/stylesheets/weui/weixin.css
@@ -87,6 +87,7 @@ a.underline {text-decoration:underline;}
.btn-disabled {background-color:#ccc !important;}
.btn2 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; margin:18px auto 20px auto; border-radius:50px; display:block;}
.btn3 {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; border-radius:50px; display:block;}
+.btn4 {width:150px; height:40px; line-height:40px; vertical-align:middle; text-align:center; color:#fff; display:inline-block; border-radius:5px;}
.fixed-bottom-btn {position:fixed; bottom:5px; left:50%; transform:translate(-50%,0);}
/*tab*/
@@ -178,7 +179,7 @@ a.underline {text-decoration:underline;}
.invitation-code-wrap {text-align:center; font-size:18px; color:#3b3b3b; padding:16px;}
.share-code-wrap {width:100%; background-color:#efeff4;}
.share-code-btn, .finish-btn {width:145px; height:35px; color:#fff; font-size:15px; line-height:35px; text-align:center; vertical-align:middle; background-color:#ff7239; margin:18px auto 20px auto; border-radius:50px; display:block;}
-.share-code-instruction {max-width:228px; font-size:12px; color:#666; line-height:20px; margin:0 auto;}
+.share-code-instruction {max-width:228px; font-size:12px; color:#666; line-height:20px; margin:20px auto 30px;}
/*20160613班级详情*/
.class-detail-name, .blue-title {width:100%; height:45px; line-height:45px; vertical-align:middle; background-color:#3b94d6; color:#fff; font-size:18px; text-align:center;}
@@ -216,9 +217,10 @@ a.underline {text-decoration:underline;}
.border-bottom-none {border-bottom:none !important;}
.border-top-none {border-top:none !important;}
.students-amount {height:14px; line-height:14px; vertical-align:middle; padding:2px 5px; background-color:#e6e6e6; border-radius:10px;}
+.amount-arrow {height:14px; line-height:14px; vertical-align:middle; margin-top:12px;}
.new-class-btn {font-size:15px; color:#fff; background-color:#3b94d6; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
.join-class-btn {font-size:15px; color:#444; background-color:#ccc; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
-.new-class-input {width:60%; color:#555; height:16px; line-height:16px; vertical-align:middle; border:none; outline:none; padding:8px 0;}
+.new-class-input {width:60%; color:#555; height:16px; line-height:16px; border:none; outline:none; padding:11px 0;}
.class-list-setting {position:absolute; top:11px; right:10px;}
.class-setting-wrap {width:38px; height:38px; position:absolute; top:0; right:0;}
@@ -230,8 +232,7 @@ a.underline {text-decoration:underline;}
.login-box{display:inline-block; width:14px; height:14px; line-height:14px; text-align:center; vertical-align:middle; border:1px solid #ccc; background:#fff; border-radius:3px; color:#fff; cursor:pointer;}
.login-box.checked{background:#63c360; border:1px solid #63c360;}
.login-box.checked:after{content:url(/images/wechat/checked.png);}
-.forget-psw-wrap {width:60px; margin:0 auto;}
-.forget-psw {position:fixed; bottom:10px;}
+.forget-psw-wrap {width:60px; margin:30px auto;}
/*二级回复*/
.mult-reply-container{ border:solid 1px #f3ddb3; background:#fffef4; padding:4px;color:#999;}
@@ -247,4 +248,13 @@ a.underline {text-decoration:underline;}
/*新建说明*/
.new-tip {line-height:2;}
-.new-tip li {position:relative; padding-left:10px;}
\ No newline at end of file
+.new-tip li {position:relative; padding-left:10px;}
+
+/*20160810绑定说明*/
+.ac-wrap {text-align:center;}
+.ac-content {display:inline-block; line-height:2;}
+.ac-content li {position:relative; text-align:left; padding-left:5px;}
+
+/*发布帖子,通知*/
+.full-width-wrap {padding:5px 15px; background-color:#fff; border-top:1px solid #ddd; border-bottom:1px solid #ddd;}
+.full-width-textarea {width:100%; height:180px; line-height:18px; max-height:180px; border:none; resize:none; font-size:13px; color:#555;}
\ No newline at end of file
diff --git a/spec/factories/pull_requests.rb b/spec/factories/pull_requests.rb
new file mode 100644
index 000000000..51a2b94a1
--- /dev/null
+++ b/spec/factories/pull_requests.rb
@@ -0,0 +1,8 @@
+FactoryGirl.define do
+ factory :pull_request do
+ pull_request_id 1
+gpid 1
+user_id 1
+ end
+
+end
diff --git a/spec/models/pull_request_spec.rb b/spec/models/pull_request_spec.rb
new file mode 100644
index 000000000..d7e798e9a
--- /dev/null
+++ b/spec/models/pull_request_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe PullRequest, :type => :model do
+ pending "add some examples to (or delete) #{__FILE__}"
+end