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 1/8] =?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 @@
+
+ \ 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 2/8] =?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 3/8] ... --- 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 4/8] ... --- 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 5/8] ... --- 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 6/8] ... --- 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 7/8] =?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 8/8] ... --- 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');//标记为已经初始化