diff --git a/assets/result.html.erb b/assets/result.html.erb index 2e4253d9..774c3ba2 100644 --- a/assets/result.html.erb +++ b/assets/result.html.erb @@ -22,18 +22,18 @@ margin: 10px 0; font-size: 14px; } - table th, table td { + table.result th, table.result td { padding: 4px; border: 1px solid #D0D0D0; } - table th { + table.result th { background-color: #DFC; color: #337022; } - table td.filename { + table.result td.filename { color: #ED1556; } - table tr:hover { + table.result tr:hover { background-color: #FFFFC0; } ul { @@ -48,6 +48,14 @@ float: left; } +<% + def columnize(arr, col_count) + row_count = arr.size / col_count + row_count += 1 if arr.size % col_count > 0 + cols = arr.each_slice(row_count).to_a + cols[0].zip(*cols[1..-1]).map(&:compact) + end +%>

rails_best_practices output

@@ -63,59 +71,73 @@ Found <%= @errors.size %> warnings. <% end %>

- + <% columnize(@error_types, 3).each do |row| %> + + <% row.map { |error_type| error_type.split(':').last }.each do |error_type| %> + + <% end %> + + <% end %> - - - - <% if @hg %> - - - <% elsif @git %> - - - <% end %> + - <% @errors.each do |error| %> - - - - +
+   +
FilenameLine NumberWarning MessageHg CommitHg UsernameGit CommitGit Username + + +
- <% if @github %> - <%= error.short_filename %> - <% elsif @textmate %> - <%= error.short_filename %> - <% elsif @mvim %> - <%= error.short_filename %> - <% else %> - <%= error.short_filename %> - <% end %> - <%= error.line_number %> - <%= error.message %> -
+ + + + + + <% if @hg %> - - + + <% elsif @git %> - - + + <% end %> - <% end %> + + + <% @errors.each do |error| %> + + + + + <% if @hg %> + + + <% elsif @git %> + + + <% end %> + + <% end %> +
FilenameLine NumberWarning Message<%= error.hg_commit %><%= error.hg_username %>Hg CommitHg Username<%= error.git_commit %><%= error.git_username %>Git CommitGit Username
+ <% if @github %> + <%= error.short_filename %> + <% elsif @textmate %> + <%= error.short_filename %> + <% elsif @mvim %> + <%= error.short_filename %> + <% else %> + <%= error.short_filename %> + <% end %> + <%= error.line_number %> + <%= error.message %> + <%= error.hg_commit %><%= error.hg_username %><%= error.git_commit %><%= error.git_username %>
- +