作品追加附件
This commit is contained in:
parent
4e9e7543ba
commit
8fe53468e1
|
@ -4,7 +4,7 @@ class StudentWorkController < ApplicationController
|
|||
require 'bigdecimal'
|
||||
require "base64"
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule,:forbidden_anonymous_comment,:delete_work]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
||||
before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work]
|
||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :set_score_rule, :forbidden_anonymous_comment]
|
||||
|
@ -527,6 +527,18 @@ class StudentWorkController < ApplicationController
|
|||
@course_activity = params[:course_activity].to_i
|
||||
end
|
||||
|
||||
def revise_attachment
|
||||
Attachment.attach_filesex(@work, params[:attachments], params[:attachment_type])
|
||||
revise_attachments = @work.attachments.where("attachtype = 7").reorder("created_on desc")
|
||||
if revise_attachments.count == 2
|
||||
revise_attachments.last.destroy
|
||||
end
|
||||
#@attachment = @work.attachments.where("attachtype = 7").order("created_on desc").first
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def hsd_committed_work?(user, homework)
|
||||
sw = StudentWork.where("user_id =? and homework_common_id =?", user, homework).first
|
||||
|
|
|
@ -126,4 +126,15 @@ module StudentWorkHelper
|
|||
end
|
||||
type
|
||||
end
|
||||
|
||||
def revise_attachment_status homework, attach
|
||||
date = Time.parse(format_time(attach.created_on.to_s)).strftime("%Y-%m-%d")
|
||||
status = ""
|
||||
if homework.homework_detail_manual && ((homework.anonymous_comment == 0 &&homework.homework_detail_manual.evaluation_start.to_s <= date) || (homework.anonymous_comment == 1 && homework.end_time < date))
|
||||
status = "此时其他同学作品已公开"
|
||||
else
|
||||
status = "此时其他同学作品尚未公开"
|
||||
end
|
||||
return status
|
||||
end
|
||||
end
|
|
@ -10,6 +10,7 @@ class StudentWork < ActiveRecord::Base
|
|||
has_many :student_work_tests, order: 'id desc'
|
||||
# course's message
|
||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||
has_many :attachments, :dependent => :destroy
|
||||
|
||||
before_destroy :delete_praise
|
||||
before_save :set_program_score, :set_src
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<% if @is_destroy%>
|
||||
$("#attachment_<%= @attachment.id%>").remove();
|
||||
if(document.getElementById("uploadReviseBox")) {
|
||||
$("#uploadReviseBox").removeClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","_file.click();");
|
||||
}
|
||||
<%else%>
|
||||
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
||||
|
@ -26,5 +30,10 @@
|
|||
$('#upload_file_count'+containerid).html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
||||
}
|
||||
}
|
||||
|
||||
if(document.getElementById("uploadReviseBox")) {
|
||||
$("#uploadReviseBox").removeClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","_file.click();");
|
||||
}
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
||||
<% end%>
|
|
@ -89,6 +89,11 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
|
@ -99,4 +104,26 @@
|
|||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr linkBlue mt5 mb5" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function show_upload(){
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
}
|
||||
function submit_files(){
|
||||
$("#upload_form").submit();
|
||||
}
|
||||
function closeModal(){
|
||||
hideModal($(".uploadBoxContainer"));
|
||||
}
|
||||
function disable_choose(){
|
||||
if ($("#attachments_fields .attachment").size() >= 1) {
|
||||
$("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
|
||||
<% if @homework.end_time < Date.today %>
|
||||
<% if revise_attachment && @is_teacher %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">追加修订附件</span>
|
||||
</div>
|
||||
<div class="mb10">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
|
||||
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %> (<%=revise_attachment_status @homework,revise_attachment %>)
|
||||
</div>
|
||||
<% end %>
|
||||
<% if work.user == User.current %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">追加修订附件</span>
|
||||
</div>
|
||||
<% if revise_attachment %>
|
||||
<div class="mb10">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
|
||||
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="mb10">
|
||||
<a href="javascript:void(0);" onclick="show_upload();" class="blueCir ml5" title="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -1,30 +0,0 @@
|
|||
<div class="fl">
|
||||
<div class="cl"></div>
|
||||
<span style="font-weight:normal;">
|
||||
<a href="javascript:void(0);" class="blueCir ml5" onclick="$('#_file<%=work.id %>').click();">上传附件</a>
|
||||
<%#= button_tag "上传附件", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'blueCir ml5' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => "_file#{work.id}",
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => "addReviseFiles(this, '#{work.id}');",
|
||||
:style => '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),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:containerid => "#{work.id}"
|
||||
} %>
|
||||
</span>
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -41,17 +41,18 @@
|
|||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% if work.attachments.empty?%>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current)%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
|
@ -61,30 +62,10 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<!--<div class="resubAtt">
|
||||
<span class="resubTitle">追加修订附件</span>
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="mt15">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<a href="javascript:void(0);" class="link_file fl" >socket实验-123456-王强revise.zip</a>
|
||||
<span id="attachments_fields<%= work.id%>" xmlns="http://www.w3.org/1999/html">
|
||||
<span id="attachments_p<%= work.id %>">-->
|
||||
<%#= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :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')%>
|
||||
<%#= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%#= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
<!--</span>
|
||||
</span>
|
||||
<span class="ml5">(123KB)</span><br />
|
||||
<span class="tit_fb">追加时间:</span>2015-12-03 11:00 (此时其他同学作品尚未公开)
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<%#= render :partial => 'student_work/revise_attachments', :locals => {:work => work } %>
|
||||
<a href="javascript:void(0);" class="blueCir ml5" title="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
<div class="cl"></div>-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
|
@ -96,4 +77,26 @@
|
|||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr linkBlue mt5 mb5" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function show_upload(){
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
}
|
||||
function submit_files(){
|
||||
$("#upload_form").submit();
|
||||
}
|
||||
function closeModal(){
|
||||
hideModal($(".uploadBoxContainer"));
|
||||
}
|
||||
function disable_choose(){
|
||||
if ($("#attachments_fields .attachment").size() >= 1) {
|
||||
$("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,50 @@
|
|||
<!--<div class="resourceUploadPopup">-->
|
||||
<span class="uploadDialogText">上传附件</span>
|
||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||
<div class="uploadBoxContainer">
|
||||
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||
<div>
|
||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
</span>
|
||||
</div>
|
||||
<div class="uploadBox" id="uploadReviseBox">
|
||||
<input type="hidden" name="attachment_type" value="7">
|
||||
<a href="javascript:void(0);" class="uploadIcon f14" name="button" id="choose_revise_attach" onclick="_file.click();" onmouseover="" style="<%= ie8? ? 'display:none' : ''%>">
|
||||
<span class="chooseFile">选择文件</span></a>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => ie8? ? '':'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addReviseInputFiles(this,"'+'upload_files_submit_btn'+'");',
|
||||
: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),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
<div class="cl"></div>
|
||||
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
</div>
|
||||
<div class="uploadResourceIntr">
|
||||
<div class="uploadResourceName">最多只能上传一个小于<span class="c_red">50MB</span>的附件</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div style="margin-top: 10px" >
|
||||
<div class="courseSendSubmit">
|
||||
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1,2 @@
|
|||
closeModal();
|
||||
$("#revise_attachment").html('<%= escape_javascript( render :partial => 'revise_attachment' ,:locals=>{ :work => @work})%>');
|
|
@ -206,6 +206,7 @@ RedmineApp::Application.routes.draw do
|
|||
resources :student_work do
|
||||
member do
|
||||
post 'add_score'
|
||||
post 'revise_attachment'
|
||||
get 'retry_work'
|
||||
get 'praise_student_work'
|
||||
get 'forbidden_anonymous_comment'
|
||||
|
|
|
@ -154,6 +154,73 @@ function addFile(inputEl, file, eagerUpload,btnId) {
|
|||
}
|
||||
addFile.nextAttachmentId = 1;
|
||||
|
||||
function addReviseFile(inputEl, file, eagerUpload,btnId) {
|
||||
|
||||
var attachments_frame = '#attachments_fields';
|
||||
if ($(attachments_frame).children().length < 30) {
|
||||
deleteallfiles = $(inputEl).data('deleteAllFiles');
|
||||
var attachmentId = addFile.nextAttachmentId++;
|
||||
|
||||
var fileSpan = $('<span>', {
|
||||
'id': 'attachments_' + attachmentId,
|
||||
'class': 'attachment'
|
||||
});
|
||||
|
||||
fileSpan.append(
|
||||
$('<input>', {
|
||||
'type': 'text',
|
||||
'class': 'upload_filename readonly',
|
||||
'name': 'attachments[' + attachmentId + '][filename]',
|
||||
'readonly': 'readonly'
|
||||
}).val(file.name),
|
||||
// $('<input>', {
|
||||
// 'type': 'text',
|
||||
// 'class': 'description',
|
||||
// 'name': 'attachments[' + attachmentId + '][description]',
|
||||
// 'maxlength': 254,
|
||||
// 'placeholder': $(inputEl).data('descriptionPlaceholder')
|
||||
// }).toggle(!eagerUpload),
|
||||
// $('<span >' + $(inputEl).data('fieldIsPublic') + ':</span>').attr({
|
||||
// 'class': 'ispublic-label'
|
||||
// }),
|
||||
// $('<input>', {
|
||||
// 'type': 'checkbox',
|
||||
// 'class': 'is_public_checkbox',
|
||||
// 'value': 1,
|
||||
// 'name': 'attachments[' + attachmentId + '][is_public_checkbox]',
|
||||
// checked: 'checked'
|
||||
// }).toggle(!eagerUpload),
|
||||
$('<a> </a>').attr({
|
||||
'href': "#",
|
||||
'class': 'remove-upload'
|
||||
}).click(function() {
|
||||
if (confirm($(inputEl).data('areYouSure'))) {
|
||||
removeReviseFile();
|
||||
if (!eagerUpload) {
|
||||
(function(e) {
|
||||
reload(e);
|
||||
})(fileSpan);
|
||||
}
|
||||
}
|
||||
|
||||
}).toggle(!eagerUpload),
|
||||
$('<div>', {
|
||||
'class': 'div_attachments',
|
||||
'name': 'div_' + 'attachments_' + attachmentId
|
||||
})
|
||||
).appendTo('#attachments_fields');
|
||||
|
||||
$("#uploadReviseBox").addClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","return false;");
|
||||
|
||||
if (eagerUpload) {
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId);
|
||||
}
|
||||
return attachmentId;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) {
|
||||
//上传开始调用函数
|
||||
function onLoadstart(e) {
|
||||
|
@ -293,6 +360,13 @@ function removeFile() {
|
|||
return false;
|
||||
}
|
||||
|
||||
function removeReviseFile() {
|
||||
$(this).parent('span').remove();
|
||||
$("#uploadReviseBox").removeClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","_file.click();");
|
||||
return false;
|
||||
}
|
||||
|
||||
//gcm delete all file
|
||||
//modify by yutao 2015-5-14 <20><>1<EFBFBD><31>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>ϴ<EFBFBD><CFB4>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ start
|
||||
function removeAll(containerid) {
|
||||
|
@ -346,6 +420,30 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
|
|||
});
|
||||
}
|
||||
|
||||
function addReviseInputFiles(inputEl,btnId) {
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
if (inputEl.files) {
|
||||
uploadAndAttachReviseFiles(inputEl.files, inputEl,btnId);
|
||||
// $(inputEl).remove();
|
||||
} else {
|
||||
// browser not supporting the file API, upload on form submission
|
||||
var attachmentId;
|
||||
var aFilename = inputEl.value.split(/\/|\\/);
|
||||
var count = $('#attachments_fields>span').length;
|
||||
attachmentId = addReviseFile(inputEl, {
|
||||
name: aFilename[aFilename.length - 1]
|
||||
}, false);
|
||||
if (attachmentId) {
|
||||
$(inputEl).attr({
|
||||
name: 'attachments[' + attachmentId + '][file]'
|
||||
}).hide();
|
||||
if (count <= 0) count = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function addInputFiles(inputEl,btnId) {
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
if (inputEl.files) {
|
||||
|
@ -405,6 +503,26 @@ function addInputFiles_board(inputEl, id,btnId) {
|
|||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function uploadAndAttachReviseFiles(files, inputEl,btnId) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
|
||||
|
||||
var sizeExceeded = false;
|
||||
$.each(files, function() {
|
||||
if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {
|
||||
sizeExceeded = true;
|
||||
}
|
||||
});
|
||||
if (sizeExceeded) {
|
||||
window.alert(maxFileSizeExceeded);
|
||||
} else {
|
||||
$.each(files, function() {
|
||||
addReviseFile(inputEl, this, true,btnId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function uploadAndAttachFiles(files, inputEl,btnId) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
|
|
|
@ -1197,3 +1197,21 @@ a:hover.memberBtn{background: url(/images/course/hwork_icon.png) -80px -90px no-
|
|||
.resubTitle {position:absolute; top:-10px; left:5px; background-color:#ffffff; display:block; font-weight:bold; padding:0px 2px;}
|
||||
a.blueCir{ display:inline-block; padding:2px 5px; background-color:#ffffff;border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
|
||||
a:hover.blueCir{ background:#3598db; color:#fff;}
|
||||
|
||||
/*上传资源弹窗*/
|
||||
.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;}
|
||||
.uploadDialogText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block; font-weight: bold;}
|
||||
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative}
|
||||
.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#269ac9; border-radius:3px; float:left; margin-right:12px;}
|
||||
a.uploadBoxIcon {background:url(images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:81px; height:30px; padding-left:22px; font-size:14px; color:#ffffff;}
|
||||
a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; width:100px; height:33px;}
|
||||
.chooseFile {color:#ffffff; display:block; margin-left:32px;}
|
||||
.uploadResourceIntr {width:250px; height:33px; float:left; line-height:33px; font-size:12px;}
|
||||
.uploadResourceName {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444; margin-bottom:2px;}
|
||||
.uploadResourceIntr2 {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444;}
|
||||
.uploadType {margin:10px 0; border:1px solid #e6e6e6; width:100px; height:30px; outline:none; font-size:12px; color:#888888;}
|
||||
.uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;}
|
||||
.mb10 {margin-bottom: 10px}
|
||||
.mb15 {margin-bottom: 15px}
|
||||
div.disable_link {background-color: #c1c1c1 !important;}
|
||||
div.disable_link :hover {background-color: #c1c1c1}
|
|
@ -410,7 +410,7 @@ a:hover.search_btn{ background: #0fa9bb;}
|
|||
.resourcesSendTo {float:left; height:20px; margin-top:15px;}
|
||||
.resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;}
|
||||
.resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;}
|
||||
.resourceClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block;}
|
||||
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000;}
|
||||
.resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
|
||||
.searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;}
|
||||
.courseSend {width:260px; height:15px; line-height:15px; margin-bottom:10px;}
|
||||
|
|
|
@ -566,7 +566,7 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat;
|
|||
.resourceSharePopup {width:300px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;}
|
||||
.sendText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:100px; display:inline-block;}
|
||||
.resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;}
|
||||
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block;}
|
||||
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000;}
|
||||
.resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
|
||||
.searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;}
|
||||
.searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -18px no-repeat; display:inline-block; float:left;}
|
||||
|
|
Loading…
Reference in New Issue