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 01/11] =?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 02/11] =?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 e99206ff4a0a0213f860be92c70bad5a89e8a423 Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Thu, 11 Jun 2015 17:31:47 +0800
Subject: [PATCH 03/11] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E6=8D=A2=E7=BC=96=E8=BE=91=E5=99=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/_history.html.erb | 2 +-
app/views/projects/_project_jours.html.erb | 174 +++++++++++++++++-
app/views/words/_new_respond_course.html.erb | 5 +-
app/views/words/_new_respond_project.html.erb | 9 +-
4 files changed, 181 insertions(+), 9 deletions(-)
diff --git a/app/views/projects/_history.html.erb b/app/views/projects/_history.html.erb
index 3633ed7b5..4c29552e9 100644
--- a/app/views/projects/_history.html.erb
+++ b/app/views/projects/_history.html.erb
@@ -21,7 +21,7 @@
<% end %>
<% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
+ {:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<% end %>
diff --git a/app/views/projects/_project_jours.html.erb b/app/views/projects/_project_jours.html.erb
index 5b1e3c065..e7aebac43 100644
--- a/app/views/projects/_project_jours.html.erb
+++ b/app/views/projects/_project_jours.html.erb
@@ -1,4 +1,18 @@
-
+
+<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= l(:label_user_response) %>
<% if !User.current.logged?%>
@@ -12,8 +26,10 @@
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
- :placeholder => "#{l(:label_welcome_my_respond)}" %>
- <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr" %>
+ :placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %>
+
+
+ <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
<% end %>
<% end %>
@@ -24,3 +40,155 @@
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
+
\ No newline at end of file
diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb
index 5b27fd21f..a939a55d4 100644
--- a/app/views/words/_new_respond_course.html.erb
+++ b/app/views/words/_new_respond_course.html.erb
@@ -1,9 +1,10 @@
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
:style => "resize: none;overflow: hidden;",:rows => 4,
- :placeholder => l(:label_feedback_respond_content),
+ :placeholder => l(:label_feedback_respond_content)#,
- :maxlength => 250 %>
+ #:maxlength => 250
+ %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
diff --git a/app/views/words/_new_respond_project.html.erb b/app/views/words/_new_respond_project.html.erb
index e705b7fd3..c3ff241b3 100644
--- a/app/views/words/_new_respond_project.html.erb
+++ b/app/views/words/_new_respond_project.html.erb
@@ -1,15 +1,18 @@
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
:style => "resize: none;overflow: hidden;",:rows => 4,
- :placeholder => l(:label_feedback_respond_content),
-
- :maxlength => 250 %>
+ :placeholder => l(:label_feedback_respond_content)
+ #,:maxlength => 250
+ %>
+
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
+
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%>
+
<% end %>
\ No newline at end of file
From 6929694fb403e38f24dd2f400999a09b5464bedd Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Thu, 11 Jun 2015 18:16:23 +0800
Subject: [PATCH 04/11] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E7=95=99=E8=A8=80=E6=8D=A2=E7=BC=96=E8=BE=91=E5=99=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_history.html.erb | 2 +-
app/views/users/_user_jours.html.erb | 171 ++++++++++++++++++++++++++
app/views/words/_new.html.erb | 8 +-
app/views/words/_new_respond.html.erb | 8 +-
4 files changed, 183 insertions(+), 6 deletions(-)
diff --git a/app/views/users/_history.html.erb b/app/views/users/_history.html.erb
index 9b5744251..3daa6cc7d 100644
--- a/app/views/users/_history.html.erb
+++ b/app/views/users/_history.html.erb
@@ -24,7 +24,7 @@
<% end %>
<% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'',
- {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
+ {:focus => 'project_respond',:nhname=>'reply_btn', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
<% end %>
diff --git a/app/views/users/_user_jours.html.erb b/app/views/users/_user_jours.html.erb
index b5badf60c..061632194 100644
--- a/app/views/users/_user_jours.html.erb
+++ b/app/views/users/_user_jours.html.erb
@@ -1,3 +1,17 @@
+
+<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
@@ -49,3 +63,160 @@
}
+
+
+
diff --git a/app/views/words/_new.html.erb b/app/views/words/_new.html.erb
index 561c6a953..e81368c1f 100644
--- a/app/views/words/_new.html.erb
+++ b/app/views/words/_new.html.erb
@@ -35,7 +35,7 @@
border: #d5dee9 1px solid;
}
-
+
<%= form_for('new_form', :remote => true, :method => :post,
:url => {:controller => 'words',
:action => 'create',
@@ -51,10 +51,12 @@
<%= f.text_area 'user_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_leave_a_message)}",
:style => "resize: none; width: 98%",
- :class => 'noline'%>
+ :class => 'noline',:nhname=>'new_message_textarea'%>
<%# end %>
<%= f.text_field :reference_user_id, :style=>"display:none"%>
- <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
+
+
+ <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-top: 5px;"%>
<%else %>
<%= l(:label_user_login_tips) %>
diff --git a/app/views/words/_new_respond.html.erb b/app/views/words/_new_respond.html.erb
index 33c523c33..f140030a7 100644
--- a/app/views/words/_new_respond.html.erb
+++ b/app/views/words/_new_respond.html.erb
@@ -1,15 +1,19 @@
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
- :placeholder => l(:label_feedback_respond_content),
- :maxlength => 250 %>
+ :placeholder => l(:label_feedback_respond_content)#,
+ #:maxlength => 250
+ %>
+
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
+
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "enterprise",
:style => "float: right; margin-top: 1px; margin-right: 4px;margin-bottom: 5px;"%>
+
<% end %>
\ No newline at end of file
From f7e0ad9fc36fd001546dfeb03c0f7b870877e30d Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Fri, 12 Jun 2015 10:09:47 +0800
Subject: [PATCH 05/11] ...
---
app/views/boards/_course_show.html.erb | 2 +-
app/views/boards/_form_project.html.erb | 1 +
app/views/boards/_project_show.html.erb | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb
index 48e5a870d..5beee8601 100644
--- a/app/views/boards/_course_show.html.erb
+++ b/app/views/boards/_course_show.html.erb
@@ -253,7 +253,7 @@
};
params.get_ref_str_call=function(btn){
var div = btn.parent('div');
- var str = '
'+$('a',div).filter(':first').html()+' 写到:
'+$("input[nhname='nh_content_val']",div).val()+'
';
+ var str = '
'+$('a',div).filter(':first').html()+' 写到:
'+$("input[nhname='nh_content_val']",div).val()+'
';
return str;
}
nh_init_board(params);
diff --git a/app/views/boards/_form_project.html.erb b/app/views/boards/_form_project.html.erb
index f6b41b53f..525869901 100644
--- a/app/views/boards/_form_project.html.erb
+++ b/app/views/boards/_form_project.html.erb
@@ -47,6 +47,7 @@
+
<% unless replying %>
<% end %>
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index aed6b80e5..d5a5a7882 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -238,7 +238,7 @@
};
params.get_ref_str_call=function(btn){
var div = btn.parent('div');
- var str = ''+$('a',div).filter(':first').html()+' 写到:
'+$("input[nhname='nh_content_val']",div).val()+'
';
+ var str = ''+$('a',div).filter(':first').html()+' 写到:
'+$("input[nhname='nh_content_val']",div).val()+'
';
return str;
}
nh_init_board(params);
From 3c515dd07727e075baddf38eff08ef3e8a9410a1 Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Fri, 12 Jun 2015 10:52:15 +0800
Subject: [PATCH 06/11] ...
---
app/views/boards/show.html.erb | 7 +++++--
app/views/courses/_courses_jours.html.erb | 7 +++++--
app/views/projects/_project_jours.html.erb | 7 +++++--
app/views/users/_user_jours.html.erb | 7 +++++--
4 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index d7a02e326..196e7f097 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -185,8 +185,11 @@ function nh_init_board(params){
if(params.quote_input!=undefined)params.quote_input.empty();
}else{
if(params.type=='reply'){
- params.jumphref.attr('href','#'+params.form.attr('id'));
- params.jumphref[0].click();
+ params.textarea.show();
+ params.textarea.focus();
+ params.textarea.hide();
+ //params.jumphref.attr('href','#'+params.form.attr('id'));
+ //params.jumphref[0].click();
}else params.inputsubject.focus();
}
});
diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb
index 07d065901..a097a2286 100644
--- a/app/views/courses/_courses_jours.html.erb
+++ b/app/views/courses/_courses_jours.html.erb
@@ -168,8 +168,11 @@
params.cancel_btn.click();
setTimeout(function(){
if(!params.div_form.is(':hidden')){
- $("#nhjump").attr('href','#'+params.div_form.attr('id'));
- $("#nhjump")[0].click();
+ params.textarea.show();
+ params.textarea.focus();
+ params.textarea.hide();
+// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
+// $("#nhjump")[0].click();
}
},300);
params.textarea.data('init',1);
diff --git a/app/views/projects/_project_jours.html.erb b/app/views/projects/_project_jours.html.erb
index e7aebac43..d530a7199 100644
--- a/app/views/projects/_project_jours.html.erb
+++ b/app/views/projects/_project_jours.html.erb
@@ -162,8 +162,11 @@
params.cancel_btn.click();
setTimeout(function(){
if(!params.div_form.is(':hidden')){
- $("#nhjump").attr('href','#'+params.div_form.attr('id'));
- $("#nhjump")[0].click();
+ params.textarea.show();
+ params.textarea.focus();
+ params.textarea.hide();
+// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
+// $("#nhjump")[0].click();
}
},300);
params.textarea.data('init',1);
diff --git a/app/views/users/_user_jours.html.erb b/app/views/users/_user_jours.html.erb
index 061632194..56b9a883b 100644
--- a/app/views/users/_user_jours.html.erb
+++ b/app/views/users/_user_jours.html.erb
@@ -190,8 +190,11 @@
params.cancel_btn.click();
setTimeout(function(){
if(!params.div_form.is(':hidden')){
- $("#nhjump").attr('href','#'+params.div_form.attr('id'));
- $("#nhjump")[0].click();
+ params.textarea.show();
+ params.textarea.focus();
+ params.textarea.hide();
+// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
+// $("#nhjump")[0].click();
}
},300);
params.textarea.data('init',1);
From dbb6c9f54cab48b30ebeedd1a487909777b94bf4 Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Fri, 12 Jun 2015 11:21:49 +0800
Subject: [PATCH 07/11] ...
---
public/assets/kindeditor/kindeditor.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index 74228d3ea..5ebe96a32 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -5620,7 +5620,8 @@ _plugin('core', function(K) {
afterUpload : function(data) {
if (data.error === 0) {
var url = K.formatUrl(data.url, 'absolute');
- self.exec('insertimage', url, 'image','','','1','left');
+ //self.exec('insertimage', url, 'image','','','1','left');
+ self.insertHtml('
');
var asset_id = data.asset_id;
if ( asset_id != "" && parent.document.getElementById('asset_id') != null ) {
parent.document.getElementById('asset_id').value += asset_id.toString();
From 0ca913bc8353222a7babb346eeefa7710fdd590e Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Fri, 12 Jun 2015 11:55:29 +0800
Subject: [PATCH 08/11] ...
---
app/helpers/activity_notifys_helper.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/helpers/activity_notifys_helper.rb b/app/helpers/activity_notifys_helper.rb
index 15fc43b54..f2069a2d3 100644
--- a/app/helpers/activity_notifys_helper.rb
+++ b/app/helpers/activity_notifys_helper.rb
@@ -1,7 +1,6 @@
module ActivityNotifysHelper
def get_new_notify_count(container,type)
- logger.info('xxoo')
- query = ActivityNotify.where('activity_container_id=? and activity_container_type=? and notify_to=?',container.id,type,User.current.id);
+ query = ActivityNotify.where('activity_container_id=? and activity_container_type=? and notify_to=? and is_read=0',container.id,type,User.current.id);
return query.count()
end
end
\ No newline at end of file
From 9938c9f83abd91bbf04e448d8535a7fa45cb577b Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 12 Jun 2015 14:41:02 +0800
Subject: [PATCH 09/11] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A6=96=E9=A1=B5?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=99=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb
index 4fbf3ad43..0d48dc8d2 100644
--- a/app/views/courses/show.html.erb
+++ b/app/views/courses/show.html.erb
@@ -49,7 +49,7 @@
<%= l :label_activity_time %> : <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %>
- <%= link_to_attachments_course(e) if e.is_a?(News) %>
+ <%= link_to_attachments_course(e) if e.class.to_s == "News" %>
From e8369b2f258e3c68c605fa55c954b9ed1398af5b Mon Sep 17 00:00:00 2001
From: yutao <283765470@qq.com>
Date: Fri, 12 Jun 2015 14:49:50 +0800
Subject: [PATCH 10/11] ...
---
app/views/boards/show.html.erb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index 196e7f097..ba9583e7d 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -190,7 +190,12 @@ function nh_init_board(params){
params.textarea.hide();
//params.jumphref.attr('href','#'+params.form.attr('id'));
//params.jumphref[0].click();
- }else params.inputsubject.focus();
+ }else{
+ params.textarea.show();
+ params.textarea.focus();
+ params.textarea.hide();
+// params.inputsubject.focus();
+ }
}
});
params.textarea.data('init','1');//标记为已经初始化
From 881d66103b80578dee2101c0a259841e63b5b213 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 12 Jun 2015 14:59:06 +0800
Subject: [PATCH 11/11] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B3=A8=E9=87=8A?=
=?UTF-8?q?=E6=8E=89=E7=9A=84=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mailer/send_for_user_activities.html.erb | 12 -----
.../mailer/send_for_user_activities.text.erb | 50 +++++++++----------
2 files changed, 25 insertions(+), 37 deletions(-)
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index 1b4e2c255..21549be21 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -10,7 +10,6 @@
<%= l(:label_course_news) %>
-
<% @course_news.each do |course_new|%>
-
@@ -41,7 +40,6 @@
<%= l(:label_homework_overview) %>
-
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
@@ -76,7 +74,6 @@
<%= l(:view_course_journals_for_messages) %>
-
<% @course_journal_messages.each do |course_journal_message|%>
@@ -109,7 +106,6 @@
<%= l(:view_borad_course) %>
-
<% @course_messages.each do |course_message|%>
-
@@ -137,7 +133,6 @@
<%= l(:label_course_attendingcontestwork_download) %>
-
<% @attachments.each do |attachment|%>
-
@@ -174,7 +169,6 @@
<%= l(:label_issue_tracking) %>
-
<% @issues.each do |issue|%>
-
@@ -203,7 +197,6 @@
<%= l(:project_moule_boards_show) %>
-
<% @project_messages.each do |project_message|%>
-
@@ -236,7 +229,6 @@
<%= l(:label_wiki) %>
-
<% @wiki_contents.each do |wikicontent|%>
-
@@ -268,7 +260,6 @@
<%= l(:label_project_news) %>
-
<% @project_news.each do |project_new|%>
-
@@ -298,7 +289,6 @@
<%= l(:label_project_mail_feedback) %>
-
<% @project_journal_messages.each do |project_journal_message|%>
@@ -336,7 +326,6 @@
<%= l(:label_user_message) %>
-
<% @user_journal_messages.each do |user_journal_message|%>
@@ -395,7 +384,6 @@
<%= l(:label_user_message_forum) %>
-
<% @memos.each do |memo|%>
diff --git a/app/views/mailer/send_for_user_activities.text.erb b/app/views/mailer/send_for_user_activities.text.erb
index f09dcb299..c46e96f03 100644
--- a/app/views/mailer/send_for_user_activities.text.erb
+++ b/app/views/mailer/send_for_user_activities.text.erb
@@ -15,13 +15,13 @@
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%>
]
- <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value)
+ <%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value)
%>
<%= l(:label_project_notice) %>
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value)
-
-
+
+
%> <%= format_time(course_new.created_on) %>
<% end %>
@@ -35,7 +35,7 @@
[
<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
-
+
%>
]
@@ -44,8 +44,8 @@
<%= l(:label_course_homework) %>
<%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
-
-
+
+
%>
<%= format_time(bid.created_at) %>
@@ -66,17 +66,17 @@
[
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value)
-
+
%>
]
- <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value)
+ <%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value)
%>
<%= l(:label_send_course_journals_for_messages) %>
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value)
-
-
+
+
%>
<%= format_time(course_journal_message.created_on) %>
@@ -97,7 +97,7 @@
[
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)
-
+
%>
]
@@ -106,8 +106,8 @@
<%= l(:label_send_course_messages) %>
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value)
-
-
+
+
%>
<%= format_time(course_message.created_on) %>
@@ -126,7 +126,7 @@
▪[
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value)
-
+
%>
]
@@ -135,8 +135,8 @@
<%= l(:label_course_file_upload) %>
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value)
-
-
+
+
%>
<%= format_time(attachment.created_on) %>
@@ -158,7 +158,7 @@
[
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value)
-
+
%>
]
@@ -167,8 +167,8 @@
<%= l(:label_project_issue) %>
<%= link_to truncate(issue. subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value)
-
-
+
+
%>
<%= format_time(issue.created_on) %>
<% end %>
@@ -185,7 +185,7 @@
▪[
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value)
-
+
%>
]
@@ -194,8 +194,8 @@
<%= l(:label_send_course_messages) %>
<%= link_to truncate(project_message. subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
-
-
+
+
%>
<%= format_time(project_message.created_on) %>
<% end %>
@@ -277,13 +277,13 @@
▪
<%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)
-
+
%>
<%= l(:label_show_your_message) %>
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value)
-
-
+
+
%>
<%= format_time(user_journal_message.created_on) %>