##// END OF EJS Templates
code layout clean up app/views/messages/show.html.erb...
Toshi MARUYAMA -
r8481:413b0cc324cd
parent child
Show More
@@ -1,66 +1,94
1 1 <%= breadcrumb link_to(l(:label_board_plural), project_boards_path(@project)),
2 2 link_to(h(@board.name), project_board_path(@project, @board)) %>
3 3
4 4 <div class="contextual">
5 5 <%= watcher_tag(@topic, User.current) %>
6 <%= link_to_remote_if_authorized(l(:button_quote), { :url => {:action => 'quote', :id => @topic} }, :class => 'icon icon-comment') unless @topic.locked? %>
7 <%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'icon icon-edit') if @message.editable_by?(User.current) %>
8 <%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') if @message.destroyable_by?(User.current) %>
6 <%= link_to_remote_if_authorized(
7 l(:button_quote),
8 { :url => {:action => 'quote', :id => @topic} },
9 :class => 'icon icon-comment'
10 ) unless @topic.locked? %>
11 <%= link_to(
12 l(:button_edit),
13 {:action => 'edit', :id => @topic},
14 :class => 'icon icon-edit'
15 ) if @message.editable_by?(User.current) %>
16 <%= link_to(
17 l(:button_delete),
18 {:action => 'destroy', :id => @topic},
19 :method => :post,
20 :confirm => l(:text_are_you_sure),
21 :class => 'icon icon-del'
22 ) if @message.destroyable_by?(User.current) %>
9 23 </div>
10 24
11 25 <h2><%= avatar(@topic.author, :size => "24") %><%=h @topic.subject %></h2>
12 26
13 27 <div class="message">
14 28 <p><span class="author"><%= authoring @topic.created_on, @topic.author %></span></p>
15 29 <div class="wiki">
16 30 <%= textilizable(@topic.content, :attachments => @topic.attachments) %>
17 31 </div>
18 32 <%= link_to_attachments @topic, :author => false %>
19 33 </div>
20 34 <br />
21 35
22 36 <% unless @replies.empty? %>
23 37 <h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
24 38 <% @replies.each do |message| %>
25 39 <div class="message reply" id="<%= "message-#{message.id}" %>">
26 40 <div class="contextual">
27 <%= link_to_remote_if_authorized(image_tag('comment.png'), { :url => {:action => 'quote', :id => message} }, :title => l(:button_quote)) unless @topic.locked? %>
28 <%= link_to(image_tag('edit.png'), {:action => 'edit', :id => message}, :title => l(:button_edit)) if message.editable_by?(User.current) %>
29 <%= link_to(image_tag('delete.png'), {:action => 'destroy', :id => message}, :method => :post, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) if message.destroyable_by?(User.current) %>
41 <%= link_to_remote_if_authorized(
42 image_tag('comment.png'),
43 { :url => {:action => 'quote', :id => message} },
44 :title => l(:button_quote)
45 ) unless @topic.locked? %>
46 <%= link_to(
47 image_tag('edit.png'),
48 {:action => 'edit', :id => message},
49 :title => l(:button_edit)
50 ) if message.editable_by?(User.current) %>
51 <%= link_to(
52 image_tag('delete.png'),
53 {:action => 'destroy', :id => message},
54 :method => :post,
55 :confirm => l(:text_are_you_sure),
56 :title => l(:button_delete)
57 ) if message.destroyable_by?(User.current) %>
30 58 </div>
31 59 <h4>
32 60 <%= avatar(message.author, :size => "24") %>
33 61 <%= link_to h(message.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => "message-#{message.id}" } %>
34 62 -
35 63 <%= authoring message.created_on, message.author %>
36 64 </h4>
37 65 <div class="wiki"><%= textilizable message, :content, :attachments => message.attachments %></div>
38 66 <%= link_to_attachments message, :author => false %>
39 67 </div>
40 68 <% end %>
41 69 <p class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></p>
42 70 <% end %>
43 71
44 72 <% if !@topic.locked? && authorize_for('messages', 'reply') %>
45 73 <p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
46 74 <div id="reply" style="display:none;">
47 75 <% form_for :reply, @reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
48 76 <%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
49 77 <%= submit_tag l(:button_submit) %>
50 78 <%= link_to_remote l(:label_preview),
51 79 { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
52 80 :method => 'post',
53 81 :update => 'preview',
54 82 :with => "Form.serialize('message-form')",
55 83 :complete => "Element.scrollTo('preview')"
56 84 }, :accesskey => accesskey(:preview) %>
57 85 <% end %>
58 86 <div id="preview" class="wiki"></div>
59 87 </div>
60 88 <% end %>
61 89
62 90 <% content_for :header_tags do %>
63 91 <%= stylesheet_link_tag 'scm' %>
64 92 <% end %>
65 93
66 94 <% html_title @topic.subject %>
General Comments 0
You need to be logged in to leave comments. Login now