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

184 lines
6.0 KiB
Plaintext
Raw Normal View History

<style type="text/css">
.reply_content p {
margin-top: 13px;
margin-bottom: 13px;
}
</style>
2013-11-24 20:09:24 +08:00
<div class="lz">
2014-06-12 16:46:54 +08:00
<!-- 在这里添加赞和踩-->
<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>
2013-11-24 20:09:24 +08:00
<div class="lz-left">
2014-11-21 15:03:56 +08:00
<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>
2013-11-24 20:09:24 +08:00
</div>
<div class="memo-section">
2013-11-26 16:32:08 +08:00
<div class="contextual-borad">
2014-07-23 09:16:06 +08:00
<!-- <%#= link_to(
2013-11-26 16:32:08 +08:00
image_tag('comment.png'),
{:action => 'quote', :id => @memo},
:remote => true,
:method => 'get',
:title => l(:button_quote)
2014-03-10 17:34:19 +08:00
)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? %>
2014-03-10 17:34:19 +08:00
2013-11-26 16:32:08 +08:00
<%= link_to(
#image_tag('edit.png'),
l(:button_edit),
2013-11-26 16:32:08 +08:00
{:action => 'edit', :id => @memo},
:method => 'get',
:title => l(:button_edit)
) if @memo.editable_by?(User.current) %>
2014-07-23 09:16:06 +08:00
<!-- <%#= link_to(
2013-11-26 16:32:08 +08:00
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)
2013-11-26 16:32:08 +08:00
) 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;">
2014-11-21 15:03:56 +08:00
<%= label_tag l(:field_subject) %>:
<%=h @memo.subject %>
</div>
<div class="memo-content" id="memo-content_div">
<%= textAreailizable(@memo,:content) %>
2013-11-29 18:14:49 +08:00
<p>
<% if @memo.attachments.any?%>
2013-12-12 17:11:29 +08:00
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options} %>
2013-11-29 18:14:49 +08:00
<% end %>
</p>
2014-06-17 11:41:00 +08:00
<div class="clearfix"></div>
2013-11-26 16:32:08 +08:00
</div>
2014-11-21 15:03:56 +08:00
<div class="memo-timestamp">
<%= authoring @memo.created_at, @memo.author %>
</div>
2013-11-23 20:02:15 +08:00
</div>
<br />
2013-11-24 20:09:24 +08:00
</div>
2013-11-23 20:02:15 +08:00
<div class="replies">
2013-11-24 20:09:24 +08:00
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @replies.nil? ? 0 : @replies.size %>)</h3>
2013-12-17 21:26:34 +08:00
<% pages_count = @reply_pages.offset %>
2013-11-23 08:20:03 +08:00
<% @replies.each do |reply| %>
2013-11-23 20:02:15 +08:00
<div class="reply" id="<%= "reply-#{reply.id}" %>">
2014-07-23 09:16:06 +08:00
<p class="font_lighter"><!--<span style="display: inline"><%#= pages_count += 1 %>楼 :</span>--></p>
2013-11-24 20:09:24 +08:00
<div class="contextual-borad">
2014-07-23 09:16:06 +08:00
<!-- <%#= link_to(
2013-11-24 20:09:24 +08:00
image_tag('comment.png'),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
2013-11-26 16:32:08 +08:00
:title => l(:button_quote)
2014-03-10 17:34:19 +08:00
)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? %>
2014-03-10 17:34:19 +08:00
2013-11-24 20:09:24 +08:00
<%= link_to(
#image_tag('edit.png'),
l(:button_edit),
2013-11-24 20:09:24 +08:00
{:action => 'edit', :id => reply},
:title => l(:button_edit)
2013-11-26 16:32:08 +08:00
) if reply.editable_by?(User.current) %>
2014-07-23 09:16:06 +08:00
<!-- <%#= link_to(
2013-11-24 20:09:24 +08:00
image_tag('delete.png'),
{:action => 'destroy', :id => reply},
2013-11-26 16:32:08 +08:00
:method => :delete,
2013-11-24 20:09:24 +08:00
: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) %>
2013-11-24 20:09:24 +08:00
</div>
<br/>
<table class="borad-text-list" style="table-layout: fixed;">
2013-11-24 20:09:24 +08:00
<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>
2013-11-26 16:32:08 +08:00
<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} %>
2013-11-26 16:32:08 +08:00
<% end %>
</p>
2013-11-24 20:09:24 +08:00
</td>
</tr>
<tr>
<td class="font_lighter" style="float:right">
<%= authoring reply.created_at, reply.author %>
</td>
2013-11-24 20:09:24 +08:00
</tr>
</table>
</div>
2013-11-23 08:20:03 +08:00
<% end %>
<div class="pagination">
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
</div>
2013-11-23 20:02:15 +08:00
</div>
2014-03-08 11:08:48 +08:00
<% if User.current.login? %>
2013-11-24 20:09:24 +08:00
<div class="reply-box" style="">
2013-11-26 16:32:08 +08:00
<%= render :partial => 'reply_box' %>
2013-11-23 20:02:15 +08:00
</div>
2014-03-08 11:08:48 +08:00
<% 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 %>
2014-05-20 09:50:28 +08:00
<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);
}
});
};
2014-05-20 09:50:28 +08:00
</script>