Fossil SCM

Improvements to the "Last Change" report.

drh 2017-07-01 18:09 trunk
Commit 1dc93b704f3d1b35da7c4e751df55dff6d0c06521131cc32e4b7a6cc77fb9c5e
1 file changed +9 -5
+9 -5
--- src/statrep.c
+++ src/statrep.c
@@ -647,17 +647,21 @@
647647
** Generate a report that shows the most recent change for each user.
648648
*/
649649
static void stats_report_last_change(void){
650650
Stmt s;
651651
double rNow;
652
+ char *zBaseUrl;
652653
653654
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'>
656659
@ <thead><tr>
657
- @ <th>Username<th>Total Changes<th>Last Change</tr></thead>
660
+ @ <th>User<th>Total Changes<th>Last Change</tr></thead>
658661
@ <tbody>
662
+ zBaseUrl = mprintf("%R/timeline?y=%t&u=", PD("type","ci"));
659663
db_prepare(&s,
660664
"SELECT coalesce(euser,user),"
661665
" count(*),"
662666
" max(mtime)"
663667
" FROM v_reports"
@@ -669,19 +673,19 @@
669673
const char *zUser = db_column_text(&s, 0);
670674
int cnt = db_column_int(&s, 1);
671675
double rMTime = db_column_double(&s,2);
672676
char *zAge = human_readable_age(rNow - rMTime);
673677
@ <tr>
674
- @ <td>%h(zUser)</a>
678
+ @ <td><a href='%s(zBaseUrl)%t(zUser)'>%h(zUser)</a>
675679
@ <td>%d(cnt)
676680
@ <td data-sortkey='%f(rMTime)' style='white-space:nowrap'>%s(zAge?zAge:"")
677681
@ </tr>
678682
fossil_free(zAge);
679683
}
680684
@ </tbody></table>
681685
db_finalize(&s);
682
- output_table_sorting_javascript("userlist","tTK",3);
686
+ output_table_sorting_javascript("lastchng","tNK",3);
683687
}
684688
685689
686690
/* Report types
687691
*/
688692
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button