Fossil SCM
Improvements to the "Last Change" report.
Commit
1dc93b704f3d1b35da7c4e751df55dff6d0c06521131cc32e4b7a6cc77fb9c5e
Parent
b629647e820a2f1…
1 file changed
+9
-5
+9
-5
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -647,17 +647,21 @@ | ||
| 647 | 647 | ** Generate a report that shows the most recent change for each user. |
| 648 | 648 | */ |
| 649 | 649 | static void stats_report_last_change(void){ |
| 650 | 650 | Stmt s; |
| 651 | 651 | double rNow; |
| 652 | + char *zBaseUrl; | |
| 652 | 653 | |
| 653 | 654 | stats_report_init_view(); |
| 654 | - @ <table border=1 cellpadding=2 cellspacing=0 | |
| 655 | - @ class='lastchngTable' id='lastchng'> | |
| 655 | + @ <h1>Event Summary | |
| 656 | + @ (%s(stats_report_label_for_type())) by User</h1> | |
| 657 | + @ <table border=1 class='statistics-report-table-events' | |
| 658 | + @ cellpadding=2 cellspacing=0 id='lastchng'> | |
| 656 | 659 | @ <thead><tr> |
| 657 | - @ <th>Username<th>Total Changes<th>Last Change</tr></thead> | |
| 660 | + @ <th>User<th>Total Changes<th>Last Change</tr></thead> | |
| 658 | 661 | @ <tbody> |
| 662 | + zBaseUrl = mprintf("%R/timeline?y=%t&u=", PD("type","ci")); | |
| 659 | 663 | db_prepare(&s, |
| 660 | 664 | "SELECT coalesce(euser,user)," |
| 661 | 665 | " count(*)," |
| 662 | 666 | " max(mtime)" |
| 663 | 667 | " FROM v_reports" |
| @@ -669,19 +673,19 @@ | ||
| 669 | 673 | const char *zUser = db_column_text(&s, 0); |
| 670 | 674 | int cnt = db_column_int(&s, 1); |
| 671 | 675 | double rMTime = db_column_double(&s,2); |
| 672 | 676 | char *zAge = human_readable_age(rNow - rMTime); |
| 673 | 677 | @ <tr> |
| 674 | - @ <td>%h(zUser)</a> | |
| 678 | + @ <td><a href='%s(zBaseUrl)%t(zUser)'>%h(zUser)</a> | |
| 675 | 679 | @ <td>%d(cnt) |
| 676 | 680 | @ <td data-sortkey='%f(rMTime)' style='white-space:nowrap'>%s(zAge?zAge:"") |
| 677 | 681 | @ </tr> |
| 678 | 682 | fossil_free(zAge); |
| 679 | 683 | } |
| 680 | 684 | @ </tbody></table> |
| 681 | 685 | db_finalize(&s); |
| 682 | - output_table_sorting_javascript("userlist","tTK",3); | |
| 686 | + output_table_sorting_javascript("lastchng","tNK",3); | |
| 683 | 687 | } |
| 684 | 688 | |
| 685 | 689 | |
| 686 | 690 | /* Report types |
| 687 | 691 | */ |
| 688 | 692 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -647,17 +647,21 @@ | |
| 647 | ** Generate a report that shows the most recent change for each user. |
| 648 | */ |
| 649 | static void stats_report_last_change(void){ |
| 650 | Stmt s; |
| 651 | double rNow; |
| 652 | |
| 653 | stats_report_init_view(); |
| 654 | @ <table border=1 cellpadding=2 cellspacing=0 |
| 655 | @ class='lastchngTable' id='lastchng'> |
| 656 | @ <thead><tr> |
| 657 | @ <th>Username<th>Total Changes<th>Last Change</tr></thead> |
| 658 | @ <tbody> |
| 659 | db_prepare(&s, |
| 660 | "SELECT coalesce(euser,user)," |
| 661 | " count(*)," |
| 662 | " max(mtime)" |
| 663 | " FROM v_reports" |
| @@ -669,19 +673,19 @@ | |
| 669 | const char *zUser = db_column_text(&s, 0); |
| 670 | int cnt = db_column_int(&s, 1); |
| 671 | double rMTime = db_column_double(&s,2); |
| 672 | char *zAge = human_readable_age(rNow - rMTime); |
| 673 | @ <tr> |
| 674 | @ <td>%h(zUser)</a> |
| 675 | @ <td>%d(cnt) |
| 676 | @ <td data-sortkey='%f(rMTime)' style='white-space:nowrap'>%s(zAge?zAge:"") |
| 677 | @ </tr> |
| 678 | fossil_free(zAge); |
| 679 | } |
| 680 | @ </tbody></table> |
| 681 | db_finalize(&s); |
| 682 | output_table_sorting_javascript("userlist","tTK",3); |
| 683 | } |
| 684 | |
| 685 | |
| 686 | /* Report types |
| 687 | */ |
| 688 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -647,17 +647,21 @@ | |
| 647 | ** Generate a report that shows the most recent change for each user. |
| 648 | */ |
| 649 | static void stats_report_last_change(void){ |
| 650 | Stmt s; |
| 651 | double rNow; |
| 652 | char *zBaseUrl; |
| 653 | |
| 654 | stats_report_init_view(); |
| 655 | @ <h1>Event Summary |
| 656 | @ (%s(stats_report_label_for_type())) by User</h1> |
| 657 | @ <table border=1 class='statistics-report-table-events' |
| 658 | @ cellpadding=2 cellspacing=0 id='lastchng'> |
| 659 | @ <thead><tr> |
| 660 | @ <th>User<th>Total Changes<th>Last Change</tr></thead> |
| 661 | @ <tbody> |
| 662 | zBaseUrl = mprintf("%R/timeline?y=%t&u=", PD("type","ci")); |
| 663 | db_prepare(&s, |
| 664 | "SELECT coalesce(euser,user)," |
| 665 | " count(*)," |
| 666 | " max(mtime)" |
| 667 | " FROM v_reports" |
| @@ -669,19 +673,19 @@ | |
| 673 | const char *zUser = db_column_text(&s, 0); |
| 674 | int cnt = db_column_int(&s, 1); |
| 675 | double rMTime = db_column_double(&s,2); |
| 676 | char *zAge = human_readable_age(rNow - rMTime); |
| 677 | @ <tr> |
| 678 | @ <td><a href='%s(zBaseUrl)%t(zUser)'>%h(zUser)</a> |
| 679 | @ <td>%d(cnt) |
| 680 | @ <td data-sortkey='%f(rMTime)' style='white-space:nowrap'>%s(zAge?zAge:"") |
| 681 | @ </tr> |
| 682 | fossil_free(zAge); |
| 683 | } |
| 684 | @ </tbody></table> |
| 685 | db_finalize(&s); |
| 686 | output_table_sorting_javascript("lastchng","tNK",3); |
| 687 | } |
| 688 | |
| 689 | |
| 690 | /* Report types |
| 691 | */ |
| 692 |