2014-04-06 16:34:23 +08:00
|
|
|
<div class="lz">
|
|
|
|
<div class="lz-left">
|
2014-04-26 10:42:19 +08:00
|
|
|
<div class="">
|
|
|
|
<% if @memo.author%>
|
|
|
|
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
|
|
|
|
<% else %>
|
|
|
|
<%= image_tag('../images/avatars/User/0', :class => "avatar") %>
|
|
|
|
<% end %></div>
|
2014-04-06 16:34:23 +08:00
|
|
|
<p class=""><%=link_to @memo.author.name, user_path(@memo.author) if @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'),
|
|
|
|
{: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 class="memo-title <%= @memo.sticky ? 'sticky' : '' %> <%= @memo.locked? ? 'locked' : '' %>"><%= label_tag l(:field_subject) %>: <%=h @memo.subject %></div>
|
|
|
|
<div class="memo-content">
|
|
|
|
<!-- < %= textilizable(@memo, :content) %> -->
|
|
|
|
<%= raw @memo.content %>
|
2014-04-26 10:42:19 +08:00
|
|
|
<p>
|
2014-04-06 16:34:23 +08:00
|
|
|
<% 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} %>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
</div>
|
2014-04-26 10:42:19 +08:00
|
|
|
<div class="memo-timestamp">
|
|
|
|
<% if @memo.author %>
|
|
|
|
<%= authoring @memo.created_at, @memo.author.name %>
|
|
|
|
<% else %>
|
2014-05-20 16:33:50 +08:00
|
|
|
<%= user_url_and_time @memo.username, @memo.userhomeurl, @memo.created_at %>
|
2014-04-26 10:42:19 +08:00
|
|
|
<% end %></div>
|
|
|
|
<div class="tags">
|
|
|
|
<div id="tags">
|
|
|
|
<%= image_tag( "/images/sidebar/tags.png") %>
|
2014-05-05 15:33:24 +08:00
|
|
|
<%= render :partial => 'tags/tag_name', :locals => {:obj => @memo,:object_flag => "9",:non_list_all => true }%>
|
2014-04-26 10:42:19 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2014-04-06 16:34:23 +08:00
|
|
|
</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"><%= pages_count += 1 %>楼 :</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'),
|
|
|
|
{: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>
|
|
|
|
|
|
|
|
<table class="borad-text-list">
|
|
|
|
<tr>
|
|
|
|
<td rowspan="3" valign="top" width="60px">
|
2014-04-26 10:42:19 +08:00
|
|
|
<% if reply.author%>
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
|
|
|
|
<% else %>
|
|
|
|
<%= image_tag('../images/avatars/User/0', :class => "avatar") %>
|
|
|
|
<% end %>
|
2014-04-06 16:34:23 +08:00
|
|
|
</td>
|
|
|
|
<td class="comments">
|
|
|
|
<div class="reply_content" ><%=h reply.content.html_safe %></div>
|
|
|
|
<!-- <div class="wiki">< %=h 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} %>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2014-04-26 10:42:19 +08:00
|
|
|
<td class="font_lighter" style="float:right">
|
|
|
|
<% if reply.author %>
|
|
|
|
<%= authoring reply.created_at, reply.author.name %>
|
|
|
|
<% else %>
|
2014-05-20 16:33:50 +08:00
|
|
|
<%= user_url_and_time reply.username, reply.userhomeurl, reply.created_at %>
|
2014-04-26 10:42:19 +08:00
|
|
|
<% end %></td>
|
2014-04-06 16:34:23 +08:00
|
|
|
</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="">
|
2014-04-28 11:04:10 +08:00
|
|
|
<%= render :partial => 'relative_memos/reply_box' %>
|
2014-04-06 16:34:23 +08:00
|
|
|
</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 %>
|