From bcb162c60081659cb62553a29c3362d6edf85d86 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 14 Mar 2015 12:01:08 +0800 Subject: [PATCH] =?UTF-8?q?#1968=20=E8=A7=A3=E5=86=B3IE8=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=20?= =?UTF-8?q?=E5=8F=AA=E6=98=AF=E8=A7=A3=E5=86=B3=EF=BC=8C=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E8=BF=98=E6=98=AF=E6=B2=A1=E6=9C=89chrome,firefox=E7=9A=84?= =?UTF-8?q?=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 6 ++++-- app/helpers/application_helper.rb | 6 ++++++ app/views/files/_attachement_list.html.erb | 4 ++-- app/views/files/_upload_show.html.erb | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 34e81cef6..03b349c18 100644 --- a/Gemfile +++ b/Gemfile @@ -27,8 +27,10 @@ group :development do gem 'grape-swagger' #gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git' #gem 'puma' - gem 'pry-rails' - gem 'pry-byebug' + #gem 'pry-rails' + #gem 'pry-byebug' + #gem 'pry-stack_explorer' + #gem 'pry-debugger' gem 'better_errors', path: 'lib/better_errors' gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9629ed437..b4f54f075 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1994,4 +1994,10 @@ module ApplicationHelper end technical_title end + + + def ie8? + request.env["HTTP_USER_AGENT"] =~ /MSIE 8.0/ + end + end diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 001519a28..41025e619 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -22,13 +22,13 @@ - + <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', :multiple => true, :onchange => 'addInputFiles(this);', - :style => 'display:none', + :style => ie8? ? '': 'display:none', :data => { :max_file_size => Setting.attachment_max_size.to_i.kilobytes, :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index 91d050d93..70465c21e 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -4,7 +4,8 @@
<%= error_messages_for 'attachment' %> - <%= form_tag(course_files_path(course), :multipart => true,:remote => true,:method => :post,:name=>"upload_form") do %> + + <%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> <%= render :partial => 'attachement_list',:locals => {:course => course} %>