From da9a607a5bf6f0bc0280bf989162b06e82efc51e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 6 Jun 2015 16:11:37 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=90=8E=E6=B7=BB=E5=8A=A0=E9=99=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E4=B8=8D=E5=88=B7=E6=83=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/add_score.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 5e6c4fe6d..0ba275d5d 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -2,7 +2,7 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti $('#score_<%= @work.id%>').peSlider({range: 'min'}); <% if @is_new%> - $("#score_list_<%= @work.id%>").prepend("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>"); + $("#score_list_<%= @work.id%>").prepend("
<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>
"); <% else %> $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>"); <% end%> From 89f71ffa46df0a4f9fb92e4b2f4bf3bbf5f79b78 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 10 Jun 2015 15:19:59 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=90=8E=E7=9A=84=E4=B8=8B=E8=BD=BD=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=8C=89=E9=92=AE=E5=90=8E=E5=B0=B1=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E4=BA=86=EF=BC=8C=E4=B8=8D=E5=90=88=E9=80=82?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 6 +++--- app/views/files/_course_list.html.erb | 4 ++-- app/views/files/_project_file_list.html.erb | 4 ++-- app/views/stores/index.html.erb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index ec0480c19..c1e5af48a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -79,9 +79,7 @@ class AttachmentsController < ApplicationController if candown || User.current.admin? || User.current.id == @attachment.author_id @attachment.increment_download if stale?(:etag => @attachment.digest) - if params[:force] == 'true' - direct_download - else + if params[:preview] == 'true' convered_file = @attachment.diskfile #如果本身不是pdf文件,则先寻找是不是已转换化,如果没有则转化 unless pdf?(convered_file) @@ -96,6 +94,8 @@ class AttachmentsController < ApplicationController else direct_download end + else + direct_download end end else diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 1d5684d31..7f3e426fc 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -25,7 +25,7 @@ <% if file.is_public? || User.current.member_of_course?(course) %>
- <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %> + <%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> @@ -40,7 +40,7 @@ <% else %> <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <% end %> - <%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %> + <%= link_to_attachment file, text: '下载', class: 'f_l re_open' %> <% else %> <% end %>
diff --git a/app/views/files/_project_file_list.html.erb b/app/views/files/_project_file_list.html.erb index a5152ecdc..81b69d754 100644 --- a/app/views/files/_project_file_list.html.erb +++ b/app/views/files/_project_file_list.html.erb @@ -18,7 +18,7 @@ <% project_attachments.each do |file| %>
- <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> + <%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> <% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %> <%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> @@ -30,7 +30,7 @@ <% else %> <%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> <% end %> - <%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %> + <%= link_to_attachment file, text: '下载', class: 'f_l re_open' %> <% end %>
diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb index 6fab364b5..84116a561 100644 --- a/app/views/stores/index.html.erb +++ b/app/views/stores/index.html.erb @@ -35,7 +35,7 @@ <%= c1.downloads %>
- <%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%> + <%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>c
<% end -%> From 56f522f56361b664f5460f1d8cee5937fb5c1c06 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 10 Jun 2015 15:36:11 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E8=A7=A3=E5=86=B3IE=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E4=B8=AD--=E8=AF=BE=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/test_controller.rb | 2 +- app/controllers/zipdown_controller.rb | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb index 12fead4f2..71c445dc4 100644 --- a/app/controllers/test_controller.rb +++ b/app/controllers/test_controller.rb @@ -24,7 +24,7 @@ class TestController < ApplicationController end @paths = homeworks_attach_path zipfile = ziping homeworks_attach_path - send_file zipfile, :filename => bid.name, + send_file zipfile, :filename => filename_for_content_disposition(bid.name), :type => detect_content_type(zipfile) rescue Errno::ENOENT => e logger.error "[Errno::ENOENT] ===> #{e}" diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 7eb06d270..53b40942a 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -11,7 +11,7 @@ class ZipdownController < ApplicationController def download if User.current.logged? begin - send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file]) + send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file]) rescue => e render file: 'public/no_file_found.html' end @@ -59,9 +59,10 @@ class ZipdownController < ApplicationController if homework != nil unless homework.attachments.empty? zipfile = zip_homework_by_user homework - send_file zipfile.file_path, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) + - "_" + homework.user.show_name + - "_" + homework.name + ".zip", :type => detect_content_type(zipfile.file_path) if(zipfile) + filename = ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) + + "_" + homework.user.show_name + + "_" + homework.name + ".zip" + send_file zipfile.file_path, :filename => filename_for_content_disposition(filename), :type => detect_content_type(zipfile.file_path) if(zipfile) else render file: 'public/no_file_found.html' end From 46da84cd819fe4fbd39b8bf0f14da7c27dfa8c63 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 12 Jun 2015 15:56:28 +0800 Subject: [PATCH 04/10] ... --- app/views/courses/_courses_jours.html.erb | 4 ++-- app/views/projects/_project_jours.html.erb | 2 +- app/views/users/_user_jours.html.erb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index a097a2286..e3eba9151 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -155,8 +155,8 @@ params.div_form = $(">.respond-form",params.container); params.form = $("form",params.div_form); params.textarea = $("textarea[name='user_notes']",params.div_form); - params.contentmsg = $("p[nhname='contentmsg']",params.div_form), - params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); if(params.textarea.data('init') == undefined){ params.editor = init_editor(params); diff --git a/app/views/projects/_project_jours.html.erb b/app/views/projects/_project_jours.html.erb index d530a7199..5692afcf5 100644 --- a/app/views/projects/_project_jours.html.erb +++ b/app/views/projects/_project_jours.html.erb @@ -149,7 +149,7 @@ params.div_form = $(">.respond-form",params.container); params.form = $("form",params.div_form); params.textarea = $("textarea[name='user_notes']",params.div_form); - params.contentmsg = $("p[nhname='contentmsg']",params.div_form), + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); if(params.textarea.data('init') == undefined){ diff --git a/app/views/users/_user_jours.html.erb b/app/views/users/_user_jours.html.erb index 56b9a883b..a2f6f8cb4 100644 --- a/app/views/users/_user_jours.html.erb +++ b/app/views/users/_user_jours.html.erb @@ -177,8 +177,8 @@ params.div_form = $(">.respond-form",params.container); params.form = $("form",params.div_form); params.textarea = $("textarea[name='user_notes']",params.div_form); - params.contentmsg = $("p[nhname='contentmsg']",params.div_form), - params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); + params.contentmsg = $("p[nhname='contentmsg']",params.div_form); + params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); if(params.textarea.data('init') == undefined){ params.editor = init_editor(params); From 6d8f0e728d49cd99aa8179ea0eae89cc80a4708d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 12 Jun 2015 16:26:24 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=20=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E9=80=9A=E7=9F=A5=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E7=89=88=E7=BC=96=E8=BE=91=E5=99=A8=E7=9B=B8=E5=85=B3BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homework_common/_homework_common_form.html.erb | 14 ++++++++------ app/views/news/_course_form.html.erb | 8 ++++++-- .../kindeditor/themes/default/default.css | 1 + .../assets/kindeditor/themes/default/default.css | 1 + public/stylesheets/public.css | 1 + 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/views/homework_common/_homework_common_form.html.erb b/app/views/homework_common/_homework_common_form.html.erb index e3ef0d237..28aa490de 100644 --- a/app/views/homework_common/_homework_common_form.html.erb +++ b/app/views/homework_common/_homework_common_form.html.erb @@ -11,12 +11,14 @@
  • - <% if edit_mode %> - <%= f.kindeditor :description,:width=>'83%',:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> - <% else %> - <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor :description,:width=>'83%',:editor_id => 'homework_description_editor' %> - <% end %> +
    + <% if edit_mode %> + <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> + <% else %> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= f.kindeditor :description,:editor_id => 'homework_description_editor' %> + <% end %> +
  • diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb index 32c8e368e..1769c98f3 100644 --- a/app/views/news/_course_form.html.erb +++ b/app/views/news/_course_form.html.erb @@ -8,11 +8,15 @@ <% if is_new %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> - <%= f.kindeditor :description,:width=>'91%',:editor_id=>'news_description_editor' %> +
    + <%= f.kindeditor :description,:editor_id=>'news_description_editor' %> +

    <% else %> - <%= f.kindeditor :description,:width=>'91%',:editor_id=>'news_description_editor',:owner_id => @news.id,:owner_type => OwnerTypeHelper::NEWS %> +
    + <%= f.kindeditor :description,:editor_id=>'news_description_editor',:owner_id => @news.id,:owner_type => OwnerTypeHelper::NEWS %> +

    <% end %> diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/default/default.css b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/default/default.css index 428b6c8b5..0d322283a 100644 --- a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/default/default.css +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/default/default.css @@ -421,6 +421,7 @@ overflow: hidden; margin: 0; padding: 0; + max-width: 100%; } /* toolbar */ .ke-toolbar { diff --git a/public/assets/kindeditor/themes/default/default.css b/public/assets/kindeditor/themes/default/default.css index 5de213f37..c5a84c186 100644 --- a/public/assets/kindeditor/themes/default/default.css +++ b/public/assets/kindeditor/themes/default/default.css @@ -432,6 +432,7 @@ } /* container */ .ke-container { + max-width: 100%; display: block; border: 1px solid #CCCCCC; background-color: #FFF; diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4bfc1ef99..0ed497127 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -440,3 +440,4 @@ img{max-width: 100%;} .attachments {clear: both;} .is_public_checkbox{margin-left: 15px;margin-right: 10px;} .author_name{color: #3ca5c6 !important;} +.ke-container-default{max-width: 100%;} From e138292f2a9a01762a5b3b0647645a270fe0eaae Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 12 Jun 2015 16:31:29 +0800 Subject: [PATCH 06/10] ... --- app/views/courses/_courses_jours.html.erb | 6 ++++-- app/views/courses/_history.html.erb | 3 ++- app/views/projects/_history.html.erb | 3 ++- app/views/projects/_project_jours.html.erb | 6 ++++-- app/views/users/_history.html.erb | 3 ++- app/views/users/_user_jours.html.erb | 6 ++++-- app/views/words/_journal_reply_items.html.erb | 3 ++- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index e3eba9151..28dfbe786 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -49,6 +49,7 @@