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