Opened 11 years ago
Last modified 11 years ago
#11027 closed enhancement
Show numer of table entries in heading on ticket admin pages — at Version 4
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | admin/web | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Steffen Hoffmann | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
It can be useful to see at a glance the number of entries in the Components or Milestones tables, for instance. The attachment sections nicely show the number of attachments (added in #10743), using the trac-count
class for styling. This is also done other places in Trac, and we recently added the feature to tables in the th:AccountManagerPlugin as well (th:#7426).
I propose to add a table entry count to the heading of the following admin panels:
- General: Plugins
- Ticket System: Components
- Ticket System: Milestones
- Ticket System: enums
- Ticket System: Priorities
- Ticket System: Resolutions
- Ticket System: Severities
- Ticket System: Ticket Types
- Ticket System: Versions
- Version Control: Repositories
Change History (5)
comment:1 by , 11 years ago
Cc: | added |
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
t11027-r11682-1.patch implements the feature in JavaScript, in the way described in comment:1. I couldn't find a way to put lightweight generic code in admin.html without a count being added to the Logging page, Permissions page, etc.., but maybe someone will have a clever way to accomplish that. Also, the selector for the Plugins page is slightly different anyway.
Side note: For the trac-count
class, the text in the span
seems to align better with the text outside the span if I change vertical-align: baseline;
→ vertical-align: top;
. I first tried vertical-align: middle;
, thinking that would produce the best results, but the result appeared to be the same as vertical-align: baseline;
. This is true for the Attachment and Change History count numbers on the ticket page as well (Chrome 22 on Debian, Iceweasel 10 on Debian). I'm not sure why that is the case though, so I haven't included the change in the patch.
comment:4 by , 11 years ago
Description: | modified (diff) |
---|
It looks like the best option may be to implement this in JavaScript. The problem with implementing it in the template is that variables such as
components
are generators, so it's not possible to know the number of items in the table until the table is constructed. In order to implement this in the template, it looks like we'd need to either:h2
line.Any ideas on what is best?