Fossil SCM

Fix a bug in wiki editing. Make the /info header for associated wiki be "Edit Wiki:".

drh 2020-04-17 00:15 trunk
Commit c40863abdb3a5818e98909bfb24dcab72bb2ae3dd04adfdf1dbf029dde9ecc8f
2 files changed +6 -4 +5 -1
+6 -4
--- src/info.c
+++ src/info.c
@@ -784,21 +784,23 @@
784784
@ (<a href="%R/rcvfrom?rcvid=%d(rcvid)">Rcvid %d(rcvid)</a>)</td></tr>
785785
}
786786
db_finalize(&q2);
787787
}
788788
789
- /* Only show links to read wiki pages if the users can read wiki
789
+ /* Only show links to edit wiki pages if the users can read wiki
790790
** and if the wiki pages already exist */
791
- if( g.perm.RdWiki
791
+ if( g.perm.WrWiki
792
+ && g.perm.RdWiki
793
+ && g.perm.Write
792794
&& ((okWiki = wiki_tagid2("checkin",zUuid))!=0 ||
793795
blob_size(&wiki_read_links)>0)
794796
&& db_get_boolean("wiki-about",1)
795797
){
796798
const char *zLinks = blob_str(&wiki_read_links);
797
- @ <tr><th>Wiki:</th><td>\
799
+ @ <tr><th>Edit&nbsp;Wiki:</th><td>\
798800
if( okWiki ){
799
- @ %z(href("%R/wiki?name=checkin/%s",zUuid))this checkin</a>\
801
+ @ %z(href("%R/wikiedit?name=checkin/%s",zUuid))this checkin</a>\
800802
}else if( zLinks[0] ){
801803
zLinks += 3;
802804
}
803805
@ %s(zLinks)</td></tr>
804806
}
805807
--- src/info.c
+++ src/info.c
@@ -784,21 +784,23 @@
784 @ (<a href="%R/rcvfrom?rcvid=%d(rcvid)">Rcvid %d(rcvid)</a>)</td></tr>
785 }
786 db_finalize(&q2);
787 }
788
789 /* Only show links to read wiki pages if the users can read wiki
790 ** and if the wiki pages already exist */
791 if( g.perm.RdWiki
 
 
792 && ((okWiki = wiki_tagid2("checkin",zUuid))!=0 ||
793 blob_size(&wiki_read_links)>0)
794 && db_get_boolean("wiki-about",1)
795 ){
796 const char *zLinks = blob_str(&wiki_read_links);
797 @ <tr><th>Wiki:</th><td>\
798 if( okWiki ){
799 @ %z(href("%R/wiki?name=checkin/%s",zUuid))this checkin</a>\
800 }else if( zLinks[0] ){
801 zLinks += 3;
802 }
803 @ %s(zLinks)</td></tr>
804 }
805
--- src/info.c
+++ src/info.c
@@ -784,21 +784,23 @@
784 @ (<a href="%R/rcvfrom?rcvid=%d(rcvid)">Rcvid %d(rcvid)</a>)</td></tr>
785 }
786 db_finalize(&q2);
787 }
788
789 /* Only show links to edit wiki pages if the users can read wiki
790 ** and if the wiki pages already exist */
791 if( g.perm.WrWiki
792 && g.perm.RdWiki
793 && g.perm.Write
794 && ((okWiki = wiki_tagid2("checkin",zUuid))!=0 ||
795 blob_size(&wiki_read_links)>0)
796 && db_get_boolean("wiki-about",1)
797 ){
798 const char *zLinks = blob_str(&wiki_read_links);
799 @ <tr><th>Edit&nbsp;Wiki:</th><td>\
800 if( okWiki ){
801 @ %z(href("%R/wikiedit?name=checkin/%s",zUuid))this checkin</a>\
802 }else if( zLinks[0] ){
803 zLinks += 3;
804 }
805 @ %s(zLinks)</td></tr>
806 }
807
+5 -1
--- src/manifest.c
+++ src/manifest.c
@@ -2292,11 +2292,15 @@
22922292
zComment = mprintf("%s wiki page [%h]", zPrefix, p->zWikiTitle);
22932293
break;
22942294
}
22952295
}
22962296
search_doc_touch('w',rid,p->zWikiTitle);
2297
- add_pending_crosslink('w',p->zWikiTitle);
2297
+ if( manifest_crosslink_busy ){
2298
+ add_pending_crosslink('w',p->zWikiTitle);
2299
+ }else{
2300
+ backlink_wiki_refresh(p->zWikiTitle);
2301
+ }
22982302
db_multi_exec(
22992303
"REPLACE INTO event(type,mtime,objid,user,comment,"
23002304
" bgcolor,euser,ecomment)"
23012305
"VALUES('w',%.17g,%d,%Q,%Q,"
23022306
" (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1),"
23032307
--- src/manifest.c
+++ src/manifest.c
@@ -2292,11 +2292,15 @@
2292 zComment = mprintf("%s wiki page [%h]", zPrefix, p->zWikiTitle);
2293 break;
2294 }
2295 }
2296 search_doc_touch('w',rid,p->zWikiTitle);
2297 add_pending_crosslink('w',p->zWikiTitle);
 
 
 
 
2298 db_multi_exec(
2299 "REPLACE INTO event(type,mtime,objid,user,comment,"
2300 " bgcolor,euser,ecomment)"
2301 "VALUES('w',%.17g,%d,%Q,%Q,"
2302 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1),"
2303
--- src/manifest.c
+++ src/manifest.c
@@ -2292,11 +2292,15 @@
2292 zComment = mprintf("%s wiki page [%h]", zPrefix, p->zWikiTitle);
2293 break;
2294 }
2295 }
2296 search_doc_touch('w',rid,p->zWikiTitle);
2297 if( manifest_crosslink_busy ){
2298 add_pending_crosslink('w',p->zWikiTitle);
2299 }else{
2300 backlink_wiki_refresh(p->zWikiTitle);
2301 }
2302 db_multi_exec(
2303 "REPLACE INTO event(type,mtime,objid,user,comment,"
2304 " bgcolor,euser,ecomment)"
2305 "VALUES('w',%.17g,%d,%Q,%Q,"
2306 " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1),"
2307

Keyboard Shortcuts

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