wrapped comments

This commit is contained in:
2023-12-03 12:01:25 +01:00
parent db721ea1d8
commit d12feef4ba

View File

@@ -33,39 +33,41 @@
<%= link_to_attachments @news %> <%= link_to_attachments @news %>
</div> </div>
<div id="comments" style="margin-bottom:16px;" class="flex-box"> <div class="news-content flex-box">
<h3 class="comments"><%= l(:label_comment_plural) %></h3> <div id="comments" style="margin-bottom:16px;">
<% if @news.commentable? && @comments.size >= 3 %> <h3 class="comments"><%= l(:label_comment_plural) %></h3>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments", :scroll => "comment_comments" %></p> <% if @news.commentable? && @comments.size >= 3 %>
<% end %> <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments", :scroll => "comment_comments" %></p>
<% @comments.each do |comment| %> <% end %>
<% next if comment.new_record? %> <% @comments.each do |comment| %>
<div class="contextual"> <% next if comment.new_record? %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, <div class="contextual">
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, <%= link_to_if_authorized l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
:title => l(:button_delete), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,
:class => 'icon-only icon-del' %> :title => l(:button_delete),
</div> :class => 'icon-only icon-del' %>
<h4><%= avatar(comment.author) %><%= authoring comment.created_on, comment.author %></h4> </div>
<div class="wiki"> <h4><%= avatar(comment.author) %><%= authoring comment.created_on, comment.author %></h4>
<%= textilizable(comment.comments) %> <div class="wiki">
</div> <%= textilizable(comment.comments) %>
<% end if @comments.any? %> </div>
</div> <% end if @comments.any? %>
</div>
<% if @news.commentable? %> <% if @news.commentable? %>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p> <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %> <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
<div class="box"> <div class="box">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit', <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit',
:data => { :data => {
:auto_complete => true :auto_complete => true
} }
%> %>
<%= wikitoolbar_for 'comment_comments', preview_news_path(:project_id => @project, :id => @news) %> <%= wikitoolbar_for 'comment_comments', preview_news_path(:project_id => @project, :id => @news) %>
</div>
<p><%= submit_tag l(:button_add) %></p>
<% end %>
</div> </div>
<p><%= submit_tag l(:button_add) %></p>
<% end %>
</div> </div>
<% end %> <% end %>