From 2fb587105825eeeb4389599dcf1c0fe9a3bc7c9e Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 15 May 2015 11:26:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=96=B0=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/show.html.erb | 83 ++++++++++++++++------------------ public/stylesheets/project.css | 11 +++-- 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 8fb63bd10..1d1802172 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -46,59 +46,52 @@
<%= issue_fields_rows do |rows| %> - + <% end %> <%#= render_custom_fields_rows(@issue) %> <%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 3b04e23bf..74d7c58b3 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -87,11 +87,11 @@ a.pro_mes_w{ height:20px; float:left;display:block; color:#999999;} .pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;} .pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;} .pro_pic_box{ margin-left:60px; } -.pro_pic{ width:100px; height:75px;line-height:73px;border:2px solid #CCC; margin:10px 0; text-align: center;} -.pro_info_box{ margin-left:60px; background:#f0fbff; height:80px; padding:10px 0;} +.pro_pic{ width:100px; border:2px solid #CCC; margin:10px 0;} +.pro_info_box{ margin-left:60px; border:1px dashed #CCC; height:45px; padding:10px 0;} .pro_info_box ul{} -.pro_info_box ul li{ margin-bottom:10px;} -.pro_info_p{ color:#0781b4 !important; float:left; width:160px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;padding-top:2.5px;} +.pro_info_box ul li{ height:24px;} +.pro_info_p{color:#0781b4 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .edit_pro_box{overflow:hidden;display:none; margin-bottom:30px; border-bottom:1px dashed #CCC; padding-bottom:10px;} /****翻页***/ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } @@ -354,6 +354,9 @@ a:hover.st_add{ color:#ff8e15;} .newpro_box textarea{ height:150px; float:left; margin-bottom:10px;} .newpro_box select{ height:29px; float:left; margin-bottom:10px;} /*.label{ width:80px; text-align:right; font-size:14 background-image: url(../images/true.png); }*/ +.label02{ width:110px; text-align:right; font-size:14px; display:block; float:left;} +.label03{ width:70px; text-align:right; display:block; float:left;} +.collapsible{ border-left:none;border-right:none;border-bottom:none; border-top:1px solid #e4e4e4; padding-top:10px; } .icon-reload { background-image: url(../images/reload.png); } .icon { background-position: 0% 50%; From 68cf5fa55e6cae945927564a3d97ea8c9c58cb6b Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 15 May 2015 11:45:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=E5=BD=931=E4=B8=AA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AD=98=E5=9C=A8=E5=A4=9A=E4=B8=AA=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=8E=A7=E4=BB=B6=E6=97=B6=E7=9A=84=E5=90=84=E7=A7=8D?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form_project.html.erb | 7 +- app/views/attachments/destroy.js.erb | 32 ++++++-- public/javascripts/attachments.js | 82 +++++++++++++++++--- 3 files changed, 100 insertions(+), 21 deletions(-) diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb index 0478ba613..998766b27 100644 --- a/app/views/attachments/_form_project.html.erb +++ b/app/views/attachments/_form_project.html.erb @@ -24,7 +24,7 @@ <%= l(:field_is_public)%>: <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false, :class => 'is_public_checkbox')%> - <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') %> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), 'data-containerid'=>"#{container.id}",:method => 'delete', :remote => true, :class => 'remove-upload') %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> @@ -41,7 +41,7 @@ // file.click(); // } - + <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> <%= button_tag "文件浏览", :type=>"button", :onclick=>"_file#{container.id}.click()", :class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> @@ -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}" } %> <%= l(:label_no_file_uploaded)%> (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) diff --git a/app/views/attachments/destroy.js.erb b/app/views/attachments/destroy.js.erb index d2a3a11a1..0b6cee0df 100644 --- a/app/views/attachments/destroy.js.erb +++ b/app/views/attachments/destroy.js.erb @@ -1,8 +1,26 @@ -$('#attachments_<%= j params[:attachment_id] %>').remove(); -var count=$('#attachments_fields>span').length; -if(count<=0){ - $("#upload_file_count").text(<%= l(:label_no_file_uploaded)%>); - $(".remove_all").remove(); +var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>'); +//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start +var containerid=$('.remove-upload',attachment_html_obj).data('containerid'); +if(containerid==undefined){ + $('#attachments_<%= j params[:attachment_id] %>').remove(); + var count=$('#attachments_fields>span').length; + if(count<=0){ + $("#upload_file_count").text('<%= l(:label_no_file_uploaded)%>'); + $(".remove_all").remove(); + }else{ + $("#upload_file_count").html(""+count+""+"个文件"+"已上传"); + } }else{ - $("#upload_file_count").html("已上传"+""+count+""+"个文件"); -} \ No newline at end of file + $('#attachments_<%= j params[:attachment_id] %>').remove(); + var count=$('#attachments_fields'+containerid+'>span').length; + if(count<=0){ + $('#upload_file_count'+containerid).text('<%= l(:label_no_file_uploaded)%>'); + var remove_all_html_obj = $(".remove_all").filter(function(index){ + return $(this).data('containerid')==containerid; + }); + remove_all_html_obj.remove(); + }else{ + $('#upload_file_count'+containerid).html(""+count+""+"个文件"+"已上传"); + } +} +//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end \ No newline at end of file diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 01e587e97..3df755a7f 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -37,7 +37,7 @@ function addFile_board(inputEl, file, eagerUpload, id) { $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload), $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) , $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), - $(' ').attr({ 'href': "#", 'class': 'remove-upload' }).click(function(){ + $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-containerid':id }).click(function(){ if(confirm($(inputEl).data('areYouSure'))){ removeFile(); if(!eagerUpload){ @@ -142,14 +142,38 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) { //gcm files count and add delete_all link - var count=$('#attachments_fields>span').length; - $('#upload_file_count').html(""+count+""+$(inputEl).data('fileCount')); - if(count>=1){ - var add_attachs=$('.add_attachment'); - var delete_all=$('.remove_all'); - if(delete_all.length<1){ - add_attachs.append($(" ").attr({"href":"javascript:void(0)", 'class': 'remove_all',"onclick": "removeAll()"})); + //modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ start + var containerid=$(inputEl).data('containerid'); + if(containerid==undefined){ + var count=$('#attachments_fields>span').length; + $('#upload_file_count').html(""+count+""+$(inputEl).data('fileCount')); + if(count>=1){ + var add_attachs=$('.add_attachment'); + var delete_all=$('.remove_all'); + if(delete_all.length<1){ + add_attachs.append($(" ").attr({"href":"javascript:void(0)", 'class': 'remove_all',"onclick": "removeAll()"})); + } } + }else{ + var count=$('#attachments_fields'+containerid+'>span').length; + $('#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; + }); + var delete_all=$('.remove_all').filter(function(index){ + return $(this).data('containerid')==containerid; + }); + if(delete_all.length<1){ + add_attachs.append($(" ").attr({ + "href":"javascript:void(0)", + 'class': 'remove_all', + 'data-containerid': containerid, + "onclick": "removeAll('"+containerid+"')" + })); + } + } + //modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ end } //gcm @@ -176,13 +200,23 @@ function removeFile() { } //gcm delete all file -function removeAll(){ +//modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ start +function removeAll(containerid){ if(confirm(deleteallfiles)){ - $(".remove-upload").removeAttr("data-confirm"); - $(".remove-upload").click(); + if(containerid==undefined){ + $(".remove-upload").removeAttr("data-confirm"); + $(".remove-upload").click(); + }else{ + var arr = $(".remove-upload").filter(function(){ + return $(this).data('containerid')==containerid; + }); + arr.removeAttr("data-confirm"); + arr.click(); + } } // return false; } +//modify by yutao 2015-5-14 1ҳڶϴؼʱ˿bug ʸ֮ end //gcm function uploadBlob(blob, uploadUrl, attachmentId, options) { @@ -324,3 +358,29 @@ function setupFileDrop() { } $(document).ready(setupFileDrop); +$(function(){ + $(".file_selector").each(function() { + deleteallfiles = $(this).data('deleteAllFiles'); + var containerid = $(this).data('containerid'); + if (containerid == undefined)containerid = ''; + var count = $('#attachments_fields' + containerid + '>span').length; + if (count >= 1) { + $('#upload_file_count' + containerid).html("" + count + "" + $(this).data('fileCount')); + var add_attachs = $('.add_attachment').filter(function (index) { + return $(this).data('containerid') == containerid; + }); + var delete_all = $('.remove_all').filter(function (index) { + return $(this).data('containerid') == containerid; + }); + if (delete_all.length < 1) { + add_attachs.append($(" ").attr({ + "href": "javascript:void(0)", + 'class': 'remove_all', + 'data-containerid': containerid, + "onclick": "removeAll('" + containerid + "')" + })); + } + + } + }); +}); \ No newline at end of file From a4cf7bcaad724e9930ee8ec4cc3b92b2e14edcd7 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 15 May 2015 12:17:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA=E5=88=97=E8=A1=A8=E7=BF=BB=E9=A1=B5=E4=B8=BA?= =?UTF-8?q?=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 30bd06b9a..fa34ecb3b 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -31,5 +31,5 @@ <% end -%>
    - <%= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => false, :flag => true %> + <%= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => true, :flag => true %>
\ No newline at end of file