From 41e372c16a1440f46c50f3e12154b0a1d14f3e1e Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 14:51:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form_course.html.erb | 2 +- app/views/files/_attachement_list.html.erb | 2 +- public/javascripts/attachments.js | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index 73b637c22..39c760690 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -38,7 +38,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> -<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn" %> +<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index b2ef7742c..59f1b66fd 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -22,7 +22,7 @@ - + <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 4dcc4e744..ea385ae28 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -21,7 +21,6 @@ function addFile(inputEl, file, eagerUpload) { var fileSpan = $('', { 'id': 'attachments_' + attachmentId, 'class':'attachment' }); fileSpan.append( - $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload), $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) , From ef7949584c9b36eb8b4af3f396b25ea21b3df5e5 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 15:02:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90tag?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=9B=9E=E9=80=80=E5=90=8E=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 8 ++++++++ app/views/tags/remove_tag_new.js.erb | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index bb9a44104..e26901320 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -317,6 +317,14 @@ class TagsController < ApplicationController when '8' @obj = OpenSourceProject.find_by_id(obj_id) @obj_pages, @open_source_projects_results, @results_count = for_pagination(get_open_source_projects_by_tag(selected_tags)) + when '10' + @obj = Attachment.find_by_id(obj_id) + + # modifed by Long Jun + # this is used to find the attachments that came from the same project and tagged with the same tag. + #@result = get_attachments_by_project_tag(selected_tags, @obj) + @result = get_attachments_by_tag(selected_tags) + @obj_pages, @attachments_results, @results_count = for_pagination(@result) when '9' then @obj = Course.find_by_id(obj_id) @obj_pages, @courses_results, @results_count = for_pagination(get_courses_by_tag(selected_tags)) diff --git a/app/views/tags/remove_tag_new.js.erb b/app/views/tags/remove_tag_new.js.erb index 24d52a35f..01edf3e1c 100644 --- a/app/views/tags/remove_tag_new.js.erb +++ b/app/views/tags/remove_tag_new.js.erb @@ -1,6 +1,11 @@ //本js使用的新的tag显示方法 <% if @object_flag == "6"%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); +<% end %> +<% if @object_flag == "10"%> +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); <% end %> \ No newline at end of file