| | @@ -1023,52 +1023,71 @@ |
| 1023 | 1023 | db_prepare(&q, |
| 1024 | 1024 | "SELECT" |
| 1025 | 1025 | " event.mtime," |
| 1026 | 1026 | " blob.uuid," |
| 1027 | 1027 | " coalesce(event.euser,event.user)," |
| 1028 | | - " event.objid" |
| 1028 | + " event.objid," |
| 1029 | + " datetime(event.mtime)" |
| 1029 | 1030 | " FROM event, blob, tag, tagxref" |
| 1030 | 1031 | " WHERE event.type='w' AND blob.rid=event.objid" |
| 1031 | 1032 | " AND tag.tagname='wiki-%q'" |
| 1032 | 1033 | " AND tagxref.tagid=tag.tagid AND tagxref.srcid=event.objid" |
| 1033 | 1034 | " ORDER BY event.mtime DESC", |
| 1034 | 1035 | zPageName |
| 1035 | 1036 | ); |
| 1036 | 1037 | @ <h2>History of <a href="%R/wiki?name=%T(zPageName)">%h(zPageName)</a></h2> |
| 1038 | + form_begin( "id='wh-form'", "%R/wdiff" ); |
| 1039 | + @ <input id="wh-pid" name="pid" type="radio" hidden /> |
| 1040 | + @ <input id="wh-id" name="id" type="hidden" /> |
| 1041 | + @ </form> |
| 1042 | + @ <style> .wh-clickable { cursor: pointer; } </style> |
| 1037 | 1043 | @ <div class="brlist"> |
| 1038 | 1044 | @ <table> |
| 1039 | 1045 | @ <thead><tr> |
| 1040 | 1046 | @ <th>Age</th> |
| 1041 | 1047 | @ <th>Hash</th> |
| 1042 | | - @ <th>User</th> |
| 1048 | + @ <th><span title="Baseline from which diffs are computed (click to unset)" |
| 1049 | + @ id="wh-cleaner" class="wh-clickable">⚓</span></th> |
| 1050 | + @ <th>User<span hidden class="wh-clickable" |
| 1051 | + @ id="wh-collapser"> ♲</span></th> |
| 1043 | 1052 | if( showRid ){ |
| 1044 | 1053 | @ <th>RID</th> |
| 1045 | 1054 | } |
| 1046 | 1055 | @ <th> </th> |
| 1047 | 1056 | @ </tr></thead><tbody> |
| 1048 | 1057 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 1058 | + char zAuthor[64]; memset( zAuthor, 0, sizeof(zAuthor) ); |
| 1049 | 1059 | while( db_step(&q)==SQLITE_ROW ){ |
| 1050 | 1060 | double rMtime = db_column_double(&q, 0); |
| 1051 | 1061 | const char *zUuid = db_column_text(&q, 1); |
| 1052 | 1062 | const char *zUser = db_column_text(&q, 2); |
| 1053 | 1063 | int wrid = db_column_int(&q, 3); |
| 1064 | + const char *zWhen = db_column_text(&q, 4); |
| 1054 | 1065 | /* sqlite3_int64 iMtime = (sqlite3_int64)(rMtime*86400.0); */ |
| 1055 | 1066 | char *zAge = human_readable_age(rNow - rMtime); |
| 1056 | | - @ <tr> |
| 1067 | + if( strncmp( zAuthor, zUser, sizeof(zAuthor) - 1 ) == 0 ) { |
| 1068 | + @ <tr class="wh-intermediate" title="%s(zWhen)"> |
| 1069 | + } |
| 1070 | + else { |
| 1071 | + strncpy( zAuthor, zUser, sizeof(zAuthor) - 1 ); |
| 1072 | + @ <tr class="wh-major" title="%s(zWhen)"> |
| 1073 | + } |
| 1057 | 1074 | /* @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> */ |
| 1058 | 1075 | @ <td>%s(zAge)</td> |
| 1059 | 1076 | fossil_free(zAge); |
| 1060 | 1077 | @ <td>%z(href("%R/info/%s",zUuid))%S(zUuid)</a></td> |
| 1061 | | - @ <td>%h(zUser)</td> |
| 1078 | + @ <td><input disabled type="radio" name="baseline" value="%S(zUuid)"/></td> |
| 1079 | + @ <td>%h(zUser)<span class="wh-iterations" hidden /></td> |
| 1062 | 1080 | if( showRid ){ |
| 1063 | 1081 | @ <td>%z(href("%R/artifact/%S",zUuid))%d(wrid)</a></td> |
| 1064 | 1082 | } |
| 1065 | | - @ <td>%z(href("%R/wdiff?id=%S",zUuid))diff</a></td> |
| 1083 | + @ <td>%z(chref("wh-difflink","%R/wdiff?id=%S",zUuid))diff</a></td> |
| 1066 | 1084 | @ </tr> |
| 1067 | 1085 | } |
| 1068 | 1086 | @ </tbody></table></div> |
| 1069 | 1087 | db_finalize(&q); |
| 1088 | + style_load_one_js_file("whistory.js"); |
| 1070 | 1089 | /* style_table_sorter(); */ |
| 1071 | 1090 | style_footer(); |
| 1072 | 1091 | } |
| 1073 | 1092 | |
| 1074 | 1093 | /* |
| 1075 | 1094 | |