From 508ca7f823c474d756d002b437557633b3648a3e Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 11 Nov 2015 11:19:10 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=8F=90=E4=BA=A4?=
=?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1=20=E6=96=87=E4=BB=B6=E6=8F=90?=
=?UTF-8?q?=E4=BA=A4=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/attachments/_form_course.html.erb | 3 ++-
.../files/_new_style_attachment_list.html.erb | 3 ++-
.../_upload_project_files_list.html.erb | 3 ++-
public/javascripts/attachments.js | 17 ++++++++++++++---
public/stylesheets/courses.css | 3 ++-
public/stylesheets/new_user.css | 3 ++-
public/stylesheets/project.css | 4 ++--
7 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb
index b66632c7f..dddd0209e 100644
--- a/app/views/attachments/_form_course.html.erb
+++ b/app/views/attachments/_form_course.html.erb
@@ -60,7 +60,8 @@
: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),
+ :containerid => "#{container.id}"
} %>
<% if container.nil? %>
<%= l(:label_no_file_uploaded)%>
diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb
index af679c4d3..7147769da 100644
--- a/app/views/files/_new_style_attachment_list.html.erb
+++ b/app/views/files/_new_style_attachment_list.html.erb
@@ -16,7 +16,8 @@
: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),
+ :containerid => "#{container.id}"
} %>
diff --git a/app/views/projects/_upload_project_files_list.html.erb b/app/views/projects/_upload_project_files_list.html.erb
index 59da30012..b072faa24 100644
--- a/app/views/projects/_upload_project_files_list.html.erb
+++ b/app/views/projects/_upload_project_files_list.html.erb
@@ -16,7 +16,8 @@
: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),
+ :containerid => "#{container.id}"
} %>
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 813c10dee..424e0e572 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -178,6 +178,17 @@ 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;
+ $('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount'));
+ }
+ else{
+ var count = $('#attachments_fields' + containerid + '>span').length;
+ $('#upload_file_count' + containerid).html("" + count + "" + $(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 +213,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
var containerid = $(inputEl).data('containerid');
if (containerid == undefined) {
var count = $('#attachments_fields>span').length;
- $('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount'));
+ //$('#upload_file_count').html("" + count + "" + $(inputEl).data('fileCount'));
if (count >= 1) {
var add_attachs = $('.add_attachment');
var delete_all = $('.remove_all');
@@ -216,7 +227,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
}
} else {
var count = $('#attachments_fields' + containerid + '>span').length;
- $('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount'));
+ //$('#upload_file_count' + containerid).html("" + count + "" + $(inputEl).data('fileCount'));
if (count >= 1) {
var add_attachs = $('.add_attachment').filter(function(index) {
return $(this).data('containerid') == containerid;
@@ -240,7 +251,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
}
- var progressSpan = $('
').insertAfter(fileSpan.find('input.filename'));
+ var progressSpan = $('
').insertAfter(fileSpan.find('input.upload_filename'));
progressSpan.progressbar();
fileSpan.addClass('ajax-waiting');
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 48c6a2d88..71b473abe 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -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; }
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index f21a4b1fd..b9e7bf227 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -1155,7 +1155,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);}
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index e7a24b151..3dedf1396 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -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;}
From d13205bd3de9e40c0a35d0eb2e545e69dedda452 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 11 Nov 2015 11:39:02 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=AD=A3=E5=9C=A8?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/attachments/_form.html.erb | 1 +
app/views/attachments/_form_course.html.erb | 1 +
app/views/attachments/_form_project.html.erb | 2 ++
app/views/attachments/_new_form.html.erb | 1 +
app/views/blog_comments/_blog_attachments.erb | 1 +
app/views/files/_attachement_list.html.erb | 2 ++
app/views/files/_new_style_attachment_list.html.erb | 1 +
app/views/forums/_file_form.html.erb | 1 +
app/views/projects/_upload_project_files_list.html.erb | 1 +
app/views/student_work/_student_work_attachment_form.html.erb | 1 +
app/views/users/_attachment_list.html.erb | 1 +
app/views/users/_user_homework_attachment.html.erb | 1 +
config/locales/projects/zh.yml | 1 +
public/javascripts/attachments.js | 4 ++--
14 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb
index 3dbc8d8ba..ab8b80dcb 100644
--- a/app/views/attachments/_form.html.erb
+++ b/app/views/attachments/_form.html.erb
@@ -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)
} %>
diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb
index dddd0209e..ef5385647 100644
--- a/app/views/attachments/_form_course.html.erb
+++ b/app/views/attachments/_form_course.html.erb
@@ -61,6 +61,7 @@
: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),
:containerid => "#{container.id}"
} %>
<% if container.nil? %>
diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb
index d1cdf8cc9..a9cb068ad 100644
--- a/app/views/attachments/_form_project.html.erb
+++ b/app/views/attachments/_form_project.html.erb
@@ -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}"
} %>
<%= l(:label_no_file_uploaded)%>
diff --git a/app/views/attachments/_new_form.html.erb b/app/views/attachments/_new_form.html.erb
index 47f6fd202..75efb448e 100644
--- a/app/views/attachments/_new_form.html.erb
+++ b/app/views/attachments/_new_form.html.erb
@@ -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)
} %>
diff --git a/app/views/blog_comments/_blog_attachments.erb b/app/views/blog_comments/_blog_attachments.erb
index 48fe91099..dd8be659b 100644
--- a/app/views/blog_comments/_blog_attachments.erb
+++ b/app/views/blog_comments/_blog_attachments.erb
@@ -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)
} %>
diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb
index 01e5dca5f..c5a3b9af0 100644
--- a/app/views/files/_attachement_list.html.erb
+++ b/app/views/files/_attachement_list.html.erb
@@ -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 %>
diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb
index 7147769da..174a05047 100644
--- a/app/views/files/_new_style_attachment_list.html.erb
+++ b/app/views/files/_new_style_attachment_list.html.erb
@@ -17,6 +17,7 @@
: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),
:containerid => "#{container.id}"
} %>
diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb
index 560afc6d9..2510952f1 100644
--- a/app/views/forums/_file_form.html.erb
+++ b/app/views/forums/_file_form.html.erb
@@ -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)
} %>
diff --git a/app/views/projects/_upload_project_files_list.html.erb b/app/views/projects/_upload_project_files_list.html.erb
index b072faa24..c399bf210 100644
--- a/app/views/projects/_upload_project_files_list.html.erb
+++ b/app/views/projects/_upload_project_files_list.html.erb
@@ -16,6 +16,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 => "#{container.id}"
} %>
diff --git a/app/views/student_work/_student_work_attachment_form.html.erb b/app/views/student_work/_student_work_attachment_form.html.erb
index 265ff9be7..d82aea7f9 100644
--- a/app/views/student_work/_student_work_attachment_form.html.erb
+++ b/app/views/student_work/_student_work_attachment_form.html.erb
@@ -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}"
} %>
diff --git a/app/views/users/_attachment_list.html.erb b/app/views/users/_attachment_list.html.erb
index 33e944498..3d44fa267 100644
--- a/app/views/users/_attachment_list.html.erb
+++ b/app/views/users/_attachment_list.html.erb
@@ -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)
} %>
diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb
index 9b7c6c06a..24d37ae63 100644
--- a/app/views/users/_user_homework_attachment.html.erb
+++ b/app/views/users/_user_homework_attachment.html.erb
@@ -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)
} %>
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index 88a710633..1a18e5a14 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -183,6 +183,7 @@ zh:
label_optional_description: 可选的描述
label_file_count: "个文件已上传"
+ lebel_file_uploding: "个文件正在上传"
#
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 424e0e572..5718983fa 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -213,7 +213,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
var containerid = $(inputEl).data('containerid');
if (containerid == undefined) {
var count = $('#attachments_fields>span').length;
- //$('#upload_file_count').html("
" + count + "" + $(inputEl).data('fileCount'));
+ $('#upload_file_count').html("
" + count + "" + $(inputEl).data('lebelFileUploding'));
if (count >= 1) {
var add_attachs = $('.add_attachment');
var delete_all = $('.remove_all');
@@ -227,7 +227,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
}
} else {
var count = $('#attachments_fields' + containerid + '>span').length;
- //$('#upload_file_count' + containerid).html("
" + count + "" + $(inputEl).data('fileCount'));
+ $('#upload_file_count' + containerid).html("
" + count + "" + $(inputEl).data('lebelFileUploding'));
if (count >= 1) {
var add_attachs = $('.add_attachment').filter(function(index) {
return $(this).data('containerid') == containerid;