附件上传国际化调整

This commit is contained in:
whimlex 2015-04-10 17:58:59 +08:00
parent e148917865
commit 874dcc2b89
3 changed files with 6 additions and 6 deletions

View File

@ -38,7 +38,7 @@
<span class="add_attachment"> <span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%--> <!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> <%= button_tag "#{l(:button_browse)}", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]', <%= file_field_tag 'attachments[dummy][file]',
:id => '_file', :id => '_file',
:class => 'file_selector', :class => 'file_selector',

View File

@ -90,7 +90,7 @@ form #search_by
<div class="project-search" style="float: right"> <div class="project-search" style="float: right">
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil,:style =>"float: right; margin-left:3px;margin-top:2px" %> <%= submit_tag l(:label_search), :class => "enterprise", :name => nil,:style =>"float: right; margin-left:3px;margin-top:2px" %>
<div class='search_widget' > <div class='search_widget' >
<%= text_field_tag :q, nil, :placeholder => l('welcome.search.information'), style:"float:left;" %> <%= text_field_tag :q, nil, :placeholder => l('welcome.search.information'), style:"float:left; width:185px;" %>
<input type="text" name="search_by_input" style="display: none" id="search_by_input" value="0"> <input type="text" name="search_by_input" style="display: none" id="search_by_input" value="0">
<%= select_tag(:search_type, options_for_select(select_option), :onchange => "searchTypeChange();", :style => "float:right" ) %> <%= select_tag(:search_type, options_for_select(select_option), :onchange => "searchTypeChange();", :style => "float:right" ) %>
<%= select_tag(:search_by,options_for_select([[l('welcome.search.select.userinfo.nickname'),"0"],[l('welcome.search.select.userinfo.showname'),"1"],[l('welcome.search.select.userinfo.email'),"2"]]), :onchange => "searchByChange();",:style => "float:right" ) %> <%= select_tag(:search_by,options_for_select([[l('welcome.search.select.userinfo.nickname'),"0"],[l('welcome.search.select.userinfo.showname'),"1"],[l('welcome.search.select.userinfo.email'),"2"]]), :onchange => "searchByChange();",:style => "float:right" ) %>

View File

@ -37,7 +37,7 @@ function addFile(inputEl, file, eagerUpload) {
$('<span >'+$(inputEl).data('fieldIsPublic')+':</span>').attr({ 'class': 'ispublic-label' }) , $('<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), $('<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' }).click(function(){ $('<a>&nbsp</a>').attr({ 'href': "#", 'class': 'remove-upload' }).click(function(){
if(confirm('您确定要删除吗?')){ if(confirm($(inputEl).data('areYouSure'))){
removeFile(); removeFile();
if(!eagerUpload){ if(!eagerUpload){
(function(e){ (function(e){
@ -107,7 +107,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
//gcm files count and add delete_all link //gcm files count and add delete_all link
var count=$('#attachments_fields>span').length; var count=$('#attachments_fields>span').length;
$('#upload_file_count').html("<span id=\"count\">"+count+"</span>"+"个文件已上传"); $('#upload_file_count').html("<span id=\"count\">"+count+"</span>"+$(inputEl).data('fileCount'));
if(count>=1){ if(count>=1){
var add_attachs=$('.add_attachment'); var add_attachs=$('.add_attachment');
var delete_all=$('.remove_all'); var delete_all=$('.remove_all');
@ -141,7 +141,7 @@ function removeFile() {
//gcm delete all file //gcm delete all file
function removeAll(){ function removeAll(){
if(confirm("您确定要删除所有文件吗")){ if(confirm($(inputEl).data('deleteAllFiles'))){
$(".remove-upload").removeAttr("data-confirm"); $(".remove-upload").removeAttr("data-confirm");
$(".remove-upload").click(); $(".remove-upload").click();
} }
@ -196,7 +196,7 @@ function addInputFiles(inputEl) {
attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false); attachmentId = addFile(inputEl, { name: aFilename[ aFilename.length - 1 ] }, false);
if (attachmentId) { if (attachmentId) {
$(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]'}).hide(); $(inputEl).attr({ name: 'attachments[' + attachmentId + '][file]'}).hide();
$('#upload_file_count').html("已上传"+"<span id=\"count\">"+1+"</span>"+"个文件"); $('#upload_file_count').html("<span id=\"count\">"+count+"</span>"+$(inputEl).data('fileCount'));
} }
} }