Fossil SCM
Omit "Show associated wikis" from the submenu of a [/wcontent] page if there are no associated wikis in a repository. This amends [29a24941ed9b].
Commit
6e28f28091ff4baac405675a9858b2911f248ceba70439acd471f0eeb5611171
Parent
0d61fd23101299a…
1 file changed
+9
-2
+9
-2
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -1915,11 +1915,11 @@ | ||
| 1915 | 1915 | void wcontent_page(void){ |
| 1916 | 1916 | Stmt q; |
| 1917 | 1917 | double rNow; |
| 1918 | 1918 | int showAll = P("all")!=0; |
| 1919 | 1919 | int showRid = P("showid")!=0; |
| 1920 | - int showCkBr = P("showckbr")!=0; | |
| 1920 | + int showCkBr; | |
| 1921 | 1921 | |
| 1922 | 1922 | login_check_credentials(); |
| 1923 | 1923 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 1924 | 1924 | style_set_current_feature("wiki"); |
| 1925 | 1925 | style_header("Available Wiki Pages"); |
| @@ -1926,11 +1926,18 @@ | ||
| 1926 | 1926 | if( showAll ){ |
| 1927 | 1927 | style_submenu_element("Active", "%R/wcontent"); |
| 1928 | 1928 | }else{ |
| 1929 | 1929 | style_submenu_element("All", "%R/wcontent?all=1"); |
| 1930 | 1930 | } |
| 1931 | - style_submenu_checkbox("showckbr", "Show associated wikis", 0, 0); | |
| 1931 | + showCkBr = db_exists( | |
| 1932 | + "SELECT tag.tagname AS tn FROM tag JOIN tagxref USING(tagid) " | |
| 1933 | + "WHERE ( tn GLOB 'wiki-checkin/*' OR tn GLOB 'wiki-branch/*' ) " | |
| 1934 | + " AND TYPEOF(tagxref.value+0)='integer'" ); | |
| 1935 | + if( showCkBr ){ | |
| 1936 | + showCkBr = P("showckbr")!=0; | |
| 1937 | + style_submenu_checkbox("showckbr", "Show associated wikis", 0, 0); | |
| 1938 | + } | |
| 1932 | 1939 | wiki_standard_submenu(W_ALL_BUT(W_LIST)); |
| 1933 | 1940 | db_prepare(&q, listAllWikiPages/*works-like:""*/); |
| 1934 | 1941 | @ <div class="brlist"> |
| 1935 | 1942 | @ <table class='sortable' data-column-types='tKN' data-init-sort='1'> |
| 1936 | 1943 | @ <thead><tr> |
| 1937 | 1944 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -1915,11 +1915,11 @@ | |
| 1915 | void wcontent_page(void){ |
| 1916 | Stmt q; |
| 1917 | double rNow; |
| 1918 | int showAll = P("all")!=0; |
| 1919 | int showRid = P("showid")!=0; |
| 1920 | int showCkBr = P("showckbr")!=0; |
| 1921 | |
| 1922 | login_check_credentials(); |
| 1923 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 1924 | style_set_current_feature("wiki"); |
| 1925 | style_header("Available Wiki Pages"); |
| @@ -1926,11 +1926,18 @@ | |
| 1926 | if( showAll ){ |
| 1927 | style_submenu_element("Active", "%R/wcontent"); |
| 1928 | }else{ |
| 1929 | style_submenu_element("All", "%R/wcontent?all=1"); |
| 1930 | } |
| 1931 | style_submenu_checkbox("showckbr", "Show associated wikis", 0, 0); |
| 1932 | wiki_standard_submenu(W_ALL_BUT(W_LIST)); |
| 1933 | db_prepare(&q, listAllWikiPages/*works-like:""*/); |
| 1934 | @ <div class="brlist"> |
| 1935 | @ <table class='sortable' data-column-types='tKN' data-init-sort='1'> |
| 1936 | @ <thead><tr> |
| 1937 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -1915,11 +1915,11 @@ | |
| 1915 | void wcontent_page(void){ |
| 1916 | Stmt q; |
| 1917 | double rNow; |
| 1918 | int showAll = P("all")!=0; |
| 1919 | int showRid = P("showid")!=0; |
| 1920 | int showCkBr; |
| 1921 | |
| 1922 | login_check_credentials(); |
| 1923 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 1924 | style_set_current_feature("wiki"); |
| 1925 | style_header("Available Wiki Pages"); |
| @@ -1926,11 +1926,18 @@ | |
| 1926 | if( showAll ){ |
| 1927 | style_submenu_element("Active", "%R/wcontent"); |
| 1928 | }else{ |
| 1929 | style_submenu_element("All", "%R/wcontent?all=1"); |
| 1930 | } |
| 1931 | showCkBr = db_exists( |
| 1932 | "SELECT tag.tagname AS tn FROM tag JOIN tagxref USING(tagid) " |
| 1933 | "WHERE ( tn GLOB 'wiki-checkin/*' OR tn GLOB 'wiki-branch/*' ) " |
| 1934 | " AND TYPEOF(tagxref.value+0)='integer'" ); |
| 1935 | if( showCkBr ){ |
| 1936 | showCkBr = P("showckbr")!=0; |
| 1937 | style_submenu_checkbox("showckbr", "Show associated wikis", 0, 0); |
| 1938 | } |
| 1939 | wiki_standard_submenu(W_ALL_BUT(W_LIST)); |
| 1940 | db_prepare(&q, listAllWikiPages/*works-like:""*/); |
| 1941 | @ <div class="brlist"> |
| 1942 | @ <table class='sortable' data-column-types='tKN' data-init-sort='1'> |
| 1943 | @ <thead><tr> |
| 1944 |