socialforge/app/views/news/_project_show.html.erb

104 lines
4.7 KiB
Plaintext
Raw Normal View History

2016-01-21 10:33:53 +08:00
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
2016-01-21 10:33:53 +08:00
<% end %>
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#Container").css("width","1000px");
});
</script>
<script>
$(function() {
sd_create_editor_from_data(<%= @news.id%>,null,"100%", "<%=@news.class.to_s%>");
2016-01-21 10:33:53 +08:00
showNormalImage('message_description_<%= @news.id %>');
});
</script>
2016-01-21 10:33:53 +08:00
<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) %>
</div>
2016-01-21 10:33:53 +08:00
<div class="postThemeWrap">
<% if User.current.allowed_to?(:manage_news, @project)%>
<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>
2016-01-21 10:33:53 +08:00
<li>
<%= link_to(
l(:button_edit),
{:action => 'edit', :id => @news},
:class => 'postOptionLink'
) if User.current.allowed_to?(:manage_news, @project) %>
</li>
<li>
<%= delete_link(
news_path(@news),
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if User.current.allowed_to?(:manage_news, @project) %>
</li>
</ul>
</li>
</ul>
</div>
<% 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>
2016-01-21 10:33:53 +08:00
<%end%>
<div class="postDetailTitle fl">
2016-01-21 16:57:13 +08:00
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">新闻: <%= @news.title%></a>
2016-01-21 10:33:53 +08:00
</div>
<div class="cl"></div>
2016-01-21 10:33:53 +08:00
<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>
<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;" >
2016-01-21 10:33:53 +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} %>
2016-01-21 10:33:53 +08:00
</div>
</div>
2016-01-21 10:33:53 +08:00
<div class="cl"></div>
</div>
<div class="cl"></div>
<div class="homepagePostReply">
<%= render :partial => 'news/news_all_replies' %>
2016-01-21 10:33:53 +08:00
</div>
</div>
<script type="text/javascript">
$(function(){
$("#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(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
autoUrl('message_description_<%= @news.id %>');
});
</script>