Boards: new message form displayed with no additional request.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@763 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-09-24 19:54:48 +00:00
parent 24b000fb24
commit 19f2853a2a
3 changed files with 17 additions and 4 deletions

View File

@ -1,8 +1,20 @@
<div class="contextual"> <div class="contextual">
<%= link_to_if_authorized l(:label_message_new), {:controller => 'messages', :action => 'new', :board_id => @board}, :class => "icon icon-add" %> <%= link_to_if_authorized l(:label_message_new),
{:controller => 'messages', :action => 'new', :board_id => @board},
:class => 'icon icon-add',
:onclick => 'Element.show("add-message"); return false;' %>
<%= watcher_tag(@board, User.current) %> <%= watcher_tag(@board, User.current) %>
</div> </div>
<div id="add-message" style="display:none;">
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
<% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create) %>
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
<% end %>
</div>
<h2><%=h @board.name %></h2> <h2><%=h @board.name %></h2>
<% if @topics.any? %> <% if @topics.any? %>

View File

@ -3,7 +3,7 @@
<div class="box"> <div class="box">
<!--[form:message]--> <!--[form:message]-->
<p><label><%= l(:field_subject) %></label><br /> <p><label><%= l(:field_subject) %></label><br />
<%= f.text_field :subject, :required => true, :size => 80 %></p> <%= f.text_field :subject, :required => true, :size => 120 %></p>
<p><%= f.text_area :content, :required => true, :cols => 80, :rows => 15, :class => 'wiki-edit' %></p> <p><%= f.text_area :content, :required => true, :cols => 80, :rows => 15, :class => 'wiki-edit' %></p>
<%= wikitoolbar_for 'message_content' %> <%= wikitoolbar_for 'message_content' %>

View File

@ -1,16 +1,17 @@
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%=h @message.subject %></h2> <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%=h @message.subject %></h2>
<p><em><%= @message.author.name %>, <%= format_time(@message.created_on) %></em></p> <p><span class="author"><%= authoring @message.created_on, @message.author %></span></p>
<div class="wiki"> <div class="wiki">
<%= textilizable(@message.content, :attachments => @message.attachments) %> <%= textilizable(@message.content, :attachments => @message.attachments) %>
</div> </div>
<%= link_to_attachments @message.attachments, :no_author => true %> <%= link_to_attachments @message.attachments, :no_author => true %>
<br />
<h3 class="icon22 icon22-comment"><%= l(:label_reply_plural) %></h3> <h3 class="icon22 icon22-comment"><%= l(:label_reply_plural) %></h3>
<% @message.children.each do |message| %> <% @message.children.each do |message| %>
<a name="<%= "message-#{message.id}" %>"></a> <a name="<%= "message-#{message.id}" %>"></a>
<h4><%=h message.subject %> - <%= message.author.name %>, <%= format_time(message.created_on) %></h4> <h4><%=h message.subject %> - <%= message.author.name %>, <%= format_time(message.created_on) %></h4>
<div class="wiki"><p><%= textilizable message.content %></p></div> <div class="wiki"><%= textilizable message.content %></div>
<% end %> <% end %>
<% if authorize_for('messages', 'reply') %> <% if authorize_for('messages', 'reply') %>