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

102 lines
3.6 KiB
Plaintext
Raw Normal View History

2013-11-24 20:09:24 +08:00
<div class="lz">
<div class="lz-left">
<div class=""><%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %></div>
<p class=""><%=link_to @memo.author.show_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">
<%= 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(
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) %>
</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">
<!-- < %= textilizable(@memo, :content) %> -->
<%= raw @memo.content %>
2013-11-29 18:14:49 +08:00
<p>
<% if @memo.attachments.any?%>
<% options = {:author => true} %>
<%= render :partial => 'attachments/links', :locals => {:attachments => @memo.attachments, :options => options} %>
2013-11-29 18:14:49 +08:00
<% end %>
</p>
2013-11-26 16:32:08 +08:00
</div>
<div class="memo-timestamp"> <%= authoring @memo.created_at, @memo.author.show_name %></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-11-26 16:32:08 +08:00
<% reply_count = @current_count.to_i %>
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"><%= reply_count += 1 %>楼 :</p>
2013-11-24 20:09:24 +08:00
<div class="contextual-borad">
<%= link_to(
image_tag('comment.png'),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
2013-11-26 16:32:08 +08:00
:title => l(:button_quote)
)if !@memo.locked? && User.current.logged? %>
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) %>
2013-11-24 20:09:24 +08:00
<%= link_to(
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) %>
</div>
2013-11-23 20:02:15 +08:00
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">
2013-11-26 20:33:15 +08:00
<div class="reply_content" ><%=h reply.content.html_safe %></div>
<!-- <div class="wiki">< %=h reply.content.html_safe %></div> -->
2013-11-26 16:32:08 +08:00
<p>
<% if reply.attachments.any?%>
<% options = {:author => true, :deletable => false} %>
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>
2013-11-26 16:32:08 +08:00
<td class="font_lighter" style="float:right"><%= authoring reply.created_at, reply.author.show_name %></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>
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>