2015-12-06 15:03:36 +08:00
|
|
|
<%= content_for(:header_tags) do %>
|
2016-07-20 17:00:18 +08:00
|
|
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
2015-12-06 15:03:36 +08:00
|
|
|
<% end %>
|
|
|
|
|
2015-12-24 09:57:32 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function(){
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
$(function() {
|
2016-07-20 17:00:18 +08:00
|
|
|
sd_create_editor_from_data(<%= @news.id%>,null,"100%", "<%=@news.class.to_s%>");
|
2015-12-24 09:57:32 +08:00
|
|
|
showNormalImage('message_description_<%= @news.id %>');
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @news.id%>').show();" onmouseout="$('#message_setting_<%= @news.id%>').hide();">
|
|
|
|
<div class="postThemeContainer">
|
|
|
|
<div class="postDetailPortrait">
|
|
|
|
<%= link_to image_tag(url_to_avatar(@news.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@news.author) %>
|
2015-04-08 15:49:53 +08:00
|
|
|
</div>
|
2015-12-24 09:57:32 +08:00
|
|
|
<div class="postThemeWrap">
|
|
|
|
<% if User.current.allowed_to?(:manage_news, @course)%>
|
|
|
|
<div class="homepagePostSetting" id="message_setting_<%= @news.id%>" style="display: none">
|
|
|
|
<ul>
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<ul class="homepagePostSettiongText">
|
2016-01-21 14:54:20 +08:00
|
|
|
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{@news.id}','#{User.current.id}','news')") %></li>
|
2015-12-24 09:57:32 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to(
|
|
|
|
l(:button_edit),
|
|
|
|
{:action => 'edit', :id => @news},
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
) if User.current.allowed_to?(:manage_news, @course) %>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<%= delete_link(
|
|
|
|
news_path(@news),
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:class => 'postOptionLink'
|
|
|
|
) if User.current.allowed_to?(:manage_news, @course) %>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2016-01-21 14:54:20 +08:00
|
|
|
<% elsif User.current.logged? %>
|
|
|
|
<div class="homepagePostSetting" id="message_setting_<%= @news.id %>" style="display: none">
|
|
|
|
<ul>
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{@news.id}','#{User.current.id}','news')") %></li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2015-12-24 09:57:32 +08:00
|
|
|
<%end%>
|
|
|
|
<div class="postDetailTitle fl">
|
|
|
|
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">通知: <%= @news.title%></a>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
<div class="postDetailCreater">
|
|
|
|
<% if @news.try(:author).try(:realname) == ' ' %>
|
|
|
|
<%= link_to @news.try(:author), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to @news.try(:author).try(:realname), user_path(@news.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
|
|
|
|
<div class="cl"></div>
|
2016-01-22 18:33:43 +08:00
|
|
|
<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;" >
|
2015-12-24 09:57:32 +08:00
|
|
|
<%= @news.description.html_safe%>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
2016-01-22 17:05:58 +08:00
|
|
|
<div class="mt10" style="font-weight:normal;">
|
|
|
|
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @news} %>
|
2015-12-24 09:57:32 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
2015-03-25 20:36:49 +08:00
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
2015-12-24 09:57:32 +08:00
|
|
|
<div class="homepagePostReply">
|
2016-07-20 17:00:18 +08:00
|
|
|
<%= render :partial => 'news/news_all_replies' %>
|
2015-12-24 09:57:32 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-01-22 18:33:43 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function(){
|
2016-05-13 10:56:48 +08:00
|
|
|
$("#news_submit_comment").one('click',function(){
|
|
|
|
submitComment();
|
|
|
|
});
|
2016-02-02 11:23:17 +08:00
|
|
|
$("#message_description_<%= @news.id %> p,#message_description_<%= @news.id %> span,#message_description_<%= @news.id %> em").each(function(){
|
|
|
|
var postContent = $(this).html();
|
|
|
|
postContent = postContent.replace(/ /g," ");
|
|
|
|
postContent= postContent.replace(/ {2}/g," ");
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
$(this).html(postContent);
|
|
|
|
});
|
2016-05-20 15:30:25 +08:00
|
|
|
autoUrl('message_description_<%= @news.id %>');
|
2016-01-22 18:33:43 +08:00
|
|
|
});
|
|
|
|
</script>
|