Merge branch 'develop' into gitlab_guange
This commit is contained in:
commit
af70dc0ca3
|
@ -607,6 +607,13 @@ class ProjectsController < ApplicationController
|
|||
@project.organization_id = params[:organization_id]
|
||||
params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
|
||||
params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0
|
||||
# 更新公开私有时同步gitlab公开私有
|
||||
unless @project.gpid.nil?
|
||||
g = Gitlab.client
|
||||
gproject = g.project(@project.gpid)
|
||||
params[:project][:is_public] ? g.edit_project(gproject.id, 20) : g.edit_project(gproject.id, 0)
|
||||
end
|
||||
# end
|
||||
if validate_parent_id && @project.save
|
||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
||||
if params[:project][:is_public] == '0'
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
: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)
|
||||
} %>
|
||||
<span id="upload_file_count">
|
||||
|
|
|
@ -60,7 +60,9 @@
|
|||
: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)
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:containerid => "#{container.id}"
|
||||
} %>
|
||||
<% if container.nil? %>
|
||||
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
||||
|
|
|
@ -60,7 +60,9 @@
|
|||
: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),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:containerid => "#{container.id}"
|
||||
} %>
|
||||
<span id="upload_file_count<%=container.id %>" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
: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)
|
||||
} %>
|
||||
<span id="upload_file_count">
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
: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)
|
||||
} %>
|
||||
<span id="upload_file_count">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div id="new_course_topic">
|
||||
<div class="homepagePostBrief c_grey">
|
||||
<div>
|
||||
<input type="text" value="<%= article.title%>" name="blog_comment[title]" id="message_subject" class="InputBox w713" style="width: 720px !important;" maxlength="255" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " />
|
||||
<input type="text" value="<%= article.title%>" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " />
|
||||
<p id="subjectmsg"></p>
|
||||
</div>
|
||||
<div id="topic_editor" style="display: block;">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div id="new_course_topic">
|
||||
<div class="homepagePostBrief c_grey">
|
||||
<div>
|
||||
<input type="text" name="blog_comment[title]" id="message_subject" class="InputBox w713" style="width: 720px !important;" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " >
|
||||
<input type="text" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " >
|
||||
<p id="subjectmsg"></p>
|
||||
</div>
|
||||
<div id="topic_editor" style="display: none;">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
:id => '_file',
|
||||
:class => ie8? ? '':'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFilesCourseSource(this,"'+ checkBox.to_s+'");',
|
||||
:onchange => 'addInputFilesCourseSource(this,"'+ checkBox.to_s+'","'+'submit_resource'+'");',
|
||||
:style => ie8? ? '': 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
|
@ -17,6 +17,7 @@
|
|||
: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)
|
||||
} %>
|
||||
<% else %>
|
||||
|
@ -35,6 +36,7 @@
|
|||
: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)
|
||||
} %>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
:id => "_file#{container.id}",
|
||||
:class => ie8? ? '':'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => "addInputFiles_board(this, '#{container.id}');",
|
||||
:onchange => "addInputFiles_board(this, '#{container.id}','"+"submit_resource"+"');",
|
||||
:style => ie8? ? '': 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
|
@ -16,7 +16,9 @@
|
|||
: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)
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:containerid => "#{container.id}"
|
||||
} %>
|
||||
</span>
|
||||
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
<%= 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>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
|
||||
<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>-->
|
||||
<%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
<%= render :partial => 'attachement_list',:locals => {:course => course} %>
|
||||
<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>
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
<%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
: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)
|
||||
} %>
|
||||
<!--<span id="upload_file_count">-->
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
: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)
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:containerid => "#{container.id}"
|
||||
} %>
|
||||
|
||||
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
: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}"
|
||||
} %>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
:id => '_file',
|
||||
:class => ie8? ? '':'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:onchange => 'addInputFiles(this,"'+'upload_files_submit_btn'+'");',
|
||||
:style => ie8? ? '': 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
|
@ -18,6 +18,7 @@
|
|||
: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)
|
||||
} %>
|
||||
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<div class="mt10">
|
||||
<span id="attachments_fields" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= 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>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= 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;") %>
|
||||
<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>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => ie8? ? '' : 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(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',:project =>nil),
|
||||
: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>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr20" onclick="$('#_file').click();">上传附件</a>
|
||||
<%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr20",:remote => true%>
|
||||
<% if defined?(has_program) && has_program %>
|
||||
<a href="javascript:void(0);" class="ProBtn fl mt3">编程</a>
|
||||
<span class="fl C_lgrey mt3 program_detail_info"></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
|
@ -45,9 +45,9 @@
|
|||
<div style="margin-top: 10px" >
|
||||
<div class="courseSendSubmit">
|
||||
<!--<a href="javascript:void(0);" class="sendSourceText" onclick="">确定</a>-->
|
||||
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:class=>'sendSourceText' %>
|
||||
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
||||
</div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="closeModal();">取消</a></div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
: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>
|
||||
|
|
|
@ -183,6 +183,7 @@ zh:
|
|||
|
||||
label_optional_description: 可选的描述
|
||||
label_file_count: "个文件已上传"
|
||||
lebel_file_uploding: "个文件正在上传"
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -72,6 +72,23 @@ class Gitlab::Client
|
|||
post(url, :body => {:name => name}.merge(options))
|
||||
end
|
||||
|
||||
# Updates a project team member to a specified access level.
|
||||
# id (required) - The ID of a project
|
||||
# name (optional) - project name
|
||||
# path (optional) - repository name for project
|
||||
# description (optional) - short project description
|
||||
# default_branch (optional)
|
||||
# issues_enabled (optional)
|
||||
# merge_requests_enabled (optional)
|
||||
# wiki_enabled (optional)
|
||||
# snippets_enabled (optional)
|
||||
# public (optional) - if true same as setting visibility_level = 20
|
||||
# visibility_level (optional)
|
||||
|
||||
def edit_project(id, visibility_level)
|
||||
put("/projects/#{id}", :body => {:visibility_level => visibility_level})
|
||||
end
|
||||
|
||||
# Deletes a project.
|
||||
#
|
||||
# @example
|
||||
|
|
|
@ -10,6 +10,9 @@ module Trustie
|
|||
DEVELOPER = 30
|
||||
MASTER = 40
|
||||
OWNER = 50
|
||||
# 项目公开和私有
|
||||
PUBLIC = 20
|
||||
PRIVATE = 0
|
||||
end
|
||||
|
||||
class Sync
|
||||
|
@ -45,7 +48,8 @@ module Trustie
|
|||
issues_enabled: false,
|
||||
snippets_enabled: false,
|
||||
public: false,
|
||||
user_id: gid
|
||||
user_id: gid,
|
||||
visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE
|
||||
)
|
||||
project.gpid = gproject.id
|
||||
project.save!
|
||||
|
@ -84,7 +88,8 @@ module Trustie
|
|||
merge_requests_enabled: true,
|
||||
public: false,
|
||||
user_id: gid,
|
||||
import_url: import_url
|
||||
import_url: import_url,
|
||||
visibility_level: project.is_public? ? UserLevel::PUBLIC : UserLevel::PRIVATE
|
||||
)
|
||||
puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
project.gpid = gproject.id
|
||||
|
|
|
@ -22,7 +22,7 @@ function reload(fileSpan) {
|
|||
|
||||
}
|
||||
|
||||
function addFile_board(inputEl, file, eagerUpload, id) {
|
||||
function addFile_board(inputEl, file, eagerUpload, id,btnId) {
|
||||
|
||||
var attachments_frame = '#attachments_fields' + id;
|
||||
if ($(attachments_frame).children().length < 30) {
|
||||
|
@ -80,7 +80,7 @@ function addFile_board(inputEl, file, eagerUpload, id) {
|
|||
).appendTo(attachments_frame);
|
||||
|
||||
if (eagerUpload) {
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl);
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId);
|
||||
|
||||
}
|
||||
return attachmentId;
|
||||
|
@ -88,7 +88,7 @@ function addFile_board(inputEl, file, eagerUpload, id) {
|
|||
return null;
|
||||
}
|
||||
|
||||
function addFile(inputEl, file, eagerUpload) {
|
||||
function addFile(inputEl, file, eagerUpload,btnId) {
|
||||
|
||||
var attachments_frame = '#attachments_fields';
|
||||
if ($(attachments_frame).children().length < 30) {
|
||||
|
@ -145,7 +145,7 @@ function addFile(inputEl, file, eagerUpload) {
|
|||
).appendTo('#attachments_fields');
|
||||
|
||||
if (eagerUpload) {
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl);
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId);
|
||||
|
||||
}
|
||||
return attachmentId;
|
||||
|
@ -154,7 +154,7 @@ function addFile(inputEl, file, eagerUpload) {
|
|||
}
|
||||
addFile.nextAttachmentId = 1;
|
||||
|
||||
function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
||||
function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) {
|
||||
|
||||
function onLoadstart(e) {
|
||||
fileSpan.removeClass('ajax-waiting');
|
||||
|
@ -168,7 +168,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|||
}
|
||||
}
|
||||
|
||||
function actualUpload(file, attachmentId, fileSpan, inputEl) {
|
||||
function actualUpload(file, attachmentId, fileSpan, inputEl,btnId) {
|
||||
|
||||
ajaxUpload.uploading++;
|
||||
|
||||
|
@ -178,6 +178,23 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|||
})
|
||||
.done(function(result) {
|
||||
progressSpan.progressbar('value', 100).remove();
|
||||
var containerid = $(inputEl).data('containerid');
|
||||
console.log($(inputEl))
|
||||
if(containerid == undefined ){
|
||||
var count = $('#attachments_fields>span').length;
|
||||
$('#'+btnId).removeAttr("disabled");
|
||||
$('#'+btnId).val('确定')
|
||||
$('#'+btnId).css('background-color','#269ac9')
|
||||
$('#upload_file_count').html("<span id=\"count\">" + count + "</span>" + $(inputEl).data('fileCount'));
|
||||
}
|
||||
else{
|
||||
$('#'+btnId).removeAttr("disabled");
|
||||
$('#'+btnId).val('确定')
|
||||
$('#'+btnId).css('background-color','#269ac9')
|
||||
var count = $('#attachments_fields' + containerid + '>span').length;
|
||||
$('#upload_file_count' + containerid).html("<span id=\"count\">" + count + "</span>" + $(inputEl).data('fileCount'));
|
||||
}
|
||||
|
||||
fileSpan.find('input.description, a').css('display', 'inline-block');
|
||||
fileSpan.find('input.is_public_checkbox, a').css('display', 'inline-block');
|
||||
})
|
||||
|
@ -202,7 +219,10 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|||
var containerid = $(inputEl).data('containerid');
|
||||
if (containerid == undefined) {
|
||||
var count = $('#attachments_fields>span').length;
|
||||
$('#upload_file_count').html("<span id=\"count\">" + count + "</span>" + $(inputEl).data('fileCount'));
|
||||
$('#'+btnId).attr("disabled",true);
|
||||
$('#'+btnId).val('提交中');
|
||||
$('#'+btnId).css('background-color','#c1c1c1')
|
||||
$('#upload_file_count').html("<span id=\"count\">" + count + "</span>" + $(inputEl).data('lebelFileUploding'));
|
||||
if (count >= 1) {
|
||||
var add_attachs = $('.add_attachment');
|
||||
var delete_all = $('.remove_all');
|
||||
|
@ -216,7 +236,10 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|||
}
|
||||
} else {
|
||||
var count = $('#attachments_fields' + containerid + '>span').length;
|
||||
$('#upload_file_count' + containerid).html("<span id=\"count\">" + count + "</span>" + $(inputEl).data('fileCount'));
|
||||
$('#'+btnId).attr("disabled",true);
|
||||
$('#'+btnId).val('提交中');
|
||||
$('#'+btnId).css('background-color','#c1c1c1')
|
||||
$('#upload_file_count' + containerid).html("<span id=\"count\">" + count + "</span>" + $(inputEl).data('lebelFileUploding'));
|
||||
if (count >= 1) {
|
||||
var add_attachs = $('.add_attachment').filter(function(index) {
|
||||
return $(this).data('containerid') == containerid;
|
||||
|
@ -240,14 +263,14 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
|
|||
|
||||
}
|
||||
|
||||
var progressSpan = $('<div>').insertAfter(fileSpan.find('input.filename'));
|
||||
var progressSpan = $('<div>').insertAfter(fileSpan.find('input.upload_filename'));
|
||||
progressSpan.progressbar();
|
||||
fileSpan.addClass('ajax-waiting');
|
||||
|
||||
var maxSyncUpload = $(inputEl).data('max-concurrent-uploads');
|
||||
|
||||
if (maxSyncUpload == null || maxSyncUpload <= 0 || ajaxUpload.uploading < maxSyncUpload)
|
||||
actualUpload(file, attachmentId, fileSpan, inputEl);
|
||||
actualUpload(file, attachmentId, fileSpan, inputEl,btnId);
|
||||
else
|
||||
$(inputEl).parents('form').queue('upload', actualUpload.bind(this, file, attachmentId, fileSpan, inputEl));
|
||||
}
|
||||
|
@ -312,11 +335,11 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
|
|||
});
|
||||
}
|
||||
|
||||
function addInputFiles(inputEl) {
|
||||
function addInputFiles(inputEl,btnId) {
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
if (inputEl.files) {
|
||||
// upload files using ajax
|
||||
uploadAndAttachFiles(inputEl.files, inputEl);
|
||||
uploadAndAttachFiles(inputEl.files, inputEl,btnId);
|
||||
// $(inputEl).remove();
|
||||
} else {
|
||||
// browser not supporting the file API, upload on form submission
|
||||
|
@ -338,12 +361,12 @@ function addInputFiles(inputEl) {
|
|||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function addInputFiles_board(inputEl, id) {
|
||||
function addInputFiles_board(inputEl, id,btnId) {
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
|
||||
if (inputEl.files) {
|
||||
// upload files using ajax
|
||||
uploadAndAttachFiles_board(inputEl.files, inputEl, id);
|
||||
uploadAndAttachFiles_board(inputEl.files, inputEl, id,btnId);
|
||||
// $(inputEl).remove();
|
||||
} else {
|
||||
// browser not supporting the file API, upload on form submission
|
||||
|
@ -363,7 +386,7 @@ function addInputFiles_board(inputEl, id) {
|
|||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function uploadAndAttachFiles(files, inputEl) {
|
||||
function uploadAndAttachFiles(files, inputEl,btnId) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
|
||||
|
@ -378,12 +401,12 @@ function uploadAndAttachFiles(files, inputEl) {
|
|||
window.alert(maxFileSizeExceeded);
|
||||
} else {
|
||||
$.each(files, function() {
|
||||
addFile(inputEl, this, true);
|
||||
addFile(inputEl, this, true,btnId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function uploadAndAttachFiles_board(files, inputEl, id) {
|
||||
function uploadAndAttachFiles_board(files, inputEl, id,btnId) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
|
||||
|
@ -398,7 +421,7 @@ function uploadAndAttachFiles_board(files, inputEl, id) {
|
|||
window.alert(maxFileSizeExceeded);
|
||||
} else {
|
||||
$.each(files, function() {
|
||||
addFile_board(inputEl, this, true, id);
|
||||
addFile_board(inputEl, this, true, id,btnId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -471,10 +494,11 @@ $(function() {
|
|||
//课程课件
|
||||
function addInputFilesCourseSource(inputEl) {
|
||||
checkBox = arguments[1] == 'public' ? false : true;
|
||||
btnId = arguments[2];
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
if (inputEl.files) {
|
||||
// upload files using ajax
|
||||
uploadAndAttachFilesCourseSource(inputEl.files, inputEl,checkBox);
|
||||
uploadAndAttachFilesCourseSource(inputEl.files, inputEl,checkBox,btnId);
|
||||
// $(inputEl).remove();
|
||||
} else {
|
||||
// browser not supporting the file API, upload on form submission
|
||||
|
@ -496,7 +520,7 @@ function addInputFilesCourseSource(inputEl) {
|
|||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function uploadAndAttachFilesCourseSource(files, inputEl,checkBox) {
|
||||
function uploadAndAttachFilesCourseSource(files, inputEl,checkBox,btnId) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
|
||||
|
@ -511,12 +535,12 @@ function uploadAndAttachFilesCourseSource(files, inputEl,checkBox) {
|
|||
window.alert(maxFileSizeExceeded);
|
||||
} else {
|
||||
$.each(files, function() {
|
||||
addFileCourseSource(inputEl, this, true,checkBox);
|
||||
addFileCourseSource(inputEl, this, true,checkBox,btnId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function addFileCourseSource(inputEl, file, eagerUpload,checkBox) {
|
||||
function addFileCourseSource(inputEl, file, eagerUpload,checkBox,btnId) {
|
||||
|
||||
var attachments_frame = '#attachments_fields';
|
||||
if ($(attachments_frame).children().length < 30) {
|
||||
|
@ -595,7 +619,7 @@ function addFileCourseSource(inputEl, file, eagerUpload,checkBox) {
|
|||
}
|
||||
|
||||
if (eagerUpload) {
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl);
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId);
|
||||
|
||||
}
|
||||
return attachmentId;
|
||||
|
|
|
@ -905,7 +905,8 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f
|
|||
.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;}
|
||||
div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }
|
||||
.upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 270px;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;}
|
||||
.student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; }
|
||||
|
@ -1127,3 +1128,15 @@ a.postRouteLink:hover {text-decoration:underline;}
|
|||
.syllabusSettingIcon:hover {cursor: pointer}
|
||||
|
||||
.pic_files{display:block; background:url(../images/public_icon.png) 0px -578px no-repeat; width:20px; height:15px;}
|
||||
|
||||
/*确定按钮*/
|
||||
input.sendSourceText {
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
background-color: #269ac9;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
border: none;
|
||||
width: 50px;
|
||||
height: 25px;
|
||||
}
|
||||
|
|
|
@ -131,6 +131,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
|
|||
.w350{ width:350px;}
|
||||
.w610{ width:610px;}
|
||||
.w600{ width:600px;}
|
||||
.w713{width: 713px;}
|
||||
.h22{ height:22px;}
|
||||
.h26{ height:26px;}
|
||||
.h50{ height:50px;}
|
||||
|
@ -1155,7 +1156,8 @@ img.ui-datepicker-trigger {
|
|||
}
|
||||
.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;}
|
||||
div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }
|
||||
.upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 270px;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);}
|
||||
|
||||
|
|
|
@ -371,10 +371,10 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;}
|
|||
.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;}
|
||||
.upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 270px;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:'微软雅黑';}
|
||||
.attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }
|
||||
div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }
|
||||
a.remove-upload:hover {text-decoration:none !important;}
|
||||
.attachments_fields input.is_public_checkbox {width:20px;}
|
||||
|
||||
|
|
Loading…
Reference in New Issue