Fossil SCM

add special wiki for tickets

jkosche 2025-01-14 11:47 ticket-wiki
Commit 45419c62ea241bb90c3431b4f1ba119e5a3bfae4d1f145c1b478846ef35e822f
1 file changed +15
+15
--- src/wiki.c
+++ src/wiki.c
@@ -410,10 +410,11 @@
410410
# define WIKITYPE_UNKNOWN (-1)
411411
# define WIKITYPE_NORMAL 0
412412
# define WIKITYPE_BRANCH 1
413413
# define WIKITYPE_CHECKIN 2
414414
# define WIKITYPE_TAG 3
415
+# define WIKITYPE_TICKET 4
415416
#endif
416417
417418
/*
418419
** Figure out what type of wiki page we are dealing with.
419420
*/
@@ -429,10 +430,13 @@
429430
if( sqlite3_strglob("branch/*", zPageName)==0 ){
430431
return WIKITYPE_BRANCH;
431432
}else
432433
if( sqlite3_strglob("tag/*", zPageName)==0 ){
433434
return WIKITYPE_TAG;
435
+ }else
436
+ if( sqlite3_strglob("ticket/*", zPageName)==0 ){
437
+ return WIKITYPE_TICKET;
434438
}
435439
return WIKITYPE_NORMAL;
436440
}
437441
438442
/*
@@ -442,10 +446,11 @@
442446
const char * wiki_page_type_name(const char *zPageName){
443447
switch(wiki_page_type(zPageName)){
444448
case WIKITYPE_CHECKIN: return "checkin";
445449
case WIKITYPE_BRANCH: return "branch";
446450
case WIKITYPE_TAG: return "tag";
451
+ case WIKITYPE_TICKET: return "ticket";
447452
case WIKITYPE_NORMAL:
448453
default: return "normal";
449454
}
450455
}
451456
@@ -500,10 +505,20 @@
500505
}else{
501506
style_header("Notes About Tag %h", zPageName);
502507
style_submenu_element("Tag Timeline","%R/timeline?t=%t",zPageName);
503508
}
504509
break;
510
+ }
511
+ case WIKITYPE_TICKET: {
512
+ zPageName += 7;
513
+ if( zExtra[0]==0 && !P("p") ){
514
+ cgi_redirectf("%R/tktview/%s",zPageName);
515
+ }else{
516
+ style_header("Notes About Ticket %h", zPageName);
517
+ style_submenu_element("Ticket","%R/tktview/%s",zPageName);
518
+ }
519
+ break;
505520
}
506521
}
507522
return eType;
508523
}
509524
510525
--- src/wiki.c
+++ src/wiki.c
@@ -410,10 +410,11 @@
410 # define WIKITYPE_UNKNOWN (-1)
411 # define WIKITYPE_NORMAL 0
412 # define WIKITYPE_BRANCH 1
413 # define WIKITYPE_CHECKIN 2
414 # define WIKITYPE_TAG 3
 
415 #endif
416
417 /*
418 ** Figure out what type of wiki page we are dealing with.
419 */
@@ -429,10 +430,13 @@
429 if( sqlite3_strglob("branch/*", zPageName)==0 ){
430 return WIKITYPE_BRANCH;
431 }else
432 if( sqlite3_strglob("tag/*", zPageName)==0 ){
433 return WIKITYPE_TAG;
 
 
 
434 }
435 return WIKITYPE_NORMAL;
436 }
437
438 /*
@@ -442,10 +446,11 @@
442 const char * wiki_page_type_name(const char *zPageName){
443 switch(wiki_page_type(zPageName)){
444 case WIKITYPE_CHECKIN: return "checkin";
445 case WIKITYPE_BRANCH: return "branch";
446 case WIKITYPE_TAG: return "tag";
 
447 case WIKITYPE_NORMAL:
448 default: return "normal";
449 }
450 }
451
@@ -500,10 +505,20 @@
500 }else{
501 style_header("Notes About Tag %h", zPageName);
502 style_submenu_element("Tag Timeline","%R/timeline?t=%t",zPageName);
503 }
504 break;
 
 
 
 
 
 
 
 
 
 
505 }
506 }
507 return eType;
508 }
509
510
--- src/wiki.c
+++ src/wiki.c
@@ -410,10 +410,11 @@
410 # define WIKITYPE_UNKNOWN (-1)
411 # define WIKITYPE_NORMAL 0
412 # define WIKITYPE_BRANCH 1
413 # define WIKITYPE_CHECKIN 2
414 # define WIKITYPE_TAG 3
415 # define WIKITYPE_TICKET 4
416 #endif
417
418 /*
419 ** Figure out what type of wiki page we are dealing with.
420 */
@@ -429,10 +430,13 @@
430 if( sqlite3_strglob("branch/*", zPageName)==0 ){
431 return WIKITYPE_BRANCH;
432 }else
433 if( sqlite3_strglob("tag/*", zPageName)==0 ){
434 return WIKITYPE_TAG;
435 }else
436 if( sqlite3_strglob("ticket/*", zPageName)==0 ){
437 return WIKITYPE_TICKET;
438 }
439 return WIKITYPE_NORMAL;
440 }
441
442 /*
@@ -442,10 +446,11 @@
446 const char * wiki_page_type_name(const char *zPageName){
447 switch(wiki_page_type(zPageName)){
448 case WIKITYPE_CHECKIN: return "checkin";
449 case WIKITYPE_BRANCH: return "branch";
450 case WIKITYPE_TAG: return "tag";
451 case WIKITYPE_TICKET: return "ticket";
452 case WIKITYPE_NORMAL:
453 default: return "normal";
454 }
455 }
456
@@ -500,10 +505,20 @@
505 }else{
506 style_header("Notes About Tag %h", zPageName);
507 style_submenu_element("Tag Timeline","%R/timeline?t=%t",zPageName);
508 }
509 break;
510 }
511 case WIKITYPE_TICKET: {
512 zPageName += 7;
513 if( zExtra[0]==0 && !P("p") ){
514 cgi_redirectf("%R/tktview/%s",zPageName);
515 }else{
516 style_header("Notes About Ticket %h", zPageName);
517 style_submenu_element("Ticket","%R/tktview/%s",zPageName);
518 }
519 break;
520 }
521 }
522 return eType;
523 }
524
525

Keyboard Shortcuts

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