socialforge/app/views/memos/show.html.erb

186 lines
6.1 KiB
Plaintext

<style type="text/css">
.reply_content p {
margin-top: 13px;
margin-bottom: 13px;
}
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<div class="lz">
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
<div class="lz-left">
<div>
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
</div>
<p class="clearfix">
<%=link_to @memo.author.name, user_path(@memo.author) %>
</p>
</div>
<div class="memo-section">
<div class="contextual-borad">
<!-- <%#= link_to(
image_tag('comment.png'),
{:action => 'quote', :id => @memo},
:remote => true,
:method => 'get',
:title => l(:button_quote)
)if !@memo.locked? && User.current.logged? %> -->
<%= link_to(
l(:button_quote),
{:action => 'quote', :id => @memo},
:remote => true,
:method => 'get',
:title => l(:button_quote)
)if !@memo.locked? && User.current.logged? %>
<%= link_to(
#image_tag('edit.png'),
l(:button_edit),
{:action => 'edit', :id => @memo},
:method => 'get',
:title => l(:button_edit)
) if @memo.editable_by?(User.current) %>
<!-- <%#= link_to(
image_tag('delete.png'),
{:action => 'destroy', :id => @memo},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @memo.destroyable_by?(User.current) %> -->
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => @memo},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @memo.destroyable_by?(User.current) %>
</div>
<div>&nbsp;</div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>"
style="word-break: break-all;word-wrap: break-word;">
<%= label_tag l(:field_subject) %>:
<%=h @memo.subject %>
</div>
<div class="memo-content" id="memo-content_div">
<%= @memo.content.html_safe %>
<p>
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
<% end %>
</p>
<div class="clearfix"></div>
</div>
<div class="memo-timestamp">
<%= authoring @memo.created_at, @memo.author %>
</div>
</div>
<br />
</div>
<div class="replies">
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @replies.nil? ? 0 : @replies.size %>)</h3>
<% pages_count = @reply_pages.offset %>
<% @replies.each do |reply| %>
<div class="reply" id="<%= "reply-#{reply.id}" %>">
<p class="font_lighter"><!--<span style="display: inline"><%#= pages_count += 1 %>楼 :</span>--></p>
<div class="contextual-borad">
<!-- <%#= link_to(
image_tag('comment.png'),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_quote)
)if !@memo.locked? && User.current.logged? %> -->
<%= link_to(
l(:button_quote),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_quote)
)if !@memo.locked? && User.current.logged? %>
<%= link_to(
#image_tag('edit.png'),
l(:button_edit),
{:action => 'edit', :id => reply},
:title => l(:button_edit)
) if reply.editable_by?(User.current) %>
<!-- <%#= link_to(
image_tag('delete.png'),
{:action => 'destroy', :id => reply},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.destroyable_by?(User.current) %> -->
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.destroyable_by?(User.current) %>
</div>
<br/>
<table class="borad-text-list" style="table-layout: fixed;">
<tr>
<td rowspan="3" valign="top" width="60px">
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
</td>
<td class="comments" style="word-wrap: break-word;word-break: break-all;">
<div class="reply_content" >
<%=h sanitize(reply.content.html_safe) %>
</div>
<p>
<% if reply.attachments.any?%>
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options, :is_float => true} %>
<% end %>
</p>
</td>
</tr>
<tr>
<td class="font_lighter" style="float:right">
<%= authoring reply.created_at, reply.author %>
</td>
</tr>
</table>
</div>
<% end %>
<div class="pagination">
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
</div>
</div>
<% if User.current.login? %>
<div class="reply-box" style="">
<%= render :partial => 'reply_box' %>
</div>
<% else %>
<div style="font-size: 14px;margin:20px;">
<%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %>
<hr/>
</div>
<% end %>
<script type="text/javascript">
jQuery(document).ready(function($) {
transpotUrl('.lz');
transpotUrl('.replies');
});
window.onready = function() {
var maxwidth = $("#memo-content_div").width();
$("#memo-content_div").children().each(function(){
if($(this).width()>maxwidth)
{
$(this).width(maxwidth);
}
});
};
$("img").removeAttr("align");
</script>