Merge branch 'szzh' into develop

This commit is contained in:
huang 2015-11-10 15:32:26 +08:00
commit 5efd3fae48
37 changed files with 414 additions and 178 deletions

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -164,7 +164,7 @@
<div class="talkConIpt ml5 mb10" id="reply<%= @article.id %>">
<%= 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 %>
<div class="cl"></div>

View File

@ -0,0 +1,41 @@
<div id="popbox02">
<div class="ni_con">
<p class="f14 mt5 c_black">
当前课程的学期信息不能修改。如果您希望为本课程新建学期,请根据需要执行以下两种操作之一(目前复制学期正在改进中,将尽快上线)。选择前请参考按钮右侧的说明:
</p>
<div class="cl"></div>
<div class="mt15 grey_c lh22">
<a href="javascript:" class="term_btn fl" onclick="newTerm();">
新建学期
</a>
新建学期将为您创建一个新的课程学期,新学期不包括之前学期的任何内容。
</div>
<div class="cl"></div>
<div class="mt15 grey_c lh22">
<!--<a href="javascript:" class="term_btn fl" onclick="copyTerm();">
复制学期
</a>-->
<div class="disable_btn fl">
<span style="display: inline-block">复制学期</span>
<span style="display: inline-block">(开发中...)</span>
</div>
复制学期将为您创建一个新的课程学期,新学期将继承本学期的相关资源,具体您稍后可以选择。
</div>
<div class="cl"></div>
<div class="f12 mt15">
<a href="https://forge.trustie.net/forums/1/memos/1363" class="fl c_red">
如何复制之前学期的资源?
</a>
<a href="javascript:void(0)" class="fr exit" onclick="clickCanel();">退&nbsp;&nbsp;出</a>
</div>
</div>
</div>
<script type="text/javascript">
function newTerm(){
window.location.href = '<%= new_course_path(:host=> Setting.host_course)%>';
}
function copyTerm(){
window.location.href = '<%= copy_course_course_path(@course.id)%>';
}
</script>

View File

@ -36,8 +36,8 @@
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label>
<%= 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"} %>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
@ -92,4 +92,17 @@
</div>
</div><!---成员结束-->
</div><!--talknew end-->
<div class="cl"></div>
<div class="cl"></div>
<script type="text/javascript">
function select() {
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'courses/term_select') %>');
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("anonymos");
}
$("#time_selected").click(select);
$("#term_selected").click(select);
</script>

View File

@ -1,71 +1,33 @@
<span class="add_attachment" data-containerid="<%= container.id %>">
<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%>
<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" ><%= l(:label_browse) %></button>
<% if @course %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => ie8? ? '':'file_selector',
:multiple => true,
:onchange => 'addInputFilesCourseSource(this,"'+ checkBox.to_s+'");',
: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)
} %>
<% else %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => ie8? ? '':'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
: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)
} %>
<% end %>
<button name="button" class="sub_btn" onclick="_file<%=container.id %>.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" ><%= l(:label_browse) %></button>
<%= 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)
} %>
</span>
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
<span id="upload_file_count">
<span id="upload_file_count<%=container.id %>">
<%= l(:label_no_file_uploaded)%>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
<div class="cl"></div>
<div>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= 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;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= 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('&nbsp;'.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}" %>
</span>
<% end %>
<% end %>
<span id="attachments_fields<%= container.id %>" data-containerid="<%= container.id %>" xmlns="http://www.w3.org/1999/html">
</span>
</div>

View File

@ -7,7 +7,7 @@
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
<%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<input type="hidden" name="course_attachment_type" value="<%= course_attachment_type%>">
<input type="hidden" name="in_course_toolbar" value="Y">
<!--<p class="c_grey fr mt10 mr5">-->
<div class="c_dark">
<input name="course_attachment_type" type="radio" value="1" checked class="c_dark" >课件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
@ -19,7 +19,7 @@
</div>
<div class="cl"></div>
<div>
<%= render :partial => 'files/new_style_attachment_list',:locals => {:course => course} %>
<%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
</div>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>

View File

@ -8,6 +8,7 @@
<%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
<input type="hidden" name="in_project_toolbar" value="Y">
<%= render :partial => 'files/attachement_list',:locals => {:project => project} %>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>

View File

@ -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 = $('<div id="addBox" class="flash notice">文件上传成功!</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 = $('<div id="addBox" class="flash notice">文件上传成功!</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 = $('<div id="addBox" class="flash notice">文件上传成功!</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 = $('<div id="addBox" class="flash notice">文件上传成功!</div>');
$("#course_list").prepend(div);
setTimeout( function(){div.remove();},3000)
<% end %>
<%end%>
<% end %>
<% end %>
$(document).ready(img_thumbnails);

View File

@ -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;
}

View File

@ -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("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");

View File

@ -0,0 +1,35 @@
<span class="add_attachment" data-containerid="<%= container.id %>">
<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%>
<button name="button" class="sub_btn" onclick="_file<%=container.id %>.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" ><%= l(:label_browse) %></button>
<%= 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)
} %>
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
</span>
<span id="upload_file_count<%=container.id %>">
<%= l(:label_no_file_uploaded)%>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
<div class="cl">
<div>
<span id="attachments_fields<%= container.id %>" data-containerid="<%= container.id %>" xmlns="http://www.w3.org/1999/html">
</span>
</div>
</div>

View File

@ -0,0 +1,30 @@
<div id="popbox_upload" class="mb10" style="margin-top: -30px;color:#15bccf; font-size:16px;">
<div class="upload_con">
<h2 style="text-align: center"><%= l(:label_upload_files)%></h2>
<div class="upload_box">
<%= error_messages_for 'attachment' %>
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
<%= form_tag(project_files_path(container), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
<input type="hidden" name="in_project_toolbar" value="Y">
<%= render :partial => 'projects/upload_project_files_list',:locals => {:container => container} %>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
<% end %>
</div>
</div>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>
<script>
function submit_resource()
{
$('#submit_resource').parent().submit();
}
</script>

View File

@ -16,7 +16,7 @@
<%= render :partial => 'student_work/student_work_attachment_form', :locals => {:work => work,:score => score} %>
</div>
<%end%>
<a href="javascript:void(0);" class="blue_n_btn fr evaluation_submit" onclick="$(this).parent().parent().submit();$('#about_hwork_<%= @work.id%>').html('');">提交</a>
<a href="javascript:void(0);" class="blue_n_btn fr evaluation_submit" onclick="$(this).parent().parent().submit();$('#about_hwork_<%= work.id%>').html('');">提交</a>
<div class="cl"></div>
</li>
<% end%>

View File

@ -80,5 +80,6 @@
</div>
<% end%>
</li>
<li class="hworkTip" style="display: none"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
</ul>

View File

@ -1,62 +1,63 @@
<!-- 匿评作品列表,显示某一个作品的信息 -->
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
<% is_my_work = student_work.user == User.current%>
<li class="hworkList340 width525">
<ul>
<% if is_my_work%>
<li class="hworkPortrait mt15 mr10">
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
</li>
<li class="hworkName mt15 mr15 width285">
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<div>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
</div>
</li>
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
<%= student_work.user.show_name%>
</li>
<li class="hworkStID mt16" title="学号">
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</li>
</ul>
</li>
<% else%>
<li class="hworkPortrait mt15 mr10">
<%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
</li>
<li class="hworkName mt15 mr15 width285">
<div>
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
</div>
</li>
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
匿名
</li>
<li class="hworkStID mt16" title="学号">
--
</li>
</ul>
</li>
<% end%>
</ul>
</li>
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span>
<% end %>
</li>
<!-- 成绩 -->
<% my_score = student_work_score(student_work,User.current) %>
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10">
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
</li>
</ul>
<!-- 匿评作品列表,显示某一个作品的信息 -->
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
<% is_my_work = student_work.user == User.current%>
<li class="hworkList340 width525">
<ul>
<% if is_my_work%>
<li class="hworkPortrait mt15 mr10">
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
</li>
<li class="hworkName mt15 mr15 width285">
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<div>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
</div>
</li>
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
<%= student_work.user.show_name%>
</li>
<li class="hworkStID mt16" title="学号">
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</li>
</ul>
</li>
<% else%>
<li class="hworkPortrait mt15 mr10">
<%= image_tag(url_to_avatar(""),width:"40", height: "40") %>
</li>
<li class="hworkName mt15 mr15 width285">
<div>
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word width285"%>
</div>
</li>
<li onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<ul class="mt10 fl">
<li class="hworkStName mr10 mt16" title="姓名">
匿名
</li>
<li class="hworkStID mt16" title="学号">
--
</li>
</ul>
</li>
<% end%>
</ul>
</li>
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span>
<% end %>
</li>
<!-- 成绩 -->
<% my_score = student_work_score(student_work,User.current) %>
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10">
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
</li>
<li class="hworkTip" style="display: none"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
</ul>

View File

@ -2,10 +2,10 @@
<span class="c_dark f14 fb fl mr30">
作品
<font class="f12 c_red">
<%= @student_work_count%>
(已有<%= @student_work_count%>人提交)
</font>
<% if !@is_teacher && @stundet_works.empty?%>
<span class="f12 c_red">未提交</span>
<span class="f12 c_red">您尚未提交作品</span>
<% end %>
</span>
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>

View File

@ -26,7 +26,7 @@
<div class="cl"></div>
<div class="HomeWorkCon mt15">
<%= labelled_form_for @work,:html => { :multipart => true } do |f|%>
<%= labelled_form_for @work,:html => { :multipart => true },:remote=>true do |f|%>
<div class=" c_red mb10">
提示:作品名称和描述中不要出现真实的姓名信息
</div>
@ -52,7 +52,7 @@
</div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="edit_student_work(<%= @work.id%>);">确定</a>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();edit_student_work(<%= @work.id%>);">确定</a>
<span class="fr mr10 mt3">或</span>
<%= link_to "取消", student_work_index_path(:homework => @homework), :class => "fr mr10 mt3"%>
</div>
@ -60,3 +60,12 @@
<% end%>
</div><!----HomeWorkCon end-->
</div>
<script type="text/javascript">
function popupRegex(){
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("anonymos");
}
</script>

View File

@ -111,11 +111,20 @@
</div>
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="new_student_work();">确定</a>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();new_student_work();">确定</a>
<span class="fr mr10 mt3">或</span>
<%= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%>
</div>
<div class="cl"></div>
<% end%>
</div><!----HomeWorkCon end-->
</div>
</div>
<script type="text/javascript">
function popupRegex(){
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("anonymos");
}
</script>

View File

@ -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("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#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)%>';
}

View File

@ -21,5 +21,7 @@
<li class="resourcesListTime fl"><%= format_date(attach.created_on) %></li>
<li style="display: none"><%= attach.id %></li>
</ul>
<ul class="resourcesListDashLine"></ul>
<% end %>
<% end %>

View File

@ -66,9 +66,10 @@
<li>课程名称:<%= ma.course_message.course.name %>
(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
<li>作业标题:<span style="color:Red"><%= ma.course_message.name %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;&nbsp;23:59</span></li>
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;&nbsp;23:59</span></li>
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;&nbsp;23:59</span></li>
<li>发布时间:<span style="color:Red;"><%= DateTime.parse(ma.course_message.created_at.to_s).strftime('%Y-%m-%d %H:%M').to_s %></span></li>
<li>提交截止:<span style="color:Red;"><%= ma.course_message.end_time %>&nbsp;23:59</span></li>
<li>匿评开始:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_start %>&nbsp;23:59</span></li>
<li>匿评关闭:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.evaluation_end %>&nbsp;23:59</span></li>
<li>迟交扣分:<span style="color:Red;"><%= ma.course_message.late_penalty %>分</span></li>
<li>缺评扣分:<span style="color:Red;"><%= ma.course_message.homework_detail_manual.absence_penalty %>分</span></li>
</ul>
@ -380,7 +381,7 @@
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= 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) %></a></li>
<li class="homepageNewsPubType fl">
<%=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" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span>
</li>
<li class="homepageHomeworkContent fl"><a href="javascript:void(0);" class="newsGrey">

View File

@ -2,7 +2,7 @@
<% @attachments.each do |attachment| %>
$("#attachments_fields").append(
'<span id="attachments_p<%= attachment.id %>">'+
'<%= 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;") %>'+
'<span class="ispublic-label"><%= l(:field_is_public)%>:</span>'+
'<%= check_box_tag("attachments[p#{attachment.id}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+

View File

@ -112,7 +112,7 @@
<div class="cl"></div>
</div>
<% if test.status.to_i == -2 %>
<div class="ProResultCon "><%= test.results.first %></div>
<div class="ProResultCon"><pre><%= test.results.first %></pre></div>
<% else %>
<div class="ProResultTable " >
<ul class="ProResultUl " >

View File

@ -86,7 +86,7 @@
<div class="cl"></div>
</div>
<% if test.status.to_i == -2 %>
<div class="ProResultCon "><%= test.results.first %></div>
<div class="ProResultCon"><pre><%= test.results.first %></pre></div>
<% else %>
<div class="ProResultTable " >
<ul class="ProResultUl " >

View File

@ -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)'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -954,13 +954,19 @@ function regexStudentWorkDescription()
function new_student_work()
{
if(regexStudentWorkName()&&regexStudentWorkDescription())
{$("#new_student_work").submit();}
{
$("#new_student_work").submit();
$("#ajax-indicator").hide();
}
}
function edit_student_work(id)
{
if(regexStudentWorkName()&&regexStudentWorkDescription())
{$("#edit_student_work_" + id).submit();}
{
$("#edit_student_work_" + id).submit();
$("#ajax-indicator").hide();
}
}
//

View File

@ -250,13 +250,19 @@ function regex_evaluation_num(){
function new_student_work()
{
if(regexStudentWorkName()&&regexStudentWorkDescription())
{$("#new_student_work").submit();}
{
$("#new_student_work").submit();
$("#ajax-indicator").hide();
}
}
function edit_student_work(id)
{
if(regexStudentWorkName()&&regexStudentWorkDescription())
{$("#edit_student_work_" + id).submit();}
{
$("#edit_student_work_" + id).submit();
$("#ajax-indicator").hide();
}
}
//验证作品名称

View File

@ -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;}

View File

@ -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);}

View File

@ -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:'微软雅黑';}