diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-11-18 14:14:47 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-11-18 14:17:38 +0000 |
commit | 729b2bc7406b418dd2085fd4617dfd50c85f628f (patch) | |
tree | 1e05e0f7d3a9de9b5a5b1b250d74cda382ea1d64 | |
parent | 1ad125dd0d0e446f1c94e6abb988a67e05ca1be2 (diff) |
Use badge to show number of categories in heading
The chevron didn't illustrate that the heading had any category
children. The app uses the badge pattern elsewhere.
Adds minor style improvements:
- Pad erb tags
- Use each instead of for
Fixes https://github.com/mysociety/alaveteli/issues/1962
-rw-r--r-- | app/views/admin_public_body_categories/_heading_list.html.erb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/views/admin_public_body_categories/_heading_list.html.erb b/app/views/admin_public_body_categories/_heading_list.html.erb index 4bd8bdc90..f76584592 100644 --- a/app/views/admin_public_body_categories/_heading_list.html.erb +++ b/app/views/admin_public_body_categories/_heading_list.html.erb @@ -1,9 +1,12 @@ <div class="accordion" id="category_list"> - <% for heading in category_headings %> - <div class="accordion-group" data-id="headings_<%=heading.id%>"> + <% category_headings.each do |heading| %> + <div class="accordion-group" data-id="headings_<%= heading.id %>"> <div class="accordion-heading accordion-toggle row"> <span class="item-title span6"> - <a href="#heading_<%=heading.id%>_categories" data-toggle="collapse" data-parent="#categories" ><%= chevron_right %></a> + <a href="#heading_<%= heading.id %>_categories" data-toggle="collapse" data-parent="#categories"> + <span class="badge"><%= category_headings.size %></span> + <%= chevron_right %> + </a> <strong><%= link_to(heading.name, edit_admin_heading_path(heading), :title => "view full details") %></strong> </span> </div> |