Fossil SCM

Make the table generated by /test-rename-list sortable.

drh 2018-05-05 17:47 trunk
Commit 80ec9d532c81b58abdc2c059d98886ddf4d43031711cce14dd69f8763cb97409
1 file changed +6 -4
+6 -4
--- src/path.c
+++ src/path.c
@@ -601,15 +601,16 @@
601601
}else{
602602
style_header("List Of Distinct File Name Changes");
603603
db_prepare(&q, "%s", zDistinctRenameQuery/*safe-for-%s*/);
604604
style_submenu_element("All", "%R/test-rename-list?all");
605605
}
606
- @ <table border="1" width="100%%">
607
- @ <tr><th>Date &amp; Time</th>
606
+ @ <table class='sortable' data-column-types='tttt' data-init-sort='1'\
607
+ @ border="1" cellpadding="2" cellspacing="0">
608
+ @ <thead><tr><th>Date &amp; Time</th>
608609
@ <th>Old Name</th>
609610
@ <th>New Name</th>
610
- @ <th>Check-in</th></tr>
611
+ @ <th>Check-in</th></tr></thead><tbody>
611612
while( db_step(&q)==SQLITE_ROW ){
612613
const char *zDate = db_column_text(&q, 0);
613614
const char *zOld = db_column_text(&q, 1);
614615
const char *zNew = db_column_text(&q, 2);
615616
const char *zUuid = db_column_text(&q, 3);
@@ -617,9 +618,10 @@
617618
@ <td>%z(href("%R/timeline?c=%t",zDate))%s(zDate)</a></td>
618619
@ <td>%z(href("%R/finfo?name=%t",zOld))%h(zOld)</a></td>
619620
@ <td>%z(href("%R/finfo?name=%t",zNew))%h(zNew)</a></td>
620621
@ <td>%z(href("%R/info/%!S",zUuid))%S(zUuid)</a></td></tr>
621622
}
622
- @ </table>
623
+ @ </tbody></table>
623624
db_finalize(&q);
625
+ style_table_sorter();
624626
style_footer();
625627
}
626628
--- src/path.c
+++ src/path.c
@@ -601,15 +601,16 @@
601 }else{
602 style_header("List Of Distinct File Name Changes");
603 db_prepare(&q, "%s", zDistinctRenameQuery/*safe-for-%s*/);
604 style_submenu_element("All", "%R/test-rename-list?all");
605 }
606 @ <table border="1" width="100%%">
607 @ <tr><th>Date &amp; Time</th>
 
608 @ <th>Old Name</th>
609 @ <th>New Name</th>
610 @ <th>Check-in</th></tr>
611 while( db_step(&q)==SQLITE_ROW ){
612 const char *zDate = db_column_text(&q, 0);
613 const char *zOld = db_column_text(&q, 1);
614 const char *zNew = db_column_text(&q, 2);
615 const char *zUuid = db_column_text(&q, 3);
@@ -617,9 +618,10 @@
617 @ <td>%z(href("%R/timeline?c=%t",zDate))%s(zDate)</a></td>
618 @ <td>%z(href("%R/finfo?name=%t",zOld))%h(zOld)</a></td>
619 @ <td>%z(href("%R/finfo?name=%t",zNew))%h(zNew)</a></td>
620 @ <td>%z(href("%R/info/%!S",zUuid))%S(zUuid)</a></td></tr>
621 }
622 @ </table>
623 db_finalize(&q);
 
624 style_footer();
625 }
626
--- src/path.c
+++ src/path.c
@@ -601,15 +601,16 @@
601 }else{
602 style_header("List Of Distinct File Name Changes");
603 db_prepare(&q, "%s", zDistinctRenameQuery/*safe-for-%s*/);
604 style_submenu_element("All", "%R/test-rename-list?all");
605 }
606 @ <table class='sortable' data-column-types='tttt' data-init-sort='1'\
607 @ border="1" cellpadding="2" cellspacing="0">
608 @ <thead><tr><th>Date &amp; Time</th>
609 @ <th>Old Name</th>
610 @ <th>New Name</th>
611 @ <th>Check-in</th></tr></thead><tbody>
612 while( db_step(&q)==SQLITE_ROW ){
613 const char *zDate = db_column_text(&q, 0);
614 const char *zOld = db_column_text(&q, 1);
615 const char *zNew = db_column_text(&q, 2);
616 const char *zUuid = db_column_text(&q, 3);
@@ -617,9 +618,10 @@
618 @ <td>%z(href("%R/timeline?c=%t",zDate))%s(zDate)</a></td>
619 @ <td>%z(href("%R/finfo?name=%t",zOld))%h(zOld)</a></td>
620 @ <td>%z(href("%R/finfo?name=%t",zNew))%h(zNew)</a></td>
621 @ <td>%z(href("%R/info/%!S",zUuid))%S(zUuid)</a></td></tr>
622 }
623 @ </tbody></table>
624 db_finalize(&q);
625 style_table_sorter();
626 style_footer();
627 }
628

Keyboard Shortcuts

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