##// END OF EJS Templates
Boards: new message form displayed with no additional request....
Jean-Philippe Lang -
r752:19f2853a2ae2
parent child
Show More
@@ -1,40 +1,52
1 1 <div class="contextual">
2 <%= link_to_if_authorized l(:label_message_new), {:controller => 'messages', :action => 'new', :board_id => @board}, :class => "icon icon-add" %>
2 <%= link_to_if_authorized l(:label_message_new),
3 {:controller => 'messages', :action => 'new', :board_id => @board},
4 :class => 'icon icon-add',
5 :onclick => 'Element.show("add-message"); return false;' %>
3 6 <%= watcher_tag(@board, User.current) %>
4 7 </div>
5 8
9 <div id="add-message" style="display:none;">
10 <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
11 <% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true} do |f| %>
12 <%= render :partial => 'messages/form', :locals => {:f => f} %>
13 <p><%= submit_tag l(:button_create) %>
14 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
15 <% end %>
16 </div>
17
6 18 <h2><%=h @board.name %></h2>
7 19
8 20 <% if @topics.any? %>
9 21 <table class="list">
10 22 <thead><tr>
11 23 <th><%= l(:field_subject) %></th>
12 24 <th><%= l(:field_author) %></th>
13 25 <%= sort_header_tag("#{Message.table_name}.created_on", :caption => l(:field_created_on)) %>
14 26 <th><%= l(:label_reply_plural) %></th>
15 27 <%= sort_header_tag("#{Message.table_name}.updated_on", :caption => l(:label_message_last)) %>
16 28 </tr></thead>
17 29 <tbody>
18 30 <% @topics.each do |topic| %>
19 31 <tr class="<%= cycle 'odd', 'even' %>">
20 32 <td><%= link_to h(topic.subject), :controller => 'messages', :action => 'show', :board_id => @board, :id => topic %></td>
21 33 <td align="center"><%= link_to_user topic.author %></td>
22 34 <td align="center"><%= format_time(topic.created_on) %></td>
23 35 <td align="center"><%= topic.replies_count %></td>
24 36 <td>
25 37 <small>
26 38 <% if topic.last_reply %>
27 39 <%= topic.last_reply.author.name %>, <%= format_time(topic.last_reply.created_on) %><br />
28 40 <%= link_to_message topic.last_reply %>
29 41 <% end %>
30 42 </small>
31 43 </td>
32 44 </tr>
33 45 <% end %>
34 46 </tbody>
35 47 </table>
36 48 <p><%= pagination_links_full @topic_pages %>
37 49 [ <%= @topic_pages.current.first_item %> - <%= @topic_pages.current.last_item %> / <%= @topic_count %> ]</p>
38 50 <% else %>
39 51 <p class="nodata"><%= l(:label_no_data) %></p>
40 52 <% end %>
@@ -1,14 +1,14
1 1 <%= error_messages_for 'message' %>
2 2
3 3 <div class="box">
4 4 <!--[form:message]-->
5 5 <p><label><%= l(:field_subject) %></label><br />
6 <%= f.text_field :subject, :required => true, :size => 80 %></p>
6 <%= f.text_field :subject, :required => true, :size => 120 %></p>
7 7
8 8 <p><%= f.text_area :content, :required => true, :cols => 80, :rows => 15, :class => 'wiki-edit' %></p>
9 9 <%= wikitoolbar_for 'message_content' %>
10 10 <!--[eoform:message]-->
11 11
12 12 <span class="tabular">
13 13 <%= render :partial => 'attachments/form' %>
14 14 </div>
@@ -1,26 +1,27
1 1 <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%=h @message.subject %></h2>
2 2
3 <p><em><%= @message.author.name %>, <%= format_time(@message.created_on) %></em></p>
3 <p><span class="author"><%= authoring @message.created_on, @message.author %></span></p>
4 4 <div class="wiki">
5 5 <%= textilizable(@message.content, :attachments => @message.attachments) %>
6 6 </div>
7 7 <%= link_to_attachments @message.attachments, :no_author => true %>
8 <br />
8 9
9 10 <h3 class="icon22 icon22-comment"><%= l(:label_reply_plural) %></h3>
10 11 <% @message.children.each do |message| %>
11 12 <a name="<%= "message-#{message.id}" %>"></a>
12 13 <h4><%=h message.subject %> - <%= message.author.name %>, <%= format_time(message.created_on) %></h4>
13 <div class="wiki"><p><%= textilizable message.content %></p></div>
14 <div class="wiki"><%= textilizable message.content %></div>
14 15 <% end %>
15 16
16 17 <% if authorize_for('messages', 'reply') %>
17 18 <p><%= toggle_link l(:button_reply), "reply", :focus => "reply_content" %></p>
18 19 <div id="reply" style="display:none;">
19 20 <%= error_messages_for 'message' %>
20 21 <% form_for :reply, @reply, :url => {:action => 'reply', :id => @message} do |f| %>
21 22 <p><%= f.text_field :subject, :required => true, :size => 60 %></p>
22 23 <p><%= f.text_area :content, :required => true, :cols => 80, :rows => 10 %></p>
23 24 <p><%= submit_tag l(:button_submit) %></p>
24 25 <% end %>
25 26 </div>
26 27 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now