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

153 lines
5.3 KiB
Plaintext
Raw Permalink Normal View History

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">
<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-03-10 17:34:19 +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'),
{:action => 'edit', :id => @memo},
:method => 'get',
:title => l(:button_edit)
) if @memo.editable_by?(User.current) %>
<!-- <%= 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) %>
2013-11-26 16:32:08 +08:00
</div>
<div class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>"><%= label_tag l(:field_subject) %>: <%=h @memo.subject %></div>
2013-11-26 16:32:08 +08:00
<div class="memo-content">
2014-06-17 11:41:00 +08:00
<%=h sanitize(@memo.content.html_safe) %>
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>
<!-- modified by zjc 修正名字无链接问题 -->
<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}" %>">
<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-03-10 17:34:19 +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'),
{:action => 'edit', :id => reply},
:title => l(:button_edit)
2013-11-26 16:32:08 +08:00
) if reply.editable_by?(User.current) %>
<!-- <%= 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/>
2013-11-24 20:09:24 +08:00
<table class="borad-text-list">
<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">
2014-05-20 15:37:05 +08:00
<div class="reply_content" ><%=h sanitize(reply.content.html_safe) %></div>
2013-11-26 16:32:08 +08:00
<p>
<% if reply.attachments.any?%>
2013-12-12 09:14:10 +08:00
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
2013-11-26 16:32:08 +08:00
<%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %>
<% end %>
</p>
2013-11-24 20:09:24 +08:00
</td>
</tr>
<tr>
<!-- modified by zjc 修正名字无链接问题 -->
<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 %>
2013-11-26 16:32:08 +08:00
<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($) {
2014-05-20 15:37:05 +08:00
transpotUrl('.lz');
transpotUrl('.replies');
2014-05-20 09:50:28 +08:00
});
</script>