]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/issues/_comments.html.erb
Merge remote-tracking branch 'upstream/pull/4717'
[rails.git] / app / views / issues / _comments.html.erb
index 52f740b0967191576a4aec34e5960d09f0d6f29e..9200b4cec6246b8feebcc7dbaab1eee77fe19a43 100644 (file)
@@ -1,29 +1,28 @@
-<div class="issue-comments">
-<% comments.each do |comment| %>
-       <div class="comment">
-               <div style="float:left">
-                       <%= link_to user_thumbnail(comment.user), :controller => :user,:action =>:view, :display_name => comment.user.display_name %>
-               </div>
-               <b> <%= link_to comment.user.display_name, :controller => :user,:action =>:view, :display_name => comment.user.display_name %> </b> <br/>
-               <%= comment.body %>
+<div>
+  <% comments.each do |comment| %>
+    <div class="row">
+      <div class="col-auto">
+        <%= link_to user_thumbnail(comment.user), comment.user %>
+      </div>
+      <div class="col">
+        <p class="text-muted">
+          <%= t ".comment_from_html", :user_link => link_to(comment.user.display_name, comment.user),
+                                      :comment_created_at => tag.time(l(comment.created_at.to_datetime, :format => :friendly),
+                                                                      :datetime => comment.created_at.xmlschema) %>
+        </p>
+        <div class="richtext text-break"><%= comment.body.to_html %></div>
+      </div>
+    </div>
+    <hr>
+  <% end %>
+</div>
 
-               <% if comment.reassign %>
-                       <br/>
-                       <i><%= t('issues.show.comments.reassign') %></i>
-               <% end %>
-       </div>
-       <span class="deemphasize">
-       On <%= l comment.created_at.to_datetime, :format => :long %> </span>
-       <hr>
-<% end %>
+<div>
+  <%= bootstrap_form_for @new_comment, :url => issue_comments_path(@issue) do |f| %>
+    <%= f.richtext_field :body, :cols => 80, :rows => 20, :hide_label => true %>
+    <%= f.form_group do %>
+      <%= f.check_box :reassign, { :label => t(".reassign_param"), :id => "reassign", :name => "reassign", :checked => false }, true, false %>
+    <% end %>
+    <%= f.primary %>
+  <% end %>
 </div>
-<br/>
-<div class="comment">
-       <%= form_for :issue_comment, :url => { :action => 'comment', :id => @issue.id, :user_id => @user.id } do |f| %>
-           <%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
-           <%= label_tag t('issues.show.comments.reassign_param') %> <%= check_box_tag :reassign, true %> 
-           <br/>
-           <br/>
-       <%= submit_tag 'Submit' %>
-       <% end %>
-</div>
\ No newline at end of file