Revision 912:5e80956cc792 app/views/messages
| app/views/messages/_form.html.erb | ||
|---|---|---|
| 1 |
<%= error_messages_for 'message' %> |
|
| 2 |
<% replying ||= false %> |
|
| 3 |
|
|
| 4 |
<div class="box"> |
|
| 5 |
<!--[form:message]--> |
|
| 6 |
<p><label for="message_subject"><%= l(:field_subject) %></label><br /> |
|
| 7 |
<%= f.text_field :subject, :size => 120, :id => "message_subject" %> |
|
| 8 |
|
|
| 9 |
<% if !replying && User.current.allowed_to?(:edit_messages, @project) %> |
|
| 10 |
<label><%= f.check_box :sticky %><%= l(:label_board_sticky) %></label> |
|
| 11 |
<label><%= f.check_box :locked %><%= l(:label_board_locked) %></label> |
|
| 12 |
<% end %> |
|
| 13 |
</p> |
|
| 14 |
|
|
| 15 |
<% if !replying && !@message.new_record? && User.current.allowed_to?(:edit_messages, @project) %> |
|
| 16 |
<p><label><%= l(:label_board) %></label><br /> |
|
| 17 |
<%= f.select :board_id, @project.boards.collect {|b| [b.name, b.id]} %></p>
|
|
| 18 |
<% end %> |
|
| 19 |
|
|
| 20 |
<p> |
|
| 21 |
<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %> |
|
| 22 |
<%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'message_content' %></p> |
|
| 23 |
<%= wikitoolbar_for 'message_content' %> |
|
| 24 |
<!--[eoform:message]--> |
|
| 25 |
|
|
| 26 |
<p><%= l(:label_attachment_plural) %><br /> |
|
| 27 |
<%= render :partial => 'attachments/form' %></p> |
|
| 28 |
</div> |
|
| app/views/messages/_form.rhtml | ||
|---|---|---|
| 1 |
<%= error_messages_for 'message' %> |
|
| 2 |
<% replying ||= false %> |
|
| 3 |
|
|
| 4 |
<div class="box"> |
|
| 5 |
<!--[form:message]--> |
|
| 6 |
<p><label><%= l(:field_subject) %></label><br /> |
|
| 7 |
<%= f.text_field :subject, :size => 120 %> |
|
| 8 |
|
|
| 9 |
<% if !replying && User.current.allowed_to?(:edit_messages, @project) %> |
|
| 10 |
<label><%= f.check_box :sticky %><%= l(:label_board_sticky) %></label> |
|
| 11 |
<label><%= f.check_box :locked %><%= l(:label_board_locked) %></label> |
|
| 12 |
<% end %> |
|
| 13 |
</p> |
|
| 14 |
|
|
| 15 |
<% if !replying && !@message.new_record? && User.current.allowed_to?(:edit_messages, @project) %> |
|
| 16 |
<p><label><%= l(:label_board) %></label><br /> |
|
| 17 |
<%= f.select :board_id, @project.boards.collect {|b| [b.name, b.id]} %></p>
|
|
| 18 |
<% end %> |
|
| 19 |
|
|
| 20 |
<p><%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'message_content' %></p> |
|
| 21 |
<%= wikitoolbar_for 'message_content' %> |
|
| 22 |
<!--[eoform:message]--> |
|
| 23 |
|
|
| 24 |
<p><%= l(:label_attachment_plural) %><br /> |
|
| 25 |
<%= render :partial => 'attachments/form' %></p> |
|
| 26 |
</div> |
|
| app/views/messages/edit.html.erb | ||
|---|---|---|
| 1 |
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%=h @message.subject %></h2> |
|
| 2 |
|
|
| 3 |
<% form_for :message, @message, :url => {:action => 'edit'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
| 4 |
<%= render :partial => 'form', :locals => {:f => f, :replying => !@message.parent.nil?} %>
|
|
| 5 |
<%= submit_tag l(:button_save) %> |
|
| 6 |
<%= link_to_remote l(:label_preview), |
|
| 7 |
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
|
|
| 8 |
:method => 'post', |
|
| 9 |
:update => 'preview', |
|
| 10 |
:with => "Form.serialize('message-form')",
|
|
| 11 |
:complete => "Element.scrollTo('preview')"
|
|
| 12 |
}, :accesskey => accesskey(:preview) %> |
|
| 13 |
<% end %> |
|
| 14 |
<div id="preview" class="wiki"></div> |
|
| 15 |
|
|
| 16 |
<% content_for :header_tags do %> |
|
| 17 |
<%= stylesheet_link_tag 'scm' %> |
|
| 18 |
<% end %> |
|
| app/views/messages/edit.rhtml | ||
|---|---|---|
| 1 |
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%=h @message.subject %></h2> |
|
| 2 |
|
|
| 3 |
<% form_for :message, @message, :url => {:action => 'edit'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
| 4 |
<%= render :partial => 'form', :locals => {:f => f, :replying => !@message.parent.nil?} %>
|
|
| 5 |
<%= submit_tag l(:button_save) %> |
|
| 6 |
<%= link_to_remote l(:label_preview), |
|
| 7 |
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
|
|
| 8 |
:method => 'post', |
|
| 9 |
:update => 'preview', |
|
| 10 |
:with => "Form.serialize('message-form')",
|
|
| 11 |
:complete => "Element.scrollTo('preview')"
|
|
| 12 |
}, :accesskey => accesskey(:preview) %> |
|
| 13 |
<% end %> |
|
| 14 |
<div id="preview" class="wiki"></div> |
|
| 15 |
|
|
| 16 |
<% content_for :header_tags do %> |
|
| 17 |
<%= stylesheet_link_tag 'scm' %> |
|
| 18 |
<% end %> |
|
| app/views/messages/new.html.erb | ||
|---|---|---|
| 1 |
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%= l(:label_message_new) %></h2> |
|
| 2 |
|
|
| 3 |
<% form_for :message, @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
| 4 |
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
| 5 |
<%= submit_tag l(:button_create) %> |
|
| 6 |
<%= link_to_remote l(:label_preview), |
|
| 7 |
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
|
|
| 8 |
:method => 'post', |
|
| 9 |
:update => 'preview', |
|
| 10 |
:with => "Form.serialize('message-form')",
|
|
| 11 |
:complete => "Element.scrollTo('preview')"
|
|
| 12 |
}, :accesskey => accesskey(:preview) %> |
|
| 13 |
<% end %> |
|
| 14 |
|
|
| 15 |
<div id="preview" class="wiki"></div> |
|
| app/views/messages/new.rhtml | ||
|---|---|---|
| 1 |
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%= l(:label_message_new) %></h2> |
|
| 2 |
|
|
| 3 |
<% form_for :message, @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
| 4 |
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
| 5 |
<%= submit_tag l(:button_create) %> |
|
| 6 |
<%= link_to_remote l(:label_preview), |
|
| 7 |
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
|
|
| 8 |
:method => 'post', |
|
| 9 |
:update => 'preview', |
|
| 10 |
:with => "Form.serialize('message-form')",
|
|
| 11 |
:complete => "Element.scrollTo('preview')"
|
|
| 12 |
}, :accesskey => accesskey(:preview) %> |
|
| 13 |
<% end %> |
|
| 14 |
|
|
| 15 |
<div id="preview" class="wiki"></div> |
|
| app/views/messages/show.html.erb | ||
|---|---|---|
| 1 |
<%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}),
|
|
| 2 |
link_to(h(@board.name), {:controller => 'boards', :action => 'show', :project_id => @project, :id => @board}) %>
|
|
| 3 |
|
|
| 4 |
<div class="contextual"> |
|
| 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) %>
|
|
| 9 |
</div> |
|
| 10 |
|
|
| 11 |
<h2><%= avatar(@topic.author, :size => "24") %><%=h @topic.subject %></h2> |
|
| 12 |
|
|
| 13 |
<div class="message"> |
|
| 14 |
<p><span class="author"><%= authoring @topic.created_on, @topic.author %></span></p> |
|
| 15 |
<div class="wiki"> |
|
| 16 |
<%= textilizable(@topic.content, :attachments => @topic.attachments) %> |
|
| 17 |
</div> |
|
| 18 |
<%= link_to_attachments @topic, :author => false %> |
|
| 19 |
</div> |
|
| 20 |
<br /> |
|
| 21 |
|
|
| 22 |
<% unless @replies.empty? %> |
|
| 23 |
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3> |
|
| 24 |
<% @replies.each do |message| %> |
|
| 25 |
<div class="message reply" id="<%= "message-#{message.id}" %>">
|
|
| 26 |
<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) %>
|
|
| 30 |
</div> |
|
| 31 |
<h4> |
|
| 32 |
<%= avatar(message.author, :size => "24") %> |
|
| 33 |
<%= link_to h(message.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => "message-#{message.id}" } %>
|
|
| 34 |
- |
|
| 35 |
<%= authoring message.created_on, message.author %> |
|
| 36 |
</h4> |
|
| 37 |
<div class="wiki"><%= textilizable message, :content, :attachments => message.attachments %></div> |
|
| 38 |
<%= link_to_attachments message, :author => false %> |
|
| 39 |
</div> |
|
| 40 |
<% end %> |
|
| 41 |
<p class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></p> |
|
| 42 |
<% end %> |
|
| 43 |
|
|
| 44 |
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
| 45 |
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p> |
|
| 46 |
<div id="reply" style="display:none;"> |
|
| 47 |
<% form_for :reply, @reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
| 48 |
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
|
|
| 49 |
<%= submit_tag l(:button_submit) %> |
|
| 50 |
<%= link_to_remote l(:label_preview), |
|
| 51 |
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
|
|
| 52 |
:method => 'post', |
|
| 53 |
:update => 'preview', |
|
| 54 |
:with => "Form.serialize('message-form')",
|
|
| 55 |
:complete => "Element.scrollTo('preview')"
|
|
| 56 |
}, :accesskey => accesskey(:preview) %> |
|
| 57 |
<% end %> |
|
| 58 |
<div id="preview" class="wiki"></div> |
|
| 59 |
</div> |
|
| 60 |
<% end %> |
|
| 61 |
|
|
| 62 |
<% content_for :header_tags do %> |
|
| 63 |
<%= stylesheet_link_tag 'scm' %> |
|
| 64 |
<% end %> |
|
| 65 |
|
|
| 66 |
<% html_title @topic.subject %> |
|
| app/views/messages/show.rhtml | ||
|---|---|---|
| 1 |
<%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}),
|
|
| 2 |
link_to(h(@board.name), {:controller => 'boards', :action => 'show', :project_id => @project, :id => @board}) %>
|
|
| 3 |
|
|
| 4 |
<div class="contextual"> |
|
| 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) %>
|
|
| 9 |
</div> |
|
| 10 |
|
|
| 11 |
<h2><%= avatar(@topic.author, :size => "24") %><%=h @topic.subject %></h2> |
|
| 12 |
|
|
| 13 |
<div class="message"> |
|
| 14 |
<p><span class="author"><%= authoring @topic.created_on, @topic.author %></span></p> |
|
| 15 |
<div class="wiki"> |
|
| 16 |
<%= textilizable(@topic.content, :attachments => @topic.attachments) %> |
|
| 17 |
</div> |
|
| 18 |
<%= link_to_attachments @topic, :author => false %> |
|
| 19 |
</div> |
|
| 20 |
<br /> |
|
| 21 |
|
|
| 22 |
<% unless @replies.empty? %> |
|
| 23 |
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3> |
|
| 24 |
<% @replies.each do |message| %> |
|
| 25 |
<div class="message reply" id="<%= "message-#{message.id}" %>">
|
|
| 26 |
<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) %>
|
|
| 30 |
</div> |
|
| 31 |
<h4> |
|
| 32 |
<%= avatar(message.author, :size => "24") %> |
|
| 33 |
<%= link_to h(message.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => "message-#{message.id}" } %>
|
|
| 34 |
- |
|
| 35 |
<%= authoring message.created_on, message.author %> |
|
| 36 |
</h4> |
|
| 37 |
<div class="wiki"><%= textilizable message, :content, :attachments => message.attachments %></div> |
|
| 38 |
<%= link_to_attachments message, :author => false %> |
|
| 39 |
</div> |
|
| 40 |
<% end %> |
|
| 41 |
<p class="pagination"><%= pagination_links_full @reply_pages, @reply_count, :per_page_links => false %></p> |
|
| 42 |
<% end %> |
|
| 43 |
|
|
| 44 |
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
| 45 |
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p> |
|
| 46 |
<div id="reply" style="display:none;"> |
|
| 47 |
<% form_for :reply, @reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
|
| 48 |
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
|
|
| 49 |
<%= submit_tag l(:button_submit) %> |
|
| 50 |
<%= link_to_remote l(:label_preview), |
|
| 51 |
{ :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
|
|
| 52 |
:method => 'post', |
|
| 53 |
:update => 'preview', |
|
| 54 |
:with => "Form.serialize('message-form')",
|
|
| 55 |
:complete => "Element.scrollTo('preview')"
|
|
| 56 |
}, :accesskey => accesskey(:preview) %> |
|
| 57 |
<% end %> |
|
| 58 |
<div id="preview" class="wiki"></div> |
|
| 59 |
</div> |
|
| 60 |
<% end %> |
|
| 61 |
|
|
| 62 |
<% content_for :header_tags do %> |
|
| 63 |
<%= stylesheet_link_tag 'scm' %> |
|
| 64 |
<% end %> |
|
| 65 |
|
|
| 66 |
<% html_title h(@topic.subject) %> |
|
Also available in: Unified diff