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].

george 2022-11-02 22:51 trunk
Commit 6e28f28091ff4baac405675a9858b2911f248ceba70439acd471f0eeb5611171
1 file changed +9 -2
+9 -2
--- src/wiki.c
+++ src/wiki.c
@@ -1915,11 +1915,11 @@
19151915
void wcontent_page(void){
19161916
Stmt q;
19171917
double rNow;
19181918
int showAll = P("all")!=0;
19191919
int showRid = P("showid")!=0;
1920
- int showCkBr = P("showckbr")!=0;
1920
+ int showCkBr;
19211921
19221922
login_check_credentials();
19231923
if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
19241924
style_set_current_feature("wiki");
19251925
style_header("Available Wiki Pages");
@@ -1926,11 +1926,18 @@
19261926
if( showAll ){
19271927
style_submenu_element("Active", "%R/wcontent");
19281928
}else{
19291929
style_submenu_element("All", "%R/wcontent?all=1");
19301930
}
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
+ }
19321939
wiki_standard_submenu(W_ALL_BUT(W_LIST));
19331940
db_prepare(&q, listAllWikiPages/*works-like:""*/);
19341941
@ <div class="brlist">
19351942
@ <table class='sortable' data-column-types='tKN' data-init-sort='1'>
19361943
@ <thead><tr>
19371944
--- 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

Keyboard Shortcuts

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