#11027 closed enhancement (fixed)
Show numer of table entries in heading on ticket admin pages — at Version 7
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | admin/web | Version: | 1.0-stable |
Severity: | normal | Keywords: | |
Cc: | Steffen Hoffmann | Branch: | |
Release Notes: |
Number of table entries is shown next to heading on applicable admin pages. |
||
API Changes: |
New jQuery functions |
||
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 (8)
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) |
---|
comment:5 by , 11 years ago
Milestone: | → 1.0.2 |
---|---|
Owner: | set to |
Status: | new → assigned |
Well, we'd need two Javascript helper functions (in trac.js?).
Something like:
$("h2").add_counter(n)
$("h2").add_row_counter($("table.listing"))
(using the above)
comment:6 by , 11 years ago
Owner: | changed from | to
---|
Changes can be found in rjollos.git:t11027, including suggestions from comment:5.
comment:7 by , 11 years ago
API Changes: | modified (diff) |
---|---|
Release Notes: | modified (diff) |
Resolution: | → fixed |
Status: | assigned → closed |
Tested with Chrome 28, Firefox 23 and Opera 12.16. Fixed some indentation issues with rjollos.git:t11027 and committed to 1.0-stable in [12015]. Merged to trunk in [12016].
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?