附件上传bug修改;意见反馈收拉一致

This commit is contained in:
whimlex 2015-03-20 15:59:30 +08:00
parent 5924cd6432
commit 34579e395f
6 changed files with 21 additions and 13 deletions

View File

@ -62,7 +62,9 @@
:upload_path => uploads_path(:format => 'js',:project =>project),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure)
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count">
<%= l(:label_no_file_uploaded)%>

View File

@ -50,7 +50,11 @@
: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)
: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 id="upload_file_count"><%= l(:label_no_file_uploaded)%></span>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)

View File

@ -34,7 +34,11 @@
: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)
: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;">-->
<label class="f_l ml10 c_grey" style=" margin-top: 3px;">

View File

@ -89,7 +89,7 @@
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
cookiesave('minStatue','false','','','');
cookiesave('minStatue','true','','','');
});
//show???
show_btn.bind("click",function() {

View File

@ -134,7 +134,7 @@ zh:
label_optional_description: 可选的描述
text_are_you_sure_all: 您确定要删除所有文件吗
#
# 项目托管平台
#

View File

@ -15,19 +15,17 @@ function postUpMsg(attachmentId)
function addFile(inputEl, file, eagerUpload) {
if ($('#attachments_fields').children().length < 10) {
alert($(inputEl).data('description_placeholder'));
alert($(inputEl).data('field_is_public'));
alert($(inputEl).data('are_you_sure'));
var attachmentId = addFile.nextAttachmentId++;
var fileSpan = $('<span>', { 'id': 'attachments_' + attachmentId, 'class':'attachment' });
fileSpan.append(
$('<input>', { 'type': 'text', 'class': '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('description-placeholder') } ).toggle(!eagerUpload),
$('<span >'+$(inputEl).data('field_is_public')+'</span>').attr({ 'class': 'ispublic-label' }) ,
$('<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>&nbsp</a>').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload),
$('<a>&nbsp;&nbsp;&nbsp;</a>').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : $(inputEl).data('areYouSure') }).click(removeFile).toggle(!eagerUpload),
$('<div>', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} )
).appendTo('#attachments_fields');
@ -88,7 +86,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
//gcm files count and add delete_all link
var count=$('#attachments_fields>span').length;
$('#upload_file_count').html("已上传"+"<span id=\"count\">"+count+"</span>"+"个文件");
$('#upload_file_count').html("<span id=\"count\">"+count+"</span>"+"个文件已上传");
if(count>=1){
var add_attachs=$('.add_attachment');
var delete_all=$('.remove_all');
@ -122,7 +120,7 @@ function removeFile() {
//gcm delete all file
function removeAll(){
if(confirm("您确定要删除所有文件吗?")){
if(confirm("您确定要删除所有文件吗")){
$(".remove-upload").removeAttr("data-confirm");
$(".remove-upload").click();
}