Merge branch 'szzh' into develop

This commit is contained in:
cxt 2016-01-22 20:55:18 +08:00
commit 8a2a1d2bc9
18 changed files with 123 additions and 37 deletions

View File

@ -76,6 +76,7 @@ class WordsController < ApplicationController
@reply_type = params[:reply_type] @reply_type = params[:reply_type]
@user_activity_id = params[:user_activity_id] @user_activity_id = params[:user_activity_id]
@activity = JournalsForMessage.find(parent_id) @activity = JournalsForMessage.find(parent_id)
@is_activity = params[:is_activity]
} }
end end

View File

@ -94,7 +94,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @article.content.html_safe%> <%= @article.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -209,3 +209,10 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @article.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @article.id %>").html(postContent);
});
</script>

View File

@ -94,7 +94,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @article.content.html_safe%> <%= @article.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -215,3 +215,10 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @article.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @article.id %>").html(postContent);
});
</script>

View File

@ -74,7 +74,7 @@
<%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div> <%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div> <div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content" id="message_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%> <%= @memo.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -137,3 +137,10 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @memo.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @memo.id %>").html(postContent);
});
</script>

View File

@ -80,7 +80,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @topic.content.html_safe%> <%= @topic.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -169,3 +169,10 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>

View File

@ -109,7 +109,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @topic.content.html_safe%> <%= @topic.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -198,3 +198,10 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>

View File

@ -135,7 +135,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @topic.content.html_safe%> <%= @topic.content.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -225,3 +225,10 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>

View File

@ -85,7 +85,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%> <%= @news.description.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -182,3 +182,10 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
});
</script>

View File

@ -75,7 +75,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%> <%= @news.description.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -172,3 +172,10 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
});
</script>

View File

@ -85,7 +85,7 @@
</div> </div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div> <div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div> <div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" > <div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%> <%= @news.description.html_safe%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -182,3 +182,10 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
});
</script>

View File

@ -20,10 +20,12 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% unless document.content.blank? %> <% unless document.content.blank? %>
<div class="homepagePostIntro" style="width:640px;" id="intro_content_<%= document.id%>"> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
<%= document.content.html_safe %>
</div>
<% end %> <% end %>
<div class="cl"></div>
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;"> <div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %> <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
</div> </div>
@ -133,9 +135,6 @@
<script type="text/javascript"> <script type="text/javascript">
function expand_reply(container, btnid) { function expand_reply(container, btnid) {
var postContent = $("#intro_content_<%= document.id%>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#intro_content_<%= document.id%>").html(postContent);
var target = $(container); var target = $(container);
var btn = $(btnid); var btn = $(btnid);
if (btn.data('init') == '0') { if (btn.data('init') == '0') {

View File

@ -13,7 +13,15 @@
<span class="fl c_red"><%= "无附件"%></span> <span class="fl c_red"><%= "无附件"%></span>
<% else %> <% else %>
<div class="fl grey_c"> <div class="fl grey_c">
<%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %> <% @student_work.attachments.each_with_index do |attachment,i| %>
<div id="attachment_<%= attachment.id%>">
<%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %>
<span class="ml5 fl">(<%= number_to_human_size attachment.filesize %>)</span>
<div class="cl"></div>
</div>
<% end -%>
<%#= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
</div> </div>
<% end %> <% end %>
</p> </p>

View File

@ -13,7 +13,15 @@
<span class="fl c_red"><%= "无附件"%></span> <span class="fl c_red"><%= "无附件"%></span>
<% else %> <% else %>
<div class="fl grey_c"> <div class="fl grey_c">
<%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %> <% @student_work.attachments.each_with_index do |attachment,i| %>
<div id="attachment_<%= attachment.id%>">
<%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %>
<span class="ml5 fl">(<%= number_to_human_size attachment.filesize %>)</span>
<div class="cl"></div>
</div>
<% end -%>
<%#= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
</div> </div>
<% end %> <% end %>
</p> </p>

View File

@ -143,6 +143,3 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>

View File

@ -111,7 +111,7 @@
<% case user_activity.act_type.to_s %> <% case user_activity.act_type.to_s %>
<% when 'JournalsForMessage' %> <% when 'JournalsForMessage' %>
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %> <% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>true} %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -16,13 +16,22 @@
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostTitle break_word list_style upload_img"> <% if is_activity %>
<% if activity.parent %> <div class="homepagePostTitle break_word list_style upload_img">
<%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> <% if activity.parent %>
<% else %> <%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> <% else %>
<% end %> <%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
</div> <% end %>
</div>
<% else %>
<% if activity.parent %>
<% content = activity.parent.notes %>
<% else %>
<% content = activity.notes %>
<% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<% end %>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %> 留言时间:<%= format_time(activity.created_on) %>
</div> </div>
@ -85,10 +94,10 @@
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= user_activity_id %>"> <div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= user_activity_id %>">
<%= comment.notes.html_safe %> <%= comment.notes.html_safe %>
</div> </div>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %>
</ul> </ul>
</div> </div>
<% end %> <% end %>
@ -104,6 +113,7 @@
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %> <%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
<%= hidden_field_tag 'reply_type',params[:reply_type],:value =>'user' %> <%= hidden_field_tag 'reply_type',params[:reply_type],:value =>'user' %>
<%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea> <textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div> <div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a> <a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>

View File

@ -22,7 +22,7 @@
init_activity_KindEditor_data(<%= jour.id%>, null, "87%", "<%=jour.class.to_s%>"); init_activity_KindEditor_data(<%= jour.id%>, null, "87%", "<%=jour.class.to_s%>");
}); });
</script> </script>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %> <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>false} %>
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %> <%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
<% end %> <% end %>
<%end%> <%end%>

View File

@ -1,9 +1,9 @@
<% if @save_succ %> <% if @save_succ %>
<% if @user_activity_id %> <% if @user_activity_id %>
<% if @reply_type == 'user' %> <% if @reply_type == 'user' %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% else %> <% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% end %> <% end %>
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity"); init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
<% else %> <% else %>