调整页面代码,修复公共贴吧引用显示不正确的BUG

This commit is contained in:
sw 2014-11-20 17:24:45 +08:00
parent 9277b3007a
commit dc480ecd44
3 changed files with 20 additions and 13 deletions

View File

@ -88,7 +88,7 @@ class Memo < ActiveRecord::Base
def editable_by? user def editable_by? user
# user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project)) # user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project))
(user && self.author == user) || user.admin? user.admin? || self.author == user
end end
def destroyable_by? user def destroyable_by? user

View File

@ -1,5 +1,5 @@
<%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %> <%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %>
<%= f.hidden_field :subject, :required => true, value: "RE: "+@memo.subject %> <%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %> <%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
<div id="message_quote" class="wiki"></div> <div id="message_quote" class="wiki"></div>
@ -7,11 +7,12 @@
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<%= label_tag(l(:label_reply_plural)) %>: <%= label_tag(l(:label_reply_plural)) %>:
<!-- <p> < %= f.text_area :content, :required => true, :size => "75%", :resize => "none", id: 'editor01' %> </p> --> <!-- <p> < %= f.text_area :content, :required => true, :size => "75%", :resize => "none", id: 'editor01' %> </p> -->
<%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %></p> <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script> <script type="text/javascript">var ckeditor=CKEDITOR.replace('editor01');</script>
<p><%= l(:label_attachment_plural) %><br /> <p>
<%= render :partial => 'attachments/form' %> <%= l(:label_attachment_plural) %>
<br />
<%= render :partial => 'attachments/form' %>
</p> </p>
<%= f.submit value: l(:label_reply_plural), class: "replies" %> <%= f.submit value: l(:label_reply_plural), class: "replies" %>
<% end %> <% end %>

View File

@ -117,28 +117,34 @@
</div> </div>
<br/> <br/>
<table class="borad-text-list"> <table class="borad-text-list" style="table-layout: fixed;">
<tr> <tr>
<td rowspan="3" valign="top" width="60px"> <td rowspan="3" valign="top" width="60px">
<%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> <%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %>
</td> </td>
<td class="comments"> <td class="comments" style="word-wrap: break-word;word-break: break-all;">
<div class="reply_content" ><%=h sanitize(reply.content.html_safe) %></div> <div class="reply_content" >
<%=h sanitize(reply.content.html_safe) %>
</div>
<p> <p>
<% if reply.attachments.any?%> <% if reply.attachments.any?%>
<% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %> <% options = {:author => true, :deletable => reply.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %> <%= render :partial => 'attachments/links', :locals => {:attachments => reply.attachments, :options => options} %>
<% end %> <% end %>
</p> </p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="font_lighter" style="float:right"><%= authoring reply.created_at, reply.author %></td> <td class="font_lighter" style="float:right">
<%= authoring reply.created_at, reply.author %>
</td>
</tr> </tr>
</table> </table>
</div> </div>
<% end %> <% end %>
<div class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></div> <div class="pagination">
<%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %>
</div>
</div> </div>
<% if User.current.login? %> <% if User.current.login? %>