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

170 lines
4.7 KiB
Plaintext
Raw Normal View History

2013-11-24 20:09:24 +08:00
<style type="text/css">
/** {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}*/
.lz {
position:relative;
min-height: 200px;
margin: 10px 2px;
border-radius: 5px;
2013-11-24 20:11:55 +08:00
box-shadow: 1px 1px 6px #97EBF4;
2013-11-26 16:32:08 +08:00
border: 1px solid #F1F1F1;
2013-11-24 20:09:24 +08:00
}
.lz-left{
float: left;
margin: 2%;
padding: 0;
}
.memo-section{
width: auto;
margin-left: 15%;
padding-top: 1%;
2013-11-26 20:33:15 +08:00
border-left: 2px dotted #EEE;
2013-11-24 20:09:24 +08:00
}
.memo-title{
margin: 1em 0;
padding-left: 1%;
2013-11-26 16:27:56 +08:00
padding-bottom: 1%;
font-weight: bold;
border-bottom: 1px dashed rgb(204, 204, 204);
2013-11-24 20:09:24 +08:00
}
.memo-content{
padding: 1%;
margin: 1%;
margin-bottom: 40px;
background-color: #F6F6F6;
}
.memo-timestamp{
position: absolute;
bottom: 0px;
right: 0;
margin: 20px;
}
.replies{
2013-11-26 20:33:15 +08:00
overflow:hidden;
max-width: 100%;
2013-11-24 20:09:24 +08:00
float: right;
/*max-width: 90%;*/
}
.reply-box{
float: right;
width: 640px;
padding: 3%;
/*border: 2px solid #C6F3F9;*/
border-top: 2px double #C6F3F9;
/*border-radius: 10px;*/
}
2013-11-26 20:33:15 +08:00
.comments img {
overflow:hidden;
2013-11-27 10:34:41 +08:00
/*width: 100%;*/
2013-11-26 20:33:15 +08:00
max-width: 500px;
2013-11-27 10:34:41 +08:00
height: auto !important;
2013-11-26 20:33:15 +08:00
width:expression(this.width > 500 ? "500px" : this.width+"px");
}
2013-11-24 20:09:24 +08:00
</style>
2013-11-26 16:32:08 +08:00
<!-- < %= forum_breadcrum%> -->
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>
2013-11-24 20:09:24 +08:00
<div class="memo-title"><%= 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 => true} %>
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>