课件
|
diff --git a/app/views/files/_upload_show_project.html.erb b/app/views/files/_upload_show_project.html.erb
index 8223f071e..53c57b3c6 100644
--- a/app/views/files/_upload_show_project.html.erb
+++ b/app/views/files/_upload_show_project.html.erb
@@ -8,6 +8,7 @@
<%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
+
<%= render :partial => 'files/attachement_list',:locals => {:project => project} %>
<%= l(:button_cancel)%>
diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb
index f24d60811..9de7aa042 100644
--- a/app/views/files/create.js.erb
+++ b/app/views/files/create.js.erb
@@ -23,26 +23,35 @@ $("#upload_file_count").text("未上传文件");
$('#upload_file_div').slideToggle('slow');
<% if @project %>
hideModal();
- $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>');
- $("#project_files_count_info").html("<%= @all_attachments.count%>");
- $("#project_files_count_nav").html("(<%= @all_attachments.count%>)")
-// 添加文件上传成功提示
- <% unless params[:attachments].nil? %>
- var div = $('
文件上传成功!
');
- $("#course_list").prepend(div);
- setTimeout( function(){div.remove();},3000)
+ <%if @in_project_toolbar%>
+ window.location.href = '<%= project_files_path(@project)%>'
+ <%else%>
+
+ $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>');
+ $("#project_files_count_info").html("<%= @all_attachments.count%>");
+ $("#project_files_count_nav").html("(<%= @all_attachments.count%>)")
+ // 添加文件上传成功提示
+ <% unless params[:attachments].nil? %>
+ var div = $('
文件上传成功!
');
+ $("#course_list").prepend(div);
+ setTimeout( function(){div.remove();},3000)
+ <% end %>
<% end %>
<%elsif @course%>
- closeModal();
- $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
- $("#courses_files_count_info").html("<%= @all_attachments.count%>");
- $("#courses_files_count_nav").html("(<%= @all_attachments.count%>)")
- // 添加文件上传成功提示,
- <% unless params[:attachments].nil? %>
- var div = $('
文件上传成功!
');
- $("#course_list").prepend(div);
- setTimeout( function(){div.remove();},3000)
- <% end %>
+ hideModal();
+ <%if @in_course_toolbar %>
+ window.location.href='<%= course_files_path(@course)%>'
+ <%else%>
+ $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
+ $("#courses_files_count_info").html("<%= @all_attachments.count%>");
+ $("#courses_files_count_nav").html("(<%= @all_attachments.count%>)")
+ // 添加文件上传成功提示,
+ <% unless params[:attachments].nil? %>
+ var div = $('
文件上传成功!
');
+ $("#course_list").prepend(div);
+ setTimeout( function(){div.remove();},3000)
+ <% end %>
+ <%end%>
<% end %>
<% end %>
$(document).ready(img_thumbnails);
From 8e66bb8fe166c4f9ead3c5be7b4f93c221564018 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 9 Nov 2015 10:07:12 +0800
Subject: [PATCH 03/24] =?UTF-8?q?=E5=9C=A8=E8=AF=BE=E7=A8=8B=20=E9=A1=B9?=
=?UTF-8?q?=E7=9B=AE=20=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=E5=90=8E?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=AF=B9=E5=BA=94=E7=9A=84=E8=B5=84?=
=?UTF-8?q?=E6=BA=90=E5=BA=93=E7=95=8C=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/schema.rb | 43 +++++++++++++++++++++++++------------------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/db/schema.rb b/db/schema.rb
index b7e1bfa1c..11662fc7b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -528,26 +528,23 @@ 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", :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
+ create_table "dts", :force => true do |t|
+ t.string "IPLineCode"
t.string "Description"
- t.text "PreConditions", :limit => 2147483647
- t.text "TraceInfo", :limit => 2147483647
- t.text "Code", :limit => 2147483647
+ t.string "Num"
+ t.string "Variable"
+ t.string "TraceInfo"
+ t.string "Method"
+ t.string "File"
+ t.string "IPLine"
+ t.string "Review"
+ t.string "Category"
+ t.string "Defect"
+ t.string "PreConditions"
+ t.string "StartLine"
t.integer "project_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "enabled_modules", :force => true do |t|
@@ -817,6 +814,16 @@ 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"
From 4b272b6b9c622dbc009da3de584847ae3a1cc083 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 9 Nov 2015 11:14:24 +0800
Subject: [PATCH 04/24] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=AD=97=E7=AC=A6?=
=?UTF-8?q?=E5=85=81=E8=AE=B8=E6=89=A9=E5=A4=A7=E4=B8=BA40000=E4=B8=AA?=
=?UTF-8?q?=E5=AD=97=E7=AC=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/memo.rb | 2 +-
app/views/forums/show.html.erb | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/models/memo.rb b/app/models/memo.rb
index 33b24db50..f6449a550 100644
--- a/app/models/memo.rb
+++ b/app/models/memo.rb
@@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base
# 若是主题帖,则内容可以是空
#validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? }
validates_length_of :subject, maximum: 50
- validates_length_of :content, maximum: 5000
+ validates_length_of :content, maximum: 40000
validate :cannot_reply_to_locked_topic, :on => :create
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 25a4fae46..3d239cff1 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -76,10 +76,10 @@
$("#error").html("主题 过长(最长为 50 个字符)").show();
return false;
}
-// if(memo_content.html().trim().length > 5000){
-// $("#error").html("内容 过长(最长为 5000 个字符)").show();
-// return false;
-// }
+ if(memo_content.html().trim().length > 40000){
+ $("#error").html("内容 过长(最长为 40000 个字符)").show();
+ return false;
+ }
return true;
}
From 1edd87f9e020cc69efd3f41d0689fd6baf76ba06 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 9 Nov 2015 11:15:01 +0800
Subject: [PATCH 05/24] =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E5=AD=97=E7=AC=A6?=
=?UTF-8?q?=E5=85=81=E8=AE=B8=E6=89=A9=E5=A4=A7=E4=B8=BA20000=E4=B8=AA?=
=?UTF-8?q?=E5=AD=97=E7=AC=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/memo.rb | 2 +-
app/views/forums/show.html.erb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/models/memo.rb b/app/models/memo.rb
index f6449a550..94ff5cee2 100644
--- a/app/models/memo.rb
+++ b/app/models/memo.rb
@@ -9,7 +9,7 @@ class Memo < ActiveRecord::Base
# 若是主题帖,则内容可以是空
#validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? }
validates_length_of :subject, maximum: 50
- validates_length_of :content, maximum: 40000
+ validates_length_of :content, maximum: 20000
validate :cannot_reply_to_locked_topic, :on => :create
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 3d239cff1..4bbf81668 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -76,8 +76,8 @@
$("#error").html("主题 过长(最长为 50 个字符)").show();
return false;
}
- if(memo_content.html().trim().length > 40000){
- $("#error").html("内容 过长(最长为 40000 个字符)").show();
+ if(memo_content.html().trim().length > 20000){
+ $("#error").html("内容 过长(最长为 20000 个字符)").show();
return false;
}
return true;
From 463262e83819c9039f3adeac4765773a4ffdc777 Mon Sep 17 00:00:00 2001
From: cxt
Date: Mon, 9 Nov 2015 11:16:19 +0800
Subject: [PATCH 06/24] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E6=97=B6=E7=AB=8B=E9=A9=AC=E5=BC=B9=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 12 ++++++++++++
app/views/student_work/edit.html.erb | 13 +++++++++++--
app/views/student_work/new.html.erb | 13 +++++++++++--
app/views/student_work/update.js.erb | 16 ++++++++++++++++
public/javascripts/course.js | 10 ++++++++--
public/javascripts/new_user.js | 10 ++++++++--
6 files changed, 66 insertions(+), 8 deletions(-)
create mode 100644 app/views/student_work/update.js.erb
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index c36877092..9ad46cd69 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -221,24 +221,36 @@ class StudentWorkController < ApplicationController
def update
if params[:student_work]
+ @submit_result = true
@work.name = params[:student_work][:name]
@work.description = params[:student_work][:description]
@work.project_id = params[:student_work][:project]
@work.save_attachments(params[:attachments])
render_attachment_warning_if_needed(@work)
if @work.save
+=begin
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_edit)
redirect_to student_work_index_url(:homework => @homework.id)
}
+=end
+ @student_work = @work
+ respond_to do |format|
+ format.js
end
return
end
end
+=begin
respond_to do |format|
format.html{redirect_to edit_student_work_url(@work)}
end
+=end
+ @submit_result = false
+ respond_to do |format|
+ format.js
+ end
end
def show
diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb
index 25a65f039..517a238b0 100644
--- a/app/views/student_work/edit.html.erb
+++ b/app/views/student_work/edit.html.erb
@@ -26,7 +26,7 @@
- <%= labelled_form_for @work,:html => { :multipart => true } do |f|%>
+ <%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
提示:作品名称和描述中不要出现真实的姓名信息
@@ -52,7 +52,7 @@
-
确定
+
确定
或
<%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
@@ -60,3 +60,12 @@
<% end%>