diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1b95ef895..7602b10a5 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -160,7 +160,7 @@ class AdminController < ApplicationController @sort = "" if params[:sort] && (params[:order] == 'name') # courses = School.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc") - school = School.find_by_sql(" SELECT aas.name FROM apply_add_schools aas where aas.status = '0' GROUP BY CONVERT(name USING gbk) #{params[:sort]}, aas.id desc ") + school = School.find_by_sql(" SELECT aas.name FROM apply_add_schools aas where aas.status = '0' ORDER BY CONVERT(aas.name USING gbk) #{params[:sort]}, aas.id asc ") @order = params[:order] @sort = params[:sort] end diff --git a/app/controllers/applied_project_controller.rb b/app/controllers/applied_project_controller.rb index b9824976b..d779c7759 100644 --- a/app/controllers/applied_project_controller.rb +++ b/app/controllers/applied_project_controller.rb @@ -1,44 +1,70 @@ class AppliedProjectController < ApplicationController - + helper :watchers #申请加入项目 def applied_join_project - @user_id = params[:user_id] - @project = Project.find_by_id(params[:project_id]) - if params[:project_join] - if @project - user = User.find @user_id - if user.member_of?(@project) - @status = 3 - else - @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id]) - if @applieds.count == 0 - appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id]) - Mailer.run.applied_project(appliedproject) - @status = 2 - else - @status = 1 - end - end - else - @status = 0 - end - respond_to do |format| - format.js - end - return + if params[:object_id] + @project = Project.find_by_id(params[:object_id]) end + # @user_id = params[:user_id] + # if params[:project_join] + # if @project + # user = User.find @user_id + # if user.member_of?(@project) + # @status = 3 + # else + # @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id]) + # if @applieds.count == 0 + # appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id]) + # Mailer.run.applied_project(appliedproject) + # @status = 2 + # else + # @status = 1 + # end + # end + # else + # @status = 0 + # end + # respond_to do |format| + # format.js + # end + # return + # end + # + # @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id]) + # if @applieds.count == 0 + # appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id]) + # Mailer.run.applied_project(appliedproject) + # end + # + # #redirect_to project_path(params[:project_id]) + # #redirect_to_referer_or {render :text => ( 'applied success.'), :layout => true} + # respond_to do |format| + # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} + # format.js { render :partial => 'set_applied'} + # end + end - @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id]) - if @applieds.count == 0 - appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id]) - Mailer.run.applied_project(appliedproject) + # @flage:提示语标志(1:邀请码错误;2:已经是项目成员; 3:角色没有选择; 4:申请成功) + # role:成员角色 => 0(4:管理人员;5:开发人员;6:报告人员) + # 申请成功则发送消息 + def applied_project_info + if params[:project_id].nil? + @project = Project.where(:invite_code => params[:invite_code]).first + else + @project = Project.find(params[:project_id]) end - - #redirect_to project_path(params[:project_id]) - #redirect_to_referer_or {render :text => ( 'applied success.'), :layout => true} - respond_to do |format| - format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} - format.js { render :partial => 'set_applied'} + if !@project || params[:invite_code].to_s != @project.invite_code + @flag = 1 + elsif User.current.member_of?(@project) + @flag = 2 + elsif params[:member].nil? + @flag = 3 + else + @flag = 4 + role = params[:member] == "member_manager" ? 3 : (params[:member] = "member_developer" ? 4 :5) + applied_project = AppliedProject.create(:user_id => User.current.id, :project_id => @project.id, :role => role) + # 申请成功则给项目管理员发送邮件及发送消息 + Mailer.run.applied_project(applied_project) end end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a38cc8d34..2614b6271 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -23,7 +23,7 @@ class CoursesController < ApplicationController before_filter :can_show_course, :except => [] before_filter :logged_user_by_apptoken,:only => [:show,:feedback] - before_filter :find_course, :except => [ :index, :search, :new,:join,:unjoin, :create, :new_join, :course,:join_private_courses] + before_filter :find_course, :except => [ :index, :search, :new,:join,:unjoin, :create, :new_join, :course,:join_private_courses, :join_course_multi_role] before_filter :authorize_course, :only => [:show, :settings, :update, :course] before_filter :authorize_course_global, :only => [:new,:create] before_filter :toggleCourse, :only => [:finishcourse, :restartcourse] @@ -81,6 +81,22 @@ class CoursesController < ApplicationController end + def join_course_multi_role + if User.current.logged? + cs = CoursesService.new + @user = User.current + join = cs.join_course_roles params,@user + @state = join[:state] + @course = join[:course] + else + @state = 5 #未登录 + end + @object_id = @course.id if @course + respond_to do |format| + format.js + end + end + def unjoin if User.current.logged? cs = CoursesService.new @@ -1136,6 +1152,21 @@ class CoursesController < ApplicationController end end + #切换身份 + def switch_role + members = @course.members.where("user_id = #{params[:user_id]}") + unless members.blank? + #role = MemberRole.where("member_id = #{members.first.id} and role_id = #{params[:role]}").first + curr_role = MemberRole.find_by_member_id_and_role_id(members.first.id, params[:curr_role]) + tar_role = MemberRole.find_by_member_id_and_role_id(members.first.id, params[:tar_role]) + unless (curr_role.nil? || tar_role.nil?) + curr_role.update_column('is_current', 0) + tar_role.update_column('is_current', 1) + end + end + redirect_to course_path(@course) + end + private def update_quotes attachment if attachment.copy_from diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 4dc2c52f5..0a76cfb78 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -17,10 +17,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class MembersController < ApplicationController + helper :users model_object Member - before_filter :find_model_object, :except => [:index, :create, :autocomplete] + before_filter :find_model_object, :except => [:index, :create, :autocomplete, :allow_to_join_project, :refused_allow_to_join_project] #before_filter :find_model_object_contest, :except => [:index, :create, :autocomplete] - before_filter :find_project_from_association, :except => [:index, :create, :autocomplete] + before_filter :find_project_from_association, :except => [:index, :create, :autocomplete, :allow_to_join_project, :refused_allow_to_join_project] before_filter :find_project_by_project_id, :only => [:index, :create, :autocomplete] before_filter :authorize accept_api_auth :index, :show, :create, :update, :destroy @@ -49,6 +50,62 @@ class MembersController < ApplicationController end end + # 同意消息中申请加入项目 + # 之所以role不在参数中传送是考虑到安全问题 + # status(1:申请的消息;2:已操作过该消息(包括同意或者拒绝,消息状态更新);3:决绝消息;4:被拒人收到消息;5:拒绝者收到消息;6:同意后申请人收到消息;7:同意后批准人收到消息) + def allow_to_join_project + @applied_message = AppliedMessage.find(params[:applied_message_id]) + applied_project = @applied_message.applied + user = User.find(@applied_message.applied_user_id) + project = Project.find(applied_project.project_id) + if user.member_of?(project) + @flash_message = "您已经是项目成员了" + @applied_message.update_attribute(:status, 2) + else + ap_role = applied_project.try(:role) + if ap_role + begin + members = [] + user_grades = [] + project_info = [] + members << Member.new(:role_ids => ["#{ap_role}"], :user_id => @applied_message.applied_user_id) + user_grades << UserGrade.new(:user_id => @applied_message.applied_user_id, :project_id => project.id) + role = Role.find(ap_role) + project_info << ProjectInfo.new(:project_id => project.id, :user_id => @applied_message.applied_user_id) if role.allowed_to?(:is_manager) + project.members << members + project.project_infos << project_info + project.user_grades << user_grades unless user_grades.first.user_id.nil? + @applied_message.update_attribute(:status, 2) + # 添加成功后,申请人收到消息 + AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id , + :status => 6, :viewed => true, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id) + # 添加成功后,批准人收到消息 + AppliedMessage.create(:user_id => @applied_message.user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id , + :status => 7, :viewed => true, :applied_user_id => @applied_message.applied_user_id, :role => applied_project.role, :project_id => applied_project.project_id) + rescue Exception => e + puts e + end + end + end + end + + # 同意消息中拒绝加入项目 + # params[:user_id]为申请者ID + # params[:send_id]为拒绝人ID + # status(1:申请的消息;2:已操作过该消息(包括同意或者拒绝,消息状态更新);3:拒绝消息;4:被拒人收到消息;5:拒绝者收到消息;6:同意后申请人收到消息;7:同意后批准人收到消息) + def refused_allow_to_join_project + @applied_message = AppliedMessage.find(params[:applied_message_id]) + @applied_message.update_attribute(:status, 3) + applied_project = @applied_message.applied + # 发送消息给被拒者,user_id对应的收到信息的用户 + AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 4, + :viewed => true, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id) + # 发送消息给拒绝者 + AppliedMessage.create(:user_id => @applied_message.user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 5, + :viewed => true, :applied_user_id => @applied_message.applied_user_id, :role => applied_project.role, :project_id => applied_project.project_id) + applied_project.delete + end + def create if params[:refusal_button] members = [] @@ -154,9 +211,11 @@ class MembersController < ApplicationController user_ids = attrs.delete(:user_ids) user_ids.each do |user_id| member = Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id) - role = Role.find_by_id(params[:membership][:role_ids]) + + role_ids = attrs.delete(:role_ids) + #role = Role.find(params[:membership][:role_ids]) # 这里的判断只能通过角色名,可以弄成常量 - if role && (role.name == "学生" || role.name == "Student") + if role_ids && role_ids.include?("10") StudentsForCourse.create(:student_id => user_id, :course_id =>@course.id) end @@ -252,7 +311,10 @@ class MembersController < ApplicationController if (params[:membership][:role_ids]) role = Role.find(params[:membership][:role_ids][0]) # 这里的判断只能通过角色名,可以弄成常量 - if role.name == "学生" || role.name == "Student" + attrs = params[:membership].dup + role_ids = attrs.delete(:role_ids) + + if role_ids && role_ids.include?("10") StudentsForCourse.create(:student_id => @member.user_id, :course_id =>@course.id) else joined = StudentsForCourse.where('student_id = ? and course_id = ?', @member.user_id,@course.id) @@ -313,6 +375,11 @@ class MembersController < ApplicationController grade.destroy end end + # 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除 + applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => @member.user_id).first + unless applied_projects.nil? + applied_projects.delete + end #移出项目发送消息 ForgeMessage.create(:user_id => @member.user_id, :project_id => @project.id, :forge_message_type => "RemoveFromProject", :viewed => false, :forge_message_id => User.current.id) end diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 80c5a2468..c9873ade4 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -37,7 +37,7 @@ class QualityAnalysisController < ApplicationController quality_an.delete unless quality_an.blank? end # Checks if the given job exists in Jenkins. - unless @client.job.exists?(job_name) + # unless @client.job.exists?(job_name) @g = Gitlab.client branch = params[:branch] language = swith_language_type(params[:language]) @@ -111,7 +111,7 @@ class QualityAnalysisController < ApplicationController end end end - end + # end rescue => e @message = e.message end diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index 38ec3e254..76d149f94 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -187,6 +187,12 @@ class SchoolController < ApplicationController user_extention= User.current.extensions user_extention.school_id = school.id user_extention.save! + + # status=4 向管理员发送信息 + users = User.where(:admin => 1) + users.each do |user| + AppliedMessage.create(:user_id => user.id, :status => 4, :applied_user_id => User.current.id, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name ) + end else data[:result] = 3 end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5e968e854..2f1d6a4db 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -41,7 +41,7 @@ class UsersController < ApplicationController :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource, :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction, - :user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist] + :user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list] before_filter :auth_user_extension, only: :show #before_filter :rest_user_score, only: :show #before_filter :select_entry, only: :user_projects @@ -133,6 +133,7 @@ class UsersController < ApplicationController @user_activity_id = params[:user_activity_id] @activity_id = params[:activity_id] @homepage = params[:homepage] + @user_id = params[:user_id] @type = 'BlogComment' when 'OrgDocumentComment' @reply = OrgDocumentComment.find params[:reply_id] @@ -149,6 +150,9 @@ class UsersController < ApplicationController @user_activity_id = params[:user_activity_id] @activity_id = params[:activity_id] @type = 'Issue' + when 'Syllabus' + @reply = JournalsForMessage.find params[:reply_id] + @type = 'Syllabus' end respond_to do |format| format.js @@ -351,15 +355,21 @@ class UsersController < ApplicationController case params[:agree] when 'Y' apply_user = User.find(@msg.course_message_id) - + ids = @msg.content.split(",") # [@msg.content] msg content保存的是申请的职位角色 + integer_ids = [] + ids.each do |role_id| + integer_ids << role_id.to_i + end if apply_user.member_of_course?(Course.find(@msg.course_id)) #将角色改为老师或者教辅 member = Course.find(@msg.course_id).members.where(:user_id=>apply_user.id).all[0] - member.role_ids = [@msg.content] # msg content保存的是申请的职位角色 - #删除为学生的记录 - joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@msg.course_id) - joined.each do |join| - join.delete + member.role_ids = integer_ids + #删除为学生的记录 + unless member.role_ids.include?(10) + joined = StudentsForCourse.where('student_id = ? and course_id = ?', member.user_id,@msg.course_id) + joined.each do |join| + join.delete + end end member.course_group_id = 0 @@ -368,7 +378,7 @@ class UsersController < ApplicationController @msg.update_attributes(:status=>1,:viewed=>1) else members = [] - members << Member.new(:role_ids => [@msg.content.to_i], :user_id => @msg.course_message_id) + members << Member.new(:role_ids => integer_ids, :user_id => @msg.course_message_id) Course.find(@msg.course_id).members << members CourseMessage.create(:user_id => @msg.course_message_id, :course_id => @msg.course_id, :viewed => false,:content=> @msg.content,:course_message_id=>User.current.id,:content=>@msg.content,:course_message_type=>'CourseRequestDealResult',:status=>1) @msg.update_attributes(:status=>1,:viewed=>1) @@ -3225,7 +3235,35 @@ class UsersController < ApplicationController end def user_courselist - @order, @c_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1 + @order, @c_sort, @type, @list_type = 1, 2, 1, 1 + + @my_syllabuses = @user.syllabuses + + sy_courses = @user.courses.visible.where("is_delete =? and tea_id != ?", 0, @user.id) + syllabus_ids = sy_courses.empty? ? '(-1)' : "(" + sy_courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")" + @join_syllabuses = Syllabus.where("id in #{syllabus_ids} and user_id != #{@user.id}") + + @my_syllabuses = syllabus_course_list_sort @my_syllabuses + @join_syllabuses = syllabus_course_list_sort @join_syllabuses + @my_syllabuses = @my_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]} + @join_syllabuses = @join_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]} + + #分页 + # @limit = 10 + # @is_remote = true + # @atta_count = @syllabus.count + # @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1 + # @offset ||= @atta_pages.offset + # @syllabus = paginateHelper @syllabus,@limit + + respond_to do |format| + format.html {render :layout => 'new_base_user'} + end + end + + #课程列表的排序 + def sort_syllabus_list + @order, @c_sort, @type, @list_type = params[:order] || 1, params[:sort] || 1, params[:type] || 1, params[:list_type] || 1 #确定 sort_type if @order.to_i == @type.to_i @@ -3235,40 +3273,48 @@ class UsersController < ApplicationController end sort_name = "updated_at" - sort_type = @c_sort == 1 ? "asc" : "desc" - @courses = @user.courses.visible.where("is_delete =?", 0) - syllabus_ids = @courses.empty? ? '(-1)' : "(" + @courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")" - @syllabus = Syllabus.where("id in #{syllabus_ids} or user_id = #{User.current.id}").order("#{sort_name} #{sort_type}") + if @list_type.to_i == 1 + @syllabuses = @user.syllabuses.order("updated_at desc") + else + sy_courses = @user.courses.visible.where("is_delete =? and tea_id != ?", 0, @user.id) + syllabus_ids = sy_courses.empty? ? '(-1)' : "(" + sy_courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")" + @syllabuses = Syllabus.where("id in #{syllabus_ids} and user_id != #{@user.id}").order("updated_at desc") + end - #根据 作业+资源数排序 - if @order.to_i == 2 + if @order.to_i == 1 #根据 班级更新时间排序 + @syllabuses = syllabus_course_list_sort @syllabuses + @c_sort == 1 ? (@syllabuses = @syllabuses.sort{|x,y| x[:last_update] <=> y[:last_update] }) : (@syllabuses = @syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]}) + @type = 1 + elsif @order.to_i == 2 #根据 作业+资源数排序 @type = 2 - @syllabus.each do |syllabus| + @syllabuses.each do |syllabus| count = 0 - courses = @courses.where("syllabus_id = #{syllabus.id}") + courses = syllabus.courses.not_deleted courses.each do |c| count += (User.current.admin? || User.current.allowed_to?(:as_teacher,c)) ? (c.homework_commons.count + visable_attachemnts_incourse(c).count) : (c.homework_commons.where("publish_time <= '#{Date.today}'").count + visable_attachemnts_incourse(c).count) end syllabus[:infocount] = count end - @c_sort == 1 ? (@syllabus = @syllabus.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@syllabus = @syllabus.sort{|x,y| y[:infocount] <=> x[:infocount]}) - @syllabus = sortby_time_countcommon_nosticky @syllabus,sort_name + @c_sort == 1 ? (@syllabuses = @syllabuses.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@syllabuses = @syllabuses.sort{|x,y| y[:infocount] <=> x[:infocount]}) + @syllabuses = sortby_time_countcommon_nosticky @syllabuses,sort_name else @type = 1 end - #分页 - @limit = 10 - @is_remote = true - @atta_count = @syllabus.count - @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1 - @offset ||= @atta_pages.offset - @syllabus = paginateHelper @syllabus,@limit - respond_to do |format| format.js - format.html {render :layout => 'new_base_user'} + end + end + + #展开课程下的班级 + def expand_courses + @syllabus = Syllabus.where("id = #{params[:syllabus_id]}").first + unless @syllabus.nil? + @courses = @syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") + respond_to do |format| + format.js + end end end @@ -3342,6 +3388,8 @@ class UsersController < ApplicationController when 'Syllabus' obj = Syllabus.where('id = ?', params[:id].to_i).first @journals = obj.journals_for_messages.reorder("created_on desc") + @type = 'Syllabus' + @user_activity_id = params[:div_id].to_i if params[:div_id] when 'JournalsForMessage' obj = JournalsForMessage.where('id = ?', params[:id].to_i).first journals = [] @@ -3358,6 +3406,7 @@ class UsersController < ApplicationController @user_activity_id = params[:div_id].to_i if params[:div_id] @homepage = params[:homepage].to_i @type = 'BlogComment' + @user_id = obj.author_id comments = [] @journals = get_all_children(comments, obj) when 'HomeworkCommon' diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 828739cc4..499272706 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -112,6 +112,10 @@ class WordsController < ApplicationController end @is_in_course = params[:is_in_course].to_i @course_activity = params[:course_activity].to_i + elsif @journal_destroyed.jour_type == 'Syllabus' + @syllabus = Syllabus.find @journal_destroyed.jour_id + @count = @syllabus.journals_for_messages.count + @comments = @syllabus.journals_for_messages.reorder("created_on desc").limit(3) end respond_to do |format| format.js @@ -352,6 +356,35 @@ class WordsController < ApplicationController render_403 end end + + #课程大纲的二级回复 + def reply_to_syllabus + if User.current.logged? + @user = User.current + reply = JournalsForMessage.find params[:id].to_i + @syllabus = Syllabus.find reply.jour_id + if params[:reply_message].size>0 && User.current.logged? && @user + options = {:notes => params[:reply_message], :reply_id => reply.user_id,:user_id => @user.id,:m_parent_id => params[:id].to_i,:m_reply_id => params[:id].to_i} + feedback = Syllabus.add_syllabus_jour(@user, params[:reply_message], reply.jour_id, options) + if (feedback.errors.empty?) + if params[:asset_id] + ids = params[:asset_id].split(',') + update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE + end + @syllabus.update_column('updated_at', Time.now) + @count = @syllabus.journals_for_messages.count + @comments = @syllabus.journals_for_messages.reorder("created_on desc").limit(3) + respond_to do |format| + format.js + end + else + flash[:error] = feedback.errors.full_messages[0] + end + end + else + render_403 + end + end def add_brief_introdution user = User.current diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index e1dda3554..b3e946f95 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -274,14 +274,19 @@ module CoursesHelper #searchPeopleByRoles(project, TeacherRoles) members = [] project.members.includes(:user).each do |m| - members << m if m && m.user && m.user.allowed_to?(:as_teacher,project) + #members << m if m && m.user && m.user.allowed_to?(:as_teacher,project) + members << m if m && m.user && m.user.has_teacher_role(project) end members end def TeacherAndAssistantCount course - students_count = course.student.count - number = course.members.count - students_count + #students_count = course.student.count + #number = course.members.count - students_count + member_ids = course.members.includes(:user).blank? ? "(-1)" : "(" + course.members.includes(:user).map { |mem| mem.id}.join(",") + ")" + role_ids = "(3, 7, 9)" + number = MemberRole.where("member_id in #{member_ids} and role_id in #{role_ids}").count + #number = (searchTeacherAndAssistant course).count end def search_student_in_group(project, course_group_id) @@ -789,7 +794,7 @@ module CoursesHelper if user.logged? joined = course.members.includes(:user).map{|member| member.user_id}.include? user.id text = joined ? l(:label_course_exit_student) : l(:label_course_join_student) - url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) + url = joined ? join_path(:object_id => course.id) : join_private_courses_courses_path() method = joined ? 'delete' : 'post' if joined link = link_to(text, url, :remote => true, :method => method, :class => "sy_btn_grey fl", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) @@ -831,6 +836,10 @@ module CoursesHelper result = l(:label_student) elsif role == "Manager" result = l(:field_admin) + elsif role.include?("TeachingAsistant") && role.include?("Student") + result = l(:label_TA) + " " + l(:label_student) + elsif role.include?("Teacher") && role.include?("Student") + result = l(:label_teacher) + " " + l(:label_student) end result end @@ -914,5 +923,15 @@ module CoursesHelper resource_num*5 + journal_num + homework_journal_num ) desc limit 3;") end + #用户在该课程是否具有某个角色 + def get_user_member_roles_course course, user, role + members = course.members.where("user_id = #{user.id}") + result = false + unless members.blank? + m_roles = MemberRole.where("member_id = #{members.first.id} and role_id = #{role}") + end + result = !m_roles.blank? + result + end end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 98b993183..91743289a 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -54,6 +54,44 @@ module UsersHelper end end + # 获取消息角色 + def applied_project_message_type role + case role + when 3 + "管理员" + when 4 + "开发人员" + when 5 + "报告人员" + end + end + + # 判断当前用户能否对消息进行操作 + def allow_to_show applied_message + (User.current.id == applied_message.user_id && applied_message.status == 1) ? true : false + end + + # 项目申请消息通过状态判断用户 + # status(1:申请的消息;2:已操作过该消息(包括同意或者拒绝,消息状态更新);3:拒绝消息;4:被拒人收到消息;5:拒绝者收到消息;6:同意后申请人收到消息;7:同意后批准人收到消息) + def applied_project_users applied_message + # case applied_message.status + # when 3,2,1,5,4,7,6 + user = User.find(applied_message.applied_user_id) + # end + end + + # 项目申请消息通过状态判断tip描述 + def applied_project_tip applied_message + case applied_message.status + when 4 + "拒绝申请加入项目:" + when 5,3,2,1,7 + "申请加入项目:" + when 6 + "同意申请加入项目" + end + end + def get_resource_origin attach type = attach.container_type content = attach.container @@ -690,4 +728,18 @@ module UsersHelper end result_ids end + + #课程的班级列表最近更新时间 + def syllabus_course_list_sort syllabuses + syllabuses.each do |sy| + updated_at = sy.updated_at + courses = sy.courses.not_deleted + unless courses.empty? + course_ids = "(" + courses.map { |course| course.id}.join(",") + ")" + updated_at = CourseActivity.where("course_id in #{course_ids}").order("updated_at desc").first.updated_at + end + sy[:last_update] = updated_at + end + syllabuses + end end diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 52f2ea119..d846071b5 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -364,22 +364,29 @@ module WatchersHelper :class => "pr_join_a" ,:id=>id end - #申请加入项目 + # 申请加入项目 def join_in_project_link(project, user, options=[]) - return '' unless user && user.logged? applied = project.applied_projects.find_by_user_id(user.id) text = applied ? l(:label_unapply_project) : l(:label_apply_project) - @applied_flag = project.instance_of?(Project) + url = applied_join_project_path(:object_id => project.id) + method = 'post' + @applied_flag = project.instance_of?(Project) if applied - appliedid = applied.id + link = "#{text}" + else + link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "pr_join_a") end - id = applied_css(project) - url = appliedproject_path( - :id=>appliedid, - :user_id => user.id, - :project_id => project.id) - method = applied ? 'delete' : 'post' - link_to text, url, :remote => true, :method => method , :class => "pr_join_a",:id => id + link.html_safe + # if applied + # appliedid = applied.id + # end + # id = applied_css(project) + # url = appliedproject_path( + # :id=>appliedid, + # :user_id => user.id, + # :project_id => project.id) + # method = applied ? 'delete' : 'post' + # link_to text, url, :remote => true, :method => method , :class => "pr_join_a",:id => id end def paginateHelper obj, pre_size=20 diff --git a/app/models/applied_message.rb b/app/models/applied_message.rb index de07dae22..cbba74f95 100644 --- a/app/models/applied_message.rb +++ b/app/models/applied_message.rb @@ -1,6 +1,7 @@ class AppliedMessage < ActiveRecord::Base # status: 0表示未批准; status:1表示已批准; status: 2表示已拒绝 - attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :name + + attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :applied_user_id, :role, :project_id, :name belongs_to :applied ,:polymorphic => true belongs_to :apply_add_schools belongs_to :user diff --git a/app/models/applied_project.rb b/app/models/applied_project.rb index fb8bf90af..b1945a937 100644 --- a/app/models/applied_project.rb +++ b/app/models/applied_project.rb @@ -1,18 +1,16 @@ class AppliedProject < ActiveRecord::Base - attr_accessible :project_id, :user_id + attr_accessible :project_id, :user_id, :role belongs_to :user belongs_to :project - has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy + has_many :applied_messages, :class_name => 'AppliedMessage', :as => :applied, :dependent => :destroy after_create :send_appliled_message + # 仅仅给项目管理人员发送消息 def send_appliled_message - # if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil? - self.project.members.each do |m| - if m.roles.first.to_s.include?("Manager") - self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.project_id, :viewed => false) - end + self.project.managers.each do |member| + self.applied_messages << AppliedMessage.new(:user_id => member.user_id, :status => true, :viewed => false, :applied_user_id => self.user_id, :role => self.role, :project_id => self.project_id) end # end end diff --git a/app/models/member.rb b/app/models/member.rb index 3cb70a8fe..cb15e067b 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -53,7 +53,15 @@ class Member < ActiveRecord::Base new_role_ids = ids - role_ids # Add new roles - new_role_ids.each {|id| member_roles << MemberRole.new(:role_id => id) } + if new_role_ids.include?(7) && new_role_ids.include?(10) + member_roles << MemberRole.new(:role_id => 7) + member_roles << MemberRole.new(:role_id => 10, :is_current => 0) + elsif new_role_ids.include?(9) && new_role_ids.include?(10) + member_roles << MemberRole.new(:role_id => 9) + member_roles << MemberRole.new(:role_id => 10, :is_current => 0) + else + new_role_ids.each {|id| member_roles << MemberRole.new(:role_id => id) } + end # Remove roles (Rails' #role_ids= will not trigger MemberRole#on_destroy) member_roles_to_destroy = member_roles.select {|mr| !ids.include?(mr.role_id)} if member_roles_to_destroy.any? diff --git a/app/models/member_role.rb b/app/models/member_role.rb index 4d493cb27..799720833 100644 --- a/app/models/member_role.rb +++ b/app/models/member_role.rb @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class MemberRole < ActiveRecord::Base + # multi_role 课程中的多重角色 0:单角色/学生,1:管理员&学生,2:教师&学生,3:教辅&学生 belongs_to :member belongs_to :role diff --git a/app/models/project.rb b/app/models/project.rb index aa70084d2..67f010210 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -269,6 +269,11 @@ class Project < ActiveRecord::Base notified.collect(&:mail) end + # 返回为member类型数组 + def managers + self.members.includes(:roles).select{|member| member.roles[0].try(:name) == "Manager"} + end + def initialize(attributes=nil, *args) super @@ -905,6 +910,24 @@ class Project < ActiveRecord::Base User.find(self.user_id) end + # 延迟生成邀请码 + def invite_code + return generate_invite_code + end + + # 生成邀请码 + # 如果已有改邀请码,则重新生成 + CODES = %W(2 3 4 5 6 7 8 9 A B C D E F G H J K L N M O P Q R S T U V W X Y Z) + def generate_invite_code + code = read_attribute(:invite_code) + if !code || code.size <6 + code = CODES.sample(6).join + return generate_invite_code if Project.where(invite_code: code).present? + update_attribute(:invite_code, code) + end + code + end + private def after_parent_changed(parent_was) diff --git a/app/models/user.rb b/app/models/user.rb index 996aa9be7..a4b7f3b25 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -42,12 +42,12 @@ class User < Principal # Different ways of displaying/sorting users USER_FORMATS = { :firstname_lastname => { - :string => '#{firstname} #{lastname}', + :string => '#{firstname}#{lastname}', :order => %w(firstname lastname id), :setting_order => 1 }, :firstname_lastinitial => { - :string => '#{firstname} #{lastname.to_s.chars.first}.', + :string => '#{firstname}#{lastname.to_s.chars.first}.', :order => %w(firstname lastname id), :setting_order => 2 }, @@ -57,7 +57,7 @@ class User < Principal :setting_order => 3 }, :lastname_firstname => { - :string => '#{lastname} #{firstname}', + :string => '#{lastname}#{firstname}', :order => %w(lastname firstname id), :setting_order => 4 }, @@ -369,7 +369,8 @@ class User < Principal system_messages_count = SystemMessage.where("created_at >?", onclick_time).count at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", user.id,0, onclick_time).count - messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count + applied_count = AppliedMessage.where("user_id=? and viewed =? and created_at >?", user.id, 0, onclick_time).count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count + applied_count end # 查询指派给我的缺陷记录 @@ -823,7 +824,7 @@ class User < Principal # Find course membership membership = coursemembership(course) if membership - roles = membership.roles + roles = membership.roles.where("is_current = 1") else @role_non_member ||= Role.non_member roles << @role_non_member @@ -918,6 +919,12 @@ class User < Principal end end + #是否具有老师角色 + def has_teacher_role(course) + member = course.members.where("user_id = #{self.id}").first + role = MemberRole.where("member_id = #{member.id} and role_id in (3, 7, 9)") + !role.blank? + end # Return true if the user is allowed to do the specified action on a specific context # Action can be: diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 811d73f55..ce3157d5f 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -391,6 +391,103 @@ class CoursesService {:state => @state,:course => course} end + #多个角色加入课程 + def join_course_roles params,current_user + course = Course.find_by_invite_code(params[:invite_code]) if params[:invite_code] + + @state = 10 + if course + if course_endTime_timeout? course + @state = 2 + elsif course[:is_delete] == 1 + @state = 11 + else + if current_user.member_of_course?(course) #如果已经是成员 + @state = 3 + # member = course.members.where("user_id=#{current_user.id} and course_id=#{course.id}")[0] + # role_ids = params[:role] + # #roleName = member.roles[0].name if member + # #roleName = member.roles.map{|role| role.name}.join(",") if member + # if params[:invite_code].present? + # #如果加入角色为学生 并且当前是学生 + # if role_ids == "10" && roleName.include?("Student") && !roleName.include?("Teacher") && !roleName.include?("TeachingAsistant")&& !roleName.include?("Manager") + # @state = 3 + # #如果加入的角色为老师,并且当前已经是老师 + # elsif role_ids == "9" && roleName.include?("Teacher") && !roleName.include?("Student") + # @state = 8 + # #如果加入的角色教辅并且当前为教辅 + # elsif role_ids == "7" && roleName.include?("TeachingAsistant") && !roleName.include?("Student") + # @state = 9 + # elsif roleName.include?("Manager") + # @state = 10 + # #如果加入角色为教师或者教辅,并且当前是学生,或者是要成为教辅,当前不是教辅,或者要成为教师,当前不是教师。那么要发送请求 + # elsif (params[:role] != "10" && roleName == "Student") || (params[:role] == "7" && roleName != "TeachingAsistant" ) || (params[:role] == "9" && roleName != "Teacher" ) + # #如果已经发送过消息了,那么就要给个提示 + # if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and content = #{params[:role]} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0 ").count != 0 + # @state = 7 + # else + # Mailer.run.join_course_request(course, User.current, params[:role]) + # CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0) + # @state = 6 + # end + # #如果加入角色是学生,但是是当前课程的教师或者教辅 + # elsif params[:role] == "10" && roleName != "Student" + # member.role_ids = [params[:role]] + # member.save + # StudentsForCourse.create(:student_id => current_user.id, :course_id => course.id) + # @state = 0 + # end + # else + # @state = 1 + # end + else + if params[:invite_code].present? + role_ids = params[:role] + role_str = role_ids.join(",") + if role_ids.include?("10") && !role_ids.include?("7") && !role_ids.include?("9") + members = [] + members << Member.new(:role_ids => [10], :user_id => current_user.id) + course.members << members + StudentsForCourse.create(:student_id => current_user.id, :course_id => course.id) + @state = 0 + else + is_stu = false + if role_ids.include?("10") + members = [] + members << Member.new(:role_ids => [10], :user_id => current_user.id) + course.members << members + StudentsForCourse.create(:student_id => current_user.id, :course_id =>course.id) + is_stu = true + end + #如果已经发送过消息了,那么就要给个提示 + if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and content = '#{role_str}' and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0").count != 0 + if is_stu + @state = 12 + else + @state = 7 + end + else + Mailer.run.join_course_request(course, User.current, params[:role]) + CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> role_str,:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0) + if is_stu + @state = 13 + else + @state = 6 + end + end + end + else + @state = 1 + end + end + end + else + @state = 4 + end + {:state => @state,:course => course} + end + + #作业列表 #已提交的作业数量获取 bid.homeworks.count #学生提问数量获取 bid.commit.nil? ? 0 : bid.commit diff --git a/app/views/admin/_all_schools.html.erb b/app/views/admin/_all_schools.html.erb index af59d7687..d4cf916f5 100644 --- a/app/views/admin/_all_schools.html.erb +++ b/app/views/admin/_all_schools.html.erb @@ -1,5 +1,4 @@ <%= stylesheet_link_tag 'css/common','css/popup' %> -
更改为
diff --git a/app/views/admin/_courselist_detail_tr.html.erb b/app/views/admin/_courselist_detail_tr.html.erb index 83b7904ce..6bec90845 100644 --- a/app/views/admin/_courselist_detail_tr.html.erb +++ b/app/views/admin/_courselist_detail_tr.html.erb @@ -7,7 +7,7 @@ - <%= link_to(course.teacher.show_name.truncate(6, omission: '...'), user_path(course.teacher)) %> + <%= link_to(course.teacher.show_name, user_path(course.teacher)) %> <%= course.class_period %> diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb index 61db6769f..c9ebdfb66 100644 --- a/app/views/admin/applied_schools.html.erb +++ b/app/views/admin/applied_schools.html.erb @@ -60,7 +60,7 @@ <% user = User.where("id=?", apply.user_id).first %> <% unless user.nil? %> - <%= user.login %> + <%=link_to user.show_name, user_path(user) %> <% end %> @@ -106,7 +106,7 @@ - + <%= apply.address %> @@ -118,9 +118,9 @@ <%= format_date(apply.created_at) %> - <%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }) %> - <%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure)) %> - <%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true %> + <%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => "application-default-link" ) %> + <%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure), :class => "application-default-link") %> + <%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true, :class => "application-default-link" %> diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb index cbb0e70e5..b0419bcab 100644 --- a/app/views/admin/has_applied_schools.html.erb +++ b/app/views/admin/has_applied_schools.html.erb @@ -29,7 +29,7 @@ 申请者 - + 地区 @@ -38,6 +38,9 @@ 原名 + + 用户 + 创建时间 @@ -53,7 +56,7 @@ <%= apply.id %> - + <% unless apply.school_id.nil? %> <% school_name = School.where("id=?", apply.school_id).first %> <%= school_name %> @@ -63,7 +66,7 @@ <% user = User.where("id=?", apply.user_id).first %> <% unless user.nil? %> - <%= user.login %> + <%=link_to user.show_name, user_path(user) %> <% end %> @@ -109,13 +112,17 @@ - + <%= apply.address %> <%= apply.name %> + + <% count = UserExtensions.where("school_id = #{apply.school_id}").count %> + <%= count %> + <%= format_date(apply.created_at) %> @@ -126,18 +133,8 @@ - <% unless apply.remarks.blank? %> - - - - - - <%= apply.remarks %> - - <% end %> <% end %> - <% end %>
\ No newline at end of file diff --git a/app/views/admin/non_syllabus_courses.html.erb b/app/views/admin/non_syllabus_courses.html.erb index 1be979eeb..c5a2c81ec 100644 --- a/app/views/admin/non_syllabus_courses.html.erb +++ b/app/views/admin/non_syllabus_courses.html.erb @@ -72,7 +72,7 @@ - <%= link_to(course.teacher.show_name.truncate(6, omission: '...'), user_path(course.teacher)) %> + <%= link_to(course.teacher.show_name, user_path(course.teacher)) %> <%= course.class_period %> diff --git a/app/views/admin/syllabuses.html.erb b/app/views/admin/syllabuses.html.erb index 194091abc..5098131da 100644 --- a/app/views/admin/syllabuses.html.erb +++ b/app/views/admin/syllabuses.html.erb @@ -52,7 +52,7 @@ - <%= link_to(syllabus.try(:user).try(:realname).truncate(6, omission: '...'), user_path(syllabus.user)) %> + <%= link_to syllabus.user.show_name, user_path(syllabus.user) %> <%= format_date(syllabus.created_at) %> @@ -70,7 +70,7 @@ <%= render :partial => 'admin/rename_course_name', :locals => {:course => course} %> - <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> + <%= link_to(course.teacher.show_name, user_path(course.teacher)) %> <%= format_date(course.created_at) %> diff --git a/app/views/applied_project/_applied_join_project.html.erb b/app/views/applied_project/_applied_join_project.html.erb new file mode 100644 index 000000000..457cdf9cc --- /dev/null +++ b/app/views/applied_project/_applied_join_project.html.erb @@ -0,0 +1,29 @@ +
+

欢迎加入项目

+ +
+
+
+ <%= form_tag( url_for(:controller => 'applied_project', :action => 'applied_project_info', :project_id => (@project.nil? ? nil : @project.id)), :remote => true, :id => 'project_applied_form') do %> + + <% end %> +
diff --git a/app/views/applied_project/_applied_project_tip.js.erb b/app/views/applied_project/_applied_project_tip.js.erb new file mode 100644 index 000000000..56e5270d6 --- /dev/null +++ b/app/views/applied_project/_applied_project_tip.js.erb @@ -0,0 +1,25 @@ +
+
+

提示

+ +
+
+
+ +
+
\ No newline at end of file diff --git a/app/views/applied_project/applied_join_project.js.erb b/app/views/applied_project/applied_join_project.js.erb index ae9d3f467..5d9f7f87a 100644 --- a/app/views/applied_project/applied_join_project.js.erb +++ b/app/views/applied_project/applied_join_project.js.erb @@ -1,14 +1,3 @@ -// @status: 0 该项目不存在;1 不重复加入;2 成功加入; 3 已是项目成员;其它 加入失败 -<% if @status == 0%> - alert("<%= l('project.join.tips.notexist') %>"); -<% elsif @status == 1%> - alert("<%= l('project.join.tips.repeat') %>"); -<% elsif @status == 2%> - alert("<%= l('project.join.tips.success') %>"); - hideModal($("#popbox")); - $("#applied_project_link_<%= @project.id%>").replaceWith("<%=escape_javascript(link_to '取消申请',appliedproject_applied_path(:project_id => @project.id,:user_id => User.current.id),:class => "blue_n_btn fr mt20", :remote => "true",:method => "delete",:id => "applied_project_link_#{@project.id}")%>"); -<% elsif @status == 3%> - alert("<%= l('project.join.tips.has') %>"); -<%else%> - alert("<%= l('project.join.tips.fail') %>"); -<%end%> \ No newline at end of file +var htmlvalue = "<%= escape_javascript(render :partial => 'applied_join_project', locals: {:project_id => (@project.nil? ? nil : @project.id)}) %>"; +pop_box_new(htmlvalue,460,40,50); + diff --git a/app/views/applied_project/applied_project_info.js.erb b/app/views/applied_project/applied_project_info.js.erb new file mode 100644 index 000000000..ab3cb396d --- /dev/null +++ b/app/views/applied_project/applied_project_info.js.erb @@ -0,0 +1,5 @@ +<% if @project %> +$("#join_in_project_applied").html('<%= escape_javascript( render :partial => 'projects/applied_status') %>'); +<% end %> +var htmlvalue = "<%= escape_javascript(render :partial => 'applied_project/applied_project_tip') %>"; +pop_box_new(htmlvalue,380,40,50); diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb index 0f7e8a012..759a9a735 100644 --- a/app/views/attachments/_project_file_links.html.erb +++ b/app/views/attachments/_project_file_links.html.erb @@ -92,7 +92,7 @@ <% end %> <% if options[:author] %> - <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, + <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "link-blue" %>, <%= format_time(attachment.created_on) %> <% end %> diff --git a/app/views/blog_comments/destroy.js.erb b/app/views/blog_comments/destroy.js.erb index c34986977..52ecbb925 100644 --- a/app/views/blog_comments/destroy.js.erb +++ b/app/views/blog_comments/destroy.js.erb @@ -1,5 +1,5 @@ <% if @in_user_homepage %> - <% homepage = BlogComment.find(User.current.blog.homepage_id) %> + <% homepage = BlogComment.find(@user.blog.homepage_id) %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => @blog_comment, :user_activity_id => homepage.id}) %>"); <% else%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @blog_comment,:user_activity_id =>@user_activity_id}) %>"); diff --git a/app/views/blogs/_homepage.html.erb b/app/views/blogs/_homepage.html.erb index a16547836..a076ed15c 100644 --- a/app/views/blogs/_homepage.html.erb +++ b/app/views/blogs/_homepage.html.erb @@ -1,6 +1,5 @@
-
<% if activity.author.id == User.current.id%> <%end%> -
<% all_comments = []%> @@ -57,7 +54,7 @@ <% comments = get_all_children(all_comments, activity)[0..2] %> <% if count > 0 %>
- <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1}%> + <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1, :user_id => activity.author_id}%>
<% end %> diff --git a/app/views/courses/_copy_course.html.erb b/app/views/courses/_copy_course.html.erb index 55217017b..9f45172bc 100644 --- a/app/views/courses/_copy_course.html.erb +++ b/app/views/courses/_copy_course.html.erb @@ -114,7 +114,7 @@ - 复制到新班级的资源将在1个月后发布,请您调整资源的发布时间,否则学生可能看不到资源。 + 复制到新班级的资源将在1个月后发布,请您调整资源的发布时间,否则学生将看不到资源。 \ No newline at end of file +
+ + \ No newline at end of file diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index ec5d18c7e..f95129903 100644 --- a/app/views/courses/_join_private_course.html.erb +++ b/app/views/courses/_join_private_course.html.erb @@ -1,100 +1,52 @@ - - - - - 快速进入班级通道 - - - +
+ +
  • + + 确  定 + 取  消 - -
    -
    -
    -

    快速加入班级通道

    -

    只要持有班级邀请码,就可以快速加入所在班级。班级页面搜索不到的私有班级只能从此通道进入哦!

    -
    -
    - <%= form_tag({:controller => 'courses', - :action => 'join'}, - :remote => true, - :method => :post, - :id => 'new-watcher-form') do %> -
      -
    • - - - 班级邀请码: - - -
    • -
    • 班级邀请码是所在班级页面中显示的邀请码
    • -
    • - - <% if User.current.logged? && User.current.extensions && User.current.extensions.identity == 0%> - - <%else%> - - <%end%> -
    • -
    • - - <%= l(:label_new_join) %> - - - <%= l(:button_cancel)%> - -
    • -
    - <% end%> -
    -
    +
    +
  • + + <% end %> +
    - - - + \ No newline at end of file diff --git a/app/views/courses/_member.html.erb b/app/views/courses/_member.html.erb index 95177c92c..9e6abcf4f 100644 --- a/app/views/courses/_member.html.erb +++ b/app/views/courses/_member.html.erb @@ -10,7 +10,7 @@ ) do |f| %> <% @roles.each do |role| %> @@ -35,4 +35,25 @@ :data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %> <% end%> -<% end%> \ No newline at end of file + + +<% end%> diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index c41edf680..5f9e512d7 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -29,7 +29,7 @@ <% if show_nav?(course_feedback_count) %>
  • 留言 - <%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%> + <%= link_to "", course_feedback_path(@course), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}"%>
  • <% end %> <% if show_nav?(course_poll_count) %> diff --git a/app/views/courses/join.js.erb b/app/views/courses/join.js.erb index ac8b717d1..52c1347a5 100644 --- a/app/views/courses/join.js.erb +++ b/app/views/courses/join.js.erb @@ -36,6 +36,10 @@ window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/co alert("您已经是该班级的管理员了"); hidden_join_course_form(); window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 11%> +alert("该班级已被删除"); +hidden_join_course_form(); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% else %> alert("未知错误,请稍后再试"); <% end %> diff --git a/app/views/courses/join_course_multi_role.js.erb b/app/views/courses/join_course_multi_role.js.erb new file mode 100644 index 000000000..97d6b33ce --- /dev/null +++ b/app/views/courses/join_course_multi_role.js.erb @@ -0,0 +1,52 @@ +<% if @object_id && @state != 6 && @state !=4 %> +$("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(@course, @user)) %>"); +<% end %> +<% if @state %> +<% if @state == 0 %> +alert("加入成功"); +hideModal(); +$("#try_join_course_link").replaceWith(" 'index',:course=>@course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品"); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 1 %> +alert("密码错误"); +<% elsif @state == 2 %> +alert("班级已过期\n请联系班级管理员重启班级。(在配置班级处)"); +<% elsif @state == 3 %> +alert("您已经加入了班级"); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 4 %> +alert("您加入的班级不存在"); +<% elsif @state == 5 %> +alert("您还未登录"); +<% elsif @state == 6 %> +alert("申请成功,请等待审核"); +hidden_join_course_form(); +<% elsif @state == 7%> +alert("您已经发送过申请了,请耐心等待"); +hidden_join_course_form(); +<% elsif @state == 8%> +alert("您已经是该班级的教师了"); +hidden_join_course_form(); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 9%> +alert("您已经是该班级的教辅了"); +hidden_join_course_form(); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 10%> +alert("您已经是该班级的管理员了"); +hidden_join_course_form(); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 11%> +alert("该班级已被删除"); +hidden_join_course_form(); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 12 %> +alert("您已经发送过申请了,请耐心等待"); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% elsif @state == 13 %> +alert("申请成功,请等待审核"); +window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" +<% else %> +alert("未知错误,请稍后再试"); +<% end %> +<% end %> diff --git a/app/views/courses/join_private_courses.js.erb b/app/views/courses/join_private_courses.js.erb index 199cfb5ae..14402a9ff 100644 --- a/app/views/courses/join_private_courses.js.erb +++ b/app/views/courses/join_private_courses.js.erb @@ -1,11 +1,2 @@ -$('#topnav_course_menu').hide(); -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_private_course') %>'); -showModal('ajax-modal', '540px'); -$('#ajax-modal').css('height','390px'); -//$('#ajax-modal').siblings().remove(); -$('#ajax-modal').siblings().hide(); -$('#ajax-modal').before("" + - ""); -$('#ajax-modal').parent().removeClass("alert_praise"); -$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); -$('#ajax-modal').parent().addClass("alert_box"); +var htmlvalue = "<%= escape_javascript(render :partial => 'join_private_course') %>"; +pop_box_new(htmlvalue,460,40,50); diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index fe6b3e596..f53c8c716 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -17,13 +17,13 @@
  • - +
  • - +
  • diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index ec9a0bc54..ac912a71c 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -20,7 +20,7 @@ <%= get_issue_priority(@issue.priority_id)[1] %>


    - 由<%= @issue.author %>添加于 <%= format_time(@issue.created_on).html_safe %> + 由<%=link_to @issue.author, user_path(@issue.author), :class => "link-blue" %>添加于 <%= format_time(@issue.created_on).html_safe %> diff --git a/app/views/layouts/_base_course_old.html.erb b/app/views/layouts/_base_course_old.html.erb deleted file mode 100644 index 4b2077cf8..000000000 --- a/app/views/layouts/_base_course_old.html.erb +++ /dev/null @@ -1,278 +0,0 @@ -<%# course_model %> -<% course_file_num = visable_attachemnts_incourse(@course).count%> -<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> -<% homework_num = visable_course_homework @course %> - - - - - - - <%= h html_title %> - - - - <%= csrf_meta_tag %> - <%= favicon %> - <%= javascript_heads %> - <%= heads_for_theme %> - <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/public', 'css/structure','prettify', 'css/courses','css/popup'%> - <%= javascript_include_tag "course","sy_public", "syllabus","header","attachments",'prettify' %> - - <%= yield :header_tags -%> - - - - - - - - - - - -
    -
    -
    -
    -
    - <%=render :partial=>'layouts/project_info' %> -
    - -
    -
      -
    • <%= l(:label_main_teacher)%> :  <%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher), :class => 'c_dblue') %>
    • -
    • <%= l(:label_class_period)%> :  <%= @course.class_period %> <%= l(:label_class_hour) %>
    • -
    • <%= l(:label_main_term)%> :  <%= current_time_and_term @course %>
    • - <% if @course.school%> -
    • <%= l(:label_course_organizers)%> :  <%= @course.school%>
    • - <% end%> -
    -
    - - <%# 更新访问数,刷新的时候更新访问次数 %> - <% update_visiti_count @course %> - <%# over %> - - - <%# 课程活跃度 %> -
    - <%= render :partial => 'courses/course_activity_users', :locals => {:course => @course} %> - <%# 课程英雄榜 %> - <%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %> - - <% if @course.description && !@course.description.blank? %> -
    -
    -

    <%= l(:label_course_brief_introduction)%>:

    -
    - <%= textilizable(@course.description) if @course.description && !@course.description.blank? %> -
    -
    -
    - - - - -
    -
    - <% end %> -
    -

    <%= l(:label_tag)%>:

    -
    - <%= render :partial => 'tags/new_tag', :locals => {:obj => @course, :object_flag => "9"} %> -
    -
    -
    - - <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %> -
    访问计数 <%= @course.visits.to_i %> (自2016年5月)
    -
    - -
    - <%= yield %> - <%#= render_flash_messages %> - <%#= call_hook :view_layouts_base_content %> -
    - -
    - -
    -
    - -
    -<%= render :partial => 'layouts/footer' %> -
    - -<%= render :partial => 'layouts/new_feedback' %> - - -<%= call_hook :view_layouts_base_body_bottom %> - - - - \ No newline at end of file diff --git a/app/views/layouts/_base_syllabus_old.html.erb b/app/views/layouts/_base_syllabus_old.html.erb deleted file mode 100644 index 45e77dbad..000000000 --- a/app/views/layouts/_base_syllabus_old.html.erb +++ /dev/null @@ -1,151 +0,0 @@ - - - - - <%= h html_title %> - - - <%= csrf_meta_tag %> - <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'syllabus','css/common','css/public','css/structure','css/courses','css/popup','prettify',:media => 'all' %> - <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> - <%= javascript_heads %> - <%= javascript_include_tag "bootstrap","avatars","course",'attachments','prettify','syllabus'%> - <%= heads_for_theme %> - <%= call_hook :view_layouts_base_html_head %> - <%= yield :header_tags -%> - - - - - - - -<% is_current_user = User.current.logged?%> - -
    -
    -
    -
    -
    - <%=render :partial => 'layouts/syllabus_info' %> -
    - <% update_visiti_count @syllabus %> - -
    - <%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %> -
    - -
    -
    - <%=link_to '班级', {:controller => "syllabuses", :action => "syllabus_courselist", :id => @syllabus.id}, :class => 'homepageMenuText' %> - <% if is_current_user%> - <% if User.current == @syllabus.user && User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> -
    -
      -
    • -
        -
      • - <%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "menuGrey", :target => '_blank'%> -
      • -
      • - <%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%> -
      • -
      -
    • -
    -
    - <% else%> - <%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%> - <% end%> - <% end%> -
    - <% if User.current == @syllabus.user || User.current.admin? - all_courses = @syllabus.courses.where("is_delete = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc") - else - all_courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc") - end %> - <% courses = all_courses.limit(5) %> - <% all_count = all_courses.count%> -
    -
    -
      - <%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => User.current,:all_count => all_count,:type =>'Syllabus',:page => 0} %> -
    -
    - <% if !courses.empty? %> -
    - -
    - <% end %> -
    -
    - -
    -

    标签:

    -
    - <%= render :partial => 'tags/syllabus_tag', :locals => {:obj => @syllabus,:object_flag => "11"}%> -
    -
    -
    -
    访问计数 <%=@syllabus.visits %> (自2016年7月)
    - -
    -
    - <%= yield %> -
    -
    - <%= render :partial => 'layouts/new_feedback' %> -
    -
    -<%= render :partial => 'layouts/footer' %> -
    - - - - - - diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 546b27421..1c01ecf53 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -11,16 +11,13 @@

    <% if is_teacher %> -
    +
    - <%= l(:label_project_id)%><%= @project.id %> + <%= l(:label_project_ivite_code)%> + <%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %>
    diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index f280f6506..0c49cc3b2 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -192,7 +192,7 @@ <%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "homepageMenuText" %> <% if is_current_user%> - <% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> + <%# if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
    • @@ -211,9 +211,9 @@
    - <% else%> - <%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%> - <% end%> + <%# else%> + <%#=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入班级"%> + <%# end%> <% end%>
    <% end %> @@ -245,8 +245,21 @@
    <%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => "homepageMenuText" %> - <% if is_current_user%> - <%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%> + <% if is_current_user %> +
    + +
    <% end%>
    <%# if @user.projects.visible.count > 0 @@ -362,6 +375,12 @@ $("#courseMenu").mouseleave(function(){ $("#topnav_course_menu").hide(); }); + $("#projectMenu").mouseenter(function(){ + $("#topnav_project_menu").show(); + }); + $("#projectMenu").mouseleave(function(){ + $("#topnav_project_menu").hide(); + }); function leftCourseslistChange(){ $('#homepageLeftMenuCourses').slideToggle(); $('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon"); diff --git a/app/views/members/allow_to_join_project.js.erb b/app/views/members/allow_to_join_project.js.erb new file mode 100644 index 000000000..cbd37e188 --- /dev/null +++ b/app/views/members/allow_to_join_project.js.erb @@ -0,0 +1,5 @@ +<% if @flash_message %> + alert("<%= @flash_message %>"); +<% else%> + $("#applied_project_<%= @applied_message.id %>").html('<%= render :partial => "users/user_message_applide_action", :locals =>{:ma => @applied_message} %>'); +<% end%> diff --git a/app/views/members/refused_allow_to_join_project.js.erb b/app/views/members/refused_allow_to_join_project.js.erb new file mode 100644 index 000000000..109ed3a62 --- /dev/null +++ b/app/views/members/refused_allow_to_join_project.js.erb @@ -0,0 +1 @@ +$("#applied_project_<%= @applied_message.id %>").html('<%= render :partial => "users/user_message_applide_action", :locals =>{:ma => @applied_message} %>'); \ No newline at end of file diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb new file mode 100644 index 000000000..d29819c03 --- /dev/null +++ b/app/views/projects/_applied_status.html.erb @@ -0,0 +1,9 @@ +<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %> + <%= watcher_link_for_project(@project, User.current) %> + + <% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %> + <%= join_in_project_link(@project, User.current) %> + <% else %> + 等待审批 + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index 6961fcbac..2c7d36fb5 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -55,12 +55,6 @@ <%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %> <% end %> - - <% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %> - - <% end %> <% end %> diff --git a/app/views/projects/settings/_new_members.html.erb b/app/views/projects/settings/_new_members.html.erb index b73ef647f..0773f7732 100644 --- a/app/views/projects/settings/_new_members.html.erb +++ b/app/views/projects/settings/_new_members.html.erb @@ -92,32 +92,6 @@ <% if roles.any? %>
    - <% if @project.applied_projects.any? %> -
    -

    <%= l(:label_apply_project) %>

    - <%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %> -
    - <%= render_principals_for_applied_members_new(@project) %> -
    - - - <%= l(:label_approve) %> - - - <%= l(:label_refusal) %> - - <% end %> -
    -
    - <% end %>

    <%= l(:label_member_new) %>

    diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 823d0c1ad..b80d9ee5b 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -7,6 +7,10 @@ <%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch ), :remote => true, :class => "btn_zipdown fr" %> <% end %> <% end %> + + <% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %> + <%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %> + <% end %>
    <% if @entries.nil? %> diff --git a/app/views/syllabuses/_syllabus_course_list.html.erb b/app/views/syllabuses/_syllabus_course_list.html.erb index cdb566412..4384ba2ee 100644 --- a/app/views/syllabuses/_syllabus_course_list.html.erb +++ b/app/views/syllabuses/_syllabus_course_list.html.erb @@ -24,7 +24,7 @@ <%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "sy_classlist_title fl", :style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%> <% end %> - <%=course.is_public? ? '公开' : '私有' %> +

    主讲老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %> diff --git a/app/views/syllabuses/new.html.erb b/app/views/syllabuses/new.html.erb index 3c0a39bf1..ced8a3d66 100644 --- a/app/views/syllabuses/new.html.erb +++ b/app/views/syllabuses/new.html.erb @@ -6,13 +6,13 @@ <%= labelled_form_for @syllabus do |f| %>

  • - +
  • - +
  • diff --git a/app/views/syllabuses/show.html.erb b/app/views/syllabuses/show.html.erb index 9b1bdafc5..e39d538ce 100644 --- a/app/views/syllabuses/show.html.erb +++ b/app/views/syllabuses/show.html.erb @@ -53,7 +53,7 @@ <% comments = @syllabus.journals_for_messages.reorder("created_on desc").limit(3) %> <% if count > 0 %>
    - <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> + <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'Syllabus', :activity_id => @syllabus.id} %>
    <% end %>
    diff --git a/app/views/users/_all_replies.html.erb b/app/views/users/_all_replies.html.erb deleted file mode 100644 index a74acc77c..000000000 --- a/app/views/users/_all_replies.html.erb +++ /dev/null @@ -1,39 +0,0 @@ - \ No newline at end of file diff --git a/app/views/users/_courses_list.html.erb b/app/views/users/_courses_list.html.erb new file mode 100644 index 000000000..1abe77b81 --- /dev/null +++ b/app/views/users/_courses_list.html.erb @@ -0,0 +1,30 @@ +<% unless courses.nil? %> + <% courses.each_with_index do |course, i| %> +
  • + <% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %> + " target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问"%>"> + +
    +
    +

    <%=course.name %>

    + + +
    +
    +
    +

    更新:<%=format_date Time.at(course.updatetime) %>学期:<%=current_time_and_term(course) %>

    +

    <%=studentCount course %>学生|<%=visable_course_homework course %>作业|<%=visable_attachemnts_incourse(@course).count %>资源

    +
    +
    +
    + +
    +
    +
  • + <% end %> + <% if courses.count > 3 %> +
  • + 共<%=courses.count %>个班级,点击全部展开 +
  • + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/users/_join_course_course_message.html.erb b/app/views/users/_join_course_course_message.html.erb index 933de0b0d..cb9399dba 100644 --- a/app/views/users/_join_course_course_message.html.erb +++ b/app/views/users/_join_course_course_message.html.erb @@ -5,7 +5,7 @@
  • - <%= link_to User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}", user_path(User.find(ma.course_message_id), :course_id => ma.course_id), + <%= link_to User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content && ma.content.include?('9') ? "教师" : "教辅"}", user_path(User.find(ma.course_message_id), :course_id => ma.course_id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> @@ -18,14 +18,14 @@

    真实姓名:<%= User.find(ma.course_message_id).realname %>

    申请课程:<%= Course.find(ma.course_id).name%>

    课程描述:
    -
    <%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %>

    申请职位:<%= ma.content == '9' ? "教师" : "教辅"%>

    +
    <%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %>

    申请职位:<%= ma.content.include?('9') ? "教师" : "教辅"%>

  • <% if ma.status == 0 || ma.status.nil?%> - <%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true'%> + <%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%> | - <%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true'%> + <%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%> <% elsif ma.status == 1%> 您已经同意了该申请 <% elsif ma.status == 2%> diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index 9ef2d146d..994c5c64e 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -82,7 +82,7 @@ <%= link_to( l(:button_reply), - {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage}, + {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage, :user_id => user_id}, :remote => true, :method => 'get', :title => l(:button_reply)) if !comment.root.locked? %> @@ -91,7 +91,7 @@ <% if comment.author == User.current %> <%= link_to( l(:button_delete), - {:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage}, + {:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage, :user_id => user_id}, :method => :delete, :remote => true, :class => 'fr mr20', diff --git a/app/views/users/_news_replies.html.erb b/app/views/users/_news_replies.html.erb index a4732af8c..1da4bc85e 100644 --- a/app/views/users/_news_replies.html.erb +++ b/app/views/users/_news_replies.html.erb @@ -76,6 +76,20 @@ :class => 'fr mr20', :title => l(:button_delete) ) if comment.user_id == User.current.id %> + <% elsif type == 'Syllabus' %> + + <%= link_to( + l(:button_reply), + {:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => type}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <% if User.current.admin? || User.current == Syllabus.find(activity_id).user || comment.user == User.current%> + <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> + <% end %> <% end %>
    diff --git a/app/views/users/_reply_banner.html.erb b/app/views/users/_reply_banner.html.erb index 43aebb89c..4f2094899 100644 --- a/app/views/users/_reply_banner.html.erb +++ b/app/views/users/_reply_banner.html.erb @@ -1,4 +1,4 @@ -
    +
    diff --git a/app/views/users/_syllabus_course_list.html.erb b/app/views/users/_syllabus_course_list.html.erb new file mode 100644 index 000000000..993192978 --- /dev/null +++ b/app/views/users/_syllabus_course_list.html.erb @@ -0,0 +1,61 @@ +
    + <% if @type.to_i == 2 %> + <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %> + <% else %> + <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %> + <% end %> + <%= link_to "人气", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %> + <% if @type.to_i == 1 %> + <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %> + <% else %> + <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %> + <% end %> + <%= link_to "时间", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %> + <%=@user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "加入"%>的课程 +
    +
    + +<% if syllabuses.any? %> + <% syllabuses.each_with_index do |syllabus, index|%> +
    + <% course_count = syllabus.courses.not_deleted.count %> +
    +
    + +

    <%=syllabus.title %>

    +
    +

    更新时间:<%=format_date syllabus.updated_at %> + 创建老师:<%=syllabus.user.show_name %> + 班级:<%=course_count %> +

    +
    +
    + +
    +
      + <% if index == 0 %> + <% courses = syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %> + <%= render :partial => 'users/courses_list', :locals => {:courses => courses, :syllabus => syllabus}%> + <% end %> +
    +
    + +
    +
      +
    • +
        +
      • + <%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %> +
      • + <% if User.current == syllabus.user %> +
      • <%=link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%>
      • + <% end %> +
      +
    • +
    +
    +
    + <% end %> +<% else %> +

    <%= l(:label_no_data) %>

    +<% end %> \ No newline at end of file diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index b6cd9ebc3..5361a37ad 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -50,7 +50,7 @@ <% comments = get_all_children(all_comments, activity)[0..2] %> <% if count > 0 %>
    - <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0}%> + <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0, :user_id => activity.author_id}%>
    <% end %> diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 669e7aa91..6051d8de9 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -70,7 +70,7 @@
    上传附件 - <%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %> + <%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true %> <% if defined?(has_program) && has_program %>
    编程 diff --git a/app/views/users/_user_join_syllabus_list.html.erb b/app/views/users/_user_join_syllabus_list.html.erb new file mode 100644 index 000000000..7faab0017 --- /dev/null +++ b/app/views/users/_user_join_syllabus_list.html.erb @@ -0,0 +1,3 @@ +
    + <%= render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @join_syllabuses, :list_type => 2} %> +
    diff --git a/app/views/users/_user_message_applide_action.html.erb b/app/views/users/_user_message_applide_action.html.erb new file mode 100644 index 000000000..fc56b9f22 --- /dev/null +++ b/app/views/users/_user_message_applide_action.html.erb @@ -0,0 +1,12 @@ +<% if allow_to_show(ma) %> + :<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> | + <%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :get, :class => "link-blue" %> +<% elsif ma.status == 4 %> + 被拒绝 +<% elsif ma.status == 5 %> + 您已拒绝 +<% elsif ma.status == 6 %> + 已通过 +<% elsif ma.status == 7 %> + 您已同意 +<% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_applide_users.html.erb b/app/views/users/_user_message_applide_users.html.erb new file mode 100644 index 000000000..18539c628 --- /dev/null +++ b/app/views/users/_user_message_applide_users.html.erb @@ -0,0 +1,2 @@ +<%=link_to applied_project_users(ma), user_path(applied_project_users(ma)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> +<%= applied_project_tip(ma) %> \ No newline at end of file diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb index 0a4924c27..e6fcfb25d 100644 --- a/app/views/users/_user_message_applied.html.erb +++ b/app/views/users/_user_message_applied.html.erb @@ -1,6 +1,7 @@ <% if ma.class == AppliedMessage %> <% if ma.applied_type == "ApplyAddSchools" %> + <% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 4 %> + <% end %> + <% elsif ma && ma.applied_type == "AppliedProject" %> + <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index fa2be7ae1..98ed3d1dc 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -586,9 +586,9 @@
  • <%= link_to ma.status == 1 ? - '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' + '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content.include?('9') ? '教师' : '教辅')+'申请已通过' : - '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝', course_path(Course.find(ma.course_id)), + '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content.include?('9') ? '教师' : '教辅')+'的申请被拒绝', course_path(Course.find(ma.course_id)), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> diff --git a/app/views/users/_user_syllabus_list.html.erb b/app/views/users/_user_syllabus_list.html.erb index 9fa93c76e..b6c767771 100644 --- a/app/views/users/_user_syllabus_list.html.erb +++ b/app/views/users/_user_syllabus_list.html.erb @@ -1,132 +1,3 @@ -
    -

    课程列表

    -
    - 排序: - <%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fl", :remote => true %> - <% if @type.to_i == 1 %> - <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %> - <% else %> - <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fl", :remote => true %> - <% end %> - <%= link_to "人气", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fl", :remote => true %> - <% if @type.to_i == 2 %> - <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %> - <% else %> - <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fl", :remote => true %> - <% end %> -
    -
    - - <% if @syllabus.any? %> - <% @syllabus.each_with_index do |syllabus, index|%> -
    - <% end %> -
    -
      - <%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %> -
    -
    -
    - <% else %> -

    <%= l(:label_no_data) %>

    - <% end %> -
    - - \ No newline at end of file +
    + <%= render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @my_syllabuses, :list_type => 1} %> +
    \ No newline at end of file diff --git a/app/views/users/all_journals.js.erb b/app/views/users/all_journals.js.erb index cc36ef3b3..a5fca2a60 100644 --- a/app/views/users/all_journals.js.erb +++ b/app/views/users/all_journals.js.erb @@ -5,11 +5,9 @@ $('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :part <% elsif params[:type] == 'Message' %> $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>'); <% elsif params[:type] == 'BlogComment' %> -$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage}) %>'); +$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage, :user_id => @user_id}) %>'); <% elsif params[:type] == 'OrgDocumentComment' %> $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>'); -<% elsif params[:type] == 'News' || params[:type] == 'Issue' %> +<% elsif params[:type] == 'News' || params[:type] == 'Issue' || params[:type] == 'Syllabus' %> $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>'); -<% else %> -$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>'); <% end %> diff --git a/app/views/users/expand_courses.js.erb b/app/views/users/expand_courses.js.erb new file mode 100644 index 000000000..3b2291e1d --- /dev/null +++ b/app/views/users/expand_courses.js.erb @@ -0,0 +1,5 @@ +<% unless @courses.empty? %> + $("#syllabus_course_ul_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'users/courses_list', :locals => {:courses => @courses, :syllabus => @syllabus}) %>"); + $("#syllabus_course_ul_<%=@syllabus.id %>").parent().show(); + $("#syllabus_course_ul_<%=@syllabus.id %>").parent().prev().children(":first-child").children(":first-child").toggleClass("icons_sy_close").toggleClass("icons_sy_open"); +<% end %> \ No newline at end of file diff --git a/app/views/users/sort_syllabus_list.js.erb b/app/views/users/sort_syllabus_list.js.erb new file mode 100644 index 000000000..e353109f4 --- /dev/null +++ b/app/views/users/sort_syllabus_list.js.erb @@ -0,0 +1,5 @@ +<% if @list_type.to_i == 1 %> +$("#user_syllabus_list").html('<%= escape_javascript(render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @syllabuses, :list_type => 1}) %>'); +<% else %> +$("#user_join_syllabus_list").html('<%= escape_javascript(render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @syllabuses, :list_type => 2}) %>'); +<% end %> \ No newline at end of file diff --git a/app/views/users/user_courselist.html.erb b/app/views/users/user_courselist.html.erb index 148cc1703..25bf2354d 100644 --- a/app/views/users/user_courselist.html.erb +++ b/app/views/users/user_courselist.html.erb @@ -1 +1,35 @@ -<%= render :partial => 'users/user_syllabus_list'%> +
    +

    课程列表

    + + <%= render :partial => 'users/user_syllabus_list'%> +
    + <%= render :partial => 'users/user_join_syllabus_list'%> +
    + + + \ No newline at end of file diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index c527474cd..00be899cc 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -1,6 +1,6 @@ <% if @journal_destroyed.nil? %> alert('<%=l(:notice_failed_delete)%>'); -<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication','HomeworkCommon'].include? @journal_destroyed.jour_type)%> +<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication','HomeworkCommon','Syllabus'].include? @journal_destroyed.jour_type)%> <% if @is_user%> <% if @activity %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); @@ -18,12 +18,15 @@ <% else %> <% if @bid && @jours_count %> $('#jours_count').html("<%= @jours_count %>"); + <% elsif @syllabus %> + $("#reply_banner_<%=@syllabus.id %>").replaceWith("<%=escape_javascript(render :partial => 'users/reply_banner', :locals => {:count => @count, :activity => @syllabus, :user_activity_id => @syllabus.id}) %>"); + $("#reply_div_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @comments, :type => 'Syllabus', :user_activity_id => @syllabus.id, :activity_id => @syllabus.id}) %>"); <% elsif @course && @jours_count%> <% if @user_activity_id %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity"); <% else %> - $('#course_jour_count').html("(<%= @jours_count %>)"); + $('#course_jour_count').html("<%= @jours_count %>"); <% end %> <% elsif @user && @jours_count%> $('#jour_count').html("<%= @jours_count %>"); diff --git a/app/views/words/reply_to_syllabus.js.erb b/app/views/words/reply_to_syllabus.js.erb new file mode 100644 index 000000000..4bc4848ad --- /dev/null +++ b/app/views/words/reply_to_syllabus.js.erb @@ -0,0 +1,2 @@ +$("#reply_banner_<%=@syllabus.id %>").replaceWith("<%=escape_javascript(render :partial => 'users/reply_banner', :locals => {:count => @count, :activity => @syllabus, :user_activity_id => @syllabus.id}) %>"); +$("#reply_div_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @comments, :type => 'Syllabus', :activity_id => @syllabus.id}) %>"); diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 076b905c3..91cc96791 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -48,6 +48,7 @@ zh: # 左边栏 # label_project_id: "项目ID:" + label_project_ivite_code: "邀请码:" label_agree_join_project: 同意加入 label_apply_project: "+申请加入" @@ -55,7 +56,7 @@ zh: label_exit_project: 退出项目 label_apply_project_waiting: 已处理申请,请等待管理员审核 label_member_of_project: 该用户已经是项目成员了! - label_unapply_project: 取消申请 + label_unapply_project: 等待审批 lable_sure_exit_project: 是否确认退出该项目 label_friend_organization: 圈子模式 label_research_group: 研讨模式 diff --git a/config/locales/zh.yml b/config/locales/zh.yml index df9c26895..1340e7aa6 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -388,7 +388,7 @@ zh: label_organization_name: 组织名称 label_organization_list: 组织列表 label_school_plural: 学校列表 - label_applied_shcools: 单位名称列表 + label_applied_shcools: 单位审核 label_organization_new: 新建组织 label_edit_organization: 编辑组织 label_organization_edit: 修改组织 diff --git a/config/routes.rb b/config/routes.rb index 77e6c2791..b7a743591 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -566,6 +566,7 @@ RedmineApp::Application.routes.draw do post "user_commit_homework" post 'user_select_homework' get 'all_journals' + get 'expand_courses' end member do @@ -622,6 +623,8 @@ RedmineApp::Application.routes.draw do match 'user_courselist', :to => 'users#user_courselist', :via => :get, :as => "user_courselist" 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" + get 'edit_brief_introduction' get "user_resource" get "import_resources" @@ -724,8 +727,9 @@ RedmineApp::Application.routes.draw do post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue' delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue' - post 'appliedproject/applied', :to => 'applied_project#applied_join_project', :as => 'appliedproject' - delete 'appliedproject/applied', :to => 'applied_project#unapplied_join_project' + post 'applied_project/applied_join', :to => 'applied_project#applied_join_project', :as => 'applied_join_project' + post 'applied_project/applied_project_info', :to => 'applied_project#applied_project_info', :as => 'applied_project_info' + delete 'applied_project/applied', :to => 'applied_project#unapplied_join_project', :as => 'unapplied_join_project' resources :projects do member do @@ -769,6 +773,8 @@ RedmineApp::Application.routes.draw do collection do get 'autocomplete' get 'appliedproject' + post 'allow_to_join_project' + get 'refused_allow_to_join_project' end end @@ -1159,9 +1165,12 @@ RedmineApp::Application.routes.draw do get "homework_search" get "show_comparecode" get "statistics_course" + get "switch_role" end collection do match 'join_private_courses', :via => [:get, :post] + post "join_course_multi_role" + end match '/member', :to => 'courses#member', :as => 'member', :via => :get @@ -1243,6 +1252,7 @@ RedmineApp::Application.routes.draw do post 'words/:id/leave_syllabus_message', :to => 'words#leave_syllabus_message', :as => "leave_syllabus_message" post 'words/:id/leave_homework_message', :to => 'words#leave_homework_message', :as => "leave_homework_message" post 'words/:id/reply_to_homework', :to => 'words#reply_to_homework', :as => "reply_to_homework" + post 'words/:id/reply_to_syllabus', :to => 'words#reply_to_syllabus', :as => "reply_to_syllabus" post 'join_in/join', :to => 'courses#join', :as => 'join' delete 'join_in/join', :to => 'courses#unjoin' diff --git a/db/migrate/20160725062343_add_invite_code_to_project.rb b/db/migrate/20160725062343_add_invite_code_to_project.rb new file mode 100644 index 000000000..5eb8beace --- /dev/null +++ b/db/migrate/20160725062343_add_invite_code_to_project.rb @@ -0,0 +1,5 @@ +class AddInviteCodeToProject < ActiveRecord::Migration + def change + add_column :projects, :invite_code, :string + end +end diff --git a/db/migrate/20160727065357_add_column_to_member_role.rb b/db/migrate/20160727065357_add_column_to_member_role.rb new file mode 100644 index 000000000..861a32e27 --- /dev/null +++ b/db/migrate/20160727065357_add_column_to_member_role.rb @@ -0,0 +1,5 @@ +class AddColumnToMemberRole < ActiveRecord::Migration + def change + add_column :member_roles, :is_current, :integer, :default => 1 + end +end diff --git a/db/migrate/20160728041943_add_qrcode_to_project.rb b/db/migrate/20160728041943_add_qrcode_to_project.rb new file mode 100644 index 000000000..fea91e225 --- /dev/null +++ b/db/migrate/20160728041943_add_qrcode_to_project.rb @@ -0,0 +1,5 @@ +class AddQrcodeToProject < ActiveRecord::Migration + def change + add_column :projects, :qrcode, :string + end +end diff --git a/db/migrate/20160728075947_add_role_to_applied_project.rb b/db/migrate/20160728075947_add_role_to_applied_project.rb new file mode 100644 index 000000000..964af6f19 --- /dev/null +++ b/db/migrate/20160728075947_add_role_to_applied_project.rb @@ -0,0 +1,5 @@ +class AddRoleToAppliedProject < ActiveRecord::Migration + def change + add_column :applied_projects, :role, :integer, :default => 0 + end +end diff --git a/db/migrate/20160729020903_add_applied_user_id_to_applied_message.rb b/db/migrate/20160729020903_add_applied_user_id_to_applied_message.rb new file mode 100644 index 000000000..480123b05 --- /dev/null +++ b/db/migrate/20160729020903_add_applied_user_id_to_applied_message.rb @@ -0,0 +1,5 @@ +class AddAppliedUserIdToAppliedMessage < ActiveRecord::Migration + def change + add_column :applied_messages, :applied_user_id, :integer + end +end diff --git a/db/migrate/20160729124038_add_role_to_applied_message.rb b/db/migrate/20160729124038_add_role_to_applied_message.rb new file mode 100644 index 000000000..c6a73c794 --- /dev/null +++ b/db/migrate/20160729124038_add_role_to_applied_message.rb @@ -0,0 +1,5 @@ +class AddRoleToAppliedMessage < ActiveRecord::Migration + def change + add_column :applied_messages, :role, :integer + end +end diff --git a/db/migrate/20160729124833_add_project_id_to_applied_message.rb b/db/migrate/20160729124833_add_project_id_to_applied_message.rb new file mode 100644 index 000000000..803c5d8aa --- /dev/null +++ b/db/migrate/20160729124833_add_project_id_to_applied_message.rb @@ -0,0 +1,5 @@ +class AddProjectIdToAppliedMessage < ActiveRecord::Migration + def change + add_column :applied_messages, :project_id, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 8d845f9d2..c7d918346 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,2300 +1,2300 @@ -# 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 => 20160725091759) do - - create_table "activities", :force => true do |t| - t.integer "act_id", :null => false - t.string "act_type", :null => false - t.integer "user_id", :null => false - t.integer "activity_container_id" - t.string "activity_container_type", :default => "" - t.datetime "created_at" - end - - add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" - add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" - add_index "activities", ["user_id"], :name => "index_activities_on_user_id" - - create_table "activity_notifies", :force => true do |t| - t.integer "activity_container_id" - t.string "activity_container_type" - t.integer "activity_id" - t.string "activity_type" - t.integer "notify_to" - t.datetime "created_on" - t.integer "is_read" - end - - add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" - add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" - add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" - - create_table "api_keys", :force => true do |t| - t.string "access_token" - t.datetime "expires_at" - t.integer "user_id" - t.boolean "active", :default => true - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" - add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - - create_table "applied_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - end - - create_table "apply_add_schools", :force => true do |t| - t.string "name" - t.string "province" - t.string "city" - t.string "address" - t.string "remarks" - t.integer "school_id" - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - create_table "apply_homeworks", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" - add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" - - create_table "apply_project_masters", :force => true do |t| - t.integer "user_id" - t.string "apply_type" - t.integer "apply_id" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "apply_resources", :force => true do |t| - t.integer "status" - t.integer "user_id" - t.integer "attachment_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id" - t.string "container_type" - t.text "content" - t.integer "apply_user_id" - end - - create_table "at_messages", :force => true do |t| - t.integer "user_id" - t.integer "at_message_id" - t.string "at_message_type" - t.boolean "viewed", :default => false - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sender_id" - end - - add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" - - create_table "attachment_histories", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.string "filename", :default => "" - t.string "disk_filename", :default => "" - t.integer "filesize", :default => 0 - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "" - t.integer "downloads", :default => 0 - t.integer "author_id" - t.datetime "created_on" - t.string "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.integer "copy_from" - t.integer "quotes" - t.integer "version" - t.integer "attachment_id" - t.integer "is_publish", :default => 1 - t.date "publish_time" - end - - create_table "attachments", :force => true do |t| - t.integer "container_id" - t.string "container_type", :limit => 30 - t.string "filename", :default => "", :null => false - t.string "disk_filename", :default => "", :null => false - t.integer "filesize", :default => 0, :null => false - t.string "content_type", :default => "" - t.string "digest", :limit => 40, :default => "", :null => false - t.integer "downloads", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.string "description" - t.string "disk_directory" - t.integer "attachtype", :default => 1 - t.integer "is_public", :default => 1 - t.integer "copy_from" - t.integer "quotes" - t.integer "is_publish", :default => 1 - t.date "publish_time" - end - - add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" - add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" - add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" - - create_table "attachmentstypes", :force => true do |t| - t.integer "typeId", :null => false - t.string "typeName", :limit => 50 - end - - create_table "auth_sources", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 60, :default => "", :null => false - t.string "host", :limit => 60 - t.integer "port" - t.string "account" - t.string "account_password", :default => "" - t.string "base_dn" - t.string "attr_login", :limit => 30 - t.string "attr_firstname", :limit => 30 - t.string "attr_lastname", :limit => 30 - t.string "attr_mail", :limit => 30 - t.boolean "onthefly_register", :default => false, :null => false - t.boolean "tls", :default => false, :null => false - t.string "filter" - t.integer "timeout" - end - - add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" - - create_table "biding_projects", :force => true do |t| - t.integer "project_id" - t.integer "bid_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "bids", :force => true do |t| - t.string "name" - t.string "budget", :null => false - t.integer "author_id" - t.date "deadline" - t.text "description" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "commit" - t.integer "reward_type" - t.integer "homework_type" - t.integer "parent_id" - t.string "password" - t.integer "is_evaluation" - t.integer "proportion", :default => 60 - t.integer "comment_status", :default => 0 - t.integer "evaluation_num", :default => 3 - t.integer "open_anonymous_evaluation", :default => 1 - end - - create_table "blog_comments", :force => true do |t| - t.integer "blog_id", :null => false - t.integer "parent_id" - t.string "title", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comment_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "blogs", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.integer "position", :default => 1 - t.integer "article_count", :default => 0, :null => false - t.integer "comments_count", :default => 0, :null => false - t.integer "last_comments_id" - t.integer "parent_id" - t.integer "author_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "homepage_id" - end - - create_table "boards", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :default => "", :null => false - t.string "description" - t.integer "position", :default => 1 - t.integer "topics_count", :default => 0, :null => false - t.integer "messages_count", :default => 0, :null => false - t.integer "last_message_id" - t.integer "parent_id" - t.integer "course_id" - t.integer "org_subfield_id" - end - - add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" - add_index "boards", ["project_id"], :name => "boards_project_id" - - create_table "bug_to_osps", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "changes", :force => true do |t| - t.integer "changeset_id", :null => false - t.string "action", :limit => 1, :default => "", :null => false - t.text "path", :null => false - t.text "from_path" - t.string "from_revision" - t.string "revision" - t.string "branch" - end - - add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" - - create_table "changeset_parents", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "parent_id", :null => false - end - - add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" - add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" - - create_table "changesets", :force => true do |t| - t.integer "repository_id", :null => false - t.string "revision", :null => false - t.string "committer" - t.datetime "committed_on", :null => false - t.text "comments" - t.date "commit_date" - t.string "scmid" - t.integer "user_id" - end - - add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" - add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true - add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" - add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" - add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" - - create_table "changesets_issues", :id => false, :force => true do |t| - t.integer "changeset_id", :null => false - t.integer "issue_id", :null => false - end - - add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - - create_table "code_tests", :force => true do |t| - t.integer "homework_id" - t.integer "wait_time", :default => 0 - t.integer "language" - t.integer "status" - t.integer "time_used", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "student_work_id", :default => 0 - end - - create_table "comments", :force => true do |t| - t.string "commented_type", :limit => 30, :default => "", :null => false - t.integer "commented_id", :default => 0, :null => false - t.integer "author_id", :default => 0, :null => false - t.text "comments" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "comments", ["author_id"], :name => "index_comments_on_author_id" - add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" - - create_table "commits", :force => true do |t| - t.integer "repository_id" - t.string "version" - t.string "committer" - t.text "comments" - t.datetime "committed_on" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contest_notifications", :force => true do |t| - t.text "title" - t.text "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contesting_projects", :force => true do |t| - t.integer "project_id" - t.string "contest_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "contesting_softapplications", :force => true do |t| - t.integer "softapplication_id" - t.integer "contest_id" - t.integer "user_id" - t.string "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - end - - create_table "contestnotifications", :force => true do |t| - t.integer "contest_id" - t.string "title" - t.string "summary" - t.text "description" - t.integer "author_id" - t.integer "notificationcomments_count" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "contests", :force => true do |t| - t.string "name" - t.string "budget", :default => "" - t.integer "author_id" - t.date "deadline" - t.string "description" - t.integer "commit" - t.string "password" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - create_table "course_activities", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_act_id" - t.string "course_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" - - create_table "course_attachments", :force => true do |t| - t.string "filename" - t.string "disk_filename" - t.integer "filesize" - t.string "content_type" - t.string "digest" - t.integer "downloads" - t.string "author_id" - t.string "integer" - t.string "description" - t.string "disk_directory" - t.integer "attachtype" - t.integer "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "container_id", :default => 0 - end - - create_table "course_contributor_scores", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.integer "message_num", :default => 0 - t.integer "message_reply_num", :default => 0 - t.integer "news_reply_num", :default => 0 - t.integer "resource_num", :default => 0 - t.integer "journal_num", :default => 0 - t.integer "journal_reply_num", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "total_score", :default => 0 - t.integer "homework_journal_num", :default => 0 - t.integer "news_num", :default => 0 - end - - create_table "course_groups", :force => true do |t| - t.string "name" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_infos", :force => true do |t| - t.integer "course_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "course_messages", :force => true do |t| - t.integer "user_id" - t.integer "course_id" - t.integer "course_message_id" - t.string "course_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "content" - t.integer "status" - t.integer "apply_user_id" - t.integer "apply_result" - end - - add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" - add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" - - create_table "course_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "course_id" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "courses", :force => true do |t| - t.integer "tea_id" - t.string "name" - t.integer "state" - t.string "code" - t.integer "time" - t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "location" - t.string "term" - t.string "string" - t.string "password" - t.string "setup_time" - t.string "endup_time" - t.string "class_period" - t.integer "school_id" - t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 - t.integer "lft" - t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "is_delete", :default => 0 - t.integer "end_time" - t.string "end_term" - t.integer "is_excellent", :default => 0 - t.integer "excellent_option", :default => 0 - t.integer "is_copy", :default => 0 - t.integer "visits", :default => 0 - t.integer "syllabus_id" - t.string "invite_code" - t.string "qrcode" - end - - add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true - add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" - - create_table "custom_fields", :force => true do |t| - t.string "type", :limit => 30, :default => "", :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.string "field_format", :limit => 30, :default => "", :null => false - t.text "possible_values" - t.string "regexp", :default => "" - t.integer "min_length", :default => 0, :null => false - t.integer "max_length", :default => 0, :null => false - t.boolean "is_required", :default => false, :null => false - t.boolean "is_for_all", :default => false, :null => false - t.boolean "is_filter", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "searchable", :default => false - t.text "default_value" - t.boolean "editable", :default => true - t.boolean "visible", :default => true, :null => false - t.boolean "multiple", :default => false - end - - add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" - - create_table "custom_fields_projects", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "project_id", :default => 0, :null => false - end - - add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true - - create_table "custom_fields_trackers", :id => false, :force => true do |t| - t.integer "custom_field_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true - - create_table "custom_values", :force => true do |t| - t.string "customized_type", :limit => 30, :default => "", :null => false - t.integer "customized_id", :default => 0, :null => false - t.integer "custom_field_id", :default => 0, :null => false - t.text "value" - end - - add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" - add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" - - create_table "delayed_jobs", :force => true do |t| - t.integer "priority", :default => 0, :null => false - t.integer "attempts", :default => 0, :null => false - t.text "handler", :null => false - t.text "last_error" - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" - t.string "locked_by" - t.string "queue" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "documents", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "category_id", :default => 0, :null => false - t.string "title", :limit => 60, :default => "", :null => false - t.text "description" - t.datetime "created_on" - t.integer "user_id", :default => 0 - t.integer "is_public", :default => 1 - end - - add_index "documents", ["category_id"], :name => "index_documents_on_category_id" - add_index "documents", ["created_on"], :name => "index_documents_on_created_on" - add_index "documents", ["project_id"], :name => "documents_project_id" - - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 - t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false - end - - create_table "editor_of_documents", :force => true do |t| - t.integer "editor_id" - t.integer "org_document_comment_id" - t.datetime "created_at" - end - - create_table "enabled_modules", :force => true do |t| - t.integer "project_id" - t.string "name", :null => false - t.integer "course_id" - end - - add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" - - create_table "enumerations", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "is_default", :default => false, :null => false - t.string "type" - t.boolean "active", :default => true, :null => false - t.integer "project_id" - t.integer "parent_id" - t.string "position_name", :limit => 30 - end - - add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" - add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - - create_table "exercise_answers", :force => true do |t| - t.integer "user_id" - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_choices", :force => true do |t| - t.integer "exercise_question_id" - t.text "choice_text" - t.integer "choice_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_questions", :force => true do |t| - t.text "question_title" - t.integer "question_type" - t.integer "question_number" - t.integer "exercise_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_score" - end - - create_table "exercise_standard_answers", :force => true do |t| - t.integer "exercise_question_id" - t.integer "exercise_choice_id" - t.text "answer_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "exercise_users", :force => true do |t| - t.integer "user_id" - t.integer "exercise_id" - t.integer "score" - t.datetime "start_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "end_at" - t.integer "status" - end - - create_table "exercises", :force => true do |t| - t.text "exercise_name" - t.text "exercise_description" - t.integer "course_id" - t.integer "exercise_status" - t.integer "user_id" - t.integer "time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.datetime "publish_time" - t.datetime "end_time" - t.integer "show_result" - end - - create_table "first_pages", :force => true do |t| - t.string "web_title" - t.string "title" - t.text "description" - t.string "page_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sort_type" - t.integer "image_width", :default => 107 - t.integer "image_height", :default => 63 - t.integer "show_course", :default => 1 - t.integer "show_contest", :default => 1 - end - - create_table "forge_activities", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_act_id" - t.string "forge_act_type" - t.integer "org_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" - add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" - - create_table "forge_messages", :force => true do |t| - t.integer "user_id" - t.integer "project_id" - t.integer "forge_message_id" - t.string "forge_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "secret_key" - t.integer "status" - end - - add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" - add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" - - create_table "forums", :force => true do |t| - t.string "name", :null => false - t.text "description" - t.integer "topic_count", :default => 0 - t.integer "memo_count", :default => 0 - t.integer "last_memo_id", :default => 0 - t.integer "creator_id", :null => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sticky" - t.integer "locked" - end - - create_table "forwards", :force => true do |t| - t.integer "from_id" - t.string "from_type" - t.integer "to_id" - t.string "to_type" - t.datetime "created_at" - end - - create_table "groups_users", :id => false, :force => true do |t| - t.integer "group_id", :null => false - t.integer "user_id", :null => false - end - - add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true - - create_table "homework_attaches", :force => true do |t| - t.integer "bid_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "reward" - t.string "name" - t.text "description" - t.integer "state" - t.integer "project_id", :default => 0 - t.float "score", :default => 0.0 - t.integer "is_teacher_score", :default => 0 - end - - add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" - - create_table "homework_commons", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "homework_type", :default => 1 - t.string "late_penalty" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "teacher_priority", :default => 1 - t.integer "anonymous_comment", :default => 0 - t.integer "quotes", :default => 0 - t.integer "is_open", :default => 0 - t.datetime "simi_time" - end - - add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" - - create_table "homework_detail_groups", :force => true do |t| - t.integer "homework_common_id" - t.integer "min_num" - t.integer "max_num" - t.integer "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" - - create_table "homework_detail_manuals", :force => true do |t| - t.float "ta_proportion" - t.integer "comment_status" - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "absence_penalty", :default => 1 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "homework_detail_programings", :force => true do |t| - t.string "language" - t.text "standard_code", :limit => 2147483647 - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "ta_proportion", :default => 0.1 - t.integer "question_id" - end - - create_table "homework_evaluations", :force => true do |t| - t.string "user_id" - t.string "homework_attach_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "homework_for_courses", :force => true do |t| - t.integer "course_id" - t.integer "bid_id" - end - - add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" - add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" - - create_table "homework_tests", :force => true do |t| - t.text "input" - t.text "output" - t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "result" - t.text "error_msg" - end - - create_table "homework_users", :force => true do |t| - t.string "homework_attach_id" - t.string "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "invite_lists", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "mail" - end - - create_table "issue_categories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :limit => 30, :default => "", :null => false - t.integer "assigned_to_id" - end - - add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" - add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" - - create_table "issue_relations", :force => true do |t| - t.integer "issue_from_id", :null => false - t.integer "issue_to_id", :null => false - t.string "relation_type", :default => "", :null => false - t.integer "delay" - end - - add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true - add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" - add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" - - create_table "issue_statuses", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_closed", :default => false, :null => false - t.boolean "is_default", :default => false, :null => false - t.integer "position", :default => 1 - t.integer "default_done_ratio" - end - - add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" - add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" - add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" - - create_table "issues", :force => true do |t| - t.integer "tracker_id", :null => false - t.integer "project_id", :null => false - t.string "subject", :default => "", :null => false - t.text "description" - t.date "due_date" - t.integer "category_id" - t.integer "status_id", :null => false - t.integer "assigned_to_id" - t.integer "priority_id", :null => false - t.integer "fixed_version_id" - t.integer "author_id", :null => false - t.integer "lock_version", :default => 0, :null => false - t.datetime "created_on" - t.datetime "updated_on" - t.date "start_date" - t.integer "done_ratio", :default => 0, :null => false - t.float "estimated_hours" - t.integer "parent_id" - t.integer "root_id" - t.integer "lft" - t.integer "rgt" - t.boolean "is_private", :default => false, :null => false - t.datetime "closed_on" - t.integer "project_issues_index" - end - - add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" - add_index "issues", ["author_id"], :name => "index_issues_on_author_id" - add_index "issues", ["category_id"], :name => "index_issues_on_category_id" - add_index "issues", ["created_on"], :name => "index_issues_on_created_on" - add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" - add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" - add_index "issues", ["project_id"], :name => "issues_project_id" - add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" - add_index "issues", ["status_id"], :name => "index_issues_on_status_id" - add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" - - create_table "join_in_competitions", :force => true do |t| - t.integer "user_id" - t.integer "competition_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "join_in_contests", :force => true do |t| - t.integer "user_id" - t.integer "bid_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "journal_details", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - - create_table "journal_replies", :id => false, :force => true do |t| - t.integer "journal_id" - t.integer "user_id" - t.integer "reply_id" - end - - add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" - add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" - add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" - - create_table "journals", :force => true do |t| - t.integer "journalized_id", :default => 0, :null => false - t.string "journalized_type", :limit => 30, :default => "", :null => false - t.integer "user_id", :default => 0, :null => false - t.text "notes" - t.datetime "created_on", :null => false - t.boolean "private_notes", :default => false, :null => false - t.integer "parent_id" - t.integer "comments_count", :default => 0 - t.integer "reply_id" - end - - add_index "journals", ["created_on"], :name => "index_journals_on_created_on" - add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" - add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" - add_index "journals", ["user_id"], :name => "index_journals_on_user_id" - - create_table "journals_for_messages", :force => true do |t| - t.integer "jour_id" - t.string "jour_type" - t.integer "user_id" - t.text "notes" - t.integer "status" - t.integer "reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.string "m_parent_id" - t.boolean "is_readed" - t.integer "m_reply_count" - t.integer "m_reply_id" - t.integer "is_comprehensive_evaluation" - t.integer "private", :default => 0 - end - - create_table "kindeditor_assets", :force => true do |t| - t.string "asset" - t.integer "file_size" - t.string "file_type" - t.integer "owner_id" - t.string "asset_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "owner_type", :default => 0 - end - - create_table "member_roles", :force => true do |t| - t.integer "member_id", :null => false - t.integer "role_id", :null => false - t.integer "inherited_from" - 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 "message_alls", :force => true do |t| - t.integer "user_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" - add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" - - create_table "messages", :force => true do |t| - t.integer "board_id", :null => false - t.integer "parent_id" - t.string "subject", :default => "", :null => false - t.text "content" - t.integer "author_id" - t.integer "replies_count", :default => 0, :null => false - t.integer "last_reply_id" - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "reply_id" - t.integer "quotes" - t.integer "status", :default => 0 - end - - add_index "messages", ["author_id"], :name => "index_messages_on_author_id" - add_index "messages", ["board_id"], :name => "messages_board_id" - add_index "messages", ["created_on"], :name => "index_messages_on_created_on" - add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" - add_index "messages", ["parent_id"], :name => "messages_parent_id" - - create_table "news", :force => true do |t| - t.integer "project_id" - t.string "title", :limit => 60, :default => "", :null => false - t.string "summary", :default => "" - t.text "description" - t.integer "author_id", :default => 0, :null => false - t.datetime "created_on" - t.integer "comments_count", :default => 0, :null => false - t.integer "course_id" - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - end - - add_index "news", ["author_id"], :name => "index_news_on_author_id" - add_index "news", ["created_on"], :name => "index_news_on_created_on" - add_index "news", ["project_id"], :name => "news_project_id" - - create_table "no_uses", :force => true do |t| - t.integer "user_id", :null => false - t.string "no_use_type" - t.integer "no_use_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "notificationcomments", :force => true do |t| - t.string "notificationcommented_type" - t.integer "notificationcommented_id" - t.integer "author_id" - t.text "notificationcomments" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "onclick_times", :force => true do |t| - t.integer "user_id" - t.datetime "onclick_time" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "open_id_authentication_associations", :force => true do |t| - t.integer "issued" - t.integer "lifetime" - t.string "handle" - t.string "assoc_type" - t.binary "server_url" - t.binary "secret" - end - - create_table "open_id_authentication_nonces", :force => true do |t| - t.integer "timestamp", :null => false - t.string "server_url" - t.string "salt", :null => false - end - - create_table "open_source_projects", :force => true do |t| - t.string "name" - t.text "description" - t.integer "commit_count", :default => 0 - t.integer "code_line", :default => 0 - t.integer "users_count", :default => 0 - t.date "last_commit_time" - t.string "url" - t.date "date_collected" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "option_numbers", :force => true do |t| - t.integer "user_id" - t.integer "memo" - t.integer "messages_for_issues" - t.integer "issues_status" - t.integer "replay_for_message" - t.integer "replay_for_memo" - t.integer "follow" - t.integer "tread" - t.integer "praise_by_one" - t.integer "praise_by_two" - t.integer "praise_by_three" - t.integer "tread_by_one" - t.integer "tread_by_two" - t.integer "tread_by_three" - t.integer "changeset" - t.integer "document" - t.integer "attachment" - t.integer "issue_done_ratio" - t.integer "post_issue" - t.integer "score_type" - t.integer "total_score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - end - - create_table "org_activities", :force => true do |t| - t.integer "user_id" - t.integer "org_act_id" - t.string "org_act_type" - t.integer "container_id" - t.string "container_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_courses", :force => true do |t| - t.integer "organization_id" - t.integer "course_id" - t.datetime "created_at" - end - - create_table "org_document_comments", :force => true do |t| - t.text "title" - t.text "content" - t.integer "organization_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "locked", :default => false - t.integer "sticky", :default => 0 - t.integer "org_subfield_id" - t.integer "status", :default => 0 - end - - create_table "org_member_roles", :force => true do |t| - t.integer "org_member_id" - t.integer "role_id" - end - - create_table "org_members", :force => true do |t| - t.integer "user_id" - t.integer "organization_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_messages", :force => true do |t| - t.integer "user_id" - t.integer "sender_id" - t.integer "organization_id" - t.string "message_type" - t.integer "message_id" - t.integer "viewed" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - end - - create_table "org_projects", :force => true do |t| - t.integer "organization_id" - t.integer "project_id" - t.datetime "created_at" - end - - create_table "org_subfield_messages", :force => true do |t| - t.integer "org_subfield_id" - t.integer "message_id" - t.string "message_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "org_subfields", :force => true do |t| - t.integer "organization_id" - t.integer "priority" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 1 - end - - create_table "organizations", :force => true do |t| - t.string "name" - t.text "description" - t.integer "creator_id" - t.integer "home_id" - t.boolean "is_public" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "allow_guest_download", :default => true - t.integer "visits", :default => 0 - t.integer "show_mode", :default => 0 - t.integer "allow_teacher", :default => 0 - end - - create_table "phone_app_versions", :force => true do |t| - t.string "version" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_answers", :force => true do |t| - t.integer "poll_question_id" - t.text "answer_text" - t.integer "answer_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_questions", :force => true do |t| - t.string "question_title" - t.integer "question_type" - t.integer "is_necessary" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_number" - end - - create_table "poll_users", :force => true do |t| - t.integer "user_id" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_votes", :force => true do |t| - t.integer "user_id" - t.integer "poll_question_id" - t.integer "poll_answer_id" - t.text "vote_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "polls", :force => true do |t| - t.string "polls_name" - t.string "polls_type" - t.integer "polls_group_id" - t.integer "polls_status" - t.integer "user_id" - t.datetime "published_at" - t.datetime "closed_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "polls_description" - t.integer "show_result", :default => 1 - end - - create_table "praise_tread_caches", :force => true do |t| - t.integer "object_id", :null => false - t.string "object_type" - t.integer "praise_num" - t.integer "tread_num" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "praise_treads", :force => true do |t| - t.integer "user_id", :null => false - t.integer "praise_tread_object_id" - t.string "praise_tread_object_type" - t.integer "praise_or_tread" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "principal_activities", :force => true do |t| - t.integer "user_id" - t.integer "principal_id" - t.integer "principal_act_id" - t.string "principal_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_infos", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_scores", :force => true do |t| - t.string "project_id" - t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 - t.datetime "commit_time" - end - - create_table "project_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "project_id" - t.integer "project_type" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - end - - add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" - - create_table "projecting_softapplictions", :force => true do |t| - t.integer "user_id" - t.integer "softapplication_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "identifier" - t.integer "status", :default => 1, :null => false - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "commits_count", :default => 0 - t.integer "publish_resource", :default => 0 - t.integer "issues_count", :default => 0 - t.integer "attachments_count", :default => 0 - t.integer "boards_count", :default => 0 - t.integer "news_count", :default => 0 - t.integer "acts_count", :default => 0 - t.integer "journals_count", :default => 0 - t.integer "boards_reply_count", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - 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 "quality_analyses", :force => true do |t| - t.integer "project_id" - t.string "author_login" - t.string "rep_identifier" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sonar_version", :default => 0 - t.string "path" - t.string "branch" - t.string "language" - t.string "sonar_name" - end - - create_table "queries", :force => true do |t| - t.integer "project_id" - t.string "name", :default => "", :null => false - t.text "filters" - t.integer "user_id", :default => 0, :null => false - t.boolean "is_public", :default => false, :null => false - t.text "column_names" - t.text "sort_criteria" - t.string "group_by" - t.string "type" - end - - add_index "queries", ["project_id"], :name => "index_queries_on_project_id" - add_index "queries", ["user_id"], :name => "index_queries_on_user_id" - - create_table "relative_memo_to_open_source_projects", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "relative_memos", :force => true do |t| - t.integer "osp_id" - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false - t.integer "author_id" - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 - t.string "url" - t.string "username" - t.string "userhomeurl" - t.date "date_collected" - t.string "topic_resource" - end - - create_table "rep_statics", :force => true do |t| - t.integer "project_id" - t.integer "commits_num" - t.string "uname" - t.string "email" - t.integer "add" - t.integer "del" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "changeset" - end - - create_table "repositories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "url", :default => "", :null => false - t.string "login", :limit => 60, :default => "" - t.string "password", :default => "" - t.string "root_url", :default => "" - t.string "type" - t.string "path_encoding", :limit => 64 - t.string "log_encoding", :limit => 64 - t.text "extra_info" - t.string "identifier" - t.boolean "is_default", :default => false - t.boolean "hidden", :default => false - end - - add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - - create_table "roles", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "assignable", :default => true - t.integer "builtin", :default => 0, :null => false - t.text "permissions" - t.string "issues_visibility", :limit => 30, :default => "default", :null => false - end - - create_table "schools", :force => true do |t| - t.string "name" - t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "logo_link" - t.string "pinyin" - t.integer "school_type", :default => 0 - end - - create_table "secdomains", :force => true do |t| - t.integer "sub_type" - t.string "subname" - t.integer "pid", :default => 0 - t.string "desc" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_cached_ratings", :force => true do |t| - t.integer "cacheable_id", :limit => 8 - t.string "cacheable_type" - t.float "avg", :null => false - t.integer "cnt", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_rates", :force => true do |t| - t.integer "rater_id", :limit => 8 - t.integer "rateable_id" - t.string "rateable_type" - t.float "stars", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "is_teacher_score", :default => 0 - end - - create_table "settings", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "value" - t.datetime "updated_on" - end - - add_index "settings", ["name"], :name => "index_settings_on_name" - - create_table "shares", :force => true do |t| - t.date "created_on" - t.string "url" - t.string "title" - t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - t.integer "user_id" - t.string "description" - end - - create_table "shield_activities", :force => true do |t| - t.string "container_type" - t.integer "container_id" - t.string "shield_type" - t.integer "shield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "shield_wechat_messages", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.integer "shield_id" - t.string "shield_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "softapplications", :force => true do |t| - t.string "name" - t.text "description" - t.integer "app_type_id" - t.string "app_type_name" - t.string "android_min_version_available" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "contest_id" - t.integer "softapplication_id" - t.integer "is_public" - t.string "application_developers" - t.string "deposit_project_url" - t.string "deposit_project" - t.integer "project_id" - end - - create_table "sonar_errors", :force => true do |t| - t.integer "project_id" - t.string "jenkins_job_name" - t.text "output" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "ssos", :force => true do |t| - t.integer "user_id" - t.string "openid" - t.string "name" - t.string "password" - t.string "email" - t.integer "sex" - t.string "school" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" - - create_table "student_work_projects", :force => true do |t| - t.integer "homework_common_id" - t.integer "student_work_id" - t.integer "project_id" - t.integer "user_id" - t.integer "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" - add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" - add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" - add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" - - create_table "student_work_tests", :force => true do |t| - t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 - t.text "results" - t.text "src" - end - - create_table "student_works", :force => true do |t| - t.string "name" - t.text "description", :limit => 2147483647 - t.integer "homework_common_id" - t.integer "user_id" - t.float "final_score" - t.float "teacher_score" - t.float "student_score" - t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "late_penalty", :default => 0 - t.integer "absence_penalty", :default => 0 - t.float "system_score", :default => 0.0 - t.boolean "is_test", :default => false - t.integer "simi_id" - t.integer "simi_value" - t.float "work_score" - t.integer "work_status", :default => 0 - end - - add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" - - create_table "student_works_evaluation_distributions", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "student_works_scores", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "students_for_courses", :force => true do |t| - t.integer "student_id" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" - add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" - - create_table "sub_document_comments", :force => true do |t| - t.text "content" - t.text "title" - t.integer "sub_domain_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.integer "locked" - t.integer "sticky" - t.integer "org_subfield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "sub_domains", :force => true do |t| - t.integer "org_subfield_id" - t.integer "priority", :default => 0 - t.string "name" - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "subfield_subdomain_dirs", :force => true do |t| - t.integer "org_subfield_id" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "syllabuses", :force => true do |t| - t.string "title" - t.text "description" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "eng_name" - t.integer "syllabus_type" - t.integer "credit" - t.integer "hours" - t.integer "theory_hours" - t.integer "practice_hours" - t.string "applicable_major" - t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 - end - - add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" - end - - create_table "taggings", :force => true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context", :limit => 128 - t.datetime "created_at" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" - add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" - - create_table "tags", :force => true do |t| - t.string "name" - end - - create_table "teachers", :force => true do |t| - t.string "tea_name" - t.string "location" - t.integer "couurse_time" - t.integer "course_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "extra" - end - - create_table "time_entries", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "issue_id" - t.float "hours", :null => false - t.string "comments" - t.integer "activity_id", :null => false - t.date "spent_on", :null => false - t.integer "tyear", :null => false - t.integer "tmonth", :null => false - t.integer "tweek", :null => false - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" - add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" - add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" - add_index "time_entries", ["project_id"], :name => "time_entries_project_id" - add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - - create_table "tokens", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "value", :limit => 40, :default => "", :null => false - t.datetime "created_on", :null => false - end - - add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" - add_index "tokens", ["value"], :name => "tokens_value", :unique => true - - create_table "trackers", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_in_chlog", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "is_in_roadmap", :default => true, :null => false - t.integer "fields_bits", :default => 0 - end - - create_table "user_actions", :force => true do |t| - t.integer "user_id" - t.string "action_type" - t.integer "action_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_activities", :force => true do |t| - t.string "act_type" - t.integer "act_id" - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" - - create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false - t.date "birthday" - t.string "brief_introduction" - t.integer "gender" - t.string "location" - t.string "occupation" - t.integer "work_experience" - t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "technical_title" - t.integer "identity" - t.string "student_id" - t.string "teacher_realname" - t.string "student_realname" - t.string "location_city" - t.integer "school_id" - t.string "description", :default => "" - end - - create_table "user_feedback_messages", :force => true do |t| - t.integer "user_id" - t.integer "journals_for_message_id" - t.string "journals_for_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" - add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" - - create_table "user_grades", :force => true do |t| - t.integer "user_id", :null => false - t.integer "project_id", :null => false - t.float "grade", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" - add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" - add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" - - create_table "user_levels", :force => true do |t| - t.integer "user_id" - t.integer "level" - end - - create_table "user_preferences", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.text "others" - t.boolean "hide_mail", :default => false - t.string "time_zone" - end - - add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" - - create_table "user_score_details", :force => true do |t| - t.integer "current_user_id" - t.integer "target_user_id" - t.string "score_type" - t.string "score_action" - t.integer "user_id" - t.integer "old_score" - t.integer "new_score" - t.integer "current_user_level" - t.integer "target_user_level" - t.integer "score_changeable_obj_id" - t.string "score_changeable_obj_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "grade", :default => 0.0 - end - - add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" - add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" - add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "users", :force => true do |t| - t.string "login", :default => "", :null => false - t.string "hashed_password", :limit => 40, :default => "", :null => false - t.string "firstname", :limit => 30, :default => "", :null => false - t.string "lastname", :default => "", :null => false - t.string "mail", :limit => 60, :default => "", :null => false - t.boolean "admin", :default => false, :null => false - t.integer "status", :default => 1, :null => false - t.datetime "last_login_on" - t.string "language", :limit => 5, :default => "" - t.integer "auth_source_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "type" - t.string "identity_url" - t.string "mail_notification", :default => "", :null => false - t.string "salt", :limit => 64 - t.integer "gid" - t.integer "visits", :default => 0 - t.integer "excellent_teacher", :default => 0 - t.integer "excellent_student", :default => 0 - end - - add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" - add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" - add_index "users", ["type"], :name => "index_users_on_type" - - create_table "versions", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :default => "", :null => false - t.string "description", :default => "" - t.date "effective_date" - t.datetime "created_on" - t.datetime "updated_on" - t.string "wiki_page_title" - t.string "status", :default => "open" - t.string "sharing", :default => "none", :null => false - end - - add_index "versions", ["project_id"], :name => "versions_project_id" - add_index "versions", ["sharing"], :name => "index_versions_on_sharing" - - create_table "visitors", :force => true do |t| - t.integer "user_id" - t.integer "master_id" - t.datetime "updated_on" - t.datetime "created_on" - end - - add_index "visitors", ["master_id"], :name => "index_visitors_master_id" - add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" - add_index "visitors", ["user_id"], :name => "index_visitors_user_id" - - create_table "watchers", :force => true do |t| - t.string "watchable_type", :default => "", :null => false - t.integer "watchable_id", :default => 0, :null => false - t.integer "user_id" - end - - add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" - add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" - add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" - - create_table "web_footer_companies", :force => true do |t| - t.string "name" - t.string "logo_size" - t.string "url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "web_footer_oranizers", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - - add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" - - create_table "wiki_content_versions", :force => true do |t| - t.integer "wiki_content_id", :null => false - t.integer "page_id", :null => false - t.integer "author_id" - t.binary "data", :limit => 2147483647 - t.string "compression", :limit => 6, :default => "" - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" - add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" - - create_table "wiki_contents", :force => true do |t| - t.integer "page_id", :null => false - t.integer "author_id" - t.text "text", :limit => 2147483647 - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" - add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" - - create_table "wiki_pages", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title", :null => false - t.datetime "created_on", :null => false - t.boolean "protected", :default => false, :null => false - t.integer "parent_id" - end - - add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" - add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" - add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" - - create_table "wiki_redirects", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title" - t.string "redirects_to" - t.datetime "created_on", :null => false - end - - add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" - add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" - - create_table "wikis", :force => true do |t| - t.integer "project_id", :null => false - t.string "start_page", :null => false - t.integer "status", :default => 1, :null => false - end - - add_index "wikis", ["project_id"], :name => "wikis_project_id" - - create_table "workflows", :force => true do |t| - t.integer "tracker_id", :default => 0, :null => false - t.integer "old_status_id", :default => 0, :null => false - t.integer "new_status_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - t.boolean "assignee", :default => false, :null => false - t.boolean "author", :default => false, :null => false - t.string "type", :limit => 30 - t.string "field_name", :limit => 30 - t.string "rule", :limit => 30 - end - - add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" - add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" - add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" - add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - - create_table "works_categories", :force => true do |t| - t.string "category" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "zip_packs", :force => true do |t| - t.integer "user_id" - t.integer "homework_id" - t.string "file_digest" - t.string "file_path" - t.integer "pack_times", :default => 1 - t.integer "pack_size", :default => 0 - t.text "file_digests" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - -end +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20160725091759) do + + create_table "activities", :force => true do |t| + t.integer "act_id", :null => false + t.string "act_type", :null => false + t.integer "user_id", :null => false + t.integer "activity_container_id" + t.string "activity_container_type", :default => "" + t.datetime "created_at" + end + + add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type" + add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" + add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + + create_table "activity_notifies", :force => true do |t| + t.integer "activity_container_id" + t.string "activity_container_type" + t.integer "activity_id" + t.string "activity_type" + t.integer "notify_to" + t.datetime "created_on" + t.integer "is_read" + end + + add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id" + add_index "activity_notifies", ["created_on"], :name => "index_an_created_on" + add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to" + + create_table "api_keys", :force => true do |t| + t.string "access_token" + t.datetime "expires_at" + t.integer "user_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" + add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + + create_table "applied_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + end + + create_table "apply_add_schools", :force => true do |t| + t.string "name" + t.string "province" + t.string "city" + t.string "address" + t.string "remarks" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + create_table "apply_homeworks", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id" + add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id" + + create_table "apply_project_masters", :force => true do |t| + t.integer "user_id" + t.string "apply_type" + t.integer "apply_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "apply_resources", :force => true do |t| + t.integer "status" + t.integer "user_id" + t.integer "attachment_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id" + t.string "container_type" + t.text "content" + t.integer "apply_user_id" + end + + create_table "at_messages", :force => true do |t| + t.integer "user_id" + t.integer "at_message_id" + t.string "at_message_type" + t.boolean "viewed", :default => false + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sender_id" + end + + add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id" + + create_table "attachment_histories", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.string "filename", :default => "" + t.string "disk_filename", :default => "" + t.integer "filesize", :default => 0 + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "" + t.integer "downloads", :default => 0 + t.integer "author_id" + t.datetime "created_on" + t.string "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.integer "copy_from" + t.integer "quotes" + t.integer "version" + t.integer "attachment_id" + t.integer "is_publish", :default => 1 + t.date "publish_time" + end + + create_table "attachments", :force => true do |t| + t.integer "container_id" + t.string "container_type", :limit => 30 + t.string "filename", :default => "", :null => false + t.string "disk_filename", :default => "", :null => false + t.integer "filesize", :default => 0, :null => false + t.string "content_type", :default => "" + t.string "digest", :limit => 40, :default => "", :null => false + t.integer "downloads", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.string "description" + t.string "disk_directory" + t.integer "attachtype", :default => 1 + t.integer "is_public", :default => 1 + t.integer "copy_from" + t.integer "quotes" + t.integer "is_publish", :default => 1 + t.date "publish_time" + end + + add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" + add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type" + add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on" + + create_table "attachmentstypes", :force => true do |t| + t.integer "typeId", :null => false + t.string "typeName", :limit => 50 + end + + create_table "auth_sources", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 60, :default => "", :null => false + t.string "host", :limit => 60 + t.integer "port" + t.string "account" + t.string "account_password", :default => "" + t.string "base_dn" + t.string "attr_login", :limit => 30 + t.string "attr_firstname", :limit => 30 + t.string "attr_lastname", :limit => 30 + t.string "attr_mail", :limit => 30 + t.boolean "onthefly_register", :default => false, :null => false + t.boolean "tls", :default => false, :null => false + t.string "filter" + t.integer "timeout" + end + + add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" + + create_table "biding_projects", :force => true do |t| + t.integer "project_id" + t.integer "bid_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "bids", :force => true do |t| + t.string "name" + t.string "budget", :null => false + t.integer "author_id" + t.date "deadline" + t.text "description" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "commit" + t.integer "reward_type" + t.integer "homework_type" + t.integer "parent_id" + t.string "password" + t.integer "is_evaluation" + t.integer "proportion", :default => 60 + t.integer "comment_status", :default => 0 + t.integer "evaluation_num", :default => 3 + t.integer "open_anonymous_evaluation", :default => 1 + end + + create_table "blog_comments", :force => true do |t| + t.integer "blog_id", :null => false + t.integer "parent_id" + t.string "title", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comment_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "blogs", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.integer "position", :default => 1 + t.integer "article_count", :default => 0, :null => false + t.integer "comments_count", :default => 0, :null => false + t.integer "last_comments_id" + t.integer "parent_id" + t.integer "author_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "homepage_id" + end + + create_table "boards", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :default => "", :null => false + t.string "description" + t.integer "position", :default => 1 + t.integer "topics_count", :default => 0, :null => false + t.integer "messages_count", :default => 0, :null => false + t.integer "last_message_id" + t.integer "parent_id" + t.integer "course_id" + t.integer "org_subfield_id" + end + + add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" + add_index "boards", ["project_id"], :name => "boards_project_id" + + create_table "bug_to_osps", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "changes", :force => true do |t| + t.integer "changeset_id", :null => false + t.string "action", :limit => 1, :default => "", :null => false + t.text "path", :null => false + t.text "from_path" + t.string "from_revision" + t.string "revision" + t.string "branch" + end + + add_index "changes", ["changeset_id"], :name => "changesets_changeset_id" + + create_table "changeset_parents", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "parent_id", :null => false + end + + add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids" + add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" + + create_table "changesets", :force => true do |t| + t.integer "repository_id", :null => false + t.string "revision", :null => false + t.string "committer" + t.datetime "committed_on", :null => false + t.text "comments" + t.date "commit_date" + t.string "scmid" + t.integer "user_id" + end + + add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" + add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true + add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid" + add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id" + add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id" + + create_table "changesets_issues", :id => false, :force => true do |t| + t.integer "changeset_id", :null => false + t.integer "issue_id", :null => false + end + + add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + + create_table "code_review_assignments", :force => true do |t| + t.integer "issue_id" + t.integer "change_id" + t.integer "attachment_id" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.string "action_type" + t.integer "changeset_id" + end + + create_table "code_review_project_settings", :force => true do |t| + t.integer "project_id" + t.integer "tracker_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "updated_by" + t.boolean "hide_code_review_tab", :default => false + t.integer "auto_relation", :default => 1 + t.integer "assignment_tracker_id" + t.text "auto_assign" + t.integer "lock_version", :default => 0, :null => false + t.boolean "tracker_in_review_dialog", :default => false + end + + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "code_reviews", :force => true do |t| + t.integer "project_id" + t.integer "change_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "line" + t.integer "updated_by_id" + t.integer "lock_version", :default => 0, :null => false + t.integer "status_changed_from" + t.integer "status_changed_to" + t.integer "issue_id" + t.string "action_type" + t.string "file_path" + t.string "rev" + t.string "rev_to" + t.integer "attachment_id" + t.integer "file_count", :default => 0, :null => false + t.boolean "diff_all" + end + + create_table "code_tests", :force => true do |t| + t.integer "homework_id" + t.integer "wait_time", :default => 0 + t.integer "language" + t.integer "status" + t.integer "time_used", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "student_work_id", :default => 0 + end + + create_table "comments", :force => true do |t| + t.string "commented_type", :limit => 30, :default => "", :null => false + t.integer "commented_id", :default => 0, :null => false + t.integer "author_id", :default => 0, :null => false + t.text "comments" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "comments", ["author_id"], :name => "index_comments_on_author_id" + add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type" + + create_table "commits", :force => true do |t| + t.integer "repository_id" + t.string "version" + t.string "committer" + t.text "comments" + t.datetime "committed_on" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contest_notifications", :force => true do |t| + t.text "title" + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contesting_projects", :force => true do |t| + t.integer "project_id" + t.string "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contesting_softapplications", :force => true do |t| + t.integer "softapplication_id" + t.integer "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contestnotifications", :force => true do |t| + t.integer "contest_id" + t.string "title" + t.string "summary" + t.text "description" + t.integer "author_id" + t.integer "notificationcomments_count" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "contests", :force => true do |t| + t.string "name" + t.string "budget", :default => "" + t.integer "author_id" + t.date "deadline" + t.string "description" + t.integer "commit" + t.string "password" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + create_table "course_activities", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_act_id" + t.string "course_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index" + + create_table "course_attachments", :force => true do |t| + t.string "filename" + t.string "disk_filename" + t.integer "filesize" + t.string "content_type" + t.string "digest" + t.integer "downloads" + t.string "author_id" + t.string "integer" + t.string "description" + t.string "disk_directory" + t.integer "attachtype" + t.integer "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "container_id", :default => 0 + end + + create_table "course_contributor_scores", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.integer "message_num", :default => 0 + t.integer "message_reply_num", :default => 0 + t.integer "news_reply_num", :default => 0 + t.integer "resource_num", :default => 0 + t.integer "journal_num", :default => 0 + t.integer "journal_reply_num", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "total_score", :default => 0 + t.integer "homework_journal_num", :default => 0 + t.integer "news_num", :default => 0 + end + + create_table "course_groups", :force => true do |t| + t.string "name" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_infos", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "course_messages", :force => true do |t| + t.integer "user_id" + t.integer "course_id" + t.integer "course_message_id" + t.string "course_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "content" + t.integer "status" + t.integer "apply_user_id" + t.integer "apply_result" + end + + add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" + add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" + + create_table "course_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "course_id" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "courses", :force => true do |t| + t.integer "tea_id" + t.string "name" + t.integer "state" + t.string "code" + t.integer "time" + t.string "extra" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "location" + t.string "term" + t.string "string" + t.string "password" + t.string "setup_time" + t.string "endup_time" + t.string "class_period" + t.integer "school_id" + t.text "description" + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 + t.integer "lft" + t.integer "rgt" + t.integer "is_public", :limit => 1, :default => 1 + t.integer "inherit_members", :limit => 1, :default => 1 + t.integer "open_student", :default => 0 + t.integer "outline", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "is_delete", :default => 0 + t.integer "end_time" + t.string "end_term" + t.integer "is_excellent", :default => 0 + t.integer "excellent_option", :default => 0 + t.integer "is_copy", :default => 0 + t.integer "visits", :default => 0 + t.integer "syllabus_id" + t.string "invite_code" + t.string "qrcode" + end + + add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true + add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id" + + create_table "custom_fields", :force => true do |t| + t.string "type", :limit => 30, :default => "", :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.string "field_format", :limit => 30, :default => "", :null => false + t.text "possible_values" + t.string "regexp", :default => "" + t.integer "min_length", :default => 0, :null => false + t.integer "max_length", :default => 0, :null => false + t.boolean "is_required", :default => false, :null => false + t.boolean "is_for_all", :default => false, :null => false + t.boolean "is_filter", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "searchable", :default => false + t.text "default_value" + t.boolean "editable", :default => true + t.boolean "visible", :default => true, :null => false + t.boolean "multiple", :default => false + end + + add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type" + + create_table "custom_fields_projects", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "project_id", :default => 0, :null => false + end + + add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true + + create_table "custom_fields_trackers", :id => false, :force => true do |t| + t.integer "custom_field_id", :default => 0, :null => false + t.integer "tracker_id", :default => 0, :null => false + end + + add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true + + create_table "custom_values", :force => true do |t| + t.string "customized_type", :limit => 30, :default => "", :null => false + t.integer "customized_id", :default => 0, :null => false + t.integer "custom_field_id", :default => 0, :null => false + t.text "value" + end + + add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" + add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + + create_table "delayed_jobs", :force => true do |t| + t.integer "priority", :default => 0, :null => false + t.integer "attempts", :default => 0, :null => false + t.text "handler", :null => false + t.text "last_error" + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" + t.string "locked_by" + t.string "queue" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "documents", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.integer "category_id", :default => 0, :null => false + t.string "title", :limit => 60, :default => "", :null => false + t.text "description" + t.datetime "created_on" + t.integer "user_id", :default => 0 + t.integer "is_public", :default => 1 + end + + add_index "documents", ["category_id"], :name => "index_documents_on_category_id" + add_index "documents", ["created_on"], :name => "index_documents_on_created_on" + add_index "documents", ["project_id"], :name => "documents_project_id" + + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 + t.string "File" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false + end + + create_table "editor_of_documents", :force => true do |t| + t.integer "editor_id" + t.integer "org_document_comment_id" + t.datetime "created_at" + end + + create_table "enabled_modules", :force => true do |t| + t.integer "project_id" + t.string "name", :null => false + t.integer "course_id" + end + + add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id" + + create_table "enumerations", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "is_default", :default => false, :null => false + t.string "type" + t.boolean "active", :default => true, :null => false + t.integer "project_id" + t.integer "parent_id" + t.string "position_name", :limit => 30 + end + + add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" + add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + + create_table "exercise_answers", :force => true do |t| + t.integer "user_id" + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_choices", :force => true do |t| + t.integer "exercise_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "exercise_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_score" + end + + create_table "exercise_standard_answers", :force => true do |t| + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_users", :force => true do |t| + t.integer "user_id" + t.integer "exercise_id" + t.integer "score" + t.datetime "start_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "end_at" + t.integer "status" + end + + create_table "exercises", :force => true do |t| + t.text "exercise_name" + t.text "exercise_description" + t.integer "course_id" + t.integer "exercise_status" + t.integer "user_id" + t.integer "time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "publish_time" + t.datetime "end_time" + t.integer "show_result" + end + + create_table "first_pages", :force => true do |t| + t.string "web_title" + t.string "title" + t.text "description" + t.string "page_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sort_type" + t.integer "image_width", :default => 107 + t.integer "image_height", :default => 63 + t.integer "show_course", :default => 1 + t.integer "show_contest", :default => 1 + end + + create_table "forge_activities", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_act_id" + t.string "forge_act_type" + t.integer "org_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id" + add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index" + + create_table "forge_messages", :force => true do |t| + t.integer "user_id" + t.integer "project_id" + t.integer "forge_message_id" + t.string "forge_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "secret_key" + t.integer "status" + end + + add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" + add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + + create_table "forums", :force => true do |t| + t.string "name", :null => false + t.text "description" + t.integer "topic_count", :default => 0 + t.integer "memo_count", :default => 0 + t.integer "last_memo_id", :default => 0 + t.integer "creator_id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sticky" + t.integer "locked" + end + + create_table "forwards", :force => true do |t| + t.integer "from_id" + t.string "from_type" + t.integer "to_id" + t.string "to_type" + t.datetime "created_at" + end + + create_table "groups_users", :id => false, :force => true do |t| + t.integer "group_id", :null => false + t.integer "user_id", :null => false + end + + add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true + + create_table "homework_attaches", :force => true do |t| + t.integer "bid_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + t.string "name" + t.text "description" + t.integer "state" + t.integer "project_id", :default => 0 + t.float "score", :default => 0.0 + t.integer "is_teacher_score", :default => 0 + end + + add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + + create_table "homework_commons", :force => true do |t| + t.string "name" + t.integer "user_id" + t.text "description" + t.date "publish_time" + t.date "end_time" + t.integer "homework_type", :default => 1 + t.string "late_penalty" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 + t.integer "anonymous_comment", :default => 0 + t.integer "quotes", :default => 0 + t.integer "is_open", :default => 0 + t.datetime "simi_time" + end + + add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + + create_table "homework_detail_groups", :force => true do |t| + t.integer "homework_common_id" + t.integer "min_num" + t.integer "max_num" + t.integer "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" + + create_table "homework_detail_manuals", :force => true do |t| + t.float "ta_proportion" + t.integer "comment_status" + t.date "evaluation_start" + t.date "evaluation_end" + t.integer "evaluation_num" + t.integer "absence_penalty", :default => 1 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_detail_programings", :force => true do |t| + t.string "language" + t.text "standard_code", :limit => 2147483647 + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "ta_proportion", :default => 0.1 + t.integer "question_id" + end + + create_table "homework_evaluations", :force => true do |t| + t.string "user_id" + t.string "homework_attach_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "homework_for_courses", :force => true do |t| + t.integer "course_id" + t.integer "bid_id" + end + + add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" + add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + + create_table "homework_tests", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "result" + t.text "error_msg" + end + + create_table "homework_users", :force => true do |t| + t.string "homework_attach_id" + t.string "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "invite_lists", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "mail" + end + + create_table "issue_categories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :limit => 30, :default => "", :null => false + t.integer "assigned_to_id" + end + + add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id" + add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" + + create_table "issue_relations", :force => true do |t| + t.integer "issue_from_id", :null => false + t.integer "issue_to_id", :null => false + t.string "relation_type", :default => "", :null => false + t.integer "delay" + end + + add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true + add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id" + add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id" + + create_table "issue_statuses", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_closed", :default => false, :null => false + t.boolean "is_default", :default => false, :null => false + t.integer "position", :default => 1 + t.integer "default_done_ratio" + end + + add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed" + add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default" + add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position" + + create_table "issues", :force => true do |t| + t.integer "tracker_id", :null => false + t.integer "project_id", :null => false + t.string "subject", :default => "", :null => false + t.text "description" + t.date "due_date" + t.integer "category_id" + t.integer "status_id", :null => false + t.integer "assigned_to_id" + t.integer "priority_id", :null => false + t.integer "fixed_version_id" + t.integer "author_id", :null => false + t.integer "lock_version", :default => 0, :null => false + t.datetime "created_on" + t.datetime "updated_on" + t.date "start_date" + t.integer "done_ratio", :default => 0, :null => false + t.float "estimated_hours" + t.integer "parent_id" + t.integer "root_id" + t.integer "lft" + t.integer "rgt" + t.boolean "is_private", :default => false, :null => false + t.datetime "closed_on" + t.integer "project_issues_index" + end + + add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id" + add_index "issues", ["author_id"], :name => "index_issues_on_author_id" + add_index "issues", ["category_id"], :name => "index_issues_on_category_id" + add_index "issues", ["created_on"], :name => "index_issues_on_created_on" + add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id" + add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id" + add_index "issues", ["project_id"], :name => "issues_project_id" + add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt" + add_index "issues", ["status_id"], :name => "index_issues_on_status_id" + add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id" + + create_table "join_in_competitions", :force => true do |t| + t.integer "user_id" + t.integer "competition_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "join_in_contests", :force => true do |t| + t.integer "user_id" + t.integer "bid_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "journal_details", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + + create_table "journal_replies", :id => false, :force => true do |t| + t.integer "journal_id" + t.integer "user_id" + t.integer "reply_id" + end + + add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id" + add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id" + add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id" + + create_table "journals", :force => true do |t| + t.integer "journalized_id", :default => 0, :null => false + t.string "journalized_type", :limit => 30, :default => "", :null => false + t.integer "user_id", :default => 0, :null => false + t.text "notes" + t.datetime "created_on", :null => false + t.boolean "private_notes", :default => false, :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" + end + + add_index "journals", ["created_on"], :name => "index_journals_on_created_on" + add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id" + add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id" + add_index "journals", ["user_id"], :name => "index_journals_on_user_id" + + create_table "journals_for_messages", :force => true do |t| + t.integer "jour_id" + t.string "jour_type" + t.integer "user_id" + t.text "notes" + t.integer "status" + t.integer "reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.string "m_parent_id" + t.boolean "is_readed" + t.integer "m_reply_count" + t.integer "m_reply_id" + t.integer "is_comprehensive_evaluation" + t.integer "private", :default => 0 + end + + create_table "kindeditor_assets", :force => true do |t| + t.string "asset" + t.integer "file_size" + t.string "file_type" + t.integer "owner_id" + t.string "asset_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "owner_type", :default => 0 + end + + create_table "member_roles", :force => true do |t| + t.integer "member_id", :null => false + t.integer "role_id", :null => false + t.integer "inherited_from" + 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 "message_alls", :force => true do |t| + t.integer "user_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" + add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" + + create_table "messages", :force => true do |t| + t.integer "board_id", :null => false + t.integer "parent_id" + t.string "subject", :default => "", :null => false + t.text "content" + t.integer "author_id" + t.integer "replies_count", :default => 0, :null => false + t.integer "last_reply_id" + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "reply_id" + t.integer "quotes" + t.integer "status", :default => 0 + end + + add_index "messages", ["author_id"], :name => "index_messages_on_author_id" + add_index "messages", ["board_id"], :name => "messages_board_id" + add_index "messages", ["created_on"], :name => "index_messages_on_created_on" + add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" + add_index "messages", ["parent_id"], :name => "messages_parent_id" + + create_table "news", :force => true do |t| + t.integer "project_id" + t.string "title", :limit => 60, :default => "", :null => false + t.string "summary", :default => "" + t.text "description" + t.integer "author_id", :default => 0, :null => false + t.datetime "created_on" + t.integer "comments_count", :default => 0, :null => false + t.integer "course_id" + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + end + + add_index "news", ["author_id"], :name => "index_news_on_author_id" + add_index "news", ["created_on"], :name => "index_news_on_created_on" + add_index "news", ["project_id"], :name => "news_project_id" + + create_table "no_uses", :force => true do |t| + t.integer "user_id", :null => false + t.string "no_use_type" + t.integer "no_use_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "notificationcomments", :force => true do |t| + t.string "notificationcommented_type" + t.integer "notificationcommented_id" + t.integer "author_id" + t.text "notificationcomments" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "open_id_authentication_associations", :force => true do |t| + t.integer "issued" + t.integer "lifetime" + t.string "handle" + t.string "assoc_type" + t.binary "server_url" + t.binary "secret" + end + + create_table "open_id_authentication_nonces", :force => true do |t| + t.integer "timestamp", :null => false + t.string "server_url" + t.string "salt", :null => false + end + + create_table "open_source_projects", :force => true do |t| + t.string "name" + t.text "description" + t.integer "commit_count", :default => 0 + t.integer "code_line", :default => 0 + t.integer "users_count", :default => 0 + t.date "last_commit_time" + t.string "url" + t.date "date_collected" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "option_numbers", :force => true do |t| + t.integer "user_id" + t.integer "memo" + t.integer "messages_for_issues" + t.integer "issues_status" + t.integer "replay_for_message" + t.integer "replay_for_memo" + t.integer "follow" + t.integer "tread" + t.integer "praise_by_one" + t.integer "praise_by_two" + t.integer "praise_by_three" + t.integer "tread_by_one" + t.integer "tread_by_two" + t.integer "tread_by_three" + t.integer "changeset" + t.integer "document" + t.integer "attachment" + t.integer "issue_done_ratio" + t.integer "post_issue" + t.integer "score_type" + t.integer "total_score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + end + + create_table "org_activities", :force => true do |t| + t.integer "user_id" + t.integer "org_act_id" + t.string "org_act_type" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_courses", :force => true do |t| + t.integer "organization_id" + t.integer "course_id" + t.datetime "created_at" + end + + create_table "org_document_comments", :force => true do |t| + t.text "title" + t.text "content" + t.integer "organization_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + t.integer "status", :default => 0 + end + + create_table "org_member_roles", :force => true do |t| + t.integer "org_member_id" + t.integer "role_id" + end + + create_table "org_members", :force => true do |t| + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_messages", :force => true do |t| + t.integer "user_id" + t.integer "sender_id" + t.integer "organization_id" + t.string "message_type" + t.integer "message_id" + t.integer "viewed" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + end + + create_table "org_projects", :force => true do |t| + t.integer "organization_id" + t.integer "project_id" + t.datetime "created_at" + end + + create_table "org_subfield_messages", :force => true do |t| + t.integer "org_subfield_id" + t.integer "message_id" + t.string "message_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_subfields", :force => true do |t| + t.integer "organization_id" + t.integer "priority" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 1 + end + + create_table "organizations", :force => true do |t| + t.string "name" + t.text "description" + t.integer "creator_id" + t.integer "home_id" + t.boolean "is_public" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "allow_guest_download", :default => true + t.integer "visits", :default => 0 + t.integer "show_mode", :default => 0 + t.integer "allow_teacher", :default => 0 + end + + create_table "phone_app_versions", :force => true do |t| + t.string "version" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_answers", :force => true do |t| + t.integer "poll_question_id" + t.text "answer_text" + t.integer "answer_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_questions", :force => true do |t| + t.string "question_title" + t.integer "question_type" + t.integer "is_necessary" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_number" + end + + create_table "poll_users", :force => true do |t| + t.integer "user_id" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_votes", :force => true do |t| + t.integer "user_id" + t.integer "poll_question_id" + t.integer "poll_answer_id" + t.text "vote_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "polls", :force => true do |t| + t.string "polls_name" + t.string "polls_type" + t.integer "polls_group_id" + t.integer "polls_status" + t.integer "user_id" + t.datetime "published_at" + t.datetime "closed_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "polls_description" + t.integer "show_result", :default => 1 + end + + create_table "praise_tread_caches", :force => true do |t| + t.integer "object_id", :null => false + t.string "object_type" + t.integer "praise_num" + t.integer "tread_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "praise_treads", :force => true do |t| + t.integer "user_id", :null => false + t.integer "praise_tread_object_id" + t.string "praise_tread_object_type" + t.integer "praise_or_tread" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "principal_activities", :force => true do |t| + t.integer "user_id" + t.integer "principal_id" + t.integer "principal_act_id" + t.string "principal_act_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_infos", :force => true do |t| + t.integer "project_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "project_scores", :force => true do |t| + t.string "project_id" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "issue_num", :default => 0 + t.integer "issue_journal_num", :default => 0 + t.integer "news_num", :default => 0 + t.integer "documents_num", :default => 0 + t.integer "changeset_num", :default => 0 + t.integer "board_message_num", :default => 0 + t.integer "board_num", :default => 0 + t.integer "attach_num", :default => 0 + t.datetime "commit_time" + end + + create_table "project_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "project_id" + t.integer "project_type" + t.float "grade", :default => 0.0 + t.integer "course_ac_para", :default => 0 + end + + add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" + + create_table "projecting_softapplictions", :force => true do |t| + t.integer "user_id" + t.integer "softapplication_id" + t.integer "project_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "projects", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false + t.integer "parent_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "identifier" + t.integer "status", :default => 1, :null => false + t.integer "lft" + t.integer "rgt" + t.boolean "inherit_members", :default => false, :null => false + t.integer "project_type" + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 + t.integer "user_id" + t.integer "dts_test", :default => 0 + t.string "enterprise_name" + t.integer "organization_id" + t.integer "project_new_type" + t.integer "gpid" + t.integer "forked_from_project_id" + t.integer "forked_count" + t.integer "commits_count", :default => 0 + t.integer "publish_resource", :default => 0 + t.integer "issues_count", :default => 0 + t.integer "attachments_count", :default => 0 + t.integer "boards_count", :default => 0 + t.integer "news_count", :default => 0 + t.integer "acts_count", :default => 0 + t.integer "journals_count", :default => 0 + t.integer "boards_reply_count", :default => 0 + t.integer "visits", :default => 0 + t.integer "hot", :default => 0 + 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 "quality_analyses", :force => true do |t| + t.integer "project_id" + t.string "author_login" + t.string "rep_identifier" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "sonar_version", :default => 0 + t.string "path" + t.string "branch" + t.string "language" + t.string "sonar_name" + end + + create_table "queries", :force => true do |t| + t.integer "project_id" + t.string "name", :default => "", :null => false + t.text "filters" + t.integer "user_id", :default => 0, :null => false + t.boolean "is_public", :default => false, :null => false + t.text "column_names" + t.text "sort_criteria" + t.string "group_by" + t.string "type" + end + + add_index "queries", ["project_id"], :name => "index_queries_on_project_id" + add_index "queries", ["user_id"], :name => "index_queries_on_user_id" + + create_table "relative_memo_to_open_source_projects", :force => true do |t| + t.integer "osp_id" + t.integer "relative_memo_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "relative_memos", :force => true do |t| + t.integer "osp_id" + t.integer "parent_id" + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false + t.integer "author_id" + t.integer "replies_count", :default => 0 + t.integer "last_reply_id" + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 + t.string "url" + t.string "username" + t.string "userhomeurl" + t.date "date_collected" + t.string "topic_resource" + end + + create_table "rep_statics", :force => true do |t| + t.integer "project_id" + t.integer "commits_num" + t.string "uname" + t.string "email" + t.integer "add" + t.integer "del" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "changeset" + end + + create_table "repositories", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "url", :default => "", :null => false + t.string "login", :limit => 60, :default => "" + t.string "password", :default => "" + t.string "root_url", :default => "" + t.string "type" + t.string "path_encoding", :limit => 64 + t.string "log_encoding", :limit => 64 + t.text "extra_info" + t.string "identifier" + t.boolean "is_default", :default => false + t.boolean "hidden", :default => false + end + + add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + + create_table "roles", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.integer "position", :default => 1 + t.boolean "assignable", :default => true + t.integer "builtin", :default => 0, :null => false + t.text "permissions" + t.string "issues_visibility", :limit => 30, :default => "default", :null => false + end + + create_table "schools", :force => true do |t| + t.string "name" + t.string "province" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "logo_link" + t.string "pinyin" + t.integer "school_type", :default => 0 + end + + create_table "secdomains", :force => true do |t| + t.integer "sub_type" + t.string "subname" + t.integer "pid", :default => 0 + t.string "desc" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_cached_ratings", :force => true do |t| + t.integer "cacheable_id", :limit => 8 + t.string "cacheable_type" + t.float "avg", :null => false + t.integer "cnt", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "seems_rateable_rates", :force => true do |t| + t.integer "rater_id", :limit => 8 + t.integer "rateable_id" + t.string "rateable_type" + t.float "stars", :null => false + t.string "dimension" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "is_teacher_score", :default => 0 + end + + create_table "settings", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "value" + t.datetime "updated_on" + end + + add_index "settings", ["name"], :name => "index_settings_on_name" + + create_table "shares", :force => true do |t| + t.date "created_on" + t.string "url" + t.string "title" + t.integer "share_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "project_id" + t.integer "user_id" + t.string "description" + end + + create_table "shield_activities", :force => true do |t| + t.string "container_type" + t.integer "container_id" + t.string "shield_type" + t.integer "shield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "shield_wechat_messages", :force => true do |t| + t.integer "container_id" + t.string "container_type" + t.integer "shield_id" + t.string "shield_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "softapplications", :force => true do |t| + t.string "name" + t.text "description" + t.integer "app_type_id" + t.string "app_type_name" + t.string "android_min_version_available" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "contest_id" + t.integer "softapplication_id" + t.integer "is_public" + t.string "application_developers" + t.string "deposit_project_url" + t.string "deposit_project" + t.integer "project_id" + end + + create_table "sonar_errors", :force => true do |t| + t.integer "project_id" + t.string "jenkins_job_name" + t.text "output" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "ssos", :force => true do |t| + t.integer "user_id" + t.string "openid" + t.string "name" + t.string "password" + t.string "email" + t.integer "sex" + t.string "school" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" + + create_table "student_work_projects", :force => true do |t| + t.integer "homework_common_id" + t.integer "student_work_id" + t.integer "project_id" + t.integer "user_id" + t.integer "is_leader" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" + add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" + add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" + add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" + + create_table "student_work_tests", :force => true do |t| + t.integer "student_work_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 9 + t.text "results" + t.text "src" + end + + create_table "student_works", :force => true do |t| + t.string "name" + t.text "description", :limit => 2147483647 + t.integer "homework_common_id" + t.integer "user_id" + t.float "final_score" + t.float "teacher_score" + t.float "student_score" + t.float "teaching_asistant_score" + t.integer "project_id", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "late_penalty", :default => 0 + t.integer "absence_penalty", :default => 0 + t.float "system_score", :default => 0.0 + t.boolean "is_test", :default => false + t.integer "simi_id" + t.integer "simi_value" + t.float "work_score" + t.integer "work_status", :default => 0 + end + + add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + + create_table "student_works_evaluation_distributions", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "student_works_scores", :force => true do |t| + t.integer "student_work_id" + t.integer "user_id" + t.integer "score" + t.text "comment" + t.integer "reviewer_role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "students_for_courses", :force => true do |t| + t.integer "student_id" + t.integer "course_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" + add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" + + create_table "sub_document_comments", :force => true do |t| + t.text "content" + t.text "title" + t.integer "sub_domain_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.integer "locked" + t.integer "sticky" + t.integer "org_subfield_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "sub_domains", :force => true do |t| + t.integer "org_subfield_id" + t.integer "priority", :default => 0 + t.string "name" + t.string "field_type" + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "subfield_subdomain_dirs", :force => true do |t| + t.integer "org_subfield_id" + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "syllabuses", :force => true do |t| + t.string "title" + t.text "description" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "eng_name" + t.integer "syllabus_type" + t.integer "credit" + t.integer "hours" + t.integer "theory_hours" + t.integer "practice_hours" + t.string "applicable_major" + t.string "pre_course" + t.integer "visits", :default => 0 + t.integer "des_status", :default => 0 + end + + add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" + + create_table "system_messages", :force => true do |t| + t.integer "user_id" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "description" + t.string "subject" + end + + create_table "taggings", :force => true do |t| + t.integer "tag_id" + t.integer "taggable_id" + t.string "taggable_type" + t.integer "tagger_id" + t.string "tagger_type" + t.string "context", :limit => 128 + t.datetime "created_at" + end + + add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" + add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" + add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" + + create_table "tags", :force => true do |t| + t.string "name" + end + + create_table "teachers", :force => true do |t| + t.string "tea_name" + t.string "location" + t.integer "couurse_time" + t.integer "course_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "extra" + end + + create_table "time_entries", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.integer "issue_id" + t.float "hours", :null => false + t.string "comments" + t.integer "activity_id", :null => false + t.date "spent_on", :null => false + t.integer "tyear", :null => false + t.integer "tmonth", :null => false + t.integer "tweek", :null => false + t.datetime "created_on", :null => false + t.datetime "updated_on", :null => false + end + + add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" + add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" + add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" + add_index "time_entries", ["project_id"], :name => "time_entries_project_id" + add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" + + create_table "tokens", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "value", :limit => 40, :default => "", :null => false + t.datetime "created_on", :null => false + end + + add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" + add_index "tokens", ["value"], :name => "tokens_value", :unique => true + + create_table "trackers", :force => true do |t| + t.string "name", :limit => 30, :default => "", :null => false + t.boolean "is_in_chlog", :default => false, :null => false + t.integer "position", :default => 1 + t.boolean "is_in_roadmap", :default => true, :null => false + t.integer "fields_bits", :default => 0 + end + + create_table "user_actions", :force => true do |t| + t.integer "user_id" + t.string "action_type" + t.integer "action_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_activities", :force => true do |t| + t.string "act_type" + t.integer "act_id" + t.string "container_type" + t.integer "container_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "user_id" + end + + add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" + + create_table "user_extensions", :force => true do |t| + t.integer "user_id", :null => false + t.date "birthday" + t.string "brief_introduction" + t.integer "gender" + t.string "location" + t.string "occupation" + t.integer "work_experience" + t.integer "zip_code" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "technical_title" + t.integer "identity" + t.string "student_id" + t.string "teacher_realname" + t.string "student_realname" + t.string "location_city" + t.integer "school_id" + t.string "description", :default => "" + end + + create_table "user_feedback_messages", :force => true do |t| + t.integer "user_id" + t.integer "journals_for_message_id" + t.string "journals_for_message_type" + t.integer "viewed" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" + add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" + + create_table "user_grades", :force => true do |t| + t.integer "user_id", :null => false + t.integer "project_id", :null => false + t.float "grade", :default => 0.0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" + add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" + add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" + + create_table "user_levels", :force => true do |t| + t.integer "user_id" + t.integer "level" + end + + create_table "user_preferences", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.text "others" + t.boolean "hide_mail", :default => false + t.string "time_zone" + end + + add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" + + create_table "user_score_details", :force => true do |t| + t.integer "current_user_id" + t.integer "target_user_id" + t.string "score_type" + t.string "score_action" + t.integer "user_id" + t.integer "old_score" + t.integer "new_score" + t.integer "current_user_level" + t.integer "target_user_level" + t.integer "score_changeable_obj_id" + t.string "score_changeable_obj_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_scores", :force => true do |t| + t.integer "user_id", :null => false + t.integer "collaboration" + t.integer "influence" + t.integer "skill" + t.integer "active" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "user_statuses", :force => true do |t| + t.integer "changesets_count" + t.integer "watchers_count" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.float "grade", :default => 0.0 + end + + add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" + add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" + add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" + + create_table "user_wechats", :force => true do |t| + t.integer "subscribe" + t.string "openid" + t.string "nickname" + t.integer "sex" + t.string "language" + t.string "city" + t.string "province" + t.string "country" + t.string "headimgurl" + t.string "subscribe_time" + t.string "unionid" + t.string "remark" + t.integer "groupid" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "users", :force => true do |t| + t.string "login", :default => "", :null => false + t.string "hashed_password", :limit => 40, :default => "", :null => false + t.string "firstname", :limit => 30, :default => "", :null => false + t.string "lastname", :default => "", :null => false + t.string "mail", :limit => 60, :default => "", :null => false + t.boolean "admin", :default => false, :null => false + t.integer "status", :default => 1, :null => false + t.datetime "last_login_on" + t.string "language", :limit => 5, :default => "" + t.integer "auth_source_id" + t.datetime "created_on" + t.datetime "updated_on" + t.string "type" + t.string "identity_url" + t.string "mail_notification", :default => "", :null => false + t.string "salt", :limit => 64 + t.integer "gid" + t.integer "visits", :default => 0 + t.integer "excellent_teacher", :default => 0 + t.integer "excellent_student", :default => 0 + end + + add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" + add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" + add_index "users", ["type"], :name => "index_users_on_type" + + create_table "versions", :force => true do |t| + t.integer "project_id", :default => 0, :null => false + t.string "name", :default => "", :null => false + t.string "description", :default => "" + t.date "effective_date" + t.datetime "created_on" + t.datetime "updated_on" + t.string "wiki_page_title" + t.string "status", :default => "open" + t.string "sharing", :default => "none", :null => false + end + + add_index "versions", ["project_id"], :name => "versions_project_id" + add_index "versions", ["sharing"], :name => "index_versions_on_sharing" + + create_table "visitors", :force => true do |t| + t.integer "user_id" + t.integer "master_id" + t.datetime "updated_on" + t.datetime "created_on" + end + + add_index "visitors", ["master_id"], :name => "index_visitors_master_id" + add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" + add_index "visitors", ["user_id"], :name => "index_visitors_user_id" + + create_table "watchers", :force => true do |t| + t.string "watchable_type", :default => "", :null => false + t.integer "watchable_id", :default => 0, :null => false + t.integer "user_id" + end + + add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" + add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" + add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" + + create_table "web_footer_companies", :force => true do |t| + t.string "name" + t.string "logo_size" + t.string "url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "web_footer_oranizers", :force => true do |t| + t.string "name" + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "wechat_logs", :force => true do |t| + t.string "openid", :null => false + t.text "request_raw" + t.text "response_raw" + t.text "session_raw" + t.datetime "created_at", :null => false + end + + add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" + + create_table "wiki_content_versions", :force => true do |t| + t.integer "wiki_content_id", :null => false + t.integer "page_id", :null => false + t.integer "author_id" + t.binary "data", :limit => 2147483647 + t.string "compression", :limit => 6, :default => "" + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" + add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" + + create_table "wiki_contents", :force => true do |t| + t.integer "page_id", :null => false + t.integer "author_id" + t.text "text", :limit => 2147483647 + t.string "comments", :default => "" + t.datetime "updated_on", :null => false + t.integer "version", :null => false + end + + add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" + add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" + + create_table "wiki_pages", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title", :null => false + t.datetime "created_on", :null => false + t.boolean "protected", :default => false, :null => false + t.integer "parent_id" + end + + add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" + add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" + add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" + + create_table "wiki_redirects", :force => true do |t| + t.integer "wiki_id", :null => false + t.string "title" + t.string "redirects_to" + t.datetime "created_on", :null => false + end + + add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" + add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" + + create_table "wikis", :force => true do |t| + t.integer "project_id", :null => false + t.string "start_page", :null => false + t.integer "status", :default => 1, :null => false + end + + add_index "wikis", ["project_id"], :name => "wikis_project_id" + + create_table "workflows", :force => true do |t| + t.integer "tracker_id", :default => 0, :null => false + t.integer "old_status_id", :default => 0, :null => false + t.integer "new_status_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + t.boolean "assignee", :default => false, :null => false + t.boolean "author", :default => false, :null => false + t.string "type", :limit => 30 + t.string "field_name", :limit => 30 + t.string "rule", :limit => 30 + end + + add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" + add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" + add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" + add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" + + create_table "works_categories", :force => true do |t| + t.string "category" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "zip_packs", :force => true do |t| + t.integer "user_id" + t.integer "homework_id" + t.string "file_digest" + t.string "file_path" + t.integer "pack_times", :default => 1 + t.integer "pack_size", :default => 0 + t.text "file_digests" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + +end diff --git a/public/assets/wechat/app.html b/public/assets/wechat/app.html index 74af26cfe..43640a115 100644 --- a/public/assets/wechat/app.html +++ b/public/assets/wechat/app.html @@ -36,7 +36,7 @@ - + diff --git a/public/assets/wechat/edit_class.html b/public/assets/wechat/edit_class.html index 62022566b..68b84aee6 100644 --- a/public/assets/wechat/edit_class.html +++ b/public/assets/wechat/edit_class.html @@ -3,9 +3,9 @@
    管理课程
    -
    课程
    +
    课程名称
    -
    班级删除
    +
    班级名称删除
    完成
    diff --git a/public/assets/wechat/new_project.html b/public/assets/wechat/new_project.html index 785de322f..9ef19fad9 100644 --- a/public/assets/wechat/new_project.html +++ b/public/assets/wechat/new_project.html @@ -5,7 +5,7 @@
    项目名称
    完成 -
    +
    项目功能特性(微信版)
    • 创建项目、加入项目
    • @@ -13,8 +13,6 @@
    • 浏览、回复项目动态
    • 点赞、分享项目动态
    -
    -
    更多项目特性(浏览器版)
    • 发布任务、问题跟踪
    • diff --git a/public/images/sy/icons_sy.png b/public/images/sy/icons_sy.png index 09cdd32cb..645dc4e35 100644 Binary files a/public/images/sy/icons_sy.png and b/public/images/sy/icons_sy.png differ diff --git a/public/images/sy/sy_icons_close02.png b/public/images/sy/sy_icons_close02.png new file mode 100644 index 000000000..456f2ea67 Binary files /dev/null and b/public/images/sy/sy_icons_close02.png differ diff --git a/public/images/syllabus/icons_syllabus.png b/public/images/syllabus/icons_syllabus.png index 7f6c4987c..4afdb729f 100644 Binary files a/public/images/syllabus/icons_syllabus.png and b/public/images/syllabus/icons_syllabus.png differ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index c31bc0f3e..9841a20a7 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1492,6 +1492,25 @@ function pop_up_box(value,tWidth,tTop,tLeft){ } } +// 公共弹框样式 +function pop_box_new(value, Width, Top, Left){ + $("#ajax-modal").html(value); + showModal('ajax-modal', Width + 'px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').parent().css({"top": Top+"%","left": Left+"%","transform":"translate(-50%,-50%)","padding":"0","border":"none"}); + $('#ajax-modal').css({"padding":"0"}); + +} + +// 公共提示弹框样式 +//function pop_box_tip_new(value, Width, Top, Left){ +// $("#ajax-modal").html(value); +// showModal('ajax-modal', Width + 'px'); +// $('#ajax-modal').siblings().remove(); +// $('#ajax-modal').parent().css({"top": Top+"%","left": Left+"%","transform":"translate(-50%,-50%)","padding":"0","border":"none"}); +// $('#ajax-modal').css({"padding":"0"}); +//} + //显示的时候根据当前网址是http 还是https 选择视频显示方式直接显示还是弹框 function autoMedia(id){ var rootPath = getRootPath(); diff --git a/public/javascripts/wechat/directives/ellipsis.js b/public/javascripts/wechat/directives/ellipsis.js index dd826d6a3..e5e59abf1 100644 --- a/public/javascripts/wechat/directives/ellipsis.js +++ b/public/javascripts/wechat/directives/ellipsis.js @@ -1,25 +1,25 @@ /** * Created by Tim on 7/22/16. */ -app.directive('ellipsisShow',["$timeout",function(timer){ - return{ - restrict: 'A', - scope: {}, - link: function(scope, element){ - timer(function() { - var textSplit = element.text().split(" "); - var newContent = []; - element.text(""); - for (var i = 0; i < textSplit.length; i++) { - newContent = newContent + " " + textSplit[i]; - element.text(newContent); - if(element[0].scrollHeight >= 100){ - newContent = newContent + " " + textSplit[i+1] + " " + textSplit[i+2] + " " + textSplit[i+3] + " " + textSplit[i+4] + "..."; - element.text(newContent); - break; - } - } - }); - } - } -}]); \ No newline at end of file +//app.directive('ellipsisShow',["$timeout",function(timer){ +// return{ +// restrict: 'A', +// scope: {}, +// link: function(scope, element){ +// timer(function() { +// var textSplit = element.text().split(" "); +// var newContent = []; +// element.text(""); +// for (var i = 0; i < textSplit.length; i++) { +// newContent = newContent + " " + textSplit[i]; +// element.text(newContent); +// if(element[0].scrollHeight >= 100){ +// newContent = newContent + " " + textSplit[i+1] + " " + textSplit[i+2] + " " + textSplit[i+3] + " " + textSplit[i+4] + "..."; +// element.text(newContent); +// break; +// } +// } +// }); +// } +// } +//}]); \ No newline at end of file diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 112f8224b..9031ed9d8 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1281,6 +1281,9 @@ a, a:link, a:visited{ color: #169; text-decoration: none; } a:hover, a:active{ color: #c61a1a; text-decoration: underline;} a img{ border: 0; } +a.application-default-link {color: #169 !important; text-decoration: none;} +a.application-default-link:hover {color: #c61a1a !important; text-decoration: underline;} + a.issue.closed, a.issue.closed:link, a.issue.closed:visited { color: #999; text-decoration: line-through; } a.project.closed, a.project.closed:link, a.project.closed:visited { color: #999; } a.user.locked, a.user.locked:link, a.user.locked:visited {color: #999;} diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index b72a8ef56..7db3c4370 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -51,6 +51,10 @@ a.btn_message_free{ background:#ff5722; display:block; text-align:center; color .break_word{word-break: break-all;word-wrap: break-word;} .break_word_firefox{white-space: pre-wrap !important;word-break: break-all;} +/*显隐*/ +.undis {display:none;} +.dis {display:inline-block;} + /* font & color */ h2{ font-size:18px;} /*color:#269ac9;*/ h3{ font-size:14px;}/* color:#e8770d;*/ @@ -520,7 +524,6 @@ a:hover.bgreen_n_btn{background:#08a384;} .upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;} .upbtn:hover{color:#64bdd9;cursor: pointer;} .upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer} -.undis{display:none;} .red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} @@ -542,6 +545,38 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .borderRadius {border-radius:5px;} a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a:hover.Blue-btn{ background:#3598db; color:#fff;} + +/*20160725 项目申请按钮*/ +a.sy_btn_grey{ + display:inline-block; + color: #333; + background: #e1e1e1; + 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_grey{ background: #c3c3c3;} +a.sy_btn_blue{ + display:inline-block; + color: #fff; + background: #3b94d6; + text-align: center; + font-size: 12px; + padding:0 15px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.sy_btn_blue{ background: #2788d0;} /* commonpic */ .pic_date{ display:block; background:url(/images/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; } .pic_add{ display:block; background:url(/images/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; } diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css index ccf161725..7a1a0dabb 100644 --- a/public/stylesheets/css/courses.css +++ b/public/stylesheets/css/courses.css @@ -54,8 +54,6 @@ a:hover.UsersApBtn{border:1px solid #888888; } /* 代码查重弹框 */ a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a:hover.Blue-btn{ background:#3598db; color:#fff;} -.fl{ float:left;} -.fr{ float:right;} .blue-border-box{ width:500px; padding:20px; margin:0 auto; background:#fff;} .box-con h4{ font-size:14px; font-weight: bold; width:450px; text-align:center;} .box-con{ width:450px; margin:0 auto; text-align:center;} @@ -138,10 +136,6 @@ span.author { font-size: 0.9em; color: #888; } .ReplyToMessageInputContainer {width: 582px;float: left;} .ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} -/*课程列表界面样式*/ -a.course-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:590px;} -a:hover.course-title{ color:#269ac9;} - /*我的课程*/ .courses_top{ height:27px; border-bottom:3px solid #ebebeb;} .courses_h2{ font-size:16px; font-weight:bold; color:#64bddb; border-bottom:3px solid #64bddb; padding-bottom:3px; padding-right:3px;} diff --git a/public/stylesheets/css/org.css b/public/stylesheets/css/org.css index 028254e04..3677c8bd8 100644 --- a/public/stylesheets/css/org.css +++ b/public/stylesheets/css/org.css @@ -27,8 +27,6 @@ a.saveBtn:hover {background-color:#297fb8;} .orgMemContainer {width:268px;} .orgMemberAdd {float:right;} .orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} -.undis {display:none;} -.dis {display:inline-block;} a.org_member_btn{ padding:1px 5px; background:#15bccf; color:#fff;} diff --git a/public/stylesheets/css/popup.css b/public/stylesheets/css/popup.css index ea2034a5e..2aa4ae3be 100644 --- a/public/stylesheets/css/popup.css +++ b/public/stylesheets/css/popup.css @@ -332,4 +332,97 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no .relatePWrap{max-height: 210px;overflow:hidden;} /*20160622代码分析弹窗*/ -.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;} \ No newline at end of file +.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;} + +/*公共弹框*/ +/* 按钮*/ + + + + + +/* 加入班级弹窗 */ +#sy_popup_box{ + width:460px; + background:#fff; + padding-bottom:30px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + -o-border-radius:5px; + border-radius:5px; + box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); +} +.sy_popup_top{ + background:#3b94d6; + height:40px; + -webkit-border-radius: 5px 5px 0px 0px; + -moz-border-radius: 5px 5px 0px 0px; + -o-border-radius: 5px 5px 0px 0px; + border-radius: 5px 5px 0px 0px; +} +.sy_popup_top h3{ + font-size:18px; + color:#fff; + font-weight:normal; + line-height:40px; + padding-left:10px; +} +a.sy_icons_close{ + width:20px; + height:20px; + display:block; + background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; + margin:8px 10px 0 0; +} +a:hover.sy_icons_close{ + background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat; +} +.sy_popup_con{ + margin:30px auto 0; + font-size:14px; + width:330px; +} +.sy_popup_add label{ + display:block; + float:left; + width:85px; + text-align:right; + line-height:40px; +} +.sy_popup_add li{ + line-height:40px; +} +.sy_input_txt{ + border:1px solid #dedede; + height:36px; + background:#fff; + padding:0 5px; + width:220px; +} +.sy_popup_con02{ + margin:30px auto 0; + font-size:14px; + text-align:center; + width:360px; +} +.sy_popup_con02 ul li p{ + margin-bottom:15px; + text-align:center; + font-size:14px; + color:#616161; +} +.sy_popup_con02 a{ margin:0 auto;} +.sy_popup_top_tishi{ background:#ededed; } +.sy_popup_top_tishi h3{color:#616161; font-size:16px;} +a.sy_icons_close02{ + width:20px; + height:20px; + display:block; + background: url(/images/sy/sy_icons_close02.png) 0 0px no-repeat; + margin:8px 10px 0 0; + border: none; + outline: none; +} +a:hover.sy_icons_close02{ + background: url(/images/sy/sy_icons_close02.png) -40px 0px no-repeat; +} \ No newline at end of file diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 82e27aa1f..cc27955d5 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -471,8 +471,6 @@ a:hover.AnnexBtn{background: url(../images/homepage_icon2.png) -90px -343px no-r a.postRouteLink {font-weight:bold; color:#484848;} a.postRouteLink:hover {text-decoration:underline;} -.homepagePostSetting {position:absolute; width:20px; height:20px; right:0px; top:0px;} -.homepagePostSetting ul li:hover ul {display:block;} .resourceSendO {width:65px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-48px; top:20px; padding:2px 0px; display:none;} .ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} @@ -499,7 +497,6 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;} .wlist_select a{background-color: #64bdd9;cursor: default;} /*博客列表界面样式*/ -a{text-decoration:none} .listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; } /*.bloglistbox{ min-height:690px;}*/ .list-h2{ font-size:16px; font-weight:bold; color:#000; padding-bottom:5px;} @@ -517,12 +514,24 @@ a:hover.list-title{ color:#269ac9;} .list-file{ padding:10px 0; border-bottom:1px dashed #ddd;} .list-file li{ line-height:1.9;} .list-info span{ margin-left:5px;} -.pages a{ display:block; border:1px solid #d1d1d1; color:#000; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; } -.pages a:hover{ background-color:#269ac9; color:#fff;} + /*20160727大纲新增样式*/ +.list_title{padding:10px 0; border-bottom:1px solid #ddd;} +.sortTxt{ color:#000;} +.sortTxt:hover{ color:#28be6c;} +a.sort_no{ background: url(/images/syllabus/icons_syllabus.png) -16px -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; } +a.list-title{ font-size:14px; font-weight: bold; color:#000; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block;} + +/*翻页*/ +.pages a{ display:block; border:1px solid #d1d1d1; color:#888; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; } +.pages a:hover{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;} a.pages-big{ width:50px;} -.pages .active{ background-color:#269ac9; color:#fff;} +.pages .active{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;} .pages{width:330px; margin:20px auto 10px;} +/*课程列表界面样式*/ +a.course-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:590px;} +a:hover.course-title{ color:#269ac9;} + /*视频播放默认图标*/ .mediaIco{margin: 30px 0 30px 20px;width: 200px;} a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;} @@ -543,8 +552,6 @@ a:hover.st_img { border:1px solid #1c9ec7; } .searchCourseImage {width:75px; margin-right:10px;} .searchContentDes {width:883px;} .searchTag {font-size:12px; color:#ffffff; background-color:#7ec8e4; height:16px; min-height:16px; max-height:16px; float:left; line-height:16px; padding:0px 3px;} -.undis {display:none;} -.dis {display:inline-block;} .numRed {color:#FF6600;} .pageRoll {float:right; border-left:1px solid #dddddd; margin-top:15px;} .pageCell {border:1px solid #dddddd; padding:5px 12px; float:left; margin-left:-1px; position:relative;} @@ -938,10 +945,10 @@ a:hover.member_btn{ background:#329cbd;} .search_form_course{margin-top:8px;margin-left:8px;} /*信息*/ -.project_info{ background:#fff; padding:10px; padding-right:0px;width:222px; padding-right:8px; margin-bottom:10px;} +.project_info{ background:#fff; padding:10px 8px; width:224px; margin-bottom:10px;} .pr_info_id{ width:137px; color:#5a5a5a; font-size:14px; margin-top:5px;} .pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;} -.pr_info_logo:hover{ border:1px solid #64bdd9; } +.pr_info_logo:hover{ border:1px solid #297fb8; } .pr_info_join{} a.pr_join_a{ color:#fff; display:block; padding:0 5px 0 3px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background-color:#269ac9; float:left; } a.pr_join_a_quit{ color:#fff; display:block; padding:0 2px 0 3px; padding-top:2px; height:20px; margin-right:5px; float:left; text-align:center; background-color:#269ac9; float:left; } @@ -977,6 +984,8 @@ a:hover.pr_join_a{ background:#298fbd;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} /****标签(和资源库的tag样式一致)***/ .project_Label{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px;} +/*.project_Label{ width:218px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px; border:1px solid #dddddd;}*/ +.project_Label_New {width:218px; padding-left:10px; background:#fff; margin-top:15px; margin-bottom:10px;} a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;} .submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; } .isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;} diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index be8bbc65b..fa55e1282 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -103,8 +103,11 @@ div#menu ul ul ul li a{ width:185px; overflow:hidden; white-space: nowrap; text- .homepageNewsPubTypeHomework {width:270px; font-size:12px; color:#888888; display: block; white-space:nowrap;} .homepageNewsContent {width:355px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageSystenMessageContent {width:281px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px; } + .homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageHomeworkContent {width:235px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.homepageHomeworkContentWarn2 {width:60px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.homepageHomeworkContent2 {width:285px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} .loadMore {font-size:14px;width:748px; text-align:center; display:block; border:1px solid #dddddd; background-color:#ffffff; float:right;padding:5px 0; letter-spacing: 1px;} @@ -239,9 +242,9 @@ a.postReplyCancel:hover {color:#ffffff;} .whiteSettingIcon {background:url(/images/hwork_icon.png) -5px -302px no-repeat; width:20px; height:20px;} .whiteSettingIcon:hover {background:url(/images/homepage_icon.png) -93px -44px no-repeat;} a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;text-align:center;} -a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} +a.postOptionLink:hover {color:#ffffff; background-color:#3b94d6;} a.postOptionLink2 {color:#616060; display:block; width:35px; padding:0px 15px;} -a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;} +a.postOptionLink2:hover {color:#ffffff; background-color:#3b94d6;} .homepagePostReplyPortrait {float:left; width:33px;} .imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;} .homepagePostReplyDes {float:left; width:642px; margin-left:15px;} @@ -337,7 +340,6 @@ a.projectsLineGrey:hover {color:#ffffff;} a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} a.homepageMenuControl {float:left; width:180px;} .homepageLeftLabelContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px;} -.project_Label_New {width:218px; padding-left:10px; background:#fff; margin-top:15px; margin-bottom:10px;} .homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;} .homepageRightBanner {width:718px; margin:0px auto; float:right; background-color: #ffffff; padding:10px 15px; border:1px solid #dddddd;} .homepageRightBannerImg{width:1000px; margin:0px auto; height: 60px; margin-top: 10px; background:url(/images/TeachersDay.jpg)} diff --git a/public/stylesheets/sy_public.css b/public/stylesheets/sy_public.css index 7c79bf6e6..f52fc6699 100644 --- a/public/stylesheets/sy_public.css +++ b/public/stylesheets/sy_public.css @@ -15,6 +15,7 @@ a.sy_cmore{ font-size:12px; color:#888; font-weight:normal;} a:hover.sy_cmore{color: #ee4a1f;} /* 按钮*/ a.btn_orange_big{ + display:inline-block; border: 1px solid #ee4a1f; color: #ee4a1f; text-align: center; @@ -32,6 +33,7 @@ a:hover.btn_orange_big{ color: #fff; } a.btn_green_big{ + display:inline-block; border: 1px solid #60b25e; color: #60b25e; text-align: center; @@ -49,6 +51,7 @@ a:hover.btn_green_big{ color: #fff; } a.sy_btn_green{ + display:inline-block; color: #fff; background: #60b25e; text-align: center; @@ -62,34 +65,35 @@ a.sy_btn_green{ border-radius:3px; } a:hover.sy_btn_green{ background: #51a74f;} -a.sy_btn_grey{ - color: #333; - background: #e1e1e1; - 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_grey{ background: #c3c3c3;} -a.sy_btn_blue{ - color: #fff; - background: #3b94d6; - text-align: center; - font-size: 12px; - padding:0 15px; - height: 30px; - line-height: 30px; - -webkit-border-radius:3px; - -moz-border-radius:3px; - -o-border-radius:3px; - border-radius:3px; -} -a:hover.sy_btn_blue{ background: #2788d0;} + +/*a.sy_btn_grey{*/ + /*color: #333;*/ + /*background: #e1e1e1;*/ + /*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_grey{ background: #c3c3c3;}*/ +/*a.sy_btn_blue{*/ + /*color: #fff;*/ + /*background: #3b94d6;*/ + /*text-align: center;*/ + /*font-size: 12px;*/ + /*padding:0 15px;*/ + /*height: 30px;*/ + /*line-height: 30px;*/ + /*-webkit-border-radius:3px;*/ + /*-moz-border-radius:3px;*/ + /*-o-border-radius:3px;*/ + /*border-radius:3px;*/ +/*}*/ +/*a:hover.sy_btn_blue{ background: #2788d0;}*/ /* 排序 */ .sy_category{ height: 50px; @@ -98,51 +102,7 @@ a:hover.sy_btn_blue{ background: #2788d0;} border-bottom:1px solid #ddd; } .sy_category span{ float: left;} -a.sortupbtn{ - background: url(../images/sy/liststyle.png) 0 3px no-repeat; - width:12px; - height:17px; - display:block; - margin-right:10px; - cursor:pointer; -} -a.sortdownbtn{ - background: url(../images/sy/liststyle.png) 0 -12px no-repeat; - width:12px; - height:17px; - display:block; - cursor:pointer; -} -/* 翻页 */ -.pages a{ - display:block; - border:1px solid #d1d1d1; - color:#888; - float:left; - width:30px; - text-align:center; - padding:3px 0; - line-height:1.9; - margin-right:5px; -} -.pages a:hover{ - background-color:#3b94d6; - border:1px solid #3b94d6; - color:#fff; -} -a.pages-big{ - width:50px; -} -.pages .active{ - background-color:#3b94d6; - border:1px solid #3b94d6; - color:#fff; -} -.pages{ - width:330px; - margin:20px auto 10px; -} /* 输入框 */ .sy_right_box input,.sy_right_box select{ border:1px solid #ccc; diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index 3b856ad67..dad467c68 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -1,19 +1,3 @@ -/****标签(和资源库的tag样式一致)***/ -.project_Label{ width:218px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; margin-bottom:10px; border:1px solid #dddddd;} -.project_Label_New {width:218px; padding-left:10px; background:#fff; margin-top:15px; margin-bottom:10px;} -a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;} -.submit{height:21px;border:0; cursor:pointer; background:url(../images/btn.png) no-repeat 0 0;width:42px; margin-top:2px; margin-left:3px; } -.isTxt{background:#fbfbfb url(../images/inputBg.png) repeat-x left top;height:22px;line-height:22px;border:1px solid #c1c1c1;padding:0 5px;color:#666666;} -.re_tag{ width: auto; padding:0 5px; padding-top:2px; border:1px solid #f8df8c; background:#fffce6; margin-right:5px; } -.re_tag a{ color:#0d90c3;} -.tag_h{ } -.tag_h span,.tag_h a{ margin-bottom:5px;} -/*信息*/ -.project_info{ background:#fff; padding:10px 8px; width:222px; margin-bottom:10px; border:1px solid #dddddd;} -.pr_info_id{ width:130px; color:#5a5a5a; font-size:14px; margin-top:5px;} -.pr_info_logo{ border:1px solid #eaeaea; width:60px; height:60px; padding:1px;} -.pr_info_logo:hover{ border:1px solid #297fb8; } - /*课程大纲*/ input.syllabus_input{ border:none; @@ -110,38 +94,9 @@ input.syllabus_input_min{ .syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;} .syllabus_class_list_more:hover{ background:#ececec;} .syllabus_class_list_more a{ color:#ff7e00;} -.syllabus_class_title{ font-size:14px; color:#333; width:500px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } +.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .syllabus_class_w{ width:650px;} -.dis {display:block;} -.undis {display:none;} -/*班级列表界面(用的博客列表的样式)*/ -.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; } -.bloglistbox{ min-height:690px;} -.list-h2{ font-size:16px; font-weight:bold; color:#000; padding-bottom:5px;} -.category2{ } -.list_title{padding:10px 0; border-bottom:1px solid #ddd;} -.category2 a,.category2 span{ float:left; margin-right:5px;} -.grayTxt{ color:#9093a6;} -.sortTxt{ color:#000;} -.sortTxt:hover{ color:#28be6c;} -a.sortupbtn{ background: url(../images/syllabus/icons_syllabus.png) 0 3px no-repeat; width:12px; height:17px; display:block; margin-right:10px; cursor:pointer;} -a.sortdownbtn{ background: url(../images/syllabus/icons_syllabus.png) 0 -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; } -a.sort_no{ background: url(../images/syllabus/icons_syllabus.png) -16px -12px no-repeat; width:12px; height:17px; display:block;cursor:pointer; } -.item_list{ display:block; width:5px; height:5px;-webkit-border-radius: 25px;border-radius:25px; background-color:#adadad; margin:10px 10px 0 0;} -a.list-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block;} -a:hover.list-title{ color:#269ac9;} -.c_red{ font-weight:normal; font-size:12px;} -.list-file{ padding:10px 0; border-bottom:1px dashed #ddd;} -.list-file li{ line-height:1.9;} -.list-info span{ margin-left:5px;} -.pages a{ display:block; border:1px solid #d1d1d1; color:#888; float:left; width:30px; text-align:center; padding:3px 0; line-height:1.9; margin-right:5px; } -.pages a:hover{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;} -a.pages-big{ width:50px;} -.pages .active{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;} -.pages{width:330px; margin:20px auto 10px;} -a.course-title{ font-size:14px; font-weight: bold; color:#000;white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; width:590px;} -a:hover.course-title{ color:#269ac9;} /*新建页面*/ .name_input{ border:1px solid #64bdd9; height:16px; width:310px; background:#fff; margin-bottom:10px; padding:5px;} @@ -208,12 +163,6 @@ a:hover.course-title{ color:#269ac9;} .sy_tab_nomal { border-bottom:none; } -.undis { - display:none; -} -.dis { - display:block; -} /* 课程大纲 */ .icons_tishi{ width: 110px; @@ -324,22 +273,22 @@ a:hover.sy_teachers_name{ border:1px solid #e5e5e5; position: relative; } -.homepagePostSetting { +.sy_class_setting { position:absolute; width:20px; height:20px; right:10px; top:10px; } -.homepagePostSetting ul li:hover ul { +.sy_class_setting ul li:hover ul { display:block; } -.homepagePostSettingIcon { - background:url(../images/sy/icons_sy.png) 1px -408px no-repeat; +.sy_class_setting_icon { + background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px; } -.homepagePostSettiongText { +.sy_class_setting_text { width:75px; text-align: center; line-height:2; @@ -355,16 +304,16 @@ a:hover.sy_teachers_name{ display:none; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); } -.homepagePostSettingIcon:hover { - background:url(../images/sy/icons_sy.png) -28px -408px no-repeat; +.sy_class_setting_icon:hover { + background:url(../images/homepage_icon.png) -93px -44px no-repeat; } -a.postOptionLink { +a.sy_class_option { color:#616060; display:block; width:55px; padding:0px 10px; } -a.postOptionLink:hover { +a.sy_class_option:hover { color:#fff; background-color:#3b94d6; } @@ -403,6 +352,27 @@ a.postOptionLink:hover { padding-left:10px; line-height: 22px; } +.hw_icon_private{ + display:block; + width:30px; + height:22px; + background:url(../images/sy/icons_sy.png) 0 -458px no-repeat; + color:#fff; + font-size:12px; + padding-left:10px; + line-height: 22px; +} +.hw_icon_open{ + display:block; + width:30px; + height:22px; + background:url(../images/sy/icons_sy.png) 0 -436px no-repeat; + color:#fff; + font-size:12px; + padding-left:10px; + line-height: 22px; +} + .sy_class_titbox{margin-bottom:5px; padding-top:10px; } a.sy_btn_orange{ display:block; diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 987141088..c882c604c 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -241,5 +241,5 @@ a.underline {text-decoration:underline;} /*20160729项目说明*/ -.project-intro {line-height:2;} +.project-intro {line-height:2; width:140px; margin-left:auto; margin-right:auto;} .project-intro li {list-style:disc; margin-left:20px;} \ No newline at end of file