Fossil SCM
On the /wiki page, put text to show that the page has been deleted.
Commit
c7a7a5611762df9a0b6529994c9d521bd2593a812ef7f181b86e1b36368b6a4d
Parent
81c22bc6b8605da…
1 file changed
+23
-5
+23
-5
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -415,13 +415,17 @@ | ||
| 415 | 415 | } |
| 416 | 416 | } |
| 417 | 417 | style_set_current_page("%T?name=%T", g.zPath, zPageName); |
| 418 | 418 | style_header("%s", zPageName); |
| 419 | 419 | wiki_standard_submenu(submenuFlags); |
| 420 | - blob_init(&wiki, zBody, -1); | |
| 421 | - wiki_render_by_mimetype(&wiki, zMimetype); | |
| 422 | - blob_reset(&wiki); | |
| 420 | + if( zBody[0]==0 ){ | |
| 421 | + @ <i>This page has been deleted</i> | |
| 422 | + }else{ | |
| 423 | + blob_init(&wiki, zBody, -1); | |
| 424 | + wiki_render_by_mimetype(&wiki, zMimetype); | |
| 425 | + blob_reset(&wiki); | |
| 426 | + } | |
| 423 | 427 | attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>"); |
| 424 | 428 | manifest_destroy(pWiki); |
| 425 | 429 | style_footer(); |
| 426 | 430 | } |
| 427 | 431 | |
| @@ -854,37 +858,43 @@ | ||
| 854 | 858 | ** Function called to output extra text at the end of each line in |
| 855 | 859 | ** a wiki history listing. |
| 856 | 860 | */ |
| 857 | 861 | static void wiki_history_extra(int rid){ |
| 858 | 862 | if( db_exists("SELECT 1 FROM tagxref WHERE rid=%d", rid) ){ |
| 859 | - @ %z(href("%R/wdiff?name=%t&a=%d",zWikiPageName,rid))[diff]</a> | |
| 863 | + @ op: %z(href("%R/wdiff?name=%t&a=%d",zWikiPageName,rid))diff</a>\ | |
| 860 | 864 | } |
| 861 | 865 | } |
| 862 | 866 | |
| 863 | 867 | /* |
| 864 | 868 | ** WEBPAGE: whistory |
| 865 | 869 | ** URL: /whistory?name=PAGENAME |
| 866 | 870 | ** |
| 871 | +** Additional parameters: | |
| 872 | +** | |
| 873 | +** showid Show RID values | |
| 874 | +** | |
| 867 | 875 | ** Show the complete change history for a single wiki page. |
| 868 | 876 | */ |
| 869 | 877 | void whistory_page(void){ |
| 870 | 878 | Stmt q; |
| 871 | 879 | const char *zPageName; |
| 880 | + int tmFlags = TIMELINE_ARTID; | |
| 872 | 881 | login_check_credentials(); |
| 873 | 882 | if( !g.perm.Hyperlink ){ login_needed(g.anon.Hyperlink); return; } |
| 874 | 883 | zPageName = PD("name",""); |
| 875 | 884 | style_header("History Of %s", zPageName); |
| 885 | + if( P("showid")!=0 ) tmFlags |= TIMELINE_SHOWRID; | |
| 876 | 886 | |
| 877 | 887 | db_prepare(&q, "%s AND event.objid IN " |
| 878 | 888 | " (SELECT rid FROM tagxref WHERE tagid=" |
| 879 | 889 | "(SELECT tagid FROM tag WHERE tagname='wiki-%q')" |
| 880 | 890 | " UNION SELECT attachid FROM attachment" |
| 881 | 891 | " WHERE target=%Q)" |
| 882 | 892 | "ORDER BY mtime DESC", |
| 883 | 893 | timeline_query_for_www(), zPageName, zPageName); |
| 884 | 894 | zWikiPageName = zPageName; |
| 885 | - www_print_timeline(&q, TIMELINE_ARTID, 0, 0, 0, wiki_history_extra); | |
| 895 | + www_print_timeline(&q, tmFlags, 0, 0, 0, wiki_history_extra); | |
| 886 | 896 | db_finalize(&q); |
| 887 | 897 | style_footer(); |
| 888 | 898 | } |
| 889 | 899 | |
| 890 | 900 | /* |
| @@ -965,17 +975,19 @@ | ||
| 965 | 975 | |
| 966 | 976 | /* |
| 967 | 977 | ** WEBPAGE: wcontent |
| 968 | 978 | ** |
| 969 | 979 | ** all=1 Show deleted pages |
| 980 | +** showid Show rid values for each page. | |
| 970 | 981 | ** |
| 971 | 982 | ** List all available wiki pages with date created and last modified. |
| 972 | 983 | */ |
| 973 | 984 | void wcontent_page(void){ |
| 974 | 985 | Stmt q; |
| 975 | 986 | double rNow; |
| 976 | 987 | int showAll = P("all")!=0; |
| 988 | + int showRid = P("showid")!=0; | |
| 977 | 989 | |
| 978 | 990 | login_check_credentials(); |
| 979 | 991 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 980 | 992 | style_header("Available Wiki Pages"); |
| 981 | 993 | if( showAll ){ |
| @@ -989,10 +1001,13 @@ | ||
| 989 | 1001 | @ <table class='sortable' data-column-types='tKN' data-init-sort='1'> |
| 990 | 1002 | @ <thead><tr> |
| 991 | 1003 | @ <th>Name</th> |
| 992 | 1004 | @ <th>Last Change</th> |
| 993 | 1005 | @ <th>Versions</th> |
| 1006 | + if( showRid ){ | |
| 1007 | + @ <th>RID</th> | |
| 1008 | + } | |
| 994 | 1009 | @ </tr></thead><tbody> |
| 995 | 1010 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 996 | 1011 | while( db_step(&q)==SQLITE_ROW ){ |
| 997 | 1012 | const char *zWName = db_column_text(&q, 0); |
| 998 | 1013 | const char *zSort = db_column_text(&q, 1); |
| @@ -1011,10 +1026,13 @@ | ||
| 1011 | 1026 | } |
| 1012 | 1027 | zAge = human_readable_age(rNow - rWmtime); |
| 1013 | 1028 | @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> |
| 1014 | 1029 | fossil_free(zAge); |
| 1015 | 1030 | @ <td>%z(href("%R/whistory?name=%T",zWName))%d(wcnt)</a></td> |
| 1031 | + if( showRid ){ | |
| 1032 | + @ <td>%d(wrid)</td> | |
| 1033 | + } | |
| 1016 | 1034 | @ </tr> |
| 1017 | 1035 | } |
| 1018 | 1036 | @ </tbody></table></div> |
| 1019 | 1037 | db_finalize(&q); |
| 1020 | 1038 | style_table_sorter(); |
| 1021 | 1039 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -415,13 +415,17 @@ | |
| 415 | } |
| 416 | } |
| 417 | style_set_current_page("%T?name=%T", g.zPath, zPageName); |
| 418 | style_header("%s", zPageName); |
| 419 | wiki_standard_submenu(submenuFlags); |
| 420 | blob_init(&wiki, zBody, -1); |
| 421 | wiki_render_by_mimetype(&wiki, zMimetype); |
| 422 | blob_reset(&wiki); |
| 423 | attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>"); |
| 424 | manifest_destroy(pWiki); |
| 425 | style_footer(); |
| 426 | } |
| 427 | |
| @@ -854,37 +858,43 @@ | |
| 854 | ** Function called to output extra text at the end of each line in |
| 855 | ** a wiki history listing. |
| 856 | */ |
| 857 | static void wiki_history_extra(int rid){ |
| 858 | if( db_exists("SELECT 1 FROM tagxref WHERE rid=%d", rid) ){ |
| 859 | @ %z(href("%R/wdiff?name=%t&a=%d",zWikiPageName,rid))[diff]</a> |
| 860 | } |
| 861 | } |
| 862 | |
| 863 | /* |
| 864 | ** WEBPAGE: whistory |
| 865 | ** URL: /whistory?name=PAGENAME |
| 866 | ** |
| 867 | ** Show the complete change history for a single wiki page. |
| 868 | */ |
| 869 | void whistory_page(void){ |
| 870 | Stmt q; |
| 871 | const char *zPageName; |
| 872 | login_check_credentials(); |
| 873 | if( !g.perm.Hyperlink ){ login_needed(g.anon.Hyperlink); return; } |
| 874 | zPageName = PD("name",""); |
| 875 | style_header("History Of %s", zPageName); |
| 876 | |
| 877 | db_prepare(&q, "%s AND event.objid IN " |
| 878 | " (SELECT rid FROM tagxref WHERE tagid=" |
| 879 | "(SELECT tagid FROM tag WHERE tagname='wiki-%q')" |
| 880 | " UNION SELECT attachid FROM attachment" |
| 881 | " WHERE target=%Q)" |
| 882 | "ORDER BY mtime DESC", |
| 883 | timeline_query_for_www(), zPageName, zPageName); |
| 884 | zWikiPageName = zPageName; |
| 885 | www_print_timeline(&q, TIMELINE_ARTID, 0, 0, 0, wiki_history_extra); |
| 886 | db_finalize(&q); |
| 887 | style_footer(); |
| 888 | } |
| 889 | |
| 890 | /* |
| @@ -965,17 +975,19 @@ | |
| 965 | |
| 966 | /* |
| 967 | ** WEBPAGE: wcontent |
| 968 | ** |
| 969 | ** all=1 Show deleted pages |
| 970 | ** |
| 971 | ** List all available wiki pages with date created and last modified. |
| 972 | */ |
| 973 | void wcontent_page(void){ |
| 974 | Stmt q; |
| 975 | double rNow; |
| 976 | int showAll = P("all")!=0; |
| 977 | |
| 978 | login_check_credentials(); |
| 979 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 980 | style_header("Available Wiki Pages"); |
| 981 | if( showAll ){ |
| @@ -989,10 +1001,13 @@ | |
| 989 | @ <table class='sortable' data-column-types='tKN' data-init-sort='1'> |
| 990 | @ <thead><tr> |
| 991 | @ <th>Name</th> |
| 992 | @ <th>Last Change</th> |
| 993 | @ <th>Versions</th> |
| 994 | @ </tr></thead><tbody> |
| 995 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 996 | while( db_step(&q)==SQLITE_ROW ){ |
| 997 | const char *zWName = db_column_text(&q, 0); |
| 998 | const char *zSort = db_column_text(&q, 1); |
| @@ -1011,10 +1026,13 @@ | |
| 1011 | } |
| 1012 | zAge = human_readable_age(rNow - rWmtime); |
| 1013 | @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> |
| 1014 | fossil_free(zAge); |
| 1015 | @ <td>%z(href("%R/whistory?name=%T",zWName))%d(wcnt)</a></td> |
| 1016 | @ </tr> |
| 1017 | } |
| 1018 | @ </tbody></table></div> |
| 1019 | db_finalize(&q); |
| 1020 | style_table_sorter(); |
| 1021 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -415,13 +415,17 @@ | |
| 415 | } |
| 416 | } |
| 417 | style_set_current_page("%T?name=%T", g.zPath, zPageName); |
| 418 | style_header("%s", zPageName); |
| 419 | wiki_standard_submenu(submenuFlags); |
| 420 | if( zBody[0]==0 ){ |
| 421 | @ <i>This page has been deleted</i> |
| 422 | }else{ |
| 423 | blob_init(&wiki, zBody, -1); |
| 424 | wiki_render_by_mimetype(&wiki, zMimetype); |
| 425 | blob_reset(&wiki); |
| 426 | } |
| 427 | attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>"); |
| 428 | manifest_destroy(pWiki); |
| 429 | style_footer(); |
| 430 | } |
| 431 | |
| @@ -854,37 +858,43 @@ | |
| 858 | ** Function called to output extra text at the end of each line in |
| 859 | ** a wiki history listing. |
| 860 | */ |
| 861 | static void wiki_history_extra(int rid){ |
| 862 | if( db_exists("SELECT 1 FROM tagxref WHERE rid=%d", rid) ){ |
| 863 | @ op: %z(href("%R/wdiff?name=%t&a=%d",zWikiPageName,rid))diff</a>\ |
| 864 | } |
| 865 | } |
| 866 | |
| 867 | /* |
| 868 | ** WEBPAGE: whistory |
| 869 | ** URL: /whistory?name=PAGENAME |
| 870 | ** |
| 871 | ** Additional parameters: |
| 872 | ** |
| 873 | ** showid Show RID values |
| 874 | ** |
| 875 | ** Show the complete change history for a single wiki page. |
| 876 | */ |
| 877 | void whistory_page(void){ |
| 878 | Stmt q; |
| 879 | const char *zPageName; |
| 880 | int tmFlags = TIMELINE_ARTID; |
| 881 | login_check_credentials(); |
| 882 | if( !g.perm.Hyperlink ){ login_needed(g.anon.Hyperlink); return; } |
| 883 | zPageName = PD("name",""); |
| 884 | style_header("History Of %s", zPageName); |
| 885 | if( P("showid")!=0 ) tmFlags |= TIMELINE_SHOWRID; |
| 886 | |
| 887 | db_prepare(&q, "%s AND event.objid IN " |
| 888 | " (SELECT rid FROM tagxref WHERE tagid=" |
| 889 | "(SELECT tagid FROM tag WHERE tagname='wiki-%q')" |
| 890 | " UNION SELECT attachid FROM attachment" |
| 891 | " WHERE target=%Q)" |
| 892 | "ORDER BY mtime DESC", |
| 893 | timeline_query_for_www(), zPageName, zPageName); |
| 894 | zWikiPageName = zPageName; |
| 895 | www_print_timeline(&q, tmFlags, 0, 0, 0, wiki_history_extra); |
| 896 | db_finalize(&q); |
| 897 | style_footer(); |
| 898 | } |
| 899 | |
| 900 | /* |
| @@ -965,17 +975,19 @@ | |
| 975 | |
| 976 | /* |
| 977 | ** WEBPAGE: wcontent |
| 978 | ** |
| 979 | ** all=1 Show deleted pages |
| 980 | ** showid Show rid values for each page. |
| 981 | ** |
| 982 | ** List all available wiki pages with date created and last modified. |
| 983 | */ |
| 984 | void wcontent_page(void){ |
| 985 | Stmt q; |
| 986 | double rNow; |
| 987 | int showAll = P("all")!=0; |
| 988 | int showRid = P("showid")!=0; |
| 989 | |
| 990 | login_check_credentials(); |
| 991 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 992 | style_header("Available Wiki Pages"); |
| 993 | if( showAll ){ |
| @@ -989,10 +1001,13 @@ | |
| 1001 | @ <table class='sortable' data-column-types='tKN' data-init-sort='1'> |
| 1002 | @ <thead><tr> |
| 1003 | @ <th>Name</th> |
| 1004 | @ <th>Last Change</th> |
| 1005 | @ <th>Versions</th> |
| 1006 | if( showRid ){ |
| 1007 | @ <th>RID</th> |
| 1008 | } |
| 1009 | @ </tr></thead><tbody> |
| 1010 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 1011 | while( db_step(&q)==SQLITE_ROW ){ |
| 1012 | const char *zWName = db_column_text(&q, 0); |
| 1013 | const char *zSort = db_column_text(&q, 1); |
| @@ -1011,10 +1026,13 @@ | |
| 1026 | } |
| 1027 | zAge = human_readable_age(rNow - rWmtime); |
| 1028 | @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> |
| 1029 | fossil_free(zAge); |
| 1030 | @ <td>%z(href("%R/whistory?name=%T",zWName))%d(wcnt)</a></td> |
| 1031 | if( showRid ){ |
| 1032 | @ <td>%d(wrid)</td> |
| 1033 | } |
| 1034 | @ </tr> |
| 1035 | } |
| 1036 | @ </tbody></table></div> |
| 1037 | db_finalize(&q); |
| 1038 | style_table_sorter(); |
| 1039 |