diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 1cd5b0f15..dd8dc84c4 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -332,6 +332,9 @@ class FilesController < ApplicationController
#modify by nwb
if @project
@addTag=false
+ if params[:in_project_toolbar]
+ @in_project_toolbar = params[:in_project_toolbar]
+ end
container = (params[:version_id].blank? ? @project : @project.versions.find_by_id(params[:version_id]))
attachments = Attachment.attach_filesex(container, params[:attachments], params[:attachment_type])
render_attachment_warning_if_needed(container)
@@ -363,6 +366,9 @@ class FilesController < ApplicationController
end
elsif @course
@addTag=false
+ if params[:in_course_toolbar]
+ @in_course_toolbar = params[:in_course_toolbar]
+ end
attachments = Attachment.attach_filesex(@course, params[:attachments], params[:attachment_type])
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
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/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 8590b836a..6cc622c49 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -60,6 +60,11 @@ class WordsController < ApplicationController
course_activity.updated_at = Time.now
course_activity.save
end
+ principal_activity = PrincipalActivity.where("principal_act_type='JournalsForMessage' and principal_act_id =#{parent_id}").first
+ if principal_activity
+ principal_activity.updated_at = Time.now
+ principal_activity.save
+ end
user_activity = UserActivity.where("act_type='JournalsForMessage' and act_id =#{parent_id}").first
if user_activity
user_activity.updated_at = Time.now
diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb
index faab129a6..5e40267cb 100644
--- a/app/models/journals_for_message.rb
+++ b/app/models/journals_for_message.rb
@@ -136,10 +136,8 @@ class JournalsForMessage < ActiveRecord::Base
#用户动态公共表记录
def act_as_principal_activity
- if self.jour_type == 'Principal'
- unless self.user_id == self.jour.id && self.user_id != self.reply_id && self.reply_id != 0
- self.principal_acts << PrincipalActivity.new(:user_id => self.user_id, :principal_id => self.jour_id)
- end
+ if self.jour_type == 'Principal' && self.m_parent_id.nil?
+ self.principal_acts << PrincipalActivity.new(:user_id => self.user_id, :principal_id => self.jour_id)
end
end
diff --git a/app/models/memo.rb b/app/models/memo.rb
index 33b24db50..7c4fbdcf1 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: 30000
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/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb
index 2d4754a0a..54c9541f2 100644
--- a/app/views/blog_comments/show.html.erb
+++ b/app/views/blog_comments/show.html.erb
@@ -164,7 +164,7 @@
<%= form_for :blog_comment, :url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= render :partial => 'blog_comments/reply_form', :locals => {:f => f,:user=>@user,:article=>@article} %>
- <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'canel_message_replay();', :class => " grey_btn fr c_white mt10 mr5" %>
+ <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %>
<%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-right: 5px;" %>
<% end %>
diff --git a/app/views/courses/_term_select.html.erb b/app/views/courses/_term_select.html.erb
new file mode 100644
index 000000000..e295e7c94
--- /dev/null
+++ b/app/views/courses/_term_select.html.erb
@@ -0,0 +1,41 @@
+
+
+
+ 当前课程的学期信息不能修改。如果您希望为本课程新建学期,请根据需要执行以下两种操作之一(目前复制学期正在改进中,将尽快上线)。选择前请参考按钮右侧的说明:
+
+
+
+
+ 新建学期
+
+ 新建学期将为您创建一个新的课程学期,新学期不包括之前学期的任何内容。
+
+
+
+
+
+ 复制学期
+ (开发中...)
+
+ 复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb
index a462db79d..a90be14ea 100644
--- a/app/views/courses/settings.html.erb
+++ b/app/views/courses/settings.html.erb
@@ -36,8 +36,8 @@
* <%= l(:label_course_term)%> :
- <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %>
- <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>
+ <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"time_selected"} %>
+ <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"term_selected"} %>
@@ -92,4 +92,17 @@
-
+
<%= l(:label_no_file_uploaded)%>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
-
-<% if defined?(container) && container && container.saved_attachments %>
- <% container.attachments.each_with_index do |attachment, i| %>
-
- <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
- <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
- <%= l(:field_is_public)%>:
- <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
- <%= if attachment.id.nil?
- #待补充代码
- else
- link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
- end
- %>
- <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
-
- <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
-
- <% end %>
-<% end %>
+
\ No newline at end of file
diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb
index 62d5c68e4..9c7021383 100644
--- a/app/views/files/_upload_course_files.erb
+++ b/app/views/files/_upload_course_files.erb
@@ -7,7 +7,7 @@
<%= l(:label_file_upload_error_messages)%>
<%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
-
+
课件 |
@@ -19,7 +19,7 @@
- <%= render :partial => 'files/new_style_attachment_list',:locals => {:course => course} %>
+ <%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
<%= l(:button_cancel)%>
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);
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index 25a4fae46..523ab1300 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().length > 30000){
+ $("#error").html("内容 过长(最长为 30000 个字符)").show();
+ return false;
+ }
return true;
}
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index e06db1d0f..d2186118d 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -226,7 +226,7 @@
function project_files_upload()
{
- $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_show_project',:locals => {:project => @project}) %>');
+ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/upload_project_files_on_navbar',:locals => {:container => @project}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before(" ");
diff --git a/app/views/projects/_upload_project_files_list.html.erb b/app/views/projects/_upload_project_files_list.html.erb
new file mode 100644
index 000000000..59da30012
--- /dev/null
+++ b/app/views/projects/_upload_project_files_list.html.erb
@@ -0,0 +1,35 @@
+
+<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%>
+<%= l(:label_browse) %>
+ <%= file_field_tag 'attachments[dummy][file]',
+ :id => "_file#{container.id}",
+ :class => ie8? ? '':'file_selector',
+ :multiple => true,
+ :onchange => "addInputFiles_board(this, '#{container.id}');",
+ :style => ie8? ? '': 'display:none',
+ :data => {
+ :max_file_size => Setting.attachment_max_size.to_i.kilobytes,
+ :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
+ :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
+ :upload_path => uploads_path(:format => 'js'),
+ :description_placeholder => l(:label_optional_description),
+ :field_is_public => l(:field_is_public),
+ :are_you_sure => l(:text_are_you_sure),
+ :file_count => l(:label_file_count),
+ :delete_all_files => l(:text_are_you_sure_all)
+ } %>
+
+
+
+
+ <%= l(:label_no_file_uploaded)%>
+
+(<%= l(:label_max_size) %>:
+<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
+
\ No newline at end of file
diff --git a/app/views/projects/_upload_project_files_on_navbar.html.erb b/app/views/projects/_upload_project_files_on_navbar.html.erb
new file mode 100644
index 000000000..591e159f1
--- /dev/null
+++ b/app/views/projects/_upload_project_files_on_navbar.html.erb
@@ -0,0 +1,30 @@
+
+
+
+
<%= l(:label_upload_files)%>
+
+ <%= error_messages_for 'attachment' %>
+
<%= l(:label_file_upload_error_messages)%>
+
+ <%= form_tag(project_files_path(container), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
+
+
+ <%= render :partial => 'projects/upload_project_files_list',:locals => {:container => container} %>
+
+
<%= l(:button_cancel)%>
+
<%= l(:button_confirm)%>
+ <% end %>
+
+
+
+ <% content_for :header_tags do %>
+ <%= javascript_include_tag 'attachments' %>
+ <% end %>
+
+
+
\ No newline at end of file
diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb
index 961f351de..0258b3b83 100644
--- a/app/views/student_work/_add_score.html.erb
+++ b/app/views/student_work/_add_score.html.erb
@@ -16,7 +16,7 @@
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
<%end%>
- 提交
+ 提交
<% end%>
\ No newline at end of file
diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb
index 02e73aaab..ebe3d4cc6 100644
--- a/app/views/student_work/_evaluation_un_work.html.erb
+++ b/app/views/student_work/_evaluation_un_work.html.erb
@@ -80,5 +80,6 @@
<% end%>
+ 点击查看详情
diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb
index 78114d62b..81d868a50 100644
--- a/app/views/student_work/_evaluation_work.html.erb
+++ b/app/views/student_work/_evaluation_work.html.erb
@@ -1,62 +1,63 @@
-
-
- <% is_my_work = student_work.user == User.current%>
-
-
- <% if is_my_work%>
-
- <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
-
-
- <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
-
- <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
-
-
-
-
-
- <%= student_work.user.show_name%>
-
-
- <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
-
-
-
- <% else%>
-
- <%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
-
-
-
- <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
-
-
-
-
-
- <% end%>
-
-
-
-
- <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
- <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
- [迟交]
- <% end %>
-
-
-
- <% my_score = student_work_score(student_work,User.current) %>
-
- <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
-
-
-
+
+
+ <% is_my_work = student_work.user == User.current%>
+
+
+ <% if is_my_work%>
+
+ <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
+
+
+ <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
+
+ <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
+
+
+
+
+
+ <%= student_work.user.show_name%>
+
+
+ <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
+
+
+
+ <% else%>
+
+ <%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
+
+
+
+ <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
+
+
+
+
+
+ <% end%>
+
+
+
+
+ <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
+ <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
+ [迟交]
+ <% end %>
+
+
+
+ <% my_score = student_work_score(student_work,User.current) %>
+
+ <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
+
+ 点击查看详情
+
+
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb
index d834bc845..64f097114 100644
--- a/app/views/student_work/_student_work_list.html.erb
+++ b/app/views/student_work/_student_work_list.html.erb
@@ -2,10 +2,10 @@
作品
- (<%= @student_work_count%>)
+ (已有<%= @student_work_count%>人提交)
<% if !@is_teacher && @stundet_works.empty?%>
- 未提交
+ 您尚未提交作品
<% end %>
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
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%>
+
\ No newline at end of file
diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb
index db83fd432..fdf1e31a3 100644
--- a/app/views/student_work/new.html.erb
+++ b/app/views/student_work/new.html.erb
@@ -111,11 +111,20 @@
-
确定
+
确定
或
<%= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%>
<% end%>
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/views/student_work/update.js.erb b/app/views/student_work/update.js.erb
new file mode 100644
index 000000000..79733db31
--- /dev/null
+++ b/app/views/student_work/update.js.erb
@@ -0,0 +1,16 @@
+<% if @submit_result%>
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
+showModal('ajax-modal', '500px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ " ");
+$('#ajax-modal').parent().css("top","").css("left","");
+$('#ajax-modal').parent().addClass("anonymos");
+<% else %>
+window.location.href = '<%= edit_student_work_url(@work)%>';
+<% end %>
+
+function clickCanel() {
+ hideModal('#popbox02');
+ window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
+}
\ No newline at end of file
diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb
index 34d609487..6f47e3535 100644
--- a/app/views/users/_resources_list.html.erb
+++ b/app/views/users/_resources_list.html.erb
@@ -21,5 +21,7 @@
<%= format_date(attach.created_on) %>
<%= attach.id %>
+
+
<% end %>
<% end %>
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 41c7c1eee..da649663d 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -66,9 +66,10 @@
课程名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 23:59
- 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 23:59
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59
+ 发布时间:<%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M').to_s %>
+ 提交截止:<%= ma.course_message.end_time %> 23:59
+ 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 23:59
+ 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 23:59
迟交扣分:<%= ma.course_message.late_penalty %>分
缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
@@ -380,7 +381,7 @@
<%= link_to image_tag(url_to_avatar(ma.course_message.homework_common.user), :width => "30", :height => "30"), user_path(ma.course_message.homework_common.user) %>
- <%=link_to ma.course_message.homework_common.user.show_name, user_path(ma.course_message.homework_common.user), :class => "newsBlue homepageNewsPublisher" %>
+ <%=link_to ma.course_message.homework_common.user.show_name+"老师", user_path(ma.course_message.homework_common.user), :class => "newsBlue homepageNewsPublisher" %>
">发布的作业:
diff --git a/app/views/users/import_resources_to_homework.js.erb b/app/views/users/import_resources_to_homework.js.erb
index c929f48e5..804b4ec44 100644
--- a/app/views/users/import_resources_to_homework.js.erb
+++ b/app/views/users/import_resources_to_homework.js.erb
@@ -2,7 +2,7 @@
<% @attachments.each do |attachment| %>
$("#attachments_fields").append(
''+
- '<%= text_field_tag("attachments[p#{attachment.id}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+
+ '<%= text_field_tag("attachments[p#{attachment.id}][filename]", attachment.filename, :class => "upload_filename link_file", :readonly=>"readonly")%>'+
'<%= text_field_tag("attachments[p#{attachment.id}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+
'<%= l(:field_is_public)%>: '+
'<%= check_box_tag("attachments[p#{attachment.id}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+
diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb
index c3a736058..0e2648509 100644
--- a/app/views/users/new_user_commit_homework.html.erb
+++ b/app/views/users/new_user_commit_homework.html.erb
@@ -112,7 +112,7 @@
<% if test.status.to_i == -2 %>
- <%= test.results.first %>
+ <%= test.results.first %>
<% else %>
diff --git a/app/views/users/user_commit_homework.html.erb b/app/views/users/user_commit_homework.html.erb
index a7416cf40..6f14ce05d 100644
--- a/app/views/users/user_commit_homework.html.erb
+++ b/app/views/users/user_commit_homework.html.erb
@@ -86,7 +86,7 @@
<% if test.status.to_i == -2 %>
- <%= test.results.first %>
+ <%= test.results.first %>
<% else %>
diff --git a/config/application.rb b/config/application.rb
index 90cc299c6..6e4a2983a 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -41,7 +41,7 @@ module RedmineApp
config.active_record.store_full_sti_class = true
config.active_record.default_timezone = :local
-
+ config.time_zone = 'Beijing'
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
diff --git a/db/migrate/20151109073857_delete_journals_activity.rb b/db/migrate/20151109073857_delete_journals_activity.rb
new file mode 100644
index 000000000..ae7074c9c
--- /dev/null
+++ b/db/migrate/20151109073857_delete_journals_activity.rb
@@ -0,0 +1,40 @@
+class DeleteJournalsActivity < ActiveRecord::Migration
+ def up
+ UserActivity.all.each do |activity|
+ if activity.act_type == 'JournalsForMessage'
+ if activity.act
+ unless activity.act.m_parent_id.nil?
+ parent_act = UserActivity.where("act_id = #{activity.act.m_parent_id} and act_type='JournalsForMessage' and container_type='Principal'").first
+ if parent_act
+ parent_act.created_at = activity.act.parent.children.maximum("created_on")
+ parent_act.save
+ activity.destroy
+ end
+ end
+ else
+ activity.destroy
+ end
+ end
+ end
+
+ PrincipalActivity.all.each do |activity|
+ if activity.principal_act_type == 'JournalsForMessage'
+ if activity.principal_act
+ unless activity.principal_act.m_parent_id.nil?
+ parent_act = PrincipalActivity.where("principal_act_id = #{activity.principal_act.m_parent_id} and principal_act_type='JournalsForMessage'").first
+ if parent_act
+ parent_act.created_at = activity.principal_act.parent.children.maximum("created_on")
+ parent_act.save
+ activity.destroy
+ end
+ end
+ else
+ activity.destroy
+ end
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20151109080256_alter_user_activities_update.rb b/db/migrate/20151109080256_alter_user_activities_update.rb
new file mode 100644
index 000000000..6e77c411f
--- /dev/null
+++ b/db/migrate/20151109080256_alter_user_activities_update.rb
@@ -0,0 +1,16 @@
+class AlterUserActivitiesUpdate < ActiveRecord::Migration
+ def up
+ count = UserActivity.all.count / 30 + 2
+ transaction do
+ for i in 1 ... count do i
+ UserActivity.page(i).per(30).each do |activity|
+ activity.updated_at = activity.created_at
+ activity.save
+ end
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b7e1bfa1c..7898b3f4d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20151102090519) do
+ActiveRecord::Schema.define(:version => 20151109080256) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 0c7f4156f..84e087c49 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -954,13 +954,19 @@ function regexStudentWorkDescription()
function new_student_work()
{
if(regexStudentWorkName()&®exStudentWorkDescription())
- {$("#new_student_work").submit();}
+ {
+ $("#new_student_work").submit();
+ $("#ajax-indicator").hide();
+ }
}
function edit_student_work(id)
{
if(regexStudentWorkName()&®exStudentWorkDescription())
- {$("#edit_student_work_" + id).submit();}
+ {
+ $("#edit_student_work_" + id).submit();
+ $("#ajax-indicator").hide();
+ }
}
//
diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js
index ca7b28ee7..a0647b592 100644
--- a/public/javascripts/new_user.js
+++ b/public/javascripts/new_user.js
@@ -250,13 +250,19 @@ function regex_evaluation_num(){
function new_student_work()
{
if(regexStudentWorkName()&®exStudentWorkDescription())
- {$("#new_student_work").submit();}
+ {
+ $("#new_student_work").submit();
+ $("#ajax-indicator").hide();
+ }
}
function edit_student_work(id)
{
if(regexStudentWorkName()&®exStudentWorkDescription())
- {$("#edit_student_work_" + id).submit();}
+ {
+ $("#edit_student_work_" + id).submit();
+ $("#ajax-indicator").hide();
+ }
}
//验证作品名称
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 8b5e2fba3..48c6a2d88 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -43,10 +43,13 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
.pingBackTit{ float:left; width:573px; margin-left:10px; }
.hworkUl{ height:30px; border-bottom:1px solid #eaeaea; line-height:30px; vertical-align:middle; background-color: #f6f6f6;}
.hworkH30 {height:30px !important; line-height:30px !important;}
-.hworkListRow {height:65px; border-bottom:1px dashed #eaeaea; line-height:65px; vertical-align:middle;}
+.hworkListRow {height:65px; border-bottom:1px dashed #eaeaea; line-height:65px; vertical-align:middle; position: relative;}
.hworkListRow:hover {background-color:#f6f6f7;}
.hworkUl li{ float:left;}
.hworkListRow li{ float:left;}
+.hworkTip{position:absolute; padding:3px 5px; border:1px solid #eaeaea; display:block; right:-108px; top:20px; background-color:#ffffff; line-height:20px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
+.hworkTip em {display:block; border-width:8px; position:absolute; bottom:4px; left:-16px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
+.hworkTip span {display:block; border-width:8px; position:absolute; bottom:4px; left:-15px; border-style:dashed solid dashed dashed; border-color:transparent #FFF transparent transparent; font-size:0; line-height:0;}
.hworkList340 {width:335px; text-align:left; height:50px; line-height:50px;padding-left:5px;}
.hworkList80 {width:80px; text-align:center;}
.hworkList50 {width:50px; text-align:center;}
@@ -492,6 +495,13 @@ a:hover.tijiao{ background:#0f99a9;}
.ni_con_work p{ color:#808181; }
a.xls{ margin-left:5px; color:#136b3b;}
.grey_c{ color:#808181;}
+
+.disable_btn { height:46px; display:block; width:90px; color:#fff; background:#d0d2d0; text-align:center; padding-top:4px; margin-right:15px;}
+a.term_btn{ height:38px; display:block; width:90px; color:#fff; background:#269ac9; text-align:center; padding-top:12px; margin-right:15px;}
+a:hover.term_btn{ background:#297fb8;}
+p.c_black{ color:#000000;}
+a.exit { height:24px; display:block; width:80px; color:#000000; background:#c3c3c3; text-align:center; padding-top:4px;}
+.lh22{ line-height: 22px;}
/* 学生列表*/
.st_list{ width:670px;}
.st_search{ }
@@ -893,6 +903,8 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f
.c_w{ color:#fff;}
.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
+ .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;}
+ .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;}
.upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
.evaluation{position: relative;}
.evaluation_submit{position: absolute;right: 0px;bottom: 0px;}
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 7263c2f58..f21a4b1fd 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -401,7 +401,8 @@ a.resourcesBlack {font-size:12px; color:#4c4c4c;white-space: nowrap;text-align:
a.resourcesBlack:hover {font-size:12px; color:#000000;}
.resourcesListCheckbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;}
.resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;}
-.resourcesList {width:710px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;}
+.resourcesList {width:710px; height:39px; background-color:#ffffff; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;} /*border-bottom:1px dashed #eaeaea;*/
+.resourcesListDashLine {width:710px;border-bottom:1px dashed #eaeaea !important; margin-left:auto; margin-right:auto; padding-bottom: 2px} /*border-bottom:1px dashed #eaeaea;*/
.resourcesListOption {width:710px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;}
.resourcesCheckAll {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;}
.resourcesSelectSend {float:right;}
@@ -1152,6 +1153,8 @@ img.ui-datepicker-trigger {
text-overflow: ellipsis;
margin-bottom: 3px;
}
+ .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;}
+ .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;}
.upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
.message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;}
.message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);}
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index 4594d0c51..e7a24b151 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -369,6 +369,8 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;}
#attachments_fields .ajax-loading input.filename {background:url(../images/loading.gif) no-repeat 0px 50%;}
.reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;}
.reply_btn:hover{ background:#999; color:#fff; }
+ .ajax-waiting input.upload_filename {background:url(../images/hourglass.png) no-repeat 0px 50%;}
+ .ajax-loading input.upload_filename {background:url(../images/loading.gif) no-repeat 0px 50%;}
.upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
.attachments_fields input.description {margin-left:4px; width:100px; }
.attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';}