Patch #5281

Remove empty ul tags in the issue history

Added by Henrik Ammer over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:2010-04-09
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:UI
Target version:1.0.0 (RC)

Description

I was a bit annoyed that the ul with the details in history always showed even when empty. Sure, it does not render in most browsers since it's empty but I wasn't to happy about it either. :)

And when I added the if sentence I also added a CSS class to the ul just to make it easier to style if needed.

Attached diff

Index: app/views/issues/_history.rhtml
===================================================================
--- app/views/issues/_history.rhtml    (revision 3629)
+++ app/views/issues/_history.rhtml    (working copy)
@@ -6,11 +6,13 @@
     <%= content_tag('a', '', :name => "note-#{journal.indice}")%>
         <%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %></h4>

-    <ul>
-    <% for detail in journal.details %>
+    <% if journal.details.any? %>
+    <ul class="details">
+      <% for detail in journal.details %>
        <li><%= show_detail(detail) %></li>
+      <% end %>
+    </ul>
     <% end %>
-    </ul>
     <%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
   </div>
   <%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>

Use it if needed.

history_details_css_class.diff Magnifier (836 Bytes) Henrik Ammer, 2010-04-09 13:51

Associated revisions

Revision 3666
Added by Jean-Philippe Lang over 7 years ago

Fixed: empty ul tag for issue updates with notes only (#5281).

History

#1 Updated by Jean-Philippe Lang over 7 years ago

  • Subject changed from History details ul not rendering when empty and add CSS class to Remove empty ul tags in the issue history
  • Status changed from New to Closed
  • Target version set to 1.0.0 (RC)

Patch committed in r3666. Thanks.

Also available in: Atom PDF