diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index b6ac28258..d3921d44a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -198,7 +198,7 @@ class UsersController < ApplicationController # 系统消息 def user_system_messages @sytem_messages = SystemMessage.order("created_at desc").all - @sytem_messages = paginateHelper @sytem_messages,25 + @sytem_messages = paginateHelper @sytem_messages, 10 respond_to do |format| format.html{render :layout=>'new_base_user'} end diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb index 51cb4458e..7892ed773 100644 --- a/app/views/comments/create.js.erb +++ b/app/views/comments/create.js.erb @@ -1,3 +1,3 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>"); -init_activity_KindEditor_data('<%= @user_activity_id%>',"","85%"); +init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%"); diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index edc722dbc..7c56aea6e 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,3 +1,3 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>"); -init_activity_KindEditor_data(<%= @user_activity_id%>,"","85%"); \ No newline at end of file +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); \ No newline at end of file diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb index 3d4878cf7..4cd1a86d6 100644 --- a/app/views/messages/reply.js.erb +++ b/app/views/messages/reply.js.erb @@ -3,4 +3,4 @@ <%elsif @course%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>"); <%end%> -init_activity_KindEditor_data(<%= @user_activity_id%>,"","85%"); \ No newline at end of file +init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); \ No newline at end of file diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index a58c10f8c..dcd33e3c1 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -97,16 +97,16 @@ <% end %> -
+
/* id="reply_input_<%= user_activity_id%>" style="display: <%= (first_user_activity==user_activity_id && page==0)? '' : 'none'%>"*/
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> - 发送
+ 发送

<% end%> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 90680cf82..4d030737b 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -68,9 +68,9 @@
<% end %> -
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 07f7c452b..4922ed882 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -113,9 +113,9 @@
<% end %> -
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index d734ad982..2edfcbd44 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -82,9 +82,9 @@
<% end %> -
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index ba9e970b6..225304185 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -36,7 +36,7 @@ } $(function() { - init_activity_KindEditor_data(<%= user_activity.id%>,"","85%"); + init_activity_KindEditor_data(<%= user_activity.id%>,"","87%"); }); <% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %> diff --git a/app/views/users/user_system_messages.html.erb b/app/views/users/user_system_messages.html.erb index cf0130547..3b8bd9fb6 100644 --- a/app/views/users/user_system_messages.html.erb +++ b/app/views/users/user_system_messages.html.erb @@ -39,8 +39,8 @@
- Trustie平台 发布了系统消息: - <%= system_message.subject %> + Trustie平台 发布了系统消息: + <%= system_message.subject.nil? ? "系统消息" : system_message.subject %>

diff --git a/public/javascripts/init_activity_KindEditor.js b/public/javascripts/init_activity_KindEditor.js index b73ff10d3..866d0ea41 100644 --- a/public/javascripts/init_activity_KindEditor.js +++ b/public/javascripts/init_activity_KindEditor.js @@ -1,10 +1,7 @@ -/** - * Created by Alan on 2015/9/18. - */ function init_editor(params){ // var minHeight; //最小高度 - var id = arguments[1] ? arguments[1] : undefined; var paramsHeight = params.height; //设定的高度 + var id = arguments[1] ? arguments[1] : undefined; var paramsWidth = params.width == undefined ? "100%" : params.width; var editor = params.kindutil.create(params.textarea, { @@ -13,19 +10,42 @@ function init_editor(params){ minHeight:"30px",// == undefined ? "30px":paramsHeight+"px", items:['emoticons'], afterChange:function(){//按键事件 - nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); + var edit = this.edit; var body = edit.doc.body; edit.iframe.height(paramsHeight); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + (paramsHeight == undefined ? 30:paramsHeight), paramsHeight)); }, + afterBlur:function(){ + nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); + if(this.edit.html()=="") { + this.edit.html('我要回复'); + } + //params.toolbar_container.hide(); + $('#reply_image_' + id).addClass('imageFuzzy'); + //this.resize("95%", null); + //params.submit_btn.css("display","none"); + }, + afterFocus: function(){ + var edit = this.edit; + var body = edit.doc.body; + if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(edit.html())){ + edit.html(''); + } + params.contentmsg.hide(); + // params.toolbar_container.show(); + $('#reply_image_' + id).removeClass('imageFuzzy'); + //edit.iframe.width(paramsWidth); + this.resize(paramsWidth, null); + params.submit_btn.show(); + }, + afterCreate:function(){ params.submit_btn.css("display","none"); var toolbar = $("div[class='ke-toolbar']",params.div_form); toolbar.css('width',24); $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情'); params.toolbar_container.append(toolbar); - params.toolbar_container.style.display = 'none'; //init var edit = this.edit; var body = edit.doc.body; @@ -36,20 +56,10 @@ function init_editor(params){ var body = edit.doc.body; paramsHeight = paramsHeight == undefined ? params.kindutil.removeUnit(this.height) : paramsHeight; edit.iframe.height(paramsHeight); + edit.html('我要回复'); this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (paramsHeight == undefined ? 30:paramsHeight) , paramsHeight)); + // params.toolbar_container.hide(); - }, - afterFocus:function(){ - $('#reply_image_' + id).removeClass('imageFuzzy'); - //edit.iframe.width(paramsWidth); - this.resize(paramsWidth, null); - params.submit_btn.css('display','inline-block'); - }, - - afterBlur:function(){ - $('#reply_image_' + id).addClass('imageFuzzy'); - this.resize("95%", null); - params.submit_btn.css("display","none"); } }).loadPlugin('paste'); return editor; @@ -64,7 +74,7 @@ function nh_check_field(params){ if(params.content.html()!=params.textarea.html() || params.issubmit==true){ params.textarea.html(params.content.html()); params.content.sync(); - if(params.content.isEmpty()){ + if(params.content.isEmpty() || /^\&\w*\;\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\#\d*\;\"\&\w*\;[\u4e00-\u9fa5]*\&\w*\;\/\w*\&\w*\;$/.test(params.textarea.html())){ params.contentmsg.html('内容不能为空'); params.contentmsg.css({color:'#ff0000'}); }else{ @@ -128,7 +138,7 @@ function init_activity_KindEditor_data(id){ params.height = height; params.width = width; if (params.textarea.data('init') == undefined) { - params.editor = init_editor(params, id); + params.editor = init_editor(params,id); init_form(params); params.cancel_btn.click(function () { nh_reset_form(params); @@ -141,4 +151,4 @@ function init_activity_KindEditor_data(id){ } }); }); -} +} \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index eaff43533..144589d5b 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -568,6 +568,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} .homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} .borderBottomNone {border-bottom:none !important;} +div.minHeight48{min-height: 48px;} .homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;} .homepagePostReplyBannerTime{width:85px; display:inline-block;} .homepagePostReplyBannerMore{width:330px; display:inline-block; text-align:right;} @@ -583,7 +584,7 @@ a.postReplyCancel {color:#888888; display:block;} a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyInputContainer2 {width:595px; margin:0px auto;} .homepagePostReplyInput2 {width:588px; height:45px; max-width:588px; max-height:45px; border:1px solid #d9d9d9; outline:none; margin:0px auto 10px auto;} -.homepagePostReplyContainer {border-bottom:1px solid #e3e3e3; width:680px; margin:0px auto; margin-top:18px; min-height:48px;} +.homepagePostReplyContainer {border-bottom:1px solid #e3e3e3; width:680px; margin:0px auto; margin-top:15px; min-height:60px;} .homepagePostSetting {position:absolute; width:20px; height:20px; right:0px; top:0px;} .homepagePostSetting ul li:hover ul {display:block;} .homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;}