From b06bd513474f0869713c8138b2f810303ee80c7d Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 31 Dec 2015 17:06:49 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=E6=9B=B4=E6=96=B0=E8=B5=84=E6=BA=90=E5=85=AC=E5=BC=80?= =?UTF-8?q?=E7=A7=81=E6=9C=89=E5=B1=9E=E6=80=A7=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=20=E9=9C=80=E8=A6=81=E5=8C=BA=E5=88=86=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/update_file_dense.js.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/attachments/update_file_dense.js.erb b/app/views/attachments/update_file_dense.js.erb index 110d3fc7c..747024dec 100644 --- a/app/views/attachments/update_file_dense.js.erb +++ b/app/views/attachments/update_file_dense.js.erb @@ -1,5 +1,10 @@ +<% if @attachment.container_type == 'Course' %> $("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), :remote=>true,:class=>"postOptionLink",:method => :post) %>"); +<%else%> +$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), + :remote=>true,:class=>"f_l re_open",:method => :post) %>"); +<%end %> <%if @attachment.is_public? %> $("#image_private_<%= @attachment.id%>").html('') <%else%> From 3dac8d29440de6e53010a0c250109671bb4e4bde Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 31 Dec 2015 17:53:05 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B/=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E7=9A=84=E7=BC=96=E8=BE=91/=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=B7=B3=E8=BD=AC=20=20=E6=89=80=E6=9C=89=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=83=BD=E6=9C=89=E5=8F=91=E9=80=81=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/messages_controller.rb | 83 ++++++++++--------- app/views/boards/_course_show_detail.html.erb | 2 +- .../boards/_project_show_detail.html.erb | 2 +- app/views/courses/_course_activity.html.erb | 2 +- app/views/messages/edit.html.erb | 4 +- app/views/messages/reply.js.erb | 4 +- .../projects/_project_activities.html.erb | 2 +- app/views/users/_course_message.html.erb | 28 ++++--- app/views/users/_project_message.html.erb | 25 +++--- app/views/users/_user_activities.html.erb | 4 +- 10 files changed, 86 insertions(+), 70 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index ae13b7e78..304eada37 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -211,6 +211,8 @@ class MessagesController < ApplicationController end if params[:user_activity_id] @user_activity_id = params[:user_activity_id] + @is_course = params[:is_course] + @is_board = params[:is_board] respond_to do |format| format.js end @@ -239,38 +241,42 @@ class MessagesController < ApplicationController if request.post? && @message.save attachments = Attachment.attach_files(@message, params[:attachments]) render_attachment_warning_if_needed(@message) - flash[:notice] = l(:notice_successful_update) + #flash[:notice] = l(:notice_successful_update) @message.reload - if params[:is_board] + if params[:is_course] && params[:is_course].to_i == 0 + redirect_to user_activities_path(User.current.id) + elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 0 if @project - redirect_to project_boards_path(@project) + redirect_to project_path(@project) elsif @course - redirect_to course_boards_path(@course) + redirect_to course_activity_path(@course) end - else - redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) - end - elsif request.get? || request.post? - if params[:is_board] + elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 1 if @project redirect_to project_boards_path(@project) elsif @course redirect_to course_boards_path(@course) end else - respond_to do |format| - format.html { - if @project - layout_file = 'base_projects' - elsif @course - layout_file = 'base_courses' - elsif @org_subfield - @organization = @org_subfield.organization - layout_file = 'base_org' - end - render :layout => layout_file - } - end + redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)) + end + elsif request.get? || request.post? + if params[:is_course] && params[:is_board] + @is_course = params[:is_course] + @is_board = params[:is_board] + end + respond_to do |format| + format.html { + if @project + layout_file = 'base_projects' + elsif @course + layout_file = 'base_courses' + elsif @org_subfield + @organization = @org_subfield.organization + layout_file = 'base_org' + end + render :layout => layout_file + } end end end @@ -286,25 +292,28 @@ class MessagesController < ApplicationController @message.destroy # modify by nwb if @project - if params[:is_board] - redirect_to project_boards_url(@project) + if params[:is_course] && params[:is_course].to_i == 0 + redirect_to user_activities_path(User.current.id) + elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 0 + redirect_to project_path(@project) + elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 1 + redirect_to project_boards_path(@project) + elsif @message.parent + redirect_to board_message_url(@board, @message.parent, :r => r) else - if @message.parent - redirect_to board_message_url(@board, @message.parent, :r => r) - else - redirect_to project_board_url(@project, @board) - end - # redirect_to board_message_url(@board, @topic, :r => @reply) + redirect_to project_board_url(@project, @board) end elsif @course - if params[:is_board] - redirect_to course_boards_url(@course) + if params[:is_course] && params[:is_course].to_i == 0 + redirect_to user_activities_path(User.current.id) + elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 0 + redirect_to course_activity_path(@course) + elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 1 + redirect_to course_boards_path(@course) + elsif @message.parent + redirect_to board_message_url(@board, @message.parent, :r => r) else - if @message.parent - redirect_to board_message_url(@board, @message.parent, :r => r) - else - redirect_to course_board_url(@course, @board) - end + redirect_to course_boards_path(@course) end elsif @org_subfield if params[:is_board] diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb index 7b96c4f9a..75ee516c4 100644 --- a/app/views/boards/_course_show_detail.html.erb +++ b/app/views/boards/_course_show_detail.html.erb @@ -54,7 +54,7 @@ }); <% if topic %> - <%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %> + <%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id,:is_course=>1,:is_board=>1} %> <% end %> <% end %> diff --git a/app/views/boards/_project_show_detail.html.erb b/app/views/boards/_project_show_detail.html.erb index 8fb663aff..166978ee0 100644 --- a/app/views/boards/_project_show_detail.html.erb +++ b/app/views/boards/_project_show_detail.html.erb @@ -53,7 +53,7 @@ }); <% if topic %> - <%= render :partial => 'users/project_message', :locals => {:activity => topic, :user_activity_id => topic.id} %> + <%= render :partial => 'users/project_message', :locals => {:activity => topic, :user_activity_id => topic.id,:is_course=>1,:is_board=>1} %> <% end %> <% end %> diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index 2f2622f3c..ea41787d5 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -99,7 +99,7 @@ <% when 'News' %> <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %> <% when 'Message' %> - <%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id,:is_course=>1,:is_board=>0} %> <% when 'Poll' %> <%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %> <% when 'JournalsForMessage' %> diff --git a/app/views/messages/edit.html.erb b/app/views/messages/edit.html.erb index 6e54a88e1..89fe71c65 100644 --- a/app/views/messages/edit.html.erb +++ b/app/views/messages/edit.html.erb @@ -1,6 +1,6 @@ <% if @message.project %> <%= form_for @message, {:as => :message, - :url => {:action => 'edit'}, + :url => {:action => 'edit',:is_course=>@is_course,:is_board=>@is_board}, :html => {:multipart => true, :id => 'message-form', :method => :post} @@ -14,7 +14,7 @@ <% elsif @message.course %> <%= form_for @message, { :as => :message, - :url => {:action => 'edit'}, + :url => {:action => 'edit',:is_course=>@is_course,:is_board=>@is_board}, :html => {:multipart => true, :id => 'message-form', :method => :post} diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb index c0da5ab9b..f33986c59 100644 --- a/app/views/messages/reply.js.erb +++ b/app/views/messages/reply.js.erb @@ -1,7 +1,7 @@ <%if @project%> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>"); <%elsif @course%> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>"); <% elsif @org_subfield %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); <%end%> diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index b46522fa1..b3ae89cf2 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -61,7 +61,7 @@ <% when "Message" %> - <%= render :partial => 'users/project_message', :locals => {:activity => activity.forge_act,:user_activity_id =>activity.id} %> + <%= render :partial => 'users/project_message', :locals => {:activity => activity.forge_act,:user_activity_id =>activity.id,:is_course=>1,:is_board=>0} %> <% when "News" %> <% if !activity.forge_act.nil? and activity.forge_act.project %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 3633b2134..22a4bcf57 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -44,33 +44,37 @@
- <% if activity.author.id == User.current.id%> - +
@@ -137,7 +141,7 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
- <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> + <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,is_course=>is_course},:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index c31e4ac2e..8017081c6 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -44,33 +44,36 @@
- <% if activity.author.id == User.current.id%> -
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 5cadcddd6..bb1a42f58 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -69,7 +69,7 @@ <% when 'News' %> <%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> <% when 'Message'%> - <%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %> <% when 'Poll' %> <%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %> <% when 'Course'%> @@ -82,7 +82,7 @@ <% when 'Issue' %> <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> <% when 'Message' %> - <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %> <% when 'ProjectCreateInfo'%> <%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> <% end %> From 11444f43f0f43546fa02966e278a641a5e7e0afb Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 31 Dec 2015 17:55:48 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E8=A7=A3=E5=86=B3issue=E5=A4=9A=E9=99=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=88=A0=E9=99=A4=E4=B8=80=E4=B8=AA=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=90=8E=EF=BC=8C=E6=8F=90=E4=BA=A4=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E6=A1=86=E6=A1=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 12 +- db/schema.rb | 272 ++++++++++++++++++---- 2 files changed, 234 insertions(+), 50 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 36093f33b..fd43977ee 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -229,7 +229,11 @@ class AttachmentsController < ApplicationController @attachment.container.init_journal(User.current) end if @attachment.container - @attachment.container.attachments.delete(@attachment) + if @attachment.container_type == "Issue" + @attachment.destroy + else + @attachment.container.attachments.delete(@attachment) + end else @attachment.destroy end @@ -281,7 +285,7 @@ class AttachmentsController < ApplicationController format.js end end - + def delete_homework @bid = @attachment.container.bid # Make sure association callbacks are called @@ -344,13 +348,13 @@ class AttachmentsController < ApplicationController end respond_to do |format| - format.js + format.js end rescue NoMethodError @save_flag = false @save_message = [] << l(:error_attachment_empty) respond_to do |format| - format.js + format.js end end diff --git a/db/schema.rb b/db/schema.rb index 8dbd9813c..3728e8da0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,8 +11,7 @@ # # It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20151102090519) do +ActiveRecord::Schema.define(:version => 20151231023610) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -67,6 +66,41 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.datetime "updated_at", :null => false 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" + end + create_table "attachments", :force => true do |t| t.integer "container_id" t.string "container_type", :limit => 30 @@ -384,6 +418,20 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.integer "container_id", :default => 0 end + create_table "course_contributor_scores", :force => true do |t| + t.integer "course_id" + t.integer "user_id" + t.integer "message_num" + t.integer "message_reply_num" + t.integer "news_reply_num" + t.integer "resource_num" + t.integer "journal_num" + t.integer "journal_reply_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "total_score" + end + create_table "course_groups", :force => true do |t| t.string "name" t.integer "course_id" @@ -427,8 +475,8 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.string "code" t.integer "time" t.string "extra" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "location" t.string "term" t.string "string" @@ -438,14 +486,16 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.string "class_period" t.integer "school_id" t.text "description" - t.integer "status", :default => 1 - t.integer "attachmenttype", :default => 2 + t.integer "status", :default => 1 + t.integer "attachmenttype", :default => 2 t.integer "lft" t.integer "rgt" - t.integer "is_public", :limit => 1, :default => 1 - t.integer "inherit_members", :limit => 1, :default => 1 - t.integer "open_student", :default => 0 - t.integer "outline", :default => 0 + t.integer "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" end @@ -532,23 +582,32 @@ ActiveRecord::Schema.define(:version => 20151102090519) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :force => true do |t| - t.string "IPLineCode" - t.string "Description" - t.string "Num" - t.string "Variable" - t.string "TraceInfo" - t.string "Method" + 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 "IPLine" - t.string "Review" - t.string "Category" - t.string "Defect" - t.string "PreConditions" - t.string "StartLine" + 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", :null => false - t.datetime "updated_at", :null => false + 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| @@ -573,6 +632,66 @@ ActiveRecord::Schema.define(:version => 20151102090519) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + create_table "exercise_answers", :force => true do |t| + t.integer "user_id" + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_choices", :force => true do |t| + t.integer "exercise_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "exercise_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "question_score" + end + + create_table "exercise_standard_answers", :force => true do |t| + t.integer "exercise_question_id" + t.integer "exercise_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_users", :force => true do |t| + t.integer "user_id" + t.integer "exercise_id" + t.integer "score" + t.datetime "start_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "end_at" + t.integer "status" + 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" @@ -662,6 +781,19 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.integer "anonymous_comment", :default => 0 end + add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + + create_table "homework_detail_groups", :force => true do |t| + t.integer "homework_common_id" + t.integer "min_num" + t.integer "max_num" + t.integer "base_on_project" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id" + create_table "homework_detail_manuals", :force => true do |t| t.float "ta_proportion" t.integer "comment_status" @@ -818,16 +950,6 @@ ActiveRecord::Schema.define(:version => 20151102090519) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :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_copy", ["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" @@ -947,6 +1069,7 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.boolean "locked", :default => false t.integer "sticky", :default => 0 t.integer "reply_id" + t.integer "quotes" end add_index "messages", ["author_id"], :name => "index_messages_on_author_id" @@ -964,6 +1087,7 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.integer "sticky", :default => 0 end add_index "news", ["author_id"], :name => "index_news_on_author_id" @@ -1049,10 +1173,46 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.integer "project_id" end + create_table "org_activities", :force => true do |t| + t.integer "user_id" + t.integer "org_act_id" + t.string "org_act_type" + t.integer "container_id" + t.string "container_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "org_courses", :force => true do |t| + t.integer "organization_id" + t.integer "course_id" + t.datetime "created_at" + end + + create_table "org_document_comments", :force => true do |t| + t.text "title" + t.text "content" + t.integer "organization_id" + t.integer "creator_id" + t.integer "parent_id" + t.integer "reply_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "locked", :default => false + t.integer "sticky", :default => 0 + t.integer "org_subfield_id" + 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.string "role" + t.integer "user_id" + t.integer "organization_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "org_projects", :force => true do |t| @@ -1212,27 +1372,30 @@ ActiveRecord::Schema.define(:version => 20151102090519) do end create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false + t.string "name", :default => "", :null => false t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false + t.string "homepage", :default => "" + t.boolean "is_public", :default => true, :null => false t.integer "parent_id" t.datetime "created_on" t.datetime "updated_on" t.string "identifier" - t.integer "status", :default => 1, :null => false + t.integer "status", :default => 1, :null => false t.integer "lft" t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false + t.boolean "inherit_members", :default => false, :null => false t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 + t.boolean "hidden_repo", :default => false, :null => false + t.integer "attachmenttype", :default => 1 t.integer "user_id" - t.integer "dts_test", :default => 0 + t.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 end add_index "projects", ["lft"], :name => "index_projects_on_lft" @@ -1397,6 +1560,21 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.integer "project_id" end + 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 @@ -1424,6 +1602,8 @@ ActiveRecord::Schema.define(:version => 20151102090519) do t.boolean "is_test", :default => false end + add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" + create_table "student_works_evaluation_distributions", :force => true do |t| t.integer "student_work_id" t.integer "user_id" From a4a29b0ee9b542ed9b3551fd7b4d25ce642bfe76 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 4 Jan 2016 11:26:42 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E6=96=87=E5=AD=97=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 1 + 1 file changed, 1 insertion(+) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 2e8133172..a13c63fbc 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1220,6 +1220,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;} .hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .mr150 {margin-right:150px;} .relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} +.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} /*上传资源弹窗*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} From 3ddbeae100d74011e7fd1e24a38457e60690413a Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 4 Jan 2016 11:32:48 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E2=80=9C?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E2=80=9D=E6=A8=A1=E5=BC=8F=E7=9A=84=E6=96=87?= =?UTF-8?q?=E5=AD=97=E4=B8=8D=E7=94=A8=E7=B2=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_tool_expand.html.erb | 14 +++++++------- public/stylesheets/courses.css | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index e032496ea..50854cf23 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -2,19 +2,19 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% if show_nav?(@course.homework_commons.count) %> <% end %> <% if show_nav?(@course.news.count) %> <% end %> <% if show_nav?(course_file_num) %>