Fossil SCM

Merge the styling changes from trunk into the chatroom-dev branch.

drh 2020-12-22 20:06 chatroom-dev merge
Commit b8d6319b5a15e440b47dc9059fc2b4c9b7b5d8b6758fafeb827402ae292b163a
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -14,11 +14,11 @@
1414
if(!e) throw new Error("Expecting element with ID "+x);
1515
else return e;
1616
}
1717
</script>
1818
</head>
19
- <body data-spy="scroll" data-target=".sidebar">
19
+ <body data-spy="scroll" data-target=".sidebar" class="$current_feature">
2020
<div id="wrap">
2121
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
2222
<div class="container">
2323
<div class="navbar-header">
2424
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
2525
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -14,11 +14,11 @@
14 if(!e) throw new Error("Expecting element with ID "+x);
15 else return e;
16 }
17 </script>
18 </head>
19 <body data-spy="scroll" data-target=".sidebar">
20 <div id="wrap">
21 <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
22 <div class="container">
23 <div class="navbar-header">
24 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
25
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -14,11 +14,11 @@
14 if(!e) throw new Error("Expecting element with ID "+x);
15 else return e;
16 }
17 </script>
18 </head>
19 <body data-spy="scroll" data-target=".sidebar" class="$current_feature">
20 <div id="wrap">
21 <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
22 <div class="container">
23 <div class="navbar-header">
24 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
25
+25 -14
--- src/alerts.c
+++ src/alerts.c
@@ -171,13 +171,14 @@
171171
**
172172
** If the subscriber table does exist, return 0 without doing anything.
173173
*/
174174
static int alert_webpages_disabled(void){
175175
if( alert_tables_exist() ) return 0;
176
+ style_set_current_feature("alerts");
176177
style_header("Email Alerts Are Disabled");
177178
@ <p>Email alerts are disabled on this server</p>
178
- style_finish_page("alerts");
179
+ style_finish_page();
179180
return 1;
180181
}
181182
182183
/*
183184
** Insert a "Subscriber List" submenu link if the current user
@@ -216,10 +217,11 @@
216217
}
217218
db_begin_transaction();
218219
219220
alert_submenu_common();
220221
style_submenu_element("Send Announcement","%R/announce");
222
+ style_set_current_feature("alerts");
221223
style_header("Email Notification Setup");
222224
@ <h1>Status</h1>
223225
@ <table class="label-value">
224226
if( alert_enabled() ){
225227
stats_for_email();
@@ -308,11 +310,11 @@
308310
@ <hr>
309311
310312
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
311313
@ </div></form>
312314
db_end_transaction(0);
313
- style_finish_page("alerts");
315
+ style_finish_page();
314316
}
315317
316318
#if 0
317319
/*
318320
** Encode pMsg as MIME base64 and append it to pOut
@@ -1364,10 +1366,11 @@
13641366
}
13651367
if( !g.perm.Admin && !db_get_boolean("anon-subscribe",1) ){
13661368
register_page();
13671369
return;
13681370
}
1371
+ style_set_current_feature("alerts");
13691372
alert_submenu_common();
13701373
needCaptcha = !login_is_individual();
13711374
if( P("submit")
13721375
&& cgi_csrf_safe(1)
13731376
&& subscribe_error_check(&eErr,&zErr,needCaptcha)
@@ -1435,11 +1438,11 @@
14351438
@ <p>An email has been sent to "%h(zEAddr)". That email contains a
14361439
@ hyperlink that you must click to activate your
14371440
@ subscription.</p>
14381441
}
14391442
alert_sender_free(pSender);
1440
- style_finish_page("alerts");
1443
+ style_finish_page();
14411444
}
14421445
return;
14431446
}
14441447
style_header("Signup For Email Alerts");
14451448
if( P("submit")==0 ){
@@ -1552,11 +1555,11 @@
15521555
@ Enter the 8 characters above in the "Security Code" box<br/>
15531556
@ </td></tr></table></div>
15541557
}
15551558
@ </form>
15561559
fossil_free(zErr);
1557
- style_finish_page("alerts");
1560
+ style_finish_page();
15581561
}
15591562
15601563
/*
15611564
** Either shutdown or completely delete a subscription entry given
15621565
** by the hex value zName. Then paint a webpage that explains that
@@ -1572,10 +1575,11 @@
15721575
if( db_step(&q)==SQLITE_ROW ){
15731576
zEmail = db_column_text(&q, 0);
15741577
zLogin = db_column_text(&q, 1);
15751578
uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", zLogin);
15761579
}
1580
+ style_set_current_feature("alerts");
15771581
if( zEmail==0 ){
15781582
style_header("Unsubscribe Fail");
15791583
@ <p>Unable to locate a subscriber with the requested key</p>
15801584
}else{
15811585
@@ -1590,11 +1594,11 @@
15901594
@ <a href="%R/setup_uedit?id=%d(uid)">edit or delete
15911595
@ the corresponding user "%h(zLogin)"</a></p>
15921596
}
15931597
}
15941598
db_finalize(&q);
1595
- style_finish_page("alerts");
1599
+ style_finish_page();
15961600
return;
15971601
}
15981602
15991603
/*
16001604
** WEBPAGE: alerts
@@ -1737,10 +1741,11 @@
17371741
alert_unsubscribe(sid);
17381742
db_commit_transaction();
17391743
return;
17401744
}
17411745
}
1746
+ style_set_current_feature("alerts");
17421747
style_header("Update Subscription");
17431748
db_prepare(&q,
17441749
"SELECT"
17451750
" semail," /* 0 */
17461751
" sverified," /* 1 */
@@ -1914,11 +1919,11 @@
19141919
@ </tr>
19151920
@ </table>
19161921
@ </form>
19171922
fossil_free(zErr);
19181923
db_finalize(&q);
1919
- style_finish_page("alerts");
1924
+ style_finish_page();
19201925
db_commit_transaction();
19211926
return;
19221927
}
19231928
19241929
/* This is the message that gets sent to describe how to change
@@ -1977,10 +1982,12 @@
19771982
if( login_is_individual() ){
19781983
cgi_redirectf("%R/alerts");
19791984
return;
19801985
}
19811986
1987
+ style_set_current_feature("alerts");
1988
+
19821989
zEAddr = PD("e","");
19831990
dx = atoi(PD("dx","0"));
19841991
bSubmit = P("submit")!=0 && P("e")!=0 && cgi_csrf_safe(1);
19851992
if( bSubmit ){
19861993
if( !captcha_is_correct(1) ){
@@ -2021,11 +2028,11 @@
20212028
}else{
20222029
@ <p>An email has been sent to "%h(zEAddr)" that explains how to
20232030
@ unsubscribe and/or modify your subscription settings</p>
20242031
}
20252032
alert_sender_free(pSender);
2026
- style_finish_page("alerts");
2033
+ style_finish_page();
20272034
return;
20282035
}
20292036
20302037
/* Non-logged-in users have to enter an email address to which is
20312038
** sent a message containing the unsubscribe link.
@@ -2071,11 +2078,11 @@
20712078
@ </pre>
20722079
@ Enter the 8 characters above in the "Security Code" box<br/>
20732080
@ </td></tr></table></div>
20742081
@ </form>
20752082
fossil_free(zErr);
2076
- style_finish_page("alerts");
2083
+ style_finish_page();
20772084
}
20782085
20792086
/*
20802087
** WEBPAGE: subscribers
20812088
**
@@ -2098,10 +2105,11 @@
20982105
login_needed(0);
20992106
return;
21002107
}
21012108
alert_submenu_common();
21022109
style_submenu_element("Users","setup_ulist");
2110
+ style_set_current_feature("alerts");
21032111
style_header("Subscriber List");
21042112
nTotal = db_int(0, "SELECT count(*) FROM subscriber");
21052113
nPending = db_int(0, "SELECT count(*) FROM subscriber WHERE NOT sverified");
21062114
if( nPending>0 && P("purge") && cgi_csrf_safe(0) ){
21072115
int nNewPending;
@@ -2182,11 +2190,11 @@
21822190
@ </tr>
21832191
}
21842192
@ </tbody></table>
21852193
db_finalize(&q);
21862194
style_table_sorter();
2187
- style_finish_page("alerts");
2195
+ style_finish_page();
21882196
}
21892197
21902198
#if LOCAL_INTERFACE
21912199
/*
21922200
** A single event that might appear in an alert is recorded as an
@@ -2799,14 +2807,15 @@
27992807
unsigned int uSeed = 0;
28002808
const char *zDecoded;
28012809
char *zCaptcha = 0;
28022810
28032811
login_check_credentials();
2812
+ style_set_current_feature("alerts");
28042813
if( zAdminEmail==0 || zAdminEmail[0]==0 ){
28052814
style_header("Outbound Email Disabled");
28062815
@ <p>Outbound email is disabled on this repository
2807
- style_finish_page("alerts");
2816
+ style_finish_page();
28082817
return;
28092818
}
28102819
if( P("submit")!=0
28112820
&& P("subject")!=0
28122821
&& P("msg")!=0
@@ -2834,18 +2843,19 @@
28342843
}else{
28352844
@ <p>Your message has been sent to the repository administrator.
28362845
@ Thank you for your input.</p>
28372846
}
28382847
alert_sender_free(pSender);
2839
- style_finish_page("alerts");
2848
+ style_finish_page();
28402849
return;
28412850
}
28422851
if( captcha_needed() ){
28432852
uSeed = captcha_seed();
28442853
zDecoded = captcha_decode(uSeed);
28452854
zCaptcha = captcha_render(zDecoded);
28462855
}
2856
+ style_set_current_feature("alerts");
28472857
style_header("Message To Administrator");
28482858
form_begin(0, "%R/contact_admin");
28492859
@ <p>Enter a message to the repository administrator below:</p>
28502860
@ <table class="subscribe">
28512861
if( zCaptcha ){
@@ -2881,11 +2891,11 @@
28812891
@ </pre>
28822892
@ Enter the 8 characters above in the "Security Code" box<br/>
28832893
@ </td></tr></table></div>
28842894
}
28852895
@ </form>
2886
- style_finish_page("alerts");
2896
+ style_finish_page();
28872897
}
28882898
28892899
/*
28902900
** Send an annoucement message described by query parameter.
28912901
** Permission to do this has already been verified.
@@ -2971,10 +2981,11 @@
29712981
login_check_credentials();
29722982
if( !g.perm.Announce ){
29732983
login_needed(0);
29742984
return;
29752985
}
2986
+ style_set_current_feature("alerts");
29762987
if( fossil_strcmp(P("name"),"test1")==0 ){
29772988
/* Visit the /announce/test1 page to see the CGI variables */
29782989
@ <p style='border: 1px solid black; padding: 1ex;'>
29792990
cgi_print_all(0, 0);
29802991
@ </p>
@@ -2989,11 +3000,11 @@
29893000
@ </pre></blockquote>
29903001
}else{
29913002
@ <p>The announcement has been sent.
29923003
@ <a href="%h(PD("REQUEST_URI","/"))">Send another</a></p>
29933004
}
2994
- style_finish_page("alerts");
3005
+ style_finish_page();
29953006
return;
29963007
} else if( !alert_enabled() ){
29973008
style_header("Cannot Send Announcement");
29983009
@ <p>Either you have no subscribers yet, or email alerts are not yet
29993010
@ <a href="https://fossil-scm.org/fossil/doc/trunk/www/alerts.md">set up</a>
@@ -3043,7 +3054,7 @@
30433054
@ <td><input type="submit" name="submit" value="Send Message">
30443055
}
30453056
@ </tr>
30463057
@ </table>
30473058
@ </form>
3048
- style_finish_page("alerts");
3059
+ style_finish_page();
30493060
}
30503061
--- src/alerts.c
+++ src/alerts.c
@@ -171,13 +171,14 @@
171 **
172 ** If the subscriber table does exist, return 0 without doing anything.
173 */
174 static int alert_webpages_disabled(void){
175 if( alert_tables_exist() ) return 0;
 
176 style_header("Email Alerts Are Disabled");
177 @ <p>Email alerts are disabled on this server</p>
178 style_finish_page("alerts");
179 return 1;
180 }
181
182 /*
183 ** Insert a "Subscriber List" submenu link if the current user
@@ -216,10 +217,11 @@
216 }
217 db_begin_transaction();
218
219 alert_submenu_common();
220 style_submenu_element("Send Announcement","%R/announce");
 
221 style_header("Email Notification Setup");
222 @ <h1>Status</h1>
223 @ <table class="label-value">
224 if( alert_enabled() ){
225 stats_for_email();
@@ -308,11 +310,11 @@
308 @ <hr>
309
310 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
311 @ </div></form>
312 db_end_transaction(0);
313 style_finish_page("alerts");
314 }
315
316 #if 0
317 /*
318 ** Encode pMsg as MIME base64 and append it to pOut
@@ -1364,10 +1366,11 @@
1364 }
1365 if( !g.perm.Admin && !db_get_boolean("anon-subscribe",1) ){
1366 register_page();
1367 return;
1368 }
 
1369 alert_submenu_common();
1370 needCaptcha = !login_is_individual();
1371 if( P("submit")
1372 && cgi_csrf_safe(1)
1373 && subscribe_error_check(&eErr,&zErr,needCaptcha)
@@ -1435,11 +1438,11 @@
1435 @ <p>An email has been sent to "%h(zEAddr)". That email contains a
1436 @ hyperlink that you must click to activate your
1437 @ subscription.</p>
1438 }
1439 alert_sender_free(pSender);
1440 style_finish_page("alerts");
1441 }
1442 return;
1443 }
1444 style_header("Signup For Email Alerts");
1445 if( P("submit")==0 ){
@@ -1552,11 +1555,11 @@
1552 @ Enter the 8 characters above in the "Security Code" box<br/>
1553 @ </td></tr></table></div>
1554 }
1555 @ </form>
1556 fossil_free(zErr);
1557 style_finish_page("alerts");
1558 }
1559
1560 /*
1561 ** Either shutdown or completely delete a subscription entry given
1562 ** by the hex value zName. Then paint a webpage that explains that
@@ -1572,10 +1575,11 @@
1572 if( db_step(&q)==SQLITE_ROW ){
1573 zEmail = db_column_text(&q, 0);
1574 zLogin = db_column_text(&q, 1);
1575 uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", zLogin);
1576 }
 
1577 if( zEmail==0 ){
1578 style_header("Unsubscribe Fail");
1579 @ <p>Unable to locate a subscriber with the requested key</p>
1580 }else{
1581
@@ -1590,11 +1594,11 @@
1590 @ <a href="%R/setup_uedit?id=%d(uid)">edit or delete
1591 @ the corresponding user "%h(zLogin)"</a></p>
1592 }
1593 }
1594 db_finalize(&q);
1595 style_finish_page("alerts");
1596 return;
1597 }
1598
1599 /*
1600 ** WEBPAGE: alerts
@@ -1737,10 +1741,11 @@
1737 alert_unsubscribe(sid);
1738 db_commit_transaction();
1739 return;
1740 }
1741 }
 
1742 style_header("Update Subscription");
1743 db_prepare(&q,
1744 "SELECT"
1745 " semail," /* 0 */
1746 " sverified," /* 1 */
@@ -1914,11 +1919,11 @@
1914 @ </tr>
1915 @ </table>
1916 @ </form>
1917 fossil_free(zErr);
1918 db_finalize(&q);
1919 style_finish_page("alerts");
1920 db_commit_transaction();
1921 return;
1922 }
1923
1924 /* This is the message that gets sent to describe how to change
@@ -1977,10 +1982,12 @@
1977 if( login_is_individual() ){
1978 cgi_redirectf("%R/alerts");
1979 return;
1980 }
1981
 
 
1982 zEAddr = PD("e","");
1983 dx = atoi(PD("dx","0"));
1984 bSubmit = P("submit")!=0 && P("e")!=0 && cgi_csrf_safe(1);
1985 if( bSubmit ){
1986 if( !captcha_is_correct(1) ){
@@ -2021,11 +2028,11 @@
2021 }else{
2022 @ <p>An email has been sent to "%h(zEAddr)" that explains how to
2023 @ unsubscribe and/or modify your subscription settings</p>
2024 }
2025 alert_sender_free(pSender);
2026 style_finish_page("alerts");
2027 return;
2028 }
2029
2030 /* Non-logged-in users have to enter an email address to which is
2031 ** sent a message containing the unsubscribe link.
@@ -2071,11 +2078,11 @@
2071 @ </pre>
2072 @ Enter the 8 characters above in the "Security Code" box<br/>
2073 @ </td></tr></table></div>
2074 @ </form>
2075 fossil_free(zErr);
2076 style_finish_page("alerts");
2077 }
2078
2079 /*
2080 ** WEBPAGE: subscribers
2081 **
@@ -2098,10 +2105,11 @@
2098 login_needed(0);
2099 return;
2100 }
2101 alert_submenu_common();
2102 style_submenu_element("Users","setup_ulist");
 
2103 style_header("Subscriber List");
2104 nTotal = db_int(0, "SELECT count(*) FROM subscriber");
2105 nPending = db_int(0, "SELECT count(*) FROM subscriber WHERE NOT sverified");
2106 if( nPending>0 && P("purge") && cgi_csrf_safe(0) ){
2107 int nNewPending;
@@ -2182,11 +2190,11 @@
2182 @ </tr>
2183 }
2184 @ </tbody></table>
2185 db_finalize(&q);
2186 style_table_sorter();
2187 style_finish_page("alerts");
2188 }
2189
2190 #if LOCAL_INTERFACE
2191 /*
2192 ** A single event that might appear in an alert is recorded as an
@@ -2799,14 +2807,15 @@
2799 unsigned int uSeed = 0;
2800 const char *zDecoded;
2801 char *zCaptcha = 0;
2802
2803 login_check_credentials();
 
2804 if( zAdminEmail==0 || zAdminEmail[0]==0 ){
2805 style_header("Outbound Email Disabled");
2806 @ <p>Outbound email is disabled on this repository
2807 style_finish_page("alerts");
2808 return;
2809 }
2810 if( P("submit")!=0
2811 && P("subject")!=0
2812 && P("msg")!=0
@@ -2834,18 +2843,19 @@
2834 }else{
2835 @ <p>Your message has been sent to the repository administrator.
2836 @ Thank you for your input.</p>
2837 }
2838 alert_sender_free(pSender);
2839 style_finish_page("alerts");
2840 return;
2841 }
2842 if( captcha_needed() ){
2843 uSeed = captcha_seed();
2844 zDecoded = captcha_decode(uSeed);
2845 zCaptcha = captcha_render(zDecoded);
2846 }
 
2847 style_header("Message To Administrator");
2848 form_begin(0, "%R/contact_admin");
2849 @ <p>Enter a message to the repository administrator below:</p>
2850 @ <table class="subscribe">
2851 if( zCaptcha ){
@@ -2881,11 +2891,11 @@
2881 @ </pre>
2882 @ Enter the 8 characters above in the "Security Code" box<br/>
2883 @ </td></tr></table></div>
2884 }
2885 @ </form>
2886 style_finish_page("alerts");
2887 }
2888
2889 /*
2890 ** Send an annoucement message described by query parameter.
2891 ** Permission to do this has already been verified.
@@ -2971,10 +2981,11 @@
2971 login_check_credentials();
2972 if( !g.perm.Announce ){
2973 login_needed(0);
2974 return;
2975 }
 
2976 if( fossil_strcmp(P("name"),"test1")==0 ){
2977 /* Visit the /announce/test1 page to see the CGI variables */
2978 @ <p style='border: 1px solid black; padding: 1ex;'>
2979 cgi_print_all(0, 0);
2980 @ </p>
@@ -2989,11 +3000,11 @@
2989 @ </pre></blockquote>
2990 }else{
2991 @ <p>The announcement has been sent.
2992 @ <a href="%h(PD("REQUEST_URI","/"))">Send another</a></p>
2993 }
2994 style_finish_page("alerts");
2995 return;
2996 } else if( !alert_enabled() ){
2997 style_header("Cannot Send Announcement");
2998 @ <p>Either you have no subscribers yet, or email alerts are not yet
2999 @ <a href="https://fossil-scm.org/fossil/doc/trunk/www/alerts.md">set up</a>
@@ -3043,7 +3054,7 @@
3043 @ <td><input type="submit" name="submit" value="Send Message">
3044 }
3045 @ </tr>
3046 @ </table>
3047 @ </form>
3048 style_finish_page("alerts");
3049 }
3050
--- src/alerts.c
+++ src/alerts.c
@@ -171,13 +171,14 @@
171 **
172 ** If the subscriber table does exist, return 0 without doing anything.
173 */
174 static int alert_webpages_disabled(void){
175 if( alert_tables_exist() ) return 0;
176 style_set_current_feature("alerts");
177 style_header("Email Alerts Are Disabled");
178 @ <p>Email alerts are disabled on this server</p>
179 style_finish_page();
180 return 1;
181 }
182
183 /*
184 ** Insert a "Subscriber List" submenu link if the current user
@@ -216,10 +217,11 @@
217 }
218 db_begin_transaction();
219
220 alert_submenu_common();
221 style_submenu_element("Send Announcement","%R/announce");
222 style_set_current_feature("alerts");
223 style_header("Email Notification Setup");
224 @ <h1>Status</h1>
225 @ <table class="label-value">
226 if( alert_enabled() ){
227 stats_for_email();
@@ -308,11 +310,11 @@
310 @ <hr>
311
312 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
313 @ </div></form>
314 db_end_transaction(0);
315 style_finish_page();
316 }
317
318 #if 0
319 /*
320 ** Encode pMsg as MIME base64 and append it to pOut
@@ -1364,10 +1366,11 @@
1366 }
1367 if( !g.perm.Admin && !db_get_boolean("anon-subscribe",1) ){
1368 register_page();
1369 return;
1370 }
1371 style_set_current_feature("alerts");
1372 alert_submenu_common();
1373 needCaptcha = !login_is_individual();
1374 if( P("submit")
1375 && cgi_csrf_safe(1)
1376 && subscribe_error_check(&eErr,&zErr,needCaptcha)
@@ -1435,11 +1438,11 @@
1438 @ <p>An email has been sent to "%h(zEAddr)". That email contains a
1439 @ hyperlink that you must click to activate your
1440 @ subscription.</p>
1441 }
1442 alert_sender_free(pSender);
1443 style_finish_page();
1444 }
1445 return;
1446 }
1447 style_header("Signup For Email Alerts");
1448 if( P("submit")==0 ){
@@ -1552,11 +1555,11 @@
1555 @ Enter the 8 characters above in the "Security Code" box<br/>
1556 @ </td></tr></table></div>
1557 }
1558 @ </form>
1559 fossil_free(zErr);
1560 style_finish_page();
1561 }
1562
1563 /*
1564 ** Either shutdown or completely delete a subscription entry given
1565 ** by the hex value zName. Then paint a webpage that explains that
@@ -1572,10 +1575,11 @@
1575 if( db_step(&q)==SQLITE_ROW ){
1576 zEmail = db_column_text(&q, 0);
1577 zLogin = db_column_text(&q, 1);
1578 uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", zLogin);
1579 }
1580 style_set_current_feature("alerts");
1581 if( zEmail==0 ){
1582 style_header("Unsubscribe Fail");
1583 @ <p>Unable to locate a subscriber with the requested key</p>
1584 }else{
1585
@@ -1590,11 +1594,11 @@
1594 @ <a href="%R/setup_uedit?id=%d(uid)">edit or delete
1595 @ the corresponding user "%h(zLogin)"</a></p>
1596 }
1597 }
1598 db_finalize(&q);
1599 style_finish_page();
1600 return;
1601 }
1602
1603 /*
1604 ** WEBPAGE: alerts
@@ -1737,10 +1741,11 @@
1741 alert_unsubscribe(sid);
1742 db_commit_transaction();
1743 return;
1744 }
1745 }
1746 style_set_current_feature("alerts");
1747 style_header("Update Subscription");
1748 db_prepare(&q,
1749 "SELECT"
1750 " semail," /* 0 */
1751 " sverified," /* 1 */
@@ -1914,11 +1919,11 @@
1919 @ </tr>
1920 @ </table>
1921 @ </form>
1922 fossil_free(zErr);
1923 db_finalize(&q);
1924 style_finish_page();
1925 db_commit_transaction();
1926 return;
1927 }
1928
1929 /* This is the message that gets sent to describe how to change
@@ -1977,10 +1982,12 @@
1982 if( login_is_individual() ){
1983 cgi_redirectf("%R/alerts");
1984 return;
1985 }
1986
1987 style_set_current_feature("alerts");
1988
1989 zEAddr = PD("e","");
1990 dx = atoi(PD("dx","0"));
1991 bSubmit = P("submit")!=0 && P("e")!=0 && cgi_csrf_safe(1);
1992 if( bSubmit ){
1993 if( !captcha_is_correct(1) ){
@@ -2021,11 +2028,11 @@
2028 }else{
2029 @ <p>An email has been sent to "%h(zEAddr)" that explains how to
2030 @ unsubscribe and/or modify your subscription settings</p>
2031 }
2032 alert_sender_free(pSender);
2033 style_finish_page();
2034 return;
2035 }
2036
2037 /* Non-logged-in users have to enter an email address to which is
2038 ** sent a message containing the unsubscribe link.
@@ -2071,11 +2078,11 @@
2078 @ </pre>
2079 @ Enter the 8 characters above in the "Security Code" box<br/>
2080 @ </td></tr></table></div>
2081 @ </form>
2082 fossil_free(zErr);
2083 style_finish_page();
2084 }
2085
2086 /*
2087 ** WEBPAGE: subscribers
2088 **
@@ -2098,10 +2105,11 @@
2105 login_needed(0);
2106 return;
2107 }
2108 alert_submenu_common();
2109 style_submenu_element("Users","setup_ulist");
2110 style_set_current_feature("alerts");
2111 style_header("Subscriber List");
2112 nTotal = db_int(0, "SELECT count(*) FROM subscriber");
2113 nPending = db_int(0, "SELECT count(*) FROM subscriber WHERE NOT sverified");
2114 if( nPending>0 && P("purge") && cgi_csrf_safe(0) ){
2115 int nNewPending;
@@ -2182,11 +2190,11 @@
2190 @ </tr>
2191 }
2192 @ </tbody></table>
2193 db_finalize(&q);
2194 style_table_sorter();
2195 style_finish_page();
2196 }
2197
2198 #if LOCAL_INTERFACE
2199 /*
2200 ** A single event that might appear in an alert is recorded as an
@@ -2799,14 +2807,15 @@
2807 unsigned int uSeed = 0;
2808 const char *zDecoded;
2809 char *zCaptcha = 0;
2810
2811 login_check_credentials();
2812 style_set_current_feature("alerts");
2813 if( zAdminEmail==0 || zAdminEmail[0]==0 ){
2814 style_header("Outbound Email Disabled");
2815 @ <p>Outbound email is disabled on this repository
2816 style_finish_page();
2817 return;
2818 }
2819 if( P("submit")!=0
2820 && P("subject")!=0
2821 && P("msg")!=0
@@ -2834,18 +2843,19 @@
2843 }else{
2844 @ <p>Your message has been sent to the repository administrator.
2845 @ Thank you for your input.</p>
2846 }
2847 alert_sender_free(pSender);
2848 style_finish_page();
2849 return;
2850 }
2851 if( captcha_needed() ){
2852 uSeed = captcha_seed();
2853 zDecoded = captcha_decode(uSeed);
2854 zCaptcha = captcha_render(zDecoded);
2855 }
2856 style_set_current_feature("alerts");
2857 style_header("Message To Administrator");
2858 form_begin(0, "%R/contact_admin");
2859 @ <p>Enter a message to the repository administrator below:</p>
2860 @ <table class="subscribe">
2861 if( zCaptcha ){
@@ -2881,11 +2891,11 @@
2891 @ </pre>
2892 @ Enter the 8 characters above in the "Security Code" box<br/>
2893 @ </td></tr></table></div>
2894 }
2895 @ </form>
2896 style_finish_page();
2897 }
2898
2899 /*
2900 ** Send an annoucement message described by query parameter.
2901 ** Permission to do this has already been verified.
@@ -2971,10 +2981,11 @@
2981 login_check_credentials();
2982 if( !g.perm.Announce ){
2983 login_needed(0);
2984 return;
2985 }
2986 style_set_current_feature("alerts");
2987 if( fossil_strcmp(P("name"),"test1")==0 ){
2988 /* Visit the /announce/test1 page to see the CGI variables */
2989 @ <p style='border: 1px solid black; padding: 1ex;'>
2990 cgi_print_all(0, 0);
2991 @ </p>
@@ -2989,11 +3000,11 @@
3000 @ </pre></blockquote>
3001 }else{
3002 @ <p>The announcement has been sent.
3003 @ <a href="%h(PD("REQUEST_URI","/"))">Send another</a></p>
3004 }
3005 style_finish_page();
3006 return;
3007 } else if( !alert_enabled() ){
3008 style_header("Cannot Send Announcement");
3009 @ <p>Either you have no subscribers yet, or email alerts are not yet
3010 @ <a href="https://fossil-scm.org/fossil/doc/trunk/www/alerts.md">set up</a>
@@ -3043,7 +3054,7 @@
3054 @ <td><input type="submit" name="submit" value="Send Message">
3055 }
3056 @ </tr>
3057 @ </table>
3058 @ </form>
3059 style_finish_page();
3060 }
3061
+9 -5
--- src/attach.c
+++ src/attach.c
@@ -45,10 +45,11 @@
4545
Blob sql;
4646
Stmt q;
4747
4848
if( zPage && zTkt ) zTkt = 0;
4949
login_check_credentials();
50
+ style_set_current_feature("attach");
5051
blob_zero(&sql);
5152
blob_append_sql(&sql,
5253
"SELECT datetime(mtime,toLocal()), src, target, filename,"
5354
" comment, user,"
5455
" (SELECT uuid FROM blob WHERE rid=attachid), attachid,"
@@ -145,11 +146,11 @@
145146
hyperlink_to_date(zDate, ".");
146147
free(zUrlTail);
147148
}
148149
db_finalize(&q);
149150
@ </ol>
150
- style_finish_page("attach");
151
+ style_finish_page();
151152
return;
152153
}
153154
154155
/*
155156
** WEBPAGE: attachdownload
@@ -176,10 +177,11 @@
176177
int attachid = atoi(PD("attachid","0"));
177178
char *zUUID;
178179
179180
if( zFile==0 ) fossil_redirect_home();
180181
login_check_credentials();
182
+ style_set_current_feature("attach");
181183
if( zPage ){
182184
if( g.perm.RdWiki==0 ){ login_needed(g.anon.RdWiki); return; }
183185
zTarget = zPage;
184186
}else if( zTkt ){
185187
if( g.perm.RdTkt==0 ){ login_needed(g.anon.RdTkt); return; }
@@ -205,16 +207,16 @@
205207
);
206208
}
207209
if( zUUID==0 || zUUID[0]==0 ){
208210
style_header("No Such Attachment");
209211
@ No such attachment....
210
- style_finish_page("attach");
212
+ style_finish_page();
211213
return;
212214
}else if( zUUID[0]=='x' ){
213215
style_header("Missing");
214216
@ Attachment has been deleted
215
- style_finish_page("attach");
217
+ style_finish_page();
216218
return;
217219
}else{
218220
g.perm.Read = 1;
219221
cgi_replace_parameter("name",zUUID);
220222
if( fossil_strcmp(g.zPath,"attachview")==0 ){
@@ -386,10 +388,11 @@
386388
(zPage!=0 && wiki_need_moderation(0));
387389
const char *zComment = PD("comment", "");
388390
attach_commit(zName, zTarget, aContent, szContent, needModerator, zComment);
389391
cgi_redirect(zFrom);
390392
}
393
+ style_set_current_feature("attach");
391394
style_header("Add Attachment");
392395
if( !goodCaptcha ){
393396
@ <p class="generalError">Error: Incorrect security code.</p>
394397
}
395398
@ <h2>Add Attachment To %s(zTargetType)</h2>
@@ -410,11 +413,11 @@
410413
@ <input type="submit" name="ok" value="Add Attachment" />
411414
@ <input type="submit" name="cancel" value="Cancel" />
412415
@ </div>
413416
captcha_generate(0);
414417
@ </form>
415
- style_finish_page("attach");
418
+ style_finish_page();
416419
fossil_free(zTargetType);
417420
}
418421
419422
/*
420423
** WEBPAGE: ainfo
@@ -539,10 +542,11 @@
539542
}
540543
if( strcmp(zModAction,"approve")==0 ){
541544
moderation_approve('a', rid);
542545
}
543546
}
547
+ style_set_current_feature("attach");
544548
style_header("Attachment Details");
545549
style_submenu_element("Raw", "%R/artifact/%s", zUuid);
546550
if(fShowContent){
547551
style_submenu_element("Line Numbers", "%R/ainfo/%s%s", zUuid,
548552
((zLn&&*zLn) ? "" : "?ln=0"));
@@ -622,11 +626,11 @@
622626
@ <i>(file is %d(sz) bytes of binary data)</i>
623627
}
624628
@ </blockquote>
625629
manifest_destroy(pAttach);
626630
blob_reset(&attach);
627
- style_finish_page("attach");
631
+ style_finish_page();
628632
}
629633
630634
/*
631635
** Output HTML to show a list of attachments.
632636
*/
633637
--- src/attach.c
+++ src/attach.c
@@ -45,10 +45,11 @@
45 Blob sql;
46 Stmt q;
47
48 if( zPage && zTkt ) zTkt = 0;
49 login_check_credentials();
 
50 blob_zero(&sql);
51 blob_append_sql(&sql,
52 "SELECT datetime(mtime,toLocal()), src, target, filename,"
53 " comment, user,"
54 " (SELECT uuid FROM blob WHERE rid=attachid), attachid,"
@@ -145,11 +146,11 @@
145 hyperlink_to_date(zDate, ".");
146 free(zUrlTail);
147 }
148 db_finalize(&q);
149 @ </ol>
150 style_finish_page("attach");
151 return;
152 }
153
154 /*
155 ** WEBPAGE: attachdownload
@@ -176,10 +177,11 @@
176 int attachid = atoi(PD("attachid","0"));
177 char *zUUID;
178
179 if( zFile==0 ) fossil_redirect_home();
180 login_check_credentials();
 
181 if( zPage ){
182 if( g.perm.RdWiki==0 ){ login_needed(g.anon.RdWiki); return; }
183 zTarget = zPage;
184 }else if( zTkt ){
185 if( g.perm.RdTkt==0 ){ login_needed(g.anon.RdTkt); return; }
@@ -205,16 +207,16 @@
205 );
206 }
207 if( zUUID==0 || zUUID[0]==0 ){
208 style_header("No Such Attachment");
209 @ No such attachment....
210 style_finish_page("attach");
211 return;
212 }else if( zUUID[0]=='x' ){
213 style_header("Missing");
214 @ Attachment has been deleted
215 style_finish_page("attach");
216 return;
217 }else{
218 g.perm.Read = 1;
219 cgi_replace_parameter("name",zUUID);
220 if( fossil_strcmp(g.zPath,"attachview")==0 ){
@@ -386,10 +388,11 @@
386 (zPage!=0 && wiki_need_moderation(0));
387 const char *zComment = PD("comment", "");
388 attach_commit(zName, zTarget, aContent, szContent, needModerator, zComment);
389 cgi_redirect(zFrom);
390 }
 
391 style_header("Add Attachment");
392 if( !goodCaptcha ){
393 @ <p class="generalError">Error: Incorrect security code.</p>
394 }
395 @ <h2>Add Attachment To %s(zTargetType)</h2>
@@ -410,11 +413,11 @@
410 @ <input type="submit" name="ok" value="Add Attachment" />
411 @ <input type="submit" name="cancel" value="Cancel" />
412 @ </div>
413 captcha_generate(0);
414 @ </form>
415 style_finish_page("attach");
416 fossil_free(zTargetType);
417 }
418
419 /*
420 ** WEBPAGE: ainfo
@@ -539,10 +542,11 @@
539 }
540 if( strcmp(zModAction,"approve")==0 ){
541 moderation_approve('a', rid);
542 }
543 }
 
544 style_header("Attachment Details");
545 style_submenu_element("Raw", "%R/artifact/%s", zUuid);
546 if(fShowContent){
547 style_submenu_element("Line Numbers", "%R/ainfo/%s%s", zUuid,
548 ((zLn&&*zLn) ? "" : "?ln=0"));
@@ -622,11 +626,11 @@
622 @ <i>(file is %d(sz) bytes of binary data)</i>
623 }
624 @ </blockquote>
625 manifest_destroy(pAttach);
626 blob_reset(&attach);
627 style_finish_page("attach");
628 }
629
630 /*
631 ** Output HTML to show a list of attachments.
632 */
633
--- src/attach.c
+++ src/attach.c
@@ -45,10 +45,11 @@
45 Blob sql;
46 Stmt q;
47
48 if( zPage && zTkt ) zTkt = 0;
49 login_check_credentials();
50 style_set_current_feature("attach");
51 blob_zero(&sql);
52 blob_append_sql(&sql,
53 "SELECT datetime(mtime,toLocal()), src, target, filename,"
54 " comment, user,"
55 " (SELECT uuid FROM blob WHERE rid=attachid), attachid,"
@@ -145,11 +146,11 @@
146 hyperlink_to_date(zDate, ".");
147 free(zUrlTail);
148 }
149 db_finalize(&q);
150 @ </ol>
151 style_finish_page();
152 return;
153 }
154
155 /*
156 ** WEBPAGE: attachdownload
@@ -176,10 +177,11 @@
177 int attachid = atoi(PD("attachid","0"));
178 char *zUUID;
179
180 if( zFile==0 ) fossil_redirect_home();
181 login_check_credentials();
182 style_set_current_feature("attach");
183 if( zPage ){
184 if( g.perm.RdWiki==0 ){ login_needed(g.anon.RdWiki); return; }
185 zTarget = zPage;
186 }else if( zTkt ){
187 if( g.perm.RdTkt==0 ){ login_needed(g.anon.RdTkt); return; }
@@ -205,16 +207,16 @@
207 );
208 }
209 if( zUUID==0 || zUUID[0]==0 ){
210 style_header("No Such Attachment");
211 @ No such attachment....
212 style_finish_page();
213 return;
214 }else if( zUUID[0]=='x' ){
215 style_header("Missing");
216 @ Attachment has been deleted
217 style_finish_page();
218 return;
219 }else{
220 g.perm.Read = 1;
221 cgi_replace_parameter("name",zUUID);
222 if( fossil_strcmp(g.zPath,"attachview")==0 ){
@@ -386,10 +388,11 @@
388 (zPage!=0 && wiki_need_moderation(0));
389 const char *zComment = PD("comment", "");
390 attach_commit(zName, zTarget, aContent, szContent, needModerator, zComment);
391 cgi_redirect(zFrom);
392 }
393 style_set_current_feature("attach");
394 style_header("Add Attachment");
395 if( !goodCaptcha ){
396 @ <p class="generalError">Error: Incorrect security code.</p>
397 }
398 @ <h2>Add Attachment To %s(zTargetType)</h2>
@@ -410,11 +413,11 @@
413 @ <input type="submit" name="ok" value="Add Attachment" />
414 @ <input type="submit" name="cancel" value="Cancel" />
415 @ </div>
416 captcha_generate(0);
417 @ </form>
418 style_finish_page();
419 fossil_free(zTargetType);
420 }
421
422 /*
423 ** WEBPAGE: ainfo
@@ -539,10 +542,11 @@
542 }
543 if( strcmp(zModAction,"approve")==0 ){
544 moderation_approve('a', rid);
545 }
546 }
547 style_set_current_feature("attach");
548 style_header("Attachment Details");
549 style_submenu_element("Raw", "%R/artifact/%s", zUuid);
550 if(fShowContent){
551 style_submenu_element("Line Numbers", "%R/ainfo/%s%s", zUuid,
552 ((zLn&&*zLn) ? "" : "?ln=0"));
@@ -622,11 +626,11 @@
626 @ <i>(file is %d(sz) bytes of binary data)</i>
627 }
628 @ </blockquote>
629 manifest_destroy(pAttach);
630 blob_reset(&attach);
631 style_finish_page();
632 }
633
634 /*
635 ** Output HTML to show a list of attachments.
636 */
637
+4 -2
--- src/backlink.c
+++ src/backlink.c
@@ -76,10 +76,11 @@
7676
login_check_credentials();
7777
if( !g.perm.Read || !g.perm.RdTkt || !g.perm.RdWiki ){
7878
login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
7979
return;
8080
}
81
+ style_set_current_feature("test");
8182
style_header("Backlink Timeline (Internal Testing Use)");
8283
db_multi_exec(
8384
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
8485
"DELETE FROM ok;"
8586
"INSERT OR IGNORE INTO ok"
@@ -91,11 +92,11 @@
9192
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
9293
db_prepare(&q, "%s", blob_sql_text(&sql));
9394
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
9495
0, 0, 0, 0, 0, 0);
9596
db_finalize(&q);
96
- style_finish_page("test");
97
+ style_finish_page();
9798
}
9899
99100
/*
100101
** WEBPAGE: test-backlinks
101102
**
@@ -107,10 +108,11 @@
107108
login_check_credentials();
108109
if( !g.perm.Admin ){
109110
login_needed(g.anon.Admin);
110111
return;
111112
}
113
+ style_set_current_feature("test");
112114
style_header("Backlink Table (Internal Testing Use)");
113115
n = db_int(0, "SELECT count(*) FROM backlink");
114116
@ <p>%d(n) backlink table entries:</p>
115117
db_prepare(&q,
116118
"SELECT target, srctype, srcid, datetime(mtime),"
@@ -152,11 +154,11 @@
152154
@ <td>%h(zMtime)</tr>
153155
}
154156
@ </tbody>
155157
@ </table>
156158
db_finalize(&q);
157
- style_finish_page("test");
159
+ style_finish_page();
158160
}
159161
160162
/*
161163
** Remove all prior backlinks for the wiki page given. Then
162164
** add new backlinks for the latest version of the wiki page.
163165
--- src/backlink.c
+++ src/backlink.c
@@ -76,10 +76,11 @@
76 login_check_credentials();
77 if( !g.perm.Read || !g.perm.RdTkt || !g.perm.RdWiki ){
78 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
79 return;
80 }
 
81 style_header("Backlink Timeline (Internal Testing Use)");
82 db_multi_exec(
83 "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
84 "DELETE FROM ok;"
85 "INSERT OR IGNORE INTO ok"
@@ -91,11 +92,11 @@
91 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
92 db_prepare(&q, "%s", blob_sql_text(&sql));
93 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
94 0, 0, 0, 0, 0, 0);
95 db_finalize(&q);
96 style_finish_page("test");
97 }
98
99 /*
100 ** WEBPAGE: test-backlinks
101 **
@@ -107,10 +108,11 @@
107 login_check_credentials();
108 if( !g.perm.Admin ){
109 login_needed(g.anon.Admin);
110 return;
111 }
 
112 style_header("Backlink Table (Internal Testing Use)");
113 n = db_int(0, "SELECT count(*) FROM backlink");
114 @ <p>%d(n) backlink table entries:</p>
115 db_prepare(&q,
116 "SELECT target, srctype, srcid, datetime(mtime),"
@@ -152,11 +154,11 @@
152 @ <td>%h(zMtime)</tr>
153 }
154 @ </tbody>
155 @ </table>
156 db_finalize(&q);
157 style_finish_page("test");
158 }
159
160 /*
161 ** Remove all prior backlinks for the wiki page given. Then
162 ** add new backlinks for the latest version of the wiki page.
163
--- src/backlink.c
+++ src/backlink.c
@@ -76,10 +76,11 @@
76 login_check_credentials();
77 if( !g.perm.Read || !g.perm.RdTkt || !g.perm.RdWiki ){
78 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
79 return;
80 }
81 style_set_current_feature("test");
82 style_header("Backlink Timeline (Internal Testing Use)");
83 db_multi_exec(
84 "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
85 "DELETE FROM ok;"
86 "INSERT OR IGNORE INTO ok"
@@ -91,11 +92,11 @@
92 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
93 db_prepare(&q, "%s", blob_sql_text(&sql));
94 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
95 0, 0, 0, 0, 0, 0);
96 db_finalize(&q);
97 style_finish_page();
98 }
99
100 /*
101 ** WEBPAGE: test-backlinks
102 **
@@ -107,10 +108,11 @@
108 login_check_credentials();
109 if( !g.perm.Admin ){
110 login_needed(g.anon.Admin);
111 return;
112 }
113 style_set_current_feature("test");
114 style_header("Backlink Table (Internal Testing Use)");
115 n = db_int(0, "SELECT count(*) FROM backlink");
116 @ <p>%d(n) backlink table entries:</p>
117 db_prepare(&q,
118 "SELECT target, srctype, srcid, datetime(mtime),"
@@ -152,11 +154,11 @@
154 @ <td>%h(zMtime)</tr>
155 }
156 @ </tbody>
157 @ </table>
158 db_finalize(&q);
159 style_finish_page();
160 }
161
162 /*
163 ** Remove all prior backlinks for the wiki page given. Then
164 ** add new backlinks for the latest version of the wiki page.
165
+6 -3
--- src/branch.c
+++ src/branch.c
@@ -458,10 +458,11 @@
458458
Stmt q;
459459
double rNow;
460460
int show_colors = PB("colors");
461461
login_check_credentials();
462462
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
463
+ style_set_current_feature("branch");
463464
style_header("Branches");
464465
style_adunit_config(ADUNIT_RIGHT_OK);
465466
style_submenu_checkbox("colors", "Use Branch Colors", 0, 0);
466467
login_anonymous_available();
467468
@@ -514,11 +515,11 @@
514515
@ </tr>
515516
}
516517
@ </tbody></table></div>
517518
db_finalize(&q);
518519
style_table_sorter();
519
- style_finish_page("branch");
520
+ style_finish_page();
520521
}
521522
522523
/*
523524
** WEBPAGE: brlist
524525
** Show a list of branches. With no query parameters, a sortable table
@@ -556,10 +557,11 @@
556557
showAll = 1;
557558
}
558559
if( showAll ) brFlags = BRL_BOTH;
559560
if( showClosed ) brFlags = BRL_CLOSED_ONLY;
560561
562
+ style_set_current_feature("branch");
561563
style_header("%s", showClosed ? "Closed Branches" :
562564
showAll ? "All Branches" : "Open Branches");
563565
style_submenu_element("Timeline", "brtimeline");
564566
if( showClosed ){
565567
style_submenu_element("All", "brlist?all");
@@ -622,11 +624,11 @@
622624
}
623625
if( cnt ){
624626
@ </ul>
625627
}
626628
db_finalize(&q);
627
- style_finish_page("branch");
629
+ style_finish_page();
628630
}
629631
630632
/*
631633
** This routine is called while for each check-in that is rendered by
632634
** the timeline of a "brlist" page. Add some additional hyperlinks
@@ -671,10 +673,11 @@
671673
int fOnlyHidden = PB("onlyhidden")!=0; /* The "onlyhidden" query parameter */
672674
673675
login_check_credentials();
674676
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
675677
678
+ style_set_current_feature("branch");
676679
style_header("Branches");
677680
style_submenu_element("List", "brlist");
678681
login_anonymous_available();
679682
timeline_ss_submenu();
680683
cookie_render();
@@ -698,7 +701,7 @@
698701
if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
699702
if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
700703
if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
701704
www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
702705
db_finalize(&q);
703
- style_finish_page("branch");
706
+ style_finish_page();
704707
}
705708
--- src/branch.c
+++ src/branch.c
@@ -458,10 +458,11 @@
458 Stmt q;
459 double rNow;
460 int show_colors = PB("colors");
461 login_check_credentials();
462 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
 
463 style_header("Branches");
464 style_adunit_config(ADUNIT_RIGHT_OK);
465 style_submenu_checkbox("colors", "Use Branch Colors", 0, 0);
466 login_anonymous_available();
467
@@ -514,11 +515,11 @@
514 @ </tr>
515 }
516 @ </tbody></table></div>
517 db_finalize(&q);
518 style_table_sorter();
519 style_finish_page("branch");
520 }
521
522 /*
523 ** WEBPAGE: brlist
524 ** Show a list of branches. With no query parameters, a sortable table
@@ -556,10 +557,11 @@
556 showAll = 1;
557 }
558 if( showAll ) brFlags = BRL_BOTH;
559 if( showClosed ) brFlags = BRL_CLOSED_ONLY;
560
 
561 style_header("%s", showClosed ? "Closed Branches" :
562 showAll ? "All Branches" : "Open Branches");
563 style_submenu_element("Timeline", "brtimeline");
564 if( showClosed ){
565 style_submenu_element("All", "brlist?all");
@@ -622,11 +624,11 @@
622 }
623 if( cnt ){
624 @ </ul>
625 }
626 db_finalize(&q);
627 style_finish_page("branch");
628 }
629
630 /*
631 ** This routine is called while for each check-in that is rendered by
632 ** the timeline of a "brlist" page. Add some additional hyperlinks
@@ -671,10 +673,11 @@
671 int fOnlyHidden = PB("onlyhidden")!=0; /* The "onlyhidden" query parameter */
672
673 login_check_credentials();
674 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
675
 
676 style_header("Branches");
677 style_submenu_element("List", "brlist");
678 login_anonymous_available();
679 timeline_ss_submenu();
680 cookie_render();
@@ -698,7 +701,7 @@
698 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
699 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
700 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
701 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
702 db_finalize(&q);
703 style_finish_page("branch");
704 }
705
--- src/branch.c
+++ src/branch.c
@@ -458,10 +458,11 @@
458 Stmt q;
459 double rNow;
460 int show_colors = PB("colors");
461 login_check_credentials();
462 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
463 style_set_current_feature("branch");
464 style_header("Branches");
465 style_adunit_config(ADUNIT_RIGHT_OK);
466 style_submenu_checkbox("colors", "Use Branch Colors", 0, 0);
467 login_anonymous_available();
468
@@ -514,11 +515,11 @@
515 @ </tr>
516 }
517 @ </tbody></table></div>
518 db_finalize(&q);
519 style_table_sorter();
520 style_finish_page();
521 }
522
523 /*
524 ** WEBPAGE: brlist
525 ** Show a list of branches. With no query parameters, a sortable table
@@ -556,10 +557,11 @@
557 showAll = 1;
558 }
559 if( showAll ) brFlags = BRL_BOTH;
560 if( showClosed ) brFlags = BRL_CLOSED_ONLY;
561
562 style_set_current_feature("branch");
563 style_header("%s", showClosed ? "Closed Branches" :
564 showAll ? "All Branches" : "Open Branches");
565 style_submenu_element("Timeline", "brtimeline");
566 if( showClosed ){
567 style_submenu_element("All", "brlist?all");
@@ -622,11 +624,11 @@
624 }
625 if( cnt ){
626 @ </ul>
627 }
628 db_finalize(&q);
629 style_finish_page();
630 }
631
632 /*
633 ** This routine is called while for each check-in that is rendered by
634 ** the timeline of a "brlist" page. Add some additional hyperlinks
@@ -671,10 +673,11 @@
673 int fOnlyHidden = PB("onlyhidden")!=0; /* The "onlyhidden" query parameter */
674
675 login_check_credentials();
676 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
677
678 style_set_current_feature("branch");
679 style_header("Branches");
680 style_submenu_element("List", "brlist");
681 login_anonymous_available();
682 timeline_ss_submenu();
683 cookie_render();
@@ -698,7 +701,7 @@
701 if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
702 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
703 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
704 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra);
705 db_finalize(&q);
706 style_finish_page();
707 }
708
+4 -4
--- src/browse.c
+++ src/browse.c
@@ -336,11 +336,11 @@
336336
337337
/* If the "noreadme" query parameter is present, do not try to
338338
** show the content of the README file.
339339
*/
340340
if( P("noreadme")!=0 ){
341
- style_finish_page("dir");
341
+ style_finish_page();
342342
return;
343343
}
344344
345345
/* If the directory contains a readme file, then display its content below
346346
** the list of files
@@ -397,11 +397,11 @@
397397
document_emit_js();
398398
}
399399
}
400400
}
401401
db_finalize(&q);
402
- style_finish_page("dir");
402
+ style_finish_page();
403403
}
404404
405405
/*
406406
** Objects used by the "tree" webpage.
407407
*/
@@ -913,11 +913,11 @@
913913
}
914914
}
915915
@ </ul>
916916
@ </ul></div>
917917
builtin_request_js("tree.js");
918
- style_finish_page("tree");
918
+ style_finish_page();
919919
920920
/* We could free memory used by sTree here if we needed to. But
921921
** the process is about to exit, so doing so would not really accomplish
922922
** anything useful. */
923923
}
@@ -1167,7 +1167,7 @@
11671167
fossil_free(zAge);
11681168
}
11691169
@ </table></div>
11701170
db_finalize(&q1);
11711171
db_finalize(&q2);
1172
- style_finish_page("fileage");
1172
+ style_finish_page();
11731173
}
11741174
--- src/browse.c
+++ src/browse.c
@@ -336,11 +336,11 @@
336
337 /* If the "noreadme" query parameter is present, do not try to
338 ** show the content of the README file.
339 */
340 if( P("noreadme")!=0 ){
341 style_finish_page("dir");
342 return;
343 }
344
345 /* If the directory contains a readme file, then display its content below
346 ** the list of files
@@ -397,11 +397,11 @@
397 document_emit_js();
398 }
399 }
400 }
401 db_finalize(&q);
402 style_finish_page("dir");
403 }
404
405 /*
406 ** Objects used by the "tree" webpage.
407 */
@@ -913,11 +913,11 @@
913 }
914 }
915 @ </ul>
916 @ </ul></div>
917 builtin_request_js("tree.js");
918 style_finish_page("tree");
919
920 /* We could free memory used by sTree here if we needed to. But
921 ** the process is about to exit, so doing so would not really accomplish
922 ** anything useful. */
923 }
@@ -1167,7 +1167,7 @@
1167 fossil_free(zAge);
1168 }
1169 @ </table></div>
1170 db_finalize(&q1);
1171 db_finalize(&q2);
1172 style_finish_page("fileage");
1173 }
1174
--- src/browse.c
+++ src/browse.c
@@ -336,11 +336,11 @@
336
337 /* If the "noreadme" query parameter is present, do not try to
338 ** show the content of the README file.
339 */
340 if( P("noreadme")!=0 ){
341 style_finish_page();
342 return;
343 }
344
345 /* If the directory contains a readme file, then display its content below
346 ** the list of files
@@ -397,11 +397,11 @@
397 document_emit_js();
398 }
399 }
400 }
401 db_finalize(&q);
402 style_finish_page();
403 }
404
405 /*
406 ** Objects used by the "tree" webpage.
407 */
@@ -913,11 +913,11 @@
913 }
914 }
915 @ </ul>
916 @ </ul></div>
917 builtin_request_js("tree.js");
918 style_finish_page();
919
920 /* We could free memory used by sTree here if we needed to. But
921 ** the process is about to exit, so doing so would not really accomplish
922 ** anything useful. */
923 }
@@ -1167,7 +1167,7 @@
1167 fossil_free(zAge);
1168 }
1169 @ </table></div>
1170 db_finalize(&q1);
1171 db_finalize(&q2);
1172 style_finish_page();
1173 }
1174
+2 -1
--- src/builtin.c
+++ src/builtin.c
@@ -94,20 +94,21 @@
9494
**
9595
** Show all built-in text files.
9696
*/
9797
void test_builtin_list_page(void){
9898
int i;
99
+ style_set_current_feature("test");
99100
style_header("Built-in Text Files");
100101
@ <ol>
101102
for(i=0; i<count(aBuiltinFiles); i++){
102103
const char *z = aBuiltinFiles[i].zName;
103104
char *zUrl = href("%R/builtin?name=%T&id=%.8s&mimetype=text/plain",
104105
z,fossil_exe_id());
105106
@ <li>%z(zUrl)%h(z)</a>
106107
}
107108
@ </ol>
108
- style_finish_page("test");
109
+ style_finish_page();
109110
}
110111
111112
/*
112113
** COMMAND: test-builtin-get
113114
**
114115
--- src/builtin.c
+++ src/builtin.c
@@ -94,20 +94,21 @@
94 **
95 ** Show all built-in text files.
96 */
97 void test_builtin_list_page(void){
98 int i;
 
99 style_header("Built-in Text Files");
100 @ <ol>
101 for(i=0; i<count(aBuiltinFiles); i++){
102 const char *z = aBuiltinFiles[i].zName;
103 char *zUrl = href("%R/builtin?name=%T&id=%.8s&mimetype=text/plain",
104 z,fossil_exe_id());
105 @ <li>%z(zUrl)%h(z)</a>
106 }
107 @ </ol>
108 style_finish_page("test");
109 }
110
111 /*
112 ** COMMAND: test-builtin-get
113 **
114
--- src/builtin.c
+++ src/builtin.c
@@ -94,20 +94,21 @@
94 **
95 ** Show all built-in text files.
96 */
97 void test_builtin_list_page(void){
98 int i;
99 style_set_current_feature("test");
100 style_header("Built-in Text Files");
101 @ <ol>
102 for(i=0; i<count(aBuiltinFiles); i++){
103 const char *z = aBuiltinFiles[i].zName;
104 char *zUrl = href("%R/builtin?name=%T&id=%.8s&mimetype=text/plain",
105 z,fossil_exe_id());
106 @ <li>%z(zUrl)%h(z)</a>
107 }
108 @ </ol>
109 style_finish_page();
110 }
111
112 /*
113 ** COMMAND: test-builtin-get
114 **
115
+4 -2
--- src/cache.c
+++ src/cache.c
@@ -353,10 +353,11 @@
353353
sqlite3_stmt *pStmt;
354354
char zBuf[100];
355355
356356
login_check_credentials();
357357
if( !g.perm.Setup ){ login_needed(0); return; }
358
+ style_set_current_feature("cache");
358359
style_header("Web Cache Status");
359360
db = cacheOpen(0);
360361
if( db==0 ){
361362
@ The web-page cache is disabled for this repository
362363
}else{
@@ -384,11 +385,11 @@
384385
@ <p>cache-file name: %h(zDbName)</p>
385386
@ <p>cache-file size: %s(zBuf)</p>
386387
fossil_free(zDbName);
387388
sqlite3_close(db);
388389
}
389
- style_finish_page("cache");
390
+ style_finish_page();
390391
}
391392
392393
/*
393394
** WEBPAGE: cacheget
394395
**
@@ -405,13 +406,14 @@
405406
login_check_credentials();
406407
if( !g.perm.Setup ){ login_needed(0); return; }
407408
zKey = PD("key","");
408409
blob_zero(&content);
409410
if( cache_read(&content, zKey)==0 ){
411
+ style_set_current_feature("cache");
410412
style_header("Cache Download Error");
411413
@ The cache does not contain any entry with this key: "%h(zKey)"
412
- style_finish_page("cache");
414
+ style_finish_page();
413415
return;
414416
}
415417
cgi_set_content(&content);
416418
cgi_set_content_type("application/x-compressed");
417419
}
418420
--- src/cache.c
+++ src/cache.c
@@ -353,10 +353,11 @@
353 sqlite3_stmt *pStmt;
354 char zBuf[100];
355
356 login_check_credentials();
357 if( !g.perm.Setup ){ login_needed(0); return; }
 
358 style_header("Web Cache Status");
359 db = cacheOpen(0);
360 if( db==0 ){
361 @ The web-page cache is disabled for this repository
362 }else{
@@ -384,11 +385,11 @@
384 @ <p>cache-file name: %h(zDbName)</p>
385 @ <p>cache-file size: %s(zBuf)</p>
386 fossil_free(zDbName);
387 sqlite3_close(db);
388 }
389 style_finish_page("cache");
390 }
391
392 /*
393 ** WEBPAGE: cacheget
394 **
@@ -405,13 +406,14 @@
405 login_check_credentials();
406 if( !g.perm.Setup ){ login_needed(0); return; }
407 zKey = PD("key","");
408 blob_zero(&content);
409 if( cache_read(&content, zKey)==0 ){
 
410 style_header("Cache Download Error");
411 @ The cache does not contain any entry with this key: "%h(zKey)"
412 style_finish_page("cache");
413 return;
414 }
415 cgi_set_content(&content);
416 cgi_set_content_type("application/x-compressed");
417 }
418
--- src/cache.c
+++ src/cache.c
@@ -353,10 +353,11 @@
353 sqlite3_stmt *pStmt;
354 char zBuf[100];
355
356 login_check_credentials();
357 if( !g.perm.Setup ){ login_needed(0); return; }
358 style_set_current_feature("cache");
359 style_header("Web Cache Status");
360 db = cacheOpen(0);
361 if( db==0 ){
362 @ The web-page cache is disabled for this repository
363 }else{
@@ -384,11 +385,11 @@
385 @ <p>cache-file name: %h(zDbName)</p>
386 @ <p>cache-file size: %s(zBuf)</p>
387 fossil_free(zDbName);
388 sqlite3_close(db);
389 }
390 style_finish_page();
391 }
392
393 /*
394 ** WEBPAGE: cacheget
395 **
@@ -405,13 +406,14 @@
406 login_check_credentials();
407 if( !g.perm.Setup ){ login_needed(0); return; }
408 zKey = PD("key","");
409 blob_zero(&content);
410 if( cache_read(&content, zKey)==0 ){
411 style_set_current_feature("cache");
412 style_header("Cache Download Error");
413 @ The cache does not contain any entry with this key: "%h(zKey)"
414 style_finish_page();
415 return;
416 }
417 cgi_set_content(&content);
418 cgi_set_content_type("application/x-compressed");
419 }
420
+4 -2
--- src/captcha.c
+++ src/captcha.c
@@ -586,15 +586,16 @@
586586
if( zPw==0 || zPw[0]==0 ){
587587
u64 x;
588588
sqlite3_randomness(sizeof(x), &x);
589589
zPw = mprintf("%016llx", x);
590590
}
591
+ style_set_current_feature("test");
591592
style_header("Captcha Test");
592593
@ <pre>
593594
@ %s(captcha_render(zPw))
594595
@ </pre>
595
- style_finish_page("test");
596
+ style_finish_page();
596597
}
597598
598599
/*
599600
** Check to see if the current request is coming from an agent that might
600601
** be a spider. If the agent is not a spider, then return 0 without doing
@@ -621,17 +622,18 @@
621622
cgi_set_cookie(zCookieName, "1", login_cookie_path(), 8*3600);
622623
return 0;
623624
}
624625
625626
/* This appears to be a spider. Offer the captcha */
627
+ style_set_current_feature("captcha");
626628
style_header("Verification");
627629
@ <form method='POST' action='%s(g.zPath)'>
628630
cgi_query_parameters_to_hidden();
629631
@ <p>Please demonstrate that you are human, not a spider or robot</p>
630632
captcha_generate(1);
631633
@ </form>
632
- style_finish_page("captcha");
634
+ style_finish_page();
633635
return 1;
634636
}
635637
636638
/*
637639
** Generate a WAV file that reads aloud the hex digits given by
638640
--- src/captcha.c
+++ src/captcha.c
@@ -586,15 +586,16 @@
586 if( zPw==0 || zPw[0]==0 ){
587 u64 x;
588 sqlite3_randomness(sizeof(x), &x);
589 zPw = mprintf("%016llx", x);
590 }
 
591 style_header("Captcha Test");
592 @ <pre>
593 @ %s(captcha_render(zPw))
594 @ </pre>
595 style_finish_page("test");
596 }
597
598 /*
599 ** Check to see if the current request is coming from an agent that might
600 ** be a spider. If the agent is not a spider, then return 0 without doing
@@ -621,17 +622,18 @@
621 cgi_set_cookie(zCookieName, "1", login_cookie_path(), 8*3600);
622 return 0;
623 }
624
625 /* This appears to be a spider. Offer the captcha */
 
626 style_header("Verification");
627 @ <form method='POST' action='%s(g.zPath)'>
628 cgi_query_parameters_to_hidden();
629 @ <p>Please demonstrate that you are human, not a spider or robot</p>
630 captcha_generate(1);
631 @ </form>
632 style_finish_page("captcha");
633 return 1;
634 }
635
636 /*
637 ** Generate a WAV file that reads aloud the hex digits given by
638
--- src/captcha.c
+++ src/captcha.c
@@ -586,15 +586,16 @@
586 if( zPw==0 || zPw[0]==0 ){
587 u64 x;
588 sqlite3_randomness(sizeof(x), &x);
589 zPw = mprintf("%016llx", x);
590 }
591 style_set_current_feature("test");
592 style_header("Captcha Test");
593 @ <pre>
594 @ %s(captcha_render(zPw))
595 @ </pre>
596 style_finish_page();
597 }
598
599 /*
600 ** Check to see if the current request is coming from an agent that might
601 ** be a spider. If the agent is not a spider, then return 0 without doing
@@ -621,17 +622,18 @@
622 cgi_set_cookie(zCookieName, "1", login_cookie_path(), 8*3600);
623 return 0;
624 }
625
626 /* This appears to be a spider. Offer the captcha */
627 style_set_current_feature("captcha");
628 style_header("Verification");
629 @ <form method='POST' action='%s(g.zPath)'>
630 cgi_query_parameters_to_hidden();
631 @ <p>Please demonstrate that you are human, not a spider or robot</p>
632 captcha_generate(1);
633 @ </form>
634 style_finish_page();
635 return 1;
636 }
637
638 /*
639 ** Generate a WAV file that reads aloud the hex digits given by
640
+1 -1
--- src/clone.c
+++ src/clone.c
@@ -422,7 +422,7 @@
422422
@ <p>Clone the repository using this command:
423423
@ <blockquote><pre>
424424
@ fossil clone %s(g.zBaseURL) %h(zNm).fossil
425425
@ </pre></blockquote>
426426
}
427
- style_finish_page("download");
427
+ style_finish_page();
428428
}
429429
--- src/clone.c
+++ src/clone.c
@@ -422,7 +422,7 @@
422 @ <p>Clone the repository using this command:
423 @ <blockquote><pre>
424 @ fossil clone %s(g.zBaseURL) %h(zNm).fossil
425 @ </pre></blockquote>
426 }
427 style_finish_page("download");
428 }
429
--- src/clone.c
+++ src/clone.c
@@ -422,7 +422,7 @@
422 @ <p>Clone the repository using this command:
423 @ <blockquote><pre>
424 @ fossil clone %s(g.zBaseURL) %h(zNm).fossil
425 @ </pre></blockquote>
426 }
427 style_finish_page();
428 }
429
+1 -1
--- src/cookies.c
+++ src/cookies.c
@@ -225,7 +225,7 @@
225225
@ <li>Raw cookie value: "%h(PD("fossil_display_settings",""))"
226226
for(i=0; i<cookies.nParam; i++){
227227
@ <li>%h(cookies.aParam[i].zPName): "%h(cookies.aParam[i].zPValue)"
228228
}
229229
@ </ul>
230
- style_finish_page("cookies");
230
+ style_finish_page();
231231
}
232232
--- src/cookies.c
+++ src/cookies.c
@@ -225,7 +225,7 @@
225 @ <li>Raw cookie value: "%h(PD("fossil_display_settings",""))"
226 for(i=0; i<cookies.nParam; i++){
227 @ <li>%h(cookies.aParam[i].zPName): "%h(cookies.aParam[i].zPValue)"
228 }
229 @ </ul>
230 style_finish_page("cookies");
231 }
232
--- src/cookies.c
+++ src/cookies.c
@@ -225,7 +225,7 @@
225 @ <li>Raw cookie value: "%h(PD("fossil_display_settings",""))"
226 for(i=0; i<cookies.nParam; i++){
227 @ <li>%h(cookies.aParam[i].zPName): "%h(cookies.aParam[i].zPValue)"
228 }
229 @ </ul>
230 style_finish_page();
231 }
232
--- src/descendants.c
+++ src/descendants.c
@@ -561,10 +561,11 @@
561561
}
562562
if( showClosed || showAll ){
563563
style_submenu_element("Open", "%s", url_render(&url, 0, 0, 0, 0));
564564
}
565565
url_reset(&url);
566
+ style_set_current_feature("leaves");
566567
style_header("Leaves");
567568
login_anonymous_available();
568569
timeline_ss_submenu();
569570
cookie_render();
570571
#if 0
@@ -613,11 +614,11 @@
613614
if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
614615
if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
615616
www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
616617
db_finalize(&q);
617618
@ <br />
618
- style_finish_page("leaves");
619
+ style_finish_page();
619620
}
620621
621622
#if INTERFACE
622623
/* Flag parameters to compute_uses_file() */
623624
#define USESFILE_DELETE 0x01 /* Include the check-ins where file deleted */
624625
--- src/descendants.c
+++ src/descendants.c
@@ -561,10 +561,11 @@
561 }
562 if( showClosed || showAll ){
563 style_submenu_element("Open", "%s", url_render(&url, 0, 0, 0, 0));
564 }
565 url_reset(&url);
 
566 style_header("Leaves");
567 login_anonymous_available();
568 timeline_ss_submenu();
569 cookie_render();
570 #if 0
@@ -613,11 +614,11 @@
613 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
614 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
615 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
616 db_finalize(&q);
617 @ <br />
618 style_finish_page("leaves");
619 }
620
621 #if INTERFACE
622 /* Flag parameters to compute_uses_file() */
623 #define USESFILE_DELETE 0x01 /* Include the check-ins where file deleted */
624
--- src/descendants.c
+++ src/descendants.c
@@ -561,10 +561,11 @@
561 }
562 if( showClosed || showAll ){
563 style_submenu_element("Open", "%s", url_render(&url, 0, 0, 0, 0));
564 }
565 url_reset(&url);
566 style_set_current_feature("leaves");
567 style_header("Leaves");
568 login_anonymous_available();
569 timeline_ss_submenu();
570 cookie_render();
571 #if 0
@@ -613,11 +614,11 @@
614 if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
615 if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
616 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
617 db_finalize(&q);
618 @ <br />
619 style_finish_page();
620 }
621
622 #if INTERFACE
623 /* Flag parameters to compute_uses_file() */
624 #define USESFILE_DELETE 0x01 /* Include the check-ins where file deleted */
625
+2 -1
--- src/diff.c
+++ src/diff.c
@@ -2448,10 +2448,11 @@
24482448
/* compute the annotation */
24492449
annotate_file(&ann, zFilename, zRevision, zLimit, zOrigin, annFlags);
24502450
zCI = ann.aVers[0].zMUuid;
24512451
24522452
/* generate the web page */
2453
+ style_set_current_feature("annotate");
24532454
style_header("Annotation For %h", zFilename);
24542455
if( bBlame ){
24552456
url_initialize(&url, "blame");
24562457
}else{
24572458
url_initialize(&url, "annotate");
@@ -2556,11 +2557,11 @@
25562557
}
25572558
@ %s(zPrefix) %h(z)
25582559
25592560
}
25602561
@ </pre>
2561
- style_finish_page("annotate");
2562
+ style_finish_page();
25622563
}
25632564
25642565
/*
25652566
** COMMAND: annotate
25662567
** COMMAND: blame
25672568
--- src/diff.c
+++ src/diff.c
@@ -2448,10 +2448,11 @@
2448 /* compute the annotation */
2449 annotate_file(&ann, zFilename, zRevision, zLimit, zOrigin, annFlags);
2450 zCI = ann.aVers[0].zMUuid;
2451
2452 /* generate the web page */
 
2453 style_header("Annotation For %h", zFilename);
2454 if( bBlame ){
2455 url_initialize(&url, "blame");
2456 }else{
2457 url_initialize(&url, "annotate");
@@ -2556,11 +2557,11 @@
2556 }
2557 @ %s(zPrefix) %h(z)
2558
2559 }
2560 @ </pre>
2561 style_finish_page("annotate");
2562 }
2563
2564 /*
2565 ** COMMAND: annotate
2566 ** COMMAND: blame
2567
--- src/diff.c
+++ src/diff.c
@@ -2448,10 +2448,11 @@
2448 /* compute the annotation */
2449 annotate_file(&ann, zFilename, zRevision, zLimit, zOrigin, annFlags);
2450 zCI = ann.aVers[0].zMUuid;
2451
2452 /* generate the web page */
2453 style_set_current_feature("annotate");
2454 style_header("Annotation For %h", zFilename);
2455 if( bBlame ){
2456 url_initialize(&url, "blame");
2457 }else{
2458 url_initialize(&url, "annotate");
@@ -2556,11 +2557,11 @@
2557 }
2558 @ %s(zPrefix) %h(z)
2559
2560 }
2561 @ </pre>
2562 style_finish_page();
2563 }
2564
2565 /*
2566 ** COMMAND: annotate
2567 ** COMMAND: blame
2568
+4 -2
--- src/dispatch.c
+++ src/dispatch.c
@@ -747,10 +747,11 @@
747747
if( zCmd==0 ) zCmd = P("name");
748748
if( zCmd && *zCmd ){
749749
int rc;
750750
const CmdOrPage *pCmd = 0;
751751
752
+ style_set_current_feature("tkt");
752753
style_header("Help: %s", zCmd);
753754
754755
style_submenu_element("Command-List", "%R/help");
755756
rc = dispatch_name_search(zCmd, CMDFLAG_ANY|CMDFLAG_PREFIX, &pCmd);
756757
if( *zCmd=='/' ){
@@ -850,11 +851,11 @@
850851
}
851852
}
852853
@ </ul></div>
853854
854855
}
855
- style_finish_page("help");
856
+ style_finish_page();
856857
}
857858
858859
/*
859860
** WEBPAGE: test-all-help
860861
**
@@ -862,10 +863,11 @@
862863
*/
863864
void test_all_help_page(void){
864865
int i;
865866
Blob buf;
866867
blob_init(&buf,0,0);
868
+ style_set_current_feature("test");
867869
style_header("All Help Text");
868870
@ <dl>
869871
for(i=0; i<MX_COMMAND; i++){
870872
const char *zDesc;
871873
unsigned int e = aCommand[i].eCmdFlags;
@@ -901,11 +903,11 @@
901903
help_to_html(aCommand[i].zHelp, cgi_output_blob());
902904
@ </dd>
903905
}
904906
@ </dl>
905907
blob_reset(&buf);
906
- style_finish_page("help");
908
+ style_finish_page();
907909
}
908910
909911
static void multi_column_list(const char **azWord, int nWord){
910912
int i, j, len;
911913
int mxLen = 0;
912914
--- src/dispatch.c
+++ src/dispatch.c
@@ -747,10 +747,11 @@
747 if( zCmd==0 ) zCmd = P("name");
748 if( zCmd && *zCmd ){
749 int rc;
750 const CmdOrPage *pCmd = 0;
751
 
752 style_header("Help: %s", zCmd);
753
754 style_submenu_element("Command-List", "%R/help");
755 rc = dispatch_name_search(zCmd, CMDFLAG_ANY|CMDFLAG_PREFIX, &pCmd);
756 if( *zCmd=='/' ){
@@ -850,11 +851,11 @@
850 }
851 }
852 @ </ul></div>
853
854 }
855 style_finish_page("help");
856 }
857
858 /*
859 ** WEBPAGE: test-all-help
860 **
@@ -862,10 +863,11 @@
862 */
863 void test_all_help_page(void){
864 int i;
865 Blob buf;
866 blob_init(&buf,0,0);
 
867 style_header("All Help Text");
868 @ <dl>
869 for(i=0; i<MX_COMMAND; i++){
870 const char *zDesc;
871 unsigned int e = aCommand[i].eCmdFlags;
@@ -901,11 +903,11 @@
901 help_to_html(aCommand[i].zHelp, cgi_output_blob());
902 @ </dd>
903 }
904 @ </dl>
905 blob_reset(&buf);
906 style_finish_page("help");
907 }
908
909 static void multi_column_list(const char **azWord, int nWord){
910 int i, j, len;
911 int mxLen = 0;
912
--- src/dispatch.c
+++ src/dispatch.c
@@ -747,10 +747,11 @@
747 if( zCmd==0 ) zCmd = P("name");
748 if( zCmd && *zCmd ){
749 int rc;
750 const CmdOrPage *pCmd = 0;
751
752 style_set_current_feature("tkt");
753 style_header("Help: %s", zCmd);
754
755 style_submenu_element("Command-List", "%R/help");
756 rc = dispatch_name_search(zCmd, CMDFLAG_ANY|CMDFLAG_PREFIX, &pCmd);
757 if( *zCmd=='/' ){
@@ -850,11 +851,11 @@
851 }
852 }
853 @ </ul></div>
854
855 }
856 style_finish_page();
857 }
858
859 /*
860 ** WEBPAGE: test-all-help
861 **
@@ -862,10 +863,11 @@
863 */
864 void test_all_help_page(void){
865 int i;
866 Blob buf;
867 blob_init(&buf,0,0);
868 style_set_current_feature("test");
869 style_header("All Help Text");
870 @ <dl>
871 for(i=0; i<MX_COMMAND; i++){
872 const char *zDesc;
873 unsigned int e = aCommand[i].eCmdFlags;
@@ -901,11 +903,11 @@
903 help_to_html(aCommand[i].zHelp, cgi_output_blob());
904 @ </dd>
905 }
906 @ </dl>
907 blob_reset(&buf);
908 style_finish_page();
909 }
910
911 static void multi_column_list(const char **azWord, int nWord){
912 int i, j, len;
913 int mxLen = 0;
914
+10 -9
--- src/doc.c
+++ src/doc.c
@@ -555,11 +555,11 @@
555555
}
556556
@ <tr><td>%s(zFlag)%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr>
557557
}
558558
@ </tbody></table>
559559
style_table_sorter();
560
- style_finish_page("mimetypes");
560
+ style_finish_page();
561561
}
562562
563563
/*
564564
** Check to see if the file in the pContent blob is "embedded HTML". Return
565565
** true if it is, and fill pTitle with the document title.
@@ -770,11 +770,11 @@
770770
}else{
771771
style_header("%s", zDefaultTitle);
772772
wiki_convert(pBody, 0, WIKI_BUTTONS);
773773
}
774774
document_emit_js();
775
- style_finish_page("doc");
775
+ style_finish_page();
776776
}else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
777777
Blob tail = BLOB_INITIALIZER;
778778
markdown_to_html(pBody, &title, &tail);
779779
if( blob_size(&title)>0 ){
780780
style_header("%s", blob_str(&title));
@@ -781,30 +781,30 @@
781781
}else{
782782
style_header("%s", zDefaultTitle);
783783
}
784784
convert_href_and_output(&tail);
785785
document_emit_js();
786
- style_finish_page("doc");
786
+ style_finish_page();
787787
}else if( fossil_strcmp(zMime, "text/plain")==0 ){
788788
style_header("%s", zDefaultTitle);
789789
@ <blockquote><pre>
790790
@ %h(blob_str(pBody))
791791
@ </pre></blockquote>
792792
document_emit_js();
793
- style_finish_page("doc");
793
+ style_finish_page();
794794
}else if( fossil_strcmp(zMime, "text/html")==0
795795
&& doc_is_embedded_html(pBody, &title) ){
796796
if( blob_size(&title)==0 ) blob_append(&title,zFilename,-1);
797797
style_header("%s", blob_str(&title));
798798
convert_href_and_output(pBody);
799799
document_emit_js();
800
- style_finish_page("doc");
800
+ style_finish_page();
801801
}else if( fossil_strcmp(zMime, "text/x-pikchr")==0 ){
802802
style_adunit_config(ADUNIT_RIGHT_OK);
803803
style_header("%s", zDefaultTitle);
804804
wiki_render_by_mimetype(pBody, zMime);
805
- style_finish_page("doc");
805
+ style_finish_page();
806806
#ifdef FOSSIL_ENABLE_TH1_DOCS
807807
}else if( Th_AreDocsEnabled() &&
808808
fossil_strcmp(zMime, "application/x-th1")==0 ){
809809
int raw = P("raw")!=0;
810810
if( !raw ){
@@ -821,11 +821,11 @@
821821
}else{
822822
Th_Render(blob_str(pBody));
823823
}
824824
if( !raw ){
825825
document_emit_js();
826
- style_finish_page("doc");
826
+ style_finish_page();
827827
}
828828
#endif
829829
}else{
830830
fossil_free(style_csp(1));
831831
cgi_set_content_type(zMime);
@@ -906,10 +906,11 @@
906906
#endif
907907
};
908908
909909
login_check_credentials();
910910
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
911
+ style_set_current_feature("doc");
911912
blob_init(&title, 0, 0);
912913
zDfltTitle = isUV ? "" : "Documentation";
913914
db_begin_transaction();
914915
while( rid==0 && (++nMiss)<=count(azSuffix) ){
915916
zName = P("name");
@@ -1029,11 +1030,11 @@
10291030
style_header("Not Found");
10301031
@ <p>Document %h(zOrigName) not found
10311032
if( fossil_strcmp(zCheckin,"ckout")!=0 ){
10321033
@ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
10331034
}
1034
- style_finish_page("doc");
1035
+ style_finish_page();
10351036
return;
10361037
}
10371038
10381039
/*
10391040
** The default logo.
@@ -1202,7 +1203,7 @@
12021203
*/
12031204
void doc_search_page(void){
12041205
login_check_credentials();
12051206
style_header("Document Search");
12061207
search_screen(SRCH_DOC, 0);
1207
- style_finish_page("docsrch");
1208
+ style_finish_page();
12081209
}
12091210
--- src/doc.c
+++ src/doc.c
@@ -555,11 +555,11 @@
555 }
556 @ <tr><td>%s(zFlag)%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr>
557 }
558 @ </tbody></table>
559 style_table_sorter();
560 style_finish_page("mimetypes");
561 }
562
563 /*
564 ** Check to see if the file in the pContent blob is "embedded HTML". Return
565 ** true if it is, and fill pTitle with the document title.
@@ -770,11 +770,11 @@
770 }else{
771 style_header("%s", zDefaultTitle);
772 wiki_convert(pBody, 0, WIKI_BUTTONS);
773 }
774 document_emit_js();
775 style_finish_page("doc");
776 }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
777 Blob tail = BLOB_INITIALIZER;
778 markdown_to_html(pBody, &title, &tail);
779 if( blob_size(&title)>0 ){
780 style_header("%s", blob_str(&title));
@@ -781,30 +781,30 @@
781 }else{
782 style_header("%s", zDefaultTitle);
783 }
784 convert_href_and_output(&tail);
785 document_emit_js();
786 style_finish_page("doc");
787 }else if( fossil_strcmp(zMime, "text/plain")==0 ){
788 style_header("%s", zDefaultTitle);
789 @ <blockquote><pre>
790 @ %h(blob_str(pBody))
791 @ </pre></blockquote>
792 document_emit_js();
793 style_finish_page("doc");
794 }else if( fossil_strcmp(zMime, "text/html")==0
795 && doc_is_embedded_html(pBody, &title) ){
796 if( blob_size(&title)==0 ) blob_append(&title,zFilename,-1);
797 style_header("%s", blob_str(&title));
798 convert_href_and_output(pBody);
799 document_emit_js();
800 style_finish_page("doc");
801 }else if( fossil_strcmp(zMime, "text/x-pikchr")==0 ){
802 style_adunit_config(ADUNIT_RIGHT_OK);
803 style_header("%s", zDefaultTitle);
804 wiki_render_by_mimetype(pBody, zMime);
805 style_finish_page("doc");
806 #ifdef FOSSIL_ENABLE_TH1_DOCS
807 }else if( Th_AreDocsEnabled() &&
808 fossil_strcmp(zMime, "application/x-th1")==0 ){
809 int raw = P("raw")!=0;
810 if( !raw ){
@@ -821,11 +821,11 @@
821 }else{
822 Th_Render(blob_str(pBody));
823 }
824 if( !raw ){
825 document_emit_js();
826 style_finish_page("doc");
827 }
828 #endif
829 }else{
830 fossil_free(style_csp(1));
831 cgi_set_content_type(zMime);
@@ -906,10 +906,11 @@
906 #endif
907 };
908
909 login_check_credentials();
910 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
 
911 blob_init(&title, 0, 0);
912 zDfltTitle = isUV ? "" : "Documentation";
913 db_begin_transaction();
914 while( rid==0 && (++nMiss)<=count(azSuffix) ){
915 zName = P("name");
@@ -1029,11 +1030,11 @@
1029 style_header("Not Found");
1030 @ <p>Document %h(zOrigName) not found
1031 if( fossil_strcmp(zCheckin,"ckout")!=0 ){
1032 @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
1033 }
1034 style_finish_page("doc");
1035 return;
1036 }
1037
1038 /*
1039 ** The default logo.
@@ -1202,7 +1203,7 @@
1202 */
1203 void doc_search_page(void){
1204 login_check_credentials();
1205 style_header("Document Search");
1206 search_screen(SRCH_DOC, 0);
1207 style_finish_page("docsrch");
1208 }
1209
--- src/doc.c
+++ src/doc.c
@@ -555,11 +555,11 @@
555 }
556 @ <tr><td>%s(zFlag)%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr>
557 }
558 @ </tbody></table>
559 style_table_sorter();
560 style_finish_page();
561 }
562
563 /*
564 ** Check to see if the file in the pContent blob is "embedded HTML". Return
565 ** true if it is, and fill pTitle with the document title.
@@ -770,11 +770,11 @@
770 }else{
771 style_header("%s", zDefaultTitle);
772 wiki_convert(pBody, 0, WIKI_BUTTONS);
773 }
774 document_emit_js();
775 style_finish_page();
776 }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
777 Blob tail = BLOB_INITIALIZER;
778 markdown_to_html(pBody, &title, &tail);
779 if( blob_size(&title)>0 ){
780 style_header("%s", blob_str(&title));
@@ -781,30 +781,30 @@
781 }else{
782 style_header("%s", zDefaultTitle);
783 }
784 convert_href_and_output(&tail);
785 document_emit_js();
786 style_finish_page();
787 }else if( fossil_strcmp(zMime, "text/plain")==0 ){
788 style_header("%s", zDefaultTitle);
789 @ <blockquote><pre>
790 @ %h(blob_str(pBody))
791 @ </pre></blockquote>
792 document_emit_js();
793 style_finish_page();
794 }else if( fossil_strcmp(zMime, "text/html")==0
795 && doc_is_embedded_html(pBody, &title) ){
796 if( blob_size(&title)==0 ) blob_append(&title,zFilename,-1);
797 style_header("%s", blob_str(&title));
798 convert_href_and_output(pBody);
799 document_emit_js();
800 style_finish_page();
801 }else if( fossil_strcmp(zMime, "text/x-pikchr")==0 ){
802 style_adunit_config(ADUNIT_RIGHT_OK);
803 style_header("%s", zDefaultTitle);
804 wiki_render_by_mimetype(pBody, zMime);
805 style_finish_page();
806 #ifdef FOSSIL_ENABLE_TH1_DOCS
807 }else if( Th_AreDocsEnabled() &&
808 fossil_strcmp(zMime, "application/x-th1")==0 ){
809 int raw = P("raw")!=0;
810 if( !raw ){
@@ -821,11 +821,11 @@
821 }else{
822 Th_Render(blob_str(pBody));
823 }
824 if( !raw ){
825 document_emit_js();
826 style_finish_page();
827 }
828 #endif
829 }else{
830 fossil_free(style_csp(1));
831 cgi_set_content_type(zMime);
@@ -906,10 +906,11 @@
906 #endif
907 };
908
909 login_check_credentials();
910 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
911 style_set_current_feature("doc");
912 blob_init(&title, 0, 0);
913 zDfltTitle = isUV ? "" : "Documentation";
914 db_begin_transaction();
915 while( rid==0 && (++nMiss)<=count(azSuffix) ){
916 zName = P("name");
@@ -1029,11 +1030,11 @@
1030 style_header("Not Found");
1031 @ <p>Document %h(zOrigName) not found
1032 if( fossil_strcmp(zCheckin,"ckout")!=0 ){
1033 @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
1034 }
1035 style_finish_page();
1036 return;
1037 }
1038
1039 /*
1040 ** The default logo.
@@ -1202,7 +1203,7 @@
1203 */
1204 void doc_search_page(void){
1205 login_check_credentials();
1206 style_header("Document Search");
1207 search_screen(SRCH_DOC, 0);
1208 style_finish_page();
1209 }
1210
+6 -4
--- src/event.c
+++ src/event.c
@@ -110,14 +110,15 @@
110110
}
111111
break;
112112
}
113113
}
114114
db_finalize(&q1);
115
+ style_set_current_feature("event");
115116
if( rid==0 || (specRid!=0 && specRid!=rid) ){
116117
style_header("No Such Tech-Note");
117118
@ Cannot locate a technical note called <b>%h(zId)</b>.
118
- style_finish_page("event");
119
+ style_finish_page();
119120
return;
120121
}
121122
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
122123
zVerbose = P("v");
123124
if( !zVerbose ){
@@ -229,11 +230,11 @@
229230
" FROM tag"
230231
" WHERE tagname GLOB 'event-%q*'",
231232
zId);
232233
attachment_list(zFullId, "<hr /><h2>Attachments:</h2><ul>");
233234
document_emit_js();
234
- style_finish_page("event");
235
+ style_finish_page();
235236
manifest_destroy(pTNote);
236237
}
237238
238239
/*
239240
** Add or update a new tech note to the repository. rid is id of
@@ -415,10 +416,11 @@
415416
*/
416417
if( !g.perm.Write || (rid && !g.perm.WrWiki) || (!rid && !g.perm.NewWiki) ){
417418
login_needed(g.anon.Write && (rid ? g.anon.WrWiki : g.anon.NewWiki));
418419
return;
419420
}
421
+ style_set_current_feature("event");
420422
421423
/* Figure out the color */
422424
if( rid ){
423425
zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid);
424426
if( zClr && zClr[0] ){
@@ -473,11 +475,11 @@
473475
zMimetype, zComment, zTags,
474476
zClrFlag[0] ? zClr : 0) ){
475477
style_header("Error");
476478
@ Internal error: Fossil tried to make an invalid artifact for
477479
@ the edited technote.
478
- style_finish_page("event");
480
+ style_finish_page();
479481
return;
480482
}
481483
cgi_redirectf("%R/technote?name=%T", zId);
482484
}
483485
if( P("cancel")!=0 ){
@@ -567,11 +569,11 @@
567569
if( P("preview") ){
568570
@ <input type="submit" name="submit" value="Submit" />
569571
}
570572
@ </td></tr></table>
571573
@ </div></form>
572
- style_finish_page("event");
574
+ style_finish_page();
573575
}
574576
575577
/*
576578
** Add a new tech note to the repository. The timestamp is
577579
** given by the zETime parameter. rid must be zero to create
578580
--- src/event.c
+++ src/event.c
@@ -110,14 +110,15 @@
110 }
111 break;
112 }
113 }
114 db_finalize(&q1);
 
115 if( rid==0 || (specRid!=0 && specRid!=rid) ){
116 style_header("No Such Tech-Note");
117 @ Cannot locate a technical note called <b>%h(zId)</b>.
118 style_finish_page("event");
119 return;
120 }
121 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
122 zVerbose = P("v");
123 if( !zVerbose ){
@@ -229,11 +230,11 @@
229 " FROM tag"
230 " WHERE tagname GLOB 'event-%q*'",
231 zId);
232 attachment_list(zFullId, "<hr /><h2>Attachments:</h2><ul>");
233 document_emit_js();
234 style_finish_page("event");
235 manifest_destroy(pTNote);
236 }
237
238 /*
239 ** Add or update a new tech note to the repository. rid is id of
@@ -415,10 +416,11 @@
415 */
416 if( !g.perm.Write || (rid && !g.perm.WrWiki) || (!rid && !g.perm.NewWiki) ){
417 login_needed(g.anon.Write && (rid ? g.anon.WrWiki : g.anon.NewWiki));
418 return;
419 }
 
420
421 /* Figure out the color */
422 if( rid ){
423 zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid);
424 if( zClr && zClr[0] ){
@@ -473,11 +475,11 @@
473 zMimetype, zComment, zTags,
474 zClrFlag[0] ? zClr : 0) ){
475 style_header("Error");
476 @ Internal error: Fossil tried to make an invalid artifact for
477 @ the edited technote.
478 style_finish_page("event");
479 return;
480 }
481 cgi_redirectf("%R/technote?name=%T", zId);
482 }
483 if( P("cancel")!=0 ){
@@ -567,11 +569,11 @@
567 if( P("preview") ){
568 @ <input type="submit" name="submit" value="Submit" />
569 }
570 @ </td></tr></table>
571 @ </div></form>
572 style_finish_page("event");
573 }
574
575 /*
576 ** Add a new tech note to the repository. The timestamp is
577 ** given by the zETime parameter. rid must be zero to create
578
--- src/event.c
+++ src/event.c
@@ -110,14 +110,15 @@
110 }
111 break;
112 }
113 }
114 db_finalize(&q1);
115 style_set_current_feature("event");
116 if( rid==0 || (specRid!=0 && specRid!=rid) ){
117 style_header("No Such Tech-Note");
118 @ Cannot locate a technical note called <b>%h(zId)</b>.
119 style_finish_page();
120 return;
121 }
122 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
123 zVerbose = P("v");
124 if( !zVerbose ){
@@ -229,11 +230,11 @@
230 " FROM tag"
231 " WHERE tagname GLOB 'event-%q*'",
232 zId);
233 attachment_list(zFullId, "<hr /><h2>Attachments:</h2><ul>");
234 document_emit_js();
235 style_finish_page();
236 manifest_destroy(pTNote);
237 }
238
239 /*
240 ** Add or update a new tech note to the repository. rid is id of
@@ -415,10 +416,11 @@
416 */
417 if( !g.perm.Write || (rid && !g.perm.WrWiki) || (!rid && !g.perm.NewWiki) ){
418 login_needed(g.anon.Write && (rid ? g.anon.WrWiki : g.anon.NewWiki));
419 return;
420 }
421 style_set_current_feature("event");
422
423 /* Figure out the color */
424 if( rid ){
425 zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid);
426 if( zClr && zClr[0] ){
@@ -473,11 +475,11 @@
475 zMimetype, zComment, zTags,
476 zClrFlag[0] ? zClr : 0) ){
477 style_header("Error");
478 @ Internal error: Fossil tried to make an invalid artifact for
479 @ the edited technote.
480 style_finish_page();
481 return;
482 }
483 cgi_redirectf("%R/technote?name=%T", zId);
484 }
485 if( P("cancel")!=0 ){
@@ -567,11 +569,11 @@
569 if( P("preview") ){
570 @ <input type="submit" name="submit" value="Submit" />
571 }
572 @ </td></tr></table>
573 @ </div></form>
574 style_finish_page();
575 }
576
577 /*
578 ** Add a new tech note to the repository. The timestamp is
579 ** given by the zETime parameter. rid must be zero to create
580
+2 -1
--- src/extcgi.c
+++ src/extcgi.c
@@ -395,10 +395,11 @@
395395
if( !g.perm.Admin ){
396396
login_needed(0);
397397
return;
398398
}
399399
ext_files();
400
+ style_set_current_feature("extcgi");
400401
style_header("CGI Extension Filelist");
401402
@ <table border="0" cellspacing="0" cellpadding="3">
402403
@ <tbody>
403404
db_prepare(&q, "SELECT pathname, isexe FROM sfile"
404405
" ORDER BY pathname");
@@ -420,7 +421,7 @@
420421
@ </tr>
421422
}
422423
db_finalize(&q);
423424
@ </tbody>
424425
@ </table>
425
- style_finish_page("extcgi");
426
+ style_finish_page();
426427
}
427428
--- src/extcgi.c
+++ src/extcgi.c
@@ -395,10 +395,11 @@
395 if( !g.perm.Admin ){
396 login_needed(0);
397 return;
398 }
399 ext_files();
 
400 style_header("CGI Extension Filelist");
401 @ <table border="0" cellspacing="0" cellpadding="3">
402 @ <tbody>
403 db_prepare(&q, "SELECT pathname, isexe FROM sfile"
404 " ORDER BY pathname");
@@ -420,7 +421,7 @@
420 @ </tr>
421 }
422 db_finalize(&q);
423 @ </tbody>
424 @ </table>
425 style_finish_page("extcgi");
426 }
427
--- src/extcgi.c
+++ src/extcgi.c
@@ -395,10 +395,11 @@
395 if( !g.perm.Admin ){
396 login_needed(0);
397 return;
398 }
399 ext_files();
400 style_set_current_feature("extcgi");
401 style_header("CGI Extension Filelist");
402 @ <table border="0" cellspacing="0" cellpadding="3">
403 @ <tbody>
404 db_prepare(&q, "SELECT pathname, isexe FROM sfile"
405 " ORDER BY pathname");
@@ -420,7 +421,7 @@
421 @ </tr>
422 }
423 db_finalize(&q);
424 @ </tbody>
425 @ </table>
426 style_finish_page();
427 }
428
+2 -2
--- src/fileedit.c
+++ src/fileedit.c
@@ -1606,11 +1606,11 @@
16061606
"values matching files which may be edited online."
16071607
"</p>\n");
16081608
}else{
16091609
CX("<p>Online editing is disabled for this repository.</p>\n");
16101610
}
1611
- style_finish_page("fileedit");
1611
+ style_finish_page();
16121612
return;
16131613
}
16141614
16151615
/* Dispatch AJAX methods based tail of the request URI.
16161616
** The AJAX parts do their own permissions/CSRF check and
@@ -2061,7 +2061,7 @@
20612061
style_script_end();
20622062
}
20632063
blob_reset(&err);
20642064
CheckinMiniInfo_cleanup(&cimi);
20652065
db_end_transaction(0);
2066
- style_finish_page("fileedit");
2066
+ style_finish_page();
20672067
}
20682068
--- src/fileedit.c
+++ src/fileedit.c
@@ -1606,11 +1606,11 @@
1606 "values matching files which may be edited online."
1607 "</p>\n");
1608 }else{
1609 CX("<p>Online editing is disabled for this repository.</p>\n");
1610 }
1611 style_finish_page("fileedit");
1612 return;
1613 }
1614
1615 /* Dispatch AJAX methods based tail of the request URI.
1616 ** The AJAX parts do their own permissions/CSRF check and
@@ -2061,7 +2061,7 @@
2061 style_script_end();
2062 }
2063 blob_reset(&err);
2064 CheckinMiniInfo_cleanup(&cimi);
2065 db_end_transaction(0);
2066 style_finish_page("fileedit");
2067 }
2068
--- src/fileedit.c
+++ src/fileedit.c
@@ -1606,11 +1606,11 @@
1606 "values matching files which may be edited online."
1607 "</p>\n");
1608 }else{
1609 CX("<p>Online editing is disabled for this repository.</p>\n");
1610 }
1611 style_finish_page();
1612 return;
1613 }
1614
1615 /* Dispatch AJAX methods based tail of the request URI.
1616 ** The AJAX parts do their own permissions/CSRF check and
@@ -2061,7 +2061,7 @@
2061 style_script_end();
2062 }
2063 blob_reset(&err);
2064 CheckinMiniInfo_cleanup(&cimi);
2065 db_end_transaction(0);
2066 style_finish_page();
2067 }
2068
+4 -3
--- src/finfo.c
+++ src/finfo.c
@@ -367,11 +367,11 @@
367367
ridFrom = name_to_rid_www("from");
368368
zPrevDate[0] = 0;
369369
cookie_render();
370370
if( fnid==0 ){
371371
@ No such file: %h(zFilename)
372
- style_finish_page("finfo");
372
+ style_finish_page();
373373
return;
374374
}
375375
if( g.perm.Admin ){
376376
style_submenu_element("MLink Table", "%R/mlink?name=%t", zFilename);
377377
}
@@ -754,11 +754,11 @@
754754
@ <td></td><td></td><td></td></tr>
755755
}
756756
}
757757
@ </table>
758758
timeline_output_graph_javascript(pGraph, TIMELINE_FILEDIFF, iTableId);
759
- style_finish_page("finfo");
759
+ style_finish_page();
760760
}
761761
762762
/*
763763
** WEBPAGE: mlink
764764
** URL: /mlink?name=FILENAME
@@ -779,10 +779,11 @@
779779
const char *zCI = P("ci");
780780
Stmt q;
781781
782782
login_check_credentials();
783783
if( !g.perm.Admin ){ login_needed(g.anon.Admin); return; }
784
+ style_set_current_feature("finfo");
784785
style_header("MLINK Table");
785786
if( zFName==0 && zCI==0 ){
786787
@ <span class='generalError'>
787788
@ Requires either a name= or ci= query parameter
788789
@ </span>
@@ -934,7 +935,7 @@
934935
db_finalize(&q);
935936
@ </tbody>
936937
@ </table>
937938
@ </div>
938939
}
939
- style_finish_page("finfo");
940
+ style_finish_page();
940941
}
941942
--- src/finfo.c
+++ src/finfo.c
@@ -367,11 +367,11 @@
367 ridFrom = name_to_rid_www("from");
368 zPrevDate[0] = 0;
369 cookie_render();
370 if( fnid==0 ){
371 @ No such file: %h(zFilename)
372 style_finish_page("finfo");
373 return;
374 }
375 if( g.perm.Admin ){
376 style_submenu_element("MLink Table", "%R/mlink?name=%t", zFilename);
377 }
@@ -754,11 +754,11 @@
754 @ <td></td><td></td><td></td></tr>
755 }
756 }
757 @ </table>
758 timeline_output_graph_javascript(pGraph, TIMELINE_FILEDIFF, iTableId);
759 style_finish_page("finfo");
760 }
761
762 /*
763 ** WEBPAGE: mlink
764 ** URL: /mlink?name=FILENAME
@@ -779,10 +779,11 @@
779 const char *zCI = P("ci");
780 Stmt q;
781
782 login_check_credentials();
783 if( !g.perm.Admin ){ login_needed(g.anon.Admin); return; }
 
784 style_header("MLINK Table");
785 if( zFName==0 && zCI==0 ){
786 @ <span class='generalError'>
787 @ Requires either a name= or ci= query parameter
788 @ </span>
@@ -934,7 +935,7 @@
934 db_finalize(&q);
935 @ </tbody>
936 @ </table>
937 @ </div>
938 }
939 style_finish_page("finfo");
940 }
941
--- src/finfo.c
+++ src/finfo.c
@@ -367,11 +367,11 @@
367 ridFrom = name_to_rid_www("from");
368 zPrevDate[0] = 0;
369 cookie_render();
370 if( fnid==0 ){
371 @ No such file: %h(zFilename)
372 style_finish_page();
373 return;
374 }
375 if( g.perm.Admin ){
376 style_submenu_element("MLink Table", "%R/mlink?name=%t", zFilename);
377 }
@@ -754,11 +754,11 @@
754 @ <td></td><td></td><td></td></tr>
755 }
756 }
757 @ </table>
758 timeline_output_graph_javascript(pGraph, TIMELINE_FILEDIFF, iTableId);
759 style_finish_page();
760 }
761
762 /*
763 ** WEBPAGE: mlink
764 ** URL: /mlink?name=FILENAME
@@ -779,10 +779,11 @@
779 const char *zCI = P("ci");
780 Stmt q;
781
782 login_check_credentials();
783 if( !g.perm.Admin ){ login_needed(g.anon.Admin); return; }
784 style_set_current_feature("finfo");
785 style_header("MLINK Table");
786 if( zFName==0 && zCI==0 ){
787 @ <span class='generalError'>
788 @ Requires either a name= or ci= query parameter
789 @ </span>
@@ -934,7 +935,7 @@
935 db_finalize(&q);
936 @ </tbody>
937 @ </table>
938 @ </div>
939 }
940 style_finish_page();
941 }
942
+11 -6
--- src/forum.c
+++ src/forum.c
@@ -862,10 +862,11 @@
862862
" FROM forumpost, event"
863863
" WHERE event.objid=forumpost.fpid"
864864
" AND forumpost.fpid=%d;",
865865
fpid
866866
);
867
+ style_set_current_feature("forum");
867868
style_header("%s%s", zThreadTitle, *zThreadTitle ? "" : "Forum");
868869
fossil_free(zThreadTitle);
869870
if( mode!=FD_CHRONO ){
870871
style_submenu_element("Chronological", "%R/%s/%s?t=c%s%s", g.zPath, zName,
871872
bUnf ? "&unf" : "", bHist ? "&hist" : "");
@@ -883,11 +884,11 @@
883884
/* Emit Forum Javascript. */
884885
builtin_request_js("forum.js");
885886
forum_emit_js();
886887
887888
/* Emit the page style. */
888
- style_finish_page("forum");
889
+ style_finish_page();
889890
}
890891
891892
/*
892893
** Return true if a forum post should be moderated.
893894
*/
@@ -1054,10 +1055,11 @@
10541055
}else{
10551056
forumnew_page();
10561057
}
10571058
return;
10581059
}
1060
+ style_set_current_feature("forum");
10591061
style_header("%h As Anonymous?", isEdit ? "Reply" : "Post");
10601062
@ <p>You are not logged in.
10611063
@ <p><table border="0" cellpadding="10">
10621064
@ <tr><td>
10631065
@ <form action="%s(zGoto)" method="POST">
@@ -1079,11 +1081,11 @@
10791081
@ <input type="submit" value="Login">
10801082
@ </form>
10811083
@ <td>Log into an existing account
10821084
@ </table>
10831085
forum_emit_js();
1084
- style_finish_page("forum");
1086
+ style_finish_page();
10851087
fossil_free(zGoto);
10861088
}
10871089
10881090
/*
10891091
** Write the "From: USER" line on the webpage.
@@ -1115,10 +1117,11 @@
11151117
}
11161118
if( P("preview") && !whitespace_only(zContent) ){
11171119
@ <h1>Preview:</h1>
11181120
forum_render(zTitle, zMimetype, zContent, "forumEdit", 1);
11191121
}
1122
+ style_set_current_feature("forum");
11201123
style_header("New Forum Thread");
11211124
@ <form action="%R/forume1" method="POST">
11221125
@ <h1>New Thread:</h1>
11231126
forum_from_line();
11241127
forum_post_widget(zTitle, zMimetype, zContent);
@@ -1140,11 +1143,11 @@
11401143
@ Show query parameters</label>
11411144
@ </div>
11421145
}
11431146
@ </form>
11441147
forum_emit_js();
1145
- style_finish_page("forum");
1148
+ style_finish_page();
11461149
}
11471150
11481151
/*
11491152
** WEBPAGE: forume2
11501153
**
@@ -1214,10 +1217,11 @@
12141217
cgi_redirectf("%R/forum");
12151218
}
12161219
return;
12171220
}
12181221
}
1222
+ style_set_current_feature("forum");
12191223
isDelete = P("nullout")!=0;
12201224
if( P("submit")
12211225
&& isCsrfSafe
12221226
&& (zContent = PDT("content",""))!=0
12231227
&& (!whitespace_only(zContent) || isDelete)
@@ -1320,11 +1324,11 @@
13201324
@ Show query parameters</label>
13211325
@ </div>
13221326
}
13231327
@ </form>
13241328
forum_emit_js();
1325
- style_finish_page("forum");
1329
+ style_finish_page();
13261330
}
13271331
13281332
/*
13291333
** WEBPAGE: forummain
13301334
** WEBPAGE: forum
@@ -1346,10 +1350,11 @@
13461350
srchFlags = search_restrict(SRCH_FORUM);
13471351
if( !g.perm.RdForum ){
13481352
login_needed(g.anon.RdForum);
13491353
return;
13501354
}
1355
+ style_set_current_feature("forum");
13511356
style_header("Forum");
13521357
if( g.perm.WrForum ){
13531358
style_submenu_element("New Thread","%R/forumnew");
13541359
}else{
13551360
/* Can't combine this with previous case using the ternary operator
@@ -1362,11 +1367,11 @@
13621367
style_submenu_element("Moderation Requests", "%R/modreq");
13631368
}
13641369
if( (srchFlags & SRCH_FORUM)!=0 ){
13651370
if( search_screen(SRCH_FORUM, 0) ){
13661371
style_submenu_element("Recent Threads","%R/forum");
1367
- style_finish_page("forum");
1372
+ style_finish_page();
13681373
return;
13691374
}
13701375
}
13711376
iLimit = atoi(PD("n","25"));
13721377
iOfst = atoi(PD("x","0"));
@@ -1455,7 +1460,7 @@
14551460
if( iCnt>0 ){
14561461
@ </table></div>
14571462
}else{
14581463
@ <h1>No forum posts found</h1>
14591464
}
1460
- style_finish_page("forum");
1465
+ style_finish_page();
14611466
}
14621467
--- src/forum.c
+++ src/forum.c
@@ -862,10 +862,11 @@
862 " FROM forumpost, event"
863 " WHERE event.objid=forumpost.fpid"
864 " AND forumpost.fpid=%d;",
865 fpid
866 );
 
867 style_header("%s%s", zThreadTitle, *zThreadTitle ? "" : "Forum");
868 fossil_free(zThreadTitle);
869 if( mode!=FD_CHRONO ){
870 style_submenu_element("Chronological", "%R/%s/%s?t=c%s%s", g.zPath, zName,
871 bUnf ? "&unf" : "", bHist ? "&hist" : "");
@@ -883,11 +884,11 @@
883 /* Emit Forum Javascript. */
884 builtin_request_js("forum.js");
885 forum_emit_js();
886
887 /* Emit the page style. */
888 style_finish_page("forum");
889 }
890
891 /*
892 ** Return true if a forum post should be moderated.
893 */
@@ -1054,10 +1055,11 @@
1054 }else{
1055 forumnew_page();
1056 }
1057 return;
1058 }
 
1059 style_header("%h As Anonymous?", isEdit ? "Reply" : "Post");
1060 @ <p>You are not logged in.
1061 @ <p><table border="0" cellpadding="10">
1062 @ <tr><td>
1063 @ <form action="%s(zGoto)" method="POST">
@@ -1079,11 +1081,11 @@
1079 @ <input type="submit" value="Login">
1080 @ </form>
1081 @ <td>Log into an existing account
1082 @ </table>
1083 forum_emit_js();
1084 style_finish_page("forum");
1085 fossil_free(zGoto);
1086 }
1087
1088 /*
1089 ** Write the "From: USER" line on the webpage.
@@ -1115,10 +1117,11 @@
1115 }
1116 if( P("preview") && !whitespace_only(zContent) ){
1117 @ <h1>Preview:</h1>
1118 forum_render(zTitle, zMimetype, zContent, "forumEdit", 1);
1119 }
 
1120 style_header("New Forum Thread");
1121 @ <form action="%R/forume1" method="POST">
1122 @ <h1>New Thread:</h1>
1123 forum_from_line();
1124 forum_post_widget(zTitle, zMimetype, zContent);
@@ -1140,11 +1143,11 @@
1140 @ Show query parameters</label>
1141 @ </div>
1142 }
1143 @ </form>
1144 forum_emit_js();
1145 style_finish_page("forum");
1146 }
1147
1148 /*
1149 ** WEBPAGE: forume2
1150 **
@@ -1214,10 +1217,11 @@
1214 cgi_redirectf("%R/forum");
1215 }
1216 return;
1217 }
1218 }
 
1219 isDelete = P("nullout")!=0;
1220 if( P("submit")
1221 && isCsrfSafe
1222 && (zContent = PDT("content",""))!=0
1223 && (!whitespace_only(zContent) || isDelete)
@@ -1320,11 +1324,11 @@
1320 @ Show query parameters</label>
1321 @ </div>
1322 }
1323 @ </form>
1324 forum_emit_js();
1325 style_finish_page("forum");
1326 }
1327
1328 /*
1329 ** WEBPAGE: forummain
1330 ** WEBPAGE: forum
@@ -1346,10 +1350,11 @@
1346 srchFlags = search_restrict(SRCH_FORUM);
1347 if( !g.perm.RdForum ){
1348 login_needed(g.anon.RdForum);
1349 return;
1350 }
 
1351 style_header("Forum");
1352 if( g.perm.WrForum ){
1353 style_submenu_element("New Thread","%R/forumnew");
1354 }else{
1355 /* Can't combine this with previous case using the ternary operator
@@ -1362,11 +1367,11 @@
1362 style_submenu_element("Moderation Requests", "%R/modreq");
1363 }
1364 if( (srchFlags & SRCH_FORUM)!=0 ){
1365 if( search_screen(SRCH_FORUM, 0) ){
1366 style_submenu_element("Recent Threads","%R/forum");
1367 style_finish_page("forum");
1368 return;
1369 }
1370 }
1371 iLimit = atoi(PD("n","25"));
1372 iOfst = atoi(PD("x","0"));
@@ -1455,7 +1460,7 @@
1455 if( iCnt>0 ){
1456 @ </table></div>
1457 }else{
1458 @ <h1>No forum posts found</h1>
1459 }
1460 style_finish_page("forum");
1461 }
1462
--- src/forum.c
+++ src/forum.c
@@ -862,10 +862,11 @@
862 " FROM forumpost, event"
863 " WHERE event.objid=forumpost.fpid"
864 " AND forumpost.fpid=%d;",
865 fpid
866 );
867 style_set_current_feature("forum");
868 style_header("%s%s", zThreadTitle, *zThreadTitle ? "" : "Forum");
869 fossil_free(zThreadTitle);
870 if( mode!=FD_CHRONO ){
871 style_submenu_element("Chronological", "%R/%s/%s?t=c%s%s", g.zPath, zName,
872 bUnf ? "&unf" : "", bHist ? "&hist" : "");
@@ -883,11 +884,11 @@
884 /* Emit Forum Javascript. */
885 builtin_request_js("forum.js");
886 forum_emit_js();
887
888 /* Emit the page style. */
889 style_finish_page();
890 }
891
892 /*
893 ** Return true if a forum post should be moderated.
894 */
@@ -1054,10 +1055,11 @@
1055 }else{
1056 forumnew_page();
1057 }
1058 return;
1059 }
1060 style_set_current_feature("forum");
1061 style_header("%h As Anonymous?", isEdit ? "Reply" : "Post");
1062 @ <p>You are not logged in.
1063 @ <p><table border="0" cellpadding="10">
1064 @ <tr><td>
1065 @ <form action="%s(zGoto)" method="POST">
@@ -1079,11 +1081,11 @@
1081 @ <input type="submit" value="Login">
1082 @ </form>
1083 @ <td>Log into an existing account
1084 @ </table>
1085 forum_emit_js();
1086 style_finish_page();
1087 fossil_free(zGoto);
1088 }
1089
1090 /*
1091 ** Write the "From: USER" line on the webpage.
@@ -1115,10 +1117,11 @@
1117 }
1118 if( P("preview") && !whitespace_only(zContent) ){
1119 @ <h1>Preview:</h1>
1120 forum_render(zTitle, zMimetype, zContent, "forumEdit", 1);
1121 }
1122 style_set_current_feature("forum");
1123 style_header("New Forum Thread");
1124 @ <form action="%R/forume1" method="POST">
1125 @ <h1>New Thread:</h1>
1126 forum_from_line();
1127 forum_post_widget(zTitle, zMimetype, zContent);
@@ -1140,11 +1143,11 @@
1143 @ Show query parameters</label>
1144 @ </div>
1145 }
1146 @ </form>
1147 forum_emit_js();
1148 style_finish_page();
1149 }
1150
1151 /*
1152 ** WEBPAGE: forume2
1153 **
@@ -1214,10 +1217,11 @@
1217 cgi_redirectf("%R/forum");
1218 }
1219 return;
1220 }
1221 }
1222 style_set_current_feature("forum");
1223 isDelete = P("nullout")!=0;
1224 if( P("submit")
1225 && isCsrfSafe
1226 && (zContent = PDT("content",""))!=0
1227 && (!whitespace_only(zContent) || isDelete)
@@ -1320,11 +1324,11 @@
1324 @ Show query parameters</label>
1325 @ </div>
1326 }
1327 @ </form>
1328 forum_emit_js();
1329 style_finish_page();
1330 }
1331
1332 /*
1333 ** WEBPAGE: forummain
1334 ** WEBPAGE: forum
@@ -1346,10 +1350,11 @@
1350 srchFlags = search_restrict(SRCH_FORUM);
1351 if( !g.perm.RdForum ){
1352 login_needed(g.anon.RdForum);
1353 return;
1354 }
1355 style_set_current_feature("forum");
1356 style_header("Forum");
1357 if( g.perm.WrForum ){
1358 style_submenu_element("New Thread","%R/forumnew");
1359 }else{
1360 /* Can't combine this with previous case using the ternary operator
@@ -1362,11 +1367,11 @@
1367 style_submenu_element("Moderation Requests", "%R/modreq");
1368 }
1369 if( (srchFlags & SRCH_FORUM)!=0 ){
1370 if( search_screen(SRCH_FORUM, 0) ){
1371 style_submenu_element("Recent Threads","%R/forum");
1372 style_finish_page();
1373 return;
1374 }
1375 }
1376 iLimit = atoi(PD("n","25"));
1377 iOfst = atoi(PD("x","0"));
@@ -1455,7 +1460,7 @@
1460 if( iCnt>0 ){
1461 @ </table></div>
1462 }else{
1463 @ <h1>No forum posts found</h1>
1464 }
1465 style_finish_page();
1466 }
1467
+22 -16
--- src/info.c
+++ src/info.c
@@ -503,11 +503,11 @@
503503
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
504504
rid = name_to_rid_www("name");
505505
if( rid==0 ){
506506
style_header("Check-in Information Error");
507507
@ No such object: %h(g.argv[2])
508
- style_finish_page("ci_tags");
508
+ style_finish_page();
509509
return;
510510
}
511511
zHash = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
512512
style_header("Tags and Properties");
513513
@ <h1>Tags and Properties for Check-In \
@@ -595,11 +595,11 @@
595595
blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
596596
db_prepare(&q, "%s", blob_sql_text(&sql));
597597
www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
598598
0, 0, 0, rid, 0, 0);
599599
db_finalize(&q);
600
- style_finish_page("ci_tags");
600
+ style_finish_page();
601601
}
602602
603603
/*
604604
** WEBPAGE: vinfo
605605
** WEBPAGE: ci
@@ -629,16 +629,17 @@
629629
const char *zPageHide = "ci"; /* Page that hides diffs */
630630
const char *zBrName; /* Branch name */
631631
632632
login_check_credentials();
633633
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
634
+ style_set_current_feature("vinfo");
634635
zName = P("name");
635636
rid = name_to_rid_www("name");
636637
if( rid==0 ){
637638
style_header("Check-in Information Error");
638639
@ No such object: %h(g.argv[2])
639
- style_finish_page("vinfo");
640
+ style_finish_page();
640641
return;
641642
}
642643
zRe = P("regex");
643644
if( zRe ) re_compile(&pRe, zRe, 0);
644645
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
@@ -940,11 +941,11 @@
940941
diffFlags,pRe,mperm);
941942
}
942943
db_finalize(&q3);
943944
append_diff_javascript(diffType==2);
944945
cookie_render();
945
- style_finish_page("vinfo");
946
+ style_finish_page();
946947
}
947948
948949
/*
949950
** WEBPAGE: winfo
950951
** URL: /winfo?name=HASH
@@ -962,15 +963,16 @@
962963
int tagid;
963964
int ridNext;
964965
965966
login_check_credentials();
966967
if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
968
+ style_set_current_feature("winfo");
967969
rid = name_to_rid_www("name");
968970
if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))==0 ){
969971
style_header("Wiki Page Information Error");
970972
@ No such object: %h(P("name"))
971
- style_finish_page("winfo");
973
+ style_finish_page();
972974
return;
973975
}
974976
if( g.perm.ModWiki && (zModAction = P("modaction"))!=0 ){
975977
if( strcmp(zModAction,"delete")==0 ){
976978
moderation_disapprove(rid);
@@ -1054,11 +1056,11 @@
10541056
safe_html_context(DOCSRC_WIKI);
10551057
wiki_render_by_mimetype(&wiki, pWiki->zMimetype);
10561058
blob_reset(&wiki);
10571059
manifest_destroy(pWiki);
10581060
document_emit_js();
1059
- style_finish_page("winfo");
1061
+ style_finish_page();
10601062
}
10611063
10621064
/*
10631065
** Find an check-in based on query parameter zParam and parse its
10641066
** manifest. Return the number of errors.
@@ -1210,10 +1212,11 @@
12101212
if(zGlob && !*zGlob){
12111213
zGlob = NULL;
12121214
}
12131215
diffFlags = construct_diff_flags(diffType);
12141216
zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
1217
+ style_set_current_feature("vdiff");
12151218
if( zBranch==0 ){
12161219
style_submenu_element("Path", "%R/timeline?me=%T&you=%T", zFrom, zTo);
12171220
}
12181221
if( diffType!=0 ){
12191222
style_submenu_element("Hide Diff", "%R/vdiff?%s&diff=0%s%T%s",
@@ -1327,11 +1330,11 @@
13271330
}
13281331
}
13291332
manifest_destroy(pFrom);
13301333
manifest_destroy(pTo);
13311334
append_diff_javascript(diffType==2);
1332
- style_finish_page("vdiff");
1335
+ style_finish_page();
13331336
}
13341337
13351338
#if INTERFACE
13361339
/*
13371340
** Possible return values from object_description()
@@ -1730,10 +1733,11 @@
17301733
17311734
zV1 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v1);
17321735
zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2);
17331736
diffFlags = construct_diff_flags(diffType) | DIFF_HTML;
17341737
1738
+ style_set_current_feature("fdiff");
17351739
style_header("Diff");
17361740
style_submenu_checkbox("w", "Ignore Whitespace", 0, 0);
17371741
if( diffType==2 ){
17381742
style_submenu_element("Unified Diff", "%R/fdiff?v1=%T&v2=%T&diff=1",
17391743
P("v1"), P("v2"));
@@ -1761,11 +1765,11 @@
17611765
@ are shown.</b>
17621766
}
17631767
@ <hr />
17641768
append_diff(zV1, zV2, diffFlags, pRe);
17651769
append_diff_javascript(diffType);
1766
- style_finish_page("fdiff");
1770
+ style_finish_page();
17671771
}
17681772
17691773
/*
17701774
** WEBPAGE: raw
17711775
** URL: /raw/ARTIFACTID
@@ -1965,11 +1969,11 @@
19651969
@ <hr />
19661970
content_get(rid, &content);
19671971
@ <blockquote><pre>
19681972
hexdump(&content);
19691973
@ </pre></blockquote>
1970
- style_finish_page("hexdump");
1974
+ style_finish_page();
19711975
}
19721976
19731977
/*
19741978
** Look for "ci" and "filename" query parameters. If found, try to
19751979
** use them to extract the record ID of an artifact for the file.
@@ -2234,10 +2238,11 @@
22342238
int isBranchCI = 0; /* ci= refers to a branch name */
22352239
char *zHeader = 0;
22362240
22372241
login_check_credentials();
22382242
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
2243
+ style_set_current_feature("artifact");
22392244
22402245
/* Capture and normalize the name= and ci= query parameters */
22412246
if( zName==0 ){
22422247
zName = P("filename");
22432248
if( zName==0 ){
@@ -2263,11 +2268,11 @@
22632268
page_tree();
22642269
return;
22652270
}
22662271
style_header("Missing name= query parameter");
22672272
@ The name= query parameter is missing
2268
- style_finish_page("artifact");
2273
+ style_finish_page();
22692274
return;
22702275
}
22712276
22722277
url_initialize(&url, g.zPath);
22732278
url_add_parameter(&url, "name", zName);
@@ -2324,11 +2329,11 @@
23242329
}else{
23252330
style_header("No such artifact");
23262331
@ Artifact '%h(zName)' does not exist in this repository.
23272332
}
23282333
if( rid==0 ){
2329
- style_finish_page("artifact");
2334
+ style_finish_page();
23302335
return;
23312336
}
23322337
}
23332338
23342339
if( descOnly || P("verbose")!=0 ){
@@ -2532,11 +2537,11 @@
25322537
@ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
25332538
}
25342539
@ </blockquote>
25352540
}
25362541
}
2537
- style_finish_page("artifact");
2542
+ style_finish_page();
25382543
}
25392544
25402545
/*
25412546
** WEBPAGE: tinfo
25422547
** URL: /tinfo?name=ARTIFACTID
@@ -2590,10 +2595,11 @@
25902595
}
25912596
zTktTitle = db_table_has_column("repository", "ticket", "title" )
25922597
? db_text("(No title)",
25932598
"SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
25942599
: 0;
2600
+ style_set_current_feature("tinfo");
25952601
style_header("Ticket Change Details");
25962602
style_submenu_element("Raw", "%R/artifact/%s", zUuid);
25972603
style_submenu_element("History", "%R/tkthistory/%s", zTktName);
25982604
style_submenu_element("Page", "%R/tktview/%t", zTktName);
25992605
style_submenu_element("Timeline", "%R/tkttimeline/%t", zTktName);
@@ -2639,11 +2645,11 @@
26392645
26402646
@ <div class="section">Changes</div>
26412647
@ <p>
26422648
ticket_output_change_artifact(pTktChng, 0, 1);
26432649
manifest_destroy(pTktChng);
2644
- style_finish_page("tinfo");
2650
+ style_finish_page();
26452651
}
26462652
26472653
26482654
/*
26492655
** WEBPAGE: info
@@ -2690,11 +2696,11 @@
26902696
@ <p>No such object: %h(zName)</p>
26912697
if( nLen<4 ){
26922698
@ <p>Object name should be no less than 4 characters. Ten or more
26932699
@ characters are recommended.</p>
26942700
}
2695
- style_finish_page("info");
2701
+ style_finish_page();
26962702
return;
26972703
}else if( rc==2 ){
26982704
cgi_set_parameter("src","info");
26992705
ambiguous_page();
27002706
return;
@@ -2702,11 +2708,11 @@
27022708
zName = blob_str(&uuid);
27032709
rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", zName);
27042710
if( rid==0 ){
27052711
style_header("Broken Link");
27062712
@ <p>No such object: %h(zName)</p>
2707
- style_finish_page("info");
2713
+ style_finish_page();
27082714
return;
27092715
}
27102716
if( db_exists("SELECT 1 FROM mlink WHERE mid=%d", rid) ){
27112717
ci_page();
27122718
}else
@@ -3227,11 +3233,11 @@
32273233
}
32283234
@ </td></tr>
32293235
@ </table>
32303236
@ </div></form>
32313237
builtin_request_js("ci_edit.js");
3232
- style_finish_page("ci_edit");
3238
+ style_finish_page();
32333239
}
32343240
32353241
/*
32363242
** Prepare an ammended commit comment. Let the user modify it using the
32373243
** editor specified in the global_config table or either
32383244
--- src/info.c
+++ src/info.c
@@ -503,11 +503,11 @@
503 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
504 rid = name_to_rid_www("name");
505 if( rid==0 ){
506 style_header("Check-in Information Error");
507 @ No such object: %h(g.argv[2])
508 style_finish_page("ci_tags");
509 return;
510 }
511 zHash = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
512 style_header("Tags and Properties");
513 @ <h1>Tags and Properties for Check-In \
@@ -595,11 +595,11 @@
595 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
596 db_prepare(&q, "%s", blob_sql_text(&sql));
597 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
598 0, 0, 0, rid, 0, 0);
599 db_finalize(&q);
600 style_finish_page("ci_tags");
601 }
602
603 /*
604 ** WEBPAGE: vinfo
605 ** WEBPAGE: ci
@@ -629,16 +629,17 @@
629 const char *zPageHide = "ci"; /* Page that hides diffs */
630 const char *zBrName; /* Branch name */
631
632 login_check_credentials();
633 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
 
634 zName = P("name");
635 rid = name_to_rid_www("name");
636 if( rid==0 ){
637 style_header("Check-in Information Error");
638 @ No such object: %h(g.argv[2])
639 style_finish_page("vinfo");
640 return;
641 }
642 zRe = P("regex");
643 if( zRe ) re_compile(&pRe, zRe, 0);
644 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
@@ -940,11 +941,11 @@
940 diffFlags,pRe,mperm);
941 }
942 db_finalize(&q3);
943 append_diff_javascript(diffType==2);
944 cookie_render();
945 style_finish_page("vinfo");
946 }
947
948 /*
949 ** WEBPAGE: winfo
950 ** URL: /winfo?name=HASH
@@ -962,15 +963,16 @@
962 int tagid;
963 int ridNext;
964
965 login_check_credentials();
966 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
 
967 rid = name_to_rid_www("name");
968 if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))==0 ){
969 style_header("Wiki Page Information Error");
970 @ No such object: %h(P("name"))
971 style_finish_page("winfo");
972 return;
973 }
974 if( g.perm.ModWiki && (zModAction = P("modaction"))!=0 ){
975 if( strcmp(zModAction,"delete")==0 ){
976 moderation_disapprove(rid);
@@ -1054,11 +1056,11 @@
1054 safe_html_context(DOCSRC_WIKI);
1055 wiki_render_by_mimetype(&wiki, pWiki->zMimetype);
1056 blob_reset(&wiki);
1057 manifest_destroy(pWiki);
1058 document_emit_js();
1059 style_finish_page("winfo");
1060 }
1061
1062 /*
1063 ** Find an check-in based on query parameter zParam and parse its
1064 ** manifest. Return the number of errors.
@@ -1210,10 +1212,11 @@
1210 if(zGlob && !*zGlob){
1211 zGlob = NULL;
1212 }
1213 diffFlags = construct_diff_flags(diffType);
1214 zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
 
1215 if( zBranch==0 ){
1216 style_submenu_element("Path", "%R/timeline?me=%T&you=%T", zFrom, zTo);
1217 }
1218 if( diffType!=0 ){
1219 style_submenu_element("Hide Diff", "%R/vdiff?%s&diff=0%s%T%s",
@@ -1327,11 +1330,11 @@
1327 }
1328 }
1329 manifest_destroy(pFrom);
1330 manifest_destroy(pTo);
1331 append_diff_javascript(diffType==2);
1332 style_finish_page("vdiff");
1333 }
1334
1335 #if INTERFACE
1336 /*
1337 ** Possible return values from object_description()
@@ -1730,10 +1733,11 @@
1730
1731 zV1 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v1);
1732 zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2);
1733 diffFlags = construct_diff_flags(diffType) | DIFF_HTML;
1734
 
1735 style_header("Diff");
1736 style_submenu_checkbox("w", "Ignore Whitespace", 0, 0);
1737 if( diffType==2 ){
1738 style_submenu_element("Unified Diff", "%R/fdiff?v1=%T&v2=%T&diff=1",
1739 P("v1"), P("v2"));
@@ -1761,11 +1765,11 @@
1761 @ are shown.</b>
1762 }
1763 @ <hr />
1764 append_diff(zV1, zV2, diffFlags, pRe);
1765 append_diff_javascript(diffType);
1766 style_finish_page("fdiff");
1767 }
1768
1769 /*
1770 ** WEBPAGE: raw
1771 ** URL: /raw/ARTIFACTID
@@ -1965,11 +1969,11 @@
1965 @ <hr />
1966 content_get(rid, &content);
1967 @ <blockquote><pre>
1968 hexdump(&content);
1969 @ </pre></blockquote>
1970 style_finish_page("hexdump");
1971 }
1972
1973 /*
1974 ** Look for "ci" and "filename" query parameters. If found, try to
1975 ** use them to extract the record ID of an artifact for the file.
@@ -2234,10 +2238,11 @@
2234 int isBranchCI = 0; /* ci= refers to a branch name */
2235 char *zHeader = 0;
2236
2237 login_check_credentials();
2238 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
 
2239
2240 /* Capture and normalize the name= and ci= query parameters */
2241 if( zName==0 ){
2242 zName = P("filename");
2243 if( zName==0 ){
@@ -2263,11 +2268,11 @@
2263 page_tree();
2264 return;
2265 }
2266 style_header("Missing name= query parameter");
2267 @ The name= query parameter is missing
2268 style_finish_page("artifact");
2269 return;
2270 }
2271
2272 url_initialize(&url, g.zPath);
2273 url_add_parameter(&url, "name", zName);
@@ -2324,11 +2329,11 @@
2324 }else{
2325 style_header("No such artifact");
2326 @ Artifact '%h(zName)' does not exist in this repository.
2327 }
2328 if( rid==0 ){
2329 style_finish_page("artifact");
2330 return;
2331 }
2332 }
2333
2334 if( descOnly || P("verbose")!=0 ){
@@ -2532,11 +2537,11 @@
2532 @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
2533 }
2534 @ </blockquote>
2535 }
2536 }
2537 style_finish_page("artifact");
2538 }
2539
2540 /*
2541 ** WEBPAGE: tinfo
2542 ** URL: /tinfo?name=ARTIFACTID
@@ -2590,10 +2595,11 @@
2590 }
2591 zTktTitle = db_table_has_column("repository", "ticket", "title" )
2592 ? db_text("(No title)",
2593 "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
2594 : 0;
 
2595 style_header("Ticket Change Details");
2596 style_submenu_element("Raw", "%R/artifact/%s", zUuid);
2597 style_submenu_element("History", "%R/tkthistory/%s", zTktName);
2598 style_submenu_element("Page", "%R/tktview/%t", zTktName);
2599 style_submenu_element("Timeline", "%R/tkttimeline/%t", zTktName);
@@ -2639,11 +2645,11 @@
2639
2640 @ <div class="section">Changes</div>
2641 @ <p>
2642 ticket_output_change_artifact(pTktChng, 0, 1);
2643 manifest_destroy(pTktChng);
2644 style_finish_page("tinfo");
2645 }
2646
2647
2648 /*
2649 ** WEBPAGE: info
@@ -2690,11 +2696,11 @@
2690 @ <p>No such object: %h(zName)</p>
2691 if( nLen<4 ){
2692 @ <p>Object name should be no less than 4 characters. Ten or more
2693 @ characters are recommended.</p>
2694 }
2695 style_finish_page("info");
2696 return;
2697 }else if( rc==2 ){
2698 cgi_set_parameter("src","info");
2699 ambiguous_page();
2700 return;
@@ -2702,11 +2708,11 @@
2702 zName = blob_str(&uuid);
2703 rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", zName);
2704 if( rid==0 ){
2705 style_header("Broken Link");
2706 @ <p>No such object: %h(zName)</p>
2707 style_finish_page("info");
2708 return;
2709 }
2710 if( db_exists("SELECT 1 FROM mlink WHERE mid=%d", rid) ){
2711 ci_page();
2712 }else
@@ -3227,11 +3233,11 @@
3227 }
3228 @ </td></tr>
3229 @ </table>
3230 @ </div></form>
3231 builtin_request_js("ci_edit.js");
3232 style_finish_page("ci_edit");
3233 }
3234
3235 /*
3236 ** Prepare an ammended commit comment. Let the user modify it using the
3237 ** editor specified in the global_config table or either
3238
--- src/info.c
+++ src/info.c
@@ -503,11 +503,11 @@
503 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
504 rid = name_to_rid_www("name");
505 if( rid==0 ){
506 style_header("Check-in Information Error");
507 @ No such object: %h(g.argv[2])
508 style_finish_page();
509 return;
510 }
511 zHash = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
512 style_header("Tags and Properties");
513 @ <h1>Tags and Properties for Check-In \
@@ -595,11 +595,11 @@
595 blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC");
596 db_prepare(&q, "%s", blob_sql_text(&sql));
597 www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL,
598 0, 0, 0, rid, 0, 0);
599 db_finalize(&q);
600 style_finish_page();
601 }
602
603 /*
604 ** WEBPAGE: vinfo
605 ** WEBPAGE: ci
@@ -629,16 +629,17 @@
629 const char *zPageHide = "ci"; /* Page that hides diffs */
630 const char *zBrName; /* Branch name */
631
632 login_check_credentials();
633 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
634 style_set_current_feature("vinfo");
635 zName = P("name");
636 rid = name_to_rid_www("name");
637 if( rid==0 ){
638 style_header("Check-in Information Error");
639 @ No such object: %h(g.argv[2])
640 style_finish_page();
641 return;
642 }
643 zRe = P("regex");
644 if( zRe ) re_compile(&pRe, zRe, 0);
645 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
@@ -940,11 +941,11 @@
941 diffFlags,pRe,mperm);
942 }
943 db_finalize(&q3);
944 append_diff_javascript(diffType==2);
945 cookie_render();
946 style_finish_page();
947 }
948
949 /*
950 ** WEBPAGE: winfo
951 ** URL: /winfo?name=HASH
@@ -962,15 +963,16 @@
963 int tagid;
964 int ridNext;
965
966 login_check_credentials();
967 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
968 style_set_current_feature("winfo");
969 rid = name_to_rid_www("name");
970 if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))==0 ){
971 style_header("Wiki Page Information Error");
972 @ No such object: %h(P("name"))
973 style_finish_page();
974 return;
975 }
976 if( g.perm.ModWiki && (zModAction = P("modaction"))!=0 ){
977 if( strcmp(zModAction,"delete")==0 ){
978 moderation_disapprove(rid);
@@ -1054,11 +1056,11 @@
1056 safe_html_context(DOCSRC_WIKI);
1057 wiki_render_by_mimetype(&wiki, pWiki->zMimetype);
1058 blob_reset(&wiki);
1059 manifest_destroy(pWiki);
1060 document_emit_js();
1061 style_finish_page();
1062 }
1063
1064 /*
1065 ** Find an check-in based on query parameter zParam and parse its
1066 ** manifest. Return the number of errors.
@@ -1210,10 +1212,11 @@
1212 if(zGlob && !*zGlob){
1213 zGlob = NULL;
1214 }
1215 diffFlags = construct_diff_flags(diffType);
1216 zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
1217 style_set_current_feature("vdiff");
1218 if( zBranch==0 ){
1219 style_submenu_element("Path", "%R/timeline?me=%T&you=%T", zFrom, zTo);
1220 }
1221 if( diffType!=0 ){
1222 style_submenu_element("Hide Diff", "%R/vdiff?%s&diff=0%s%T%s",
@@ -1327,11 +1330,11 @@
1330 }
1331 }
1332 manifest_destroy(pFrom);
1333 manifest_destroy(pTo);
1334 append_diff_javascript(diffType==2);
1335 style_finish_page();
1336 }
1337
1338 #if INTERFACE
1339 /*
1340 ** Possible return values from object_description()
@@ -1730,10 +1733,11 @@
1733
1734 zV1 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v1);
1735 zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2);
1736 diffFlags = construct_diff_flags(diffType) | DIFF_HTML;
1737
1738 style_set_current_feature("fdiff");
1739 style_header("Diff");
1740 style_submenu_checkbox("w", "Ignore Whitespace", 0, 0);
1741 if( diffType==2 ){
1742 style_submenu_element("Unified Diff", "%R/fdiff?v1=%T&v2=%T&diff=1",
1743 P("v1"), P("v2"));
@@ -1761,11 +1765,11 @@
1765 @ are shown.</b>
1766 }
1767 @ <hr />
1768 append_diff(zV1, zV2, diffFlags, pRe);
1769 append_diff_javascript(diffType);
1770 style_finish_page();
1771 }
1772
1773 /*
1774 ** WEBPAGE: raw
1775 ** URL: /raw/ARTIFACTID
@@ -1965,11 +1969,11 @@
1969 @ <hr />
1970 content_get(rid, &content);
1971 @ <blockquote><pre>
1972 hexdump(&content);
1973 @ </pre></blockquote>
1974 style_finish_page();
1975 }
1976
1977 /*
1978 ** Look for "ci" and "filename" query parameters. If found, try to
1979 ** use them to extract the record ID of an artifact for the file.
@@ -2234,10 +2238,11 @@
2238 int isBranchCI = 0; /* ci= refers to a branch name */
2239 char *zHeader = 0;
2240
2241 login_check_credentials();
2242 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
2243 style_set_current_feature("artifact");
2244
2245 /* Capture and normalize the name= and ci= query parameters */
2246 if( zName==0 ){
2247 zName = P("filename");
2248 if( zName==0 ){
@@ -2263,11 +2268,11 @@
2268 page_tree();
2269 return;
2270 }
2271 style_header("Missing name= query parameter");
2272 @ The name= query parameter is missing
2273 style_finish_page();
2274 return;
2275 }
2276
2277 url_initialize(&url, g.zPath);
2278 url_add_parameter(&url, "name", zName);
@@ -2324,11 +2329,11 @@
2329 }else{
2330 style_header("No such artifact");
2331 @ Artifact '%h(zName)' does not exist in this repository.
2332 }
2333 if( rid==0 ){
2334 style_finish_page();
2335 return;
2336 }
2337 }
2338
2339 if( descOnly || P("verbose")!=0 ){
@@ -2532,11 +2537,11 @@
2537 @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
2538 }
2539 @ </blockquote>
2540 }
2541 }
2542 style_finish_page();
2543 }
2544
2545 /*
2546 ** WEBPAGE: tinfo
2547 ** URL: /tinfo?name=ARTIFACTID
@@ -2590,10 +2595,11 @@
2595 }
2596 zTktTitle = db_table_has_column("repository", "ticket", "title" )
2597 ? db_text("(No title)",
2598 "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName)
2599 : 0;
2600 style_set_current_feature("tinfo");
2601 style_header("Ticket Change Details");
2602 style_submenu_element("Raw", "%R/artifact/%s", zUuid);
2603 style_submenu_element("History", "%R/tkthistory/%s", zTktName);
2604 style_submenu_element("Page", "%R/tktview/%t", zTktName);
2605 style_submenu_element("Timeline", "%R/tkttimeline/%t", zTktName);
@@ -2639,11 +2645,11 @@
2645
2646 @ <div class="section">Changes</div>
2647 @ <p>
2648 ticket_output_change_artifact(pTktChng, 0, 1);
2649 manifest_destroy(pTktChng);
2650 style_finish_page();
2651 }
2652
2653
2654 /*
2655 ** WEBPAGE: info
@@ -2690,11 +2696,11 @@
2696 @ <p>No such object: %h(zName)</p>
2697 if( nLen<4 ){
2698 @ <p>Object name should be no less than 4 characters. Ten or more
2699 @ characters are recommended.</p>
2700 }
2701 style_finish_page();
2702 return;
2703 }else if( rc==2 ){
2704 cgi_set_parameter("src","info");
2705 ambiguous_page();
2706 return;
@@ -2702,11 +2708,11 @@
2708 zName = blob_str(&uuid);
2709 rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", zName);
2710 if( rid==0 ){
2711 style_header("Broken Link");
2712 @ <p>No such object: %h(zName)</p>
2713 style_finish_page();
2714 return;
2715 }
2716 if( db_exists("SELECT 1 FROM mlink WHERE mid=%d", rid) ){
2717 ci_page();
2718 }else
@@ -3227,11 +3233,11 @@
3233 }
3234 @ </td></tr>
3235 @ </table>
3236 @ </div></form>
3237 builtin_request_js("ci_edit.js");
3238 style_finish_page();
3239 }
3240
3241 /*
3242 ** Prepare an ammended commit comment. Let the user modify it using the
3243 ** editor specified in the global_config table or either
3244
+3 -2
--- src/interwiki.c
+++ src/interwiki.c
@@ -343,10 +343,11 @@
343343
zTag, zBase, zHash, zWiki);
344344
db_protect_pop();
345345
}
346346
}
347347
348
+ style_set_current_feature("interwiki");
348349
style_header("Interwiki Map Configuration");
349350
@ <p>Interwiki links are hyperlink targets of the form
350351
@ <blockquote><i>Tag</i><b>:</b><i>PageName</i></blockquote>
351352
@ <p>Such links resolve to links to <i>PageName</i> on a separate server
352353
@ identified by <i>Tag</i>. The Interwiki Map or "intermap" is a mapping
@@ -388,11 +389,11 @@
388389
@ No mappings are currently defined.
389390
}
390391
391392
if( !g.perm.Setup ){
392393
/* Do not show intermap editing fields to non-setup users */
393
- style_finish_page("interwiki");
394
+ style_finish_page();
394395
return;
395396
}
396397
397398
@ <p>To add a new mapping, fill out the form below providing a unique name
398399
@ for the tag. To edit an exist mapping, fill out the form and use the
@@ -421,7 +422,7 @@
421422
@ <tr><td></td>
422423
@ <td><input type="submit" name="submit" value="Apply Changes"></td></tr>
423424
@ </table>
424425
@ </form>
425426
426
- style_finish_page("interwiki");
427
+ style_finish_page();
427428
}
428429
--- src/interwiki.c
+++ src/interwiki.c
@@ -343,10 +343,11 @@
343 zTag, zBase, zHash, zWiki);
344 db_protect_pop();
345 }
346 }
347
 
348 style_header("Interwiki Map Configuration");
349 @ <p>Interwiki links are hyperlink targets of the form
350 @ <blockquote><i>Tag</i><b>:</b><i>PageName</i></blockquote>
351 @ <p>Such links resolve to links to <i>PageName</i> on a separate server
352 @ identified by <i>Tag</i>. The Interwiki Map or "intermap" is a mapping
@@ -388,11 +389,11 @@
388 @ No mappings are currently defined.
389 }
390
391 if( !g.perm.Setup ){
392 /* Do not show intermap editing fields to non-setup users */
393 style_finish_page("interwiki");
394 return;
395 }
396
397 @ <p>To add a new mapping, fill out the form below providing a unique name
398 @ for the tag. To edit an exist mapping, fill out the form and use the
@@ -421,7 +422,7 @@
421 @ <tr><td></td>
422 @ <td><input type="submit" name="submit" value="Apply Changes"></td></tr>
423 @ </table>
424 @ </form>
425
426 style_finish_page("interwiki");
427 }
428
--- src/interwiki.c
+++ src/interwiki.c
@@ -343,10 +343,11 @@
343 zTag, zBase, zHash, zWiki);
344 db_protect_pop();
345 }
346 }
347
348 style_set_current_feature("interwiki");
349 style_header("Interwiki Map Configuration");
350 @ <p>Interwiki links are hyperlink targets of the form
351 @ <blockquote><i>Tag</i><b>:</b><i>PageName</i></blockquote>
352 @ <p>Such links resolve to links to <i>PageName</i> on a separate server
353 @ identified by <i>Tag</i>. The Interwiki Map or "intermap" is a mapping
@@ -388,11 +389,11 @@
389 @ No mappings are currently defined.
390 }
391
392 if( !g.perm.Setup ){
393 /* Do not show intermap editing fields to non-setup users */
394 style_finish_page();
395 return;
396 }
397
398 @ <p>To add a new mapping, fill out the form below providing a unique name
399 @ for the tag. To edit an exist mapping, fill out the form and use the
@@ -421,7 +422,7 @@
422 @ <tr><td></td>
423 @ <td><input type="submit" name="submit" value="Apply Changes"></td></tr>
424 @ </table>
425 @ </form>
426
427 style_finish_page();
428 }
429
+2 -1
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -52,15 +52,16 @@
5252
*/
5353
void load_control(void){
5454
double mxLoad = atof(db_get("max-loadavg", 0));
5555
if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
5656
57
+ style_set_current_feature("test");
5758
style_header("Server Overload");
5859
@ <h2>The server load is currently too high.
5960
@ Please try again later.</h2>
6061
@ <p>Current load average: %f(load_average()).<br />
6162
@ Load average limit: %f(mxLoad)</p>
62
- style_finish_page("test");
63
+ style_finish_page();
6364
cgi_set_status(503,"Server Overload");
6465
cgi_reply();
6566
exit(0);
6667
}
6768
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -52,15 +52,16 @@
52 */
53 void load_control(void){
54 double mxLoad = atof(db_get("max-loadavg", 0));
55 if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
56
 
57 style_header("Server Overload");
58 @ <h2>The server load is currently too high.
59 @ Please try again later.</h2>
60 @ <p>Current load average: %f(load_average()).<br />
61 @ Load average limit: %f(mxLoad)</p>
62 style_finish_page("test");
63 cgi_set_status(503,"Server Overload");
64 cgi_reply();
65 exit(0);
66 }
67
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -52,15 +52,16 @@
52 */
53 void load_control(void){
54 double mxLoad = atof(db_get("max-loadavg", 0));
55 if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
56
57 style_set_current_feature("test");
58 style_header("Server Overload");
59 @ <h2>The server load is currently too high.
60 @ Please try again later.</h2>
61 @ <p>Current load average: %f(load_average()).<br />
62 @ Load average limit: %f(mxLoad)</p>
63 style_finish_page();
64 cgi_set_status(503,"Server Overload");
65 cgi_reply();
66 exit(0);
67 }
68
+5 -4
--- src/login.c
+++ src/login.c
@@ -656,10 +656,11 @@
656656
*/
657657
login_set_user_cookie(zUsername, uid, NULL, rememberMe?0:1);
658658
redirect_to_g();
659659
}
660660
}
661
+ style_set_current_feature("login");
661662
style_header("Login/Logout");
662663
style_adunit_config(ADUNIT_OFF);
663664
@ %s(zErrMsg)
664665
if( zGoto && !noAnon ){
665666
char *zAbbrev = fossil_strdup(zGoto);
@@ -795,11 +796,11 @@
795796
@ <td><input type="submit" value="Change Password" /></td></tr>
796797
@ </table>
797798
@ </form>
798799
}
799800
}
800
- style_finish_page("login");
801
+ style_finish_page();
801802
}
802803
803804
/*
804805
** Attempt to find login credentials for user zLogin on a peer repository
805806
** with project code zCode. Transfer those credentials to the local
@@ -1549,11 +1550,11 @@
15491550
int doAlerts = 0; /* True if subscription is wanted too */
15501551
if( !db_get_boolean("self-register", 0) ){
15511552
style_header("Registration not possible");
15521553
@ <p>This project does not allow user self-registration. Please contact the
15531554
@ project administrator to obtain an account.</p>
1554
- style_finish_page("register");
1555
+ style_finish_page();
15551556
return;
15561557
}
15571558
zPerms = db_get("default-perms", "u");
15581559
15591560
/* Prompt the user for email alerts if this repository is configured for
@@ -1708,11 +1709,11 @@
17081709
}
17091710
alert_sender_free(pSender);
17101711
if( zGoto ){
17111712
@ <p><a href='%h(zGoto)'>Continue</a>
17121713
}
1713
- style_finish_page("register");
1714
+ style_finish_page();
17141715
return;
17151716
}
17161717
redirect_to_g();
17171718
}
17181719
@@ -1800,11 +1801,11 @@
18001801
@ %h(zCaptcha)
18011802
@ </pre>
18021803
@ Enter this 8-letter code in the "Captcha" box above.
18031804
@ </td></tr></table></div>
18041805
@ </form>
1805
- style_finish_page("register");
1806
+ style_finish_page();
18061807
18071808
free(zCaptcha);
18081809
}
18091810
18101811
/*
18111812
--- src/login.c
+++ src/login.c
@@ -656,10 +656,11 @@
656 */
657 login_set_user_cookie(zUsername, uid, NULL, rememberMe?0:1);
658 redirect_to_g();
659 }
660 }
 
661 style_header("Login/Logout");
662 style_adunit_config(ADUNIT_OFF);
663 @ %s(zErrMsg)
664 if( zGoto && !noAnon ){
665 char *zAbbrev = fossil_strdup(zGoto);
@@ -795,11 +796,11 @@
795 @ <td><input type="submit" value="Change Password" /></td></tr>
796 @ </table>
797 @ </form>
798 }
799 }
800 style_finish_page("login");
801 }
802
803 /*
804 ** Attempt to find login credentials for user zLogin on a peer repository
805 ** with project code zCode. Transfer those credentials to the local
@@ -1549,11 +1550,11 @@
1549 int doAlerts = 0; /* True if subscription is wanted too */
1550 if( !db_get_boolean("self-register", 0) ){
1551 style_header("Registration not possible");
1552 @ <p>This project does not allow user self-registration. Please contact the
1553 @ project administrator to obtain an account.</p>
1554 style_finish_page("register");
1555 return;
1556 }
1557 zPerms = db_get("default-perms", "u");
1558
1559 /* Prompt the user for email alerts if this repository is configured for
@@ -1708,11 +1709,11 @@
1708 }
1709 alert_sender_free(pSender);
1710 if( zGoto ){
1711 @ <p><a href='%h(zGoto)'>Continue</a>
1712 }
1713 style_finish_page("register");
1714 return;
1715 }
1716 redirect_to_g();
1717 }
1718
@@ -1800,11 +1801,11 @@
1800 @ %h(zCaptcha)
1801 @ </pre>
1802 @ Enter this 8-letter code in the "Captcha" box above.
1803 @ </td></tr></table></div>
1804 @ </form>
1805 style_finish_page("register");
1806
1807 free(zCaptcha);
1808 }
1809
1810 /*
1811
--- src/login.c
+++ src/login.c
@@ -656,10 +656,11 @@
656 */
657 login_set_user_cookie(zUsername, uid, NULL, rememberMe?0:1);
658 redirect_to_g();
659 }
660 }
661 style_set_current_feature("login");
662 style_header("Login/Logout");
663 style_adunit_config(ADUNIT_OFF);
664 @ %s(zErrMsg)
665 if( zGoto && !noAnon ){
666 char *zAbbrev = fossil_strdup(zGoto);
@@ -795,11 +796,11 @@
796 @ <td><input type="submit" value="Change Password" /></td></tr>
797 @ </table>
798 @ </form>
799 }
800 }
801 style_finish_page();
802 }
803
804 /*
805 ** Attempt to find login credentials for user zLogin on a peer repository
806 ** with project code zCode. Transfer those credentials to the local
@@ -1549,11 +1550,11 @@
1550 int doAlerts = 0; /* True if subscription is wanted too */
1551 if( !db_get_boolean("self-register", 0) ){
1552 style_header("Registration not possible");
1553 @ <p>This project does not allow user self-registration. Please contact the
1554 @ project administrator to obtain an account.</p>
1555 style_finish_page();
1556 return;
1557 }
1558 zPerms = db_get("default-perms", "u");
1559
1560 /* Prompt the user for email alerts if this repository is configured for
@@ -1708,11 +1709,11 @@
1709 }
1710 alert_sender_free(pSender);
1711 if( zGoto ){
1712 @ <p><a href='%h(zGoto)'>Continue</a>
1713 }
1714 style_finish_page();
1715 return;
1716 }
1717 redirect_to_g();
1718 }
1719
@@ -1800,11 +1801,11 @@
1801 @ %h(zCaptcha)
1802 @ </pre>
1803 @ Enter this 8-letter code in the "Captcha" box above.
1804 @ </td></tr></table></div>
1805 @ </form>
1806 style_finish_page();
1807
1808 free(zCaptcha);
1809 }
1810
1811 /*
1812
+3 -2
--- src/main.c
+++ src/main.c
@@ -1310,11 +1310,11 @@
13101310
style_submenu_element("Stat", "stat");
13111311
fossil_version_blob(&versionInfo, verboseFlag);
13121312
@ <pre>
13131313
@ %h(blob_str(&versionInfo))
13141314
@ </pre>
1315
- style_finish_page("version");
1315
+ style_finish_page();
13161316
}
13171317
13181318
13191319
/*
13201320
** Set the g.zBaseURL value to the full URL for the toplevel of
@@ -3049,10 +3049,11 @@
30493049
login_check_credentials();
30503050
if( !g.perm.Admin ){
30513051
login_needed(0);
30523052
return;
30533053
}
3054
+ style_set_current_feature("test");
30543055
style_header("Warning Test Page");
30553056
style_submenu_element("Error Log","%R/errorlog");
30563057
if( iCase<1 || iCase>4 ){
30573058
@ <p>Generate a message to the <a href="%R/errorlog">error log</a>
30583059
@ by clicking on one of the following cases:
@@ -3097,7 +3098,7 @@
30973098
cgi_reset_content();
30983099
webpage_error("Case 7 from /test-warning");
30993100
}
31003101
@ </ol>
31013102
@ <p>End of test</p>
3102
- style_finish_page("test");
3103
+ style_finish_page();
31033104
}
31043105
--- src/main.c
+++ src/main.c
@@ -1310,11 +1310,11 @@
1310 style_submenu_element("Stat", "stat");
1311 fossil_version_blob(&versionInfo, verboseFlag);
1312 @ <pre>
1313 @ %h(blob_str(&versionInfo))
1314 @ </pre>
1315 style_finish_page("version");
1316 }
1317
1318
1319 /*
1320 ** Set the g.zBaseURL value to the full URL for the toplevel of
@@ -3049,10 +3049,11 @@
3049 login_check_credentials();
3050 if( !g.perm.Admin ){
3051 login_needed(0);
3052 return;
3053 }
 
3054 style_header("Warning Test Page");
3055 style_submenu_element("Error Log","%R/errorlog");
3056 if( iCase<1 || iCase>4 ){
3057 @ <p>Generate a message to the <a href="%R/errorlog">error log</a>
3058 @ by clicking on one of the following cases:
@@ -3097,7 +3098,7 @@
3097 cgi_reset_content();
3098 webpage_error("Case 7 from /test-warning");
3099 }
3100 @ </ol>
3101 @ <p>End of test</p>
3102 style_finish_page("test");
3103 }
3104
--- src/main.c
+++ src/main.c
@@ -1310,11 +1310,11 @@
1310 style_submenu_element("Stat", "stat");
1311 fossil_version_blob(&versionInfo, verboseFlag);
1312 @ <pre>
1313 @ %h(blob_str(&versionInfo))
1314 @ </pre>
1315 style_finish_page();
1316 }
1317
1318
1319 /*
1320 ** Set the g.zBaseURL value to the full URL for the toplevel of
@@ -3049,10 +3049,11 @@
3049 login_check_credentials();
3050 if( !g.perm.Admin ){
3051 login_needed(0);
3052 return;
3053 }
3054 style_set_current_feature("test");
3055 style_header("Warning Test Page");
3056 style_submenu_element("Error Log","%R/errorlog");
3057 if( iCase<1 || iCase>4 ){
3058 @ <p>Generate a message to the <a href="%R/errorlog">error log</a>
3059 @ by clicking on one of the following cases:
@@ -3097,7 +3098,7 @@
3098 cgi_reset_content();
3099 webpage_error("Case 7 from /test-warning");
3100 }
3101 @ </ol>
3102 @ <p>End of test</p>
3103 style_finish_page();
3104 }
3105
+1 -1
--- src/moderate.c
+++ src/moderate.c
@@ -189,11 +189,11 @@
189189
);
190190
db_prepare(&q, "%s", blob_sql_text(&sql));
191191
www_print_timeline(&q, 0, 0, 0, 0, 0, 0, 0);
192192
db_finalize(&q);
193193
}
194
- style_finish_page("modreq");
194
+ style_finish_page();
195195
}
196196
197197
/*
198198
** Disapproves any entries in the modreq table which belong to any
199199
** user whose name is no longer found in the user table. This is only
200200
--- src/moderate.c
+++ src/moderate.c
@@ -189,11 +189,11 @@
189 );
190 db_prepare(&q, "%s", blob_sql_text(&sql));
191 www_print_timeline(&q, 0, 0, 0, 0, 0, 0, 0);
192 db_finalize(&q);
193 }
194 style_finish_page("modreq");
195 }
196
197 /*
198 ** Disapproves any entries in the modreq table which belong to any
199 ** user whose name is no longer found in the user table. This is only
200
--- src/moderate.c
+++ src/moderate.c
@@ -189,11 +189,11 @@
189 );
190 db_prepare(&q, "%s", blob_sql_text(&sql));
191 www_print_timeline(&q, 0, 0, 0, 0, 0, 0, 0);
192 db_finalize(&q);
193 }
194 style_finish_page();
195 }
196
197 /*
198 ** Disapproves any entries in the modreq table which belong to any
199 ** user whose name is no longer found in the user table. This is only
200
+6 -6
--- src/name.c
+++ src/name.c
@@ -668,11 +668,11 @@
668668
@ </li></ul>
669669
@ </p></li>
670670
}
671671
@ </ol>
672672
db_finalize(&q);
673
- style_finish_page("ambiguous");
673
+ style_finish_page();
674674
}
675675
676676
/*
677677
** Convert the name in CGI parameter zParamName into a rid and return that
678678
** rid. If the CGI parameter is missing or is not a valid artifact tag,
@@ -1328,11 +1328,11 @@
13281328
for(i=1; i<=mx; i+=n){
13291329
@ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n))
13301330
@ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a>
13311331
}
13321332
@ </ul>
1333
- style_finish_page("bloblist");
1333
+ style_finish_page();
13341334
return;
13351335
}
13361336
if( phantomOnly || privOnly || mx>n ){
13371337
style_submenu_element("Index", "bloblist");
13381338
}
@@ -1407,11 +1407,11 @@
14071407
}
14081408
@ </tr>
14091409
}
14101410
@ </table>
14111411
db_finalize(&q);
1412
- style_finish_page("bloblist");
1412
+ style_finish_page();
14131413
}
14141414
14151415
/*
14161416
** Output HTML that shows a table of all public phantoms.
14171417
*/
@@ -1489,11 +1489,11 @@
14891489
}
14901490
if( g.perm.Write ){
14911491
style_submenu_element("Artifact Stats", "artifact_stats");
14921492
}
14931493
table_of_public_phantoms();
1494
- style_finish_page("phantoms");
1494
+ style_finish_page();
14951495
}
14961496
14971497
/*
14981498
** WEBPAGE: bigbloblist
14991499
**
@@ -1553,11 +1553,11 @@
15531553
@ </tr>
15541554
}
15551555
@ </tbody></table>
15561556
db_finalize(&q);
15571557
style_table_sorter();
1558
- style_finish_page("bigbloblist");
1558
+ style_finish_page();
15591559
}
15601560
15611561
/*
15621562
** COMMAND: test-unsent
15631563
**
@@ -1677,7 +1677,7 @@
16771677
collision_report("SELECT (SELECT uuid FROM blob WHERE rid=objid)"
16781678
" FROM event WHERE event.type='ci'"
16791679
" ORDER BY 1");
16801680
@ <h1>Hash Prefix Collisions on All Artifacts</h1>
16811681
collision_report("SELECT uuid FROM blob ORDER BY 1");
1682
- style_finish_page("hash-collisions");
1682
+ style_finish_page();
16831683
}
16841684
--- src/name.c
+++ src/name.c
@@ -668,11 +668,11 @@
668 @ </li></ul>
669 @ </p></li>
670 }
671 @ </ol>
672 db_finalize(&q);
673 style_finish_page("ambiguous");
674 }
675
676 /*
677 ** Convert the name in CGI parameter zParamName into a rid and return that
678 ** rid. If the CGI parameter is missing or is not a valid artifact tag,
@@ -1328,11 +1328,11 @@
1328 for(i=1; i<=mx; i+=n){
1329 @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n))
1330 @ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a>
1331 }
1332 @ </ul>
1333 style_finish_page("bloblist");
1334 return;
1335 }
1336 if( phantomOnly || privOnly || mx>n ){
1337 style_submenu_element("Index", "bloblist");
1338 }
@@ -1407,11 +1407,11 @@
1407 }
1408 @ </tr>
1409 }
1410 @ </table>
1411 db_finalize(&q);
1412 style_finish_page("bloblist");
1413 }
1414
1415 /*
1416 ** Output HTML that shows a table of all public phantoms.
1417 */
@@ -1489,11 +1489,11 @@
1489 }
1490 if( g.perm.Write ){
1491 style_submenu_element("Artifact Stats", "artifact_stats");
1492 }
1493 table_of_public_phantoms();
1494 style_finish_page("phantoms");
1495 }
1496
1497 /*
1498 ** WEBPAGE: bigbloblist
1499 **
@@ -1553,11 +1553,11 @@
1553 @ </tr>
1554 }
1555 @ </tbody></table>
1556 db_finalize(&q);
1557 style_table_sorter();
1558 style_finish_page("bigbloblist");
1559 }
1560
1561 /*
1562 ** COMMAND: test-unsent
1563 **
@@ -1677,7 +1677,7 @@
1677 collision_report("SELECT (SELECT uuid FROM blob WHERE rid=objid)"
1678 " FROM event WHERE event.type='ci'"
1679 " ORDER BY 1");
1680 @ <h1>Hash Prefix Collisions on All Artifacts</h1>
1681 collision_report("SELECT uuid FROM blob ORDER BY 1");
1682 style_finish_page("hash-collisions");
1683 }
1684
--- src/name.c
+++ src/name.c
@@ -668,11 +668,11 @@
668 @ </li></ul>
669 @ </p></li>
670 }
671 @ </ol>
672 db_finalize(&q);
673 style_finish_page();
674 }
675
676 /*
677 ** Convert the name in CGI parameter zParamName into a rid and return that
678 ** rid. If the CGI parameter is missing or is not a valid artifact tag,
@@ -1328,11 +1328,11 @@
1328 for(i=1; i<=mx; i+=n){
1329 @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n))
1330 @ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a>
1331 }
1332 @ </ul>
1333 style_finish_page();
1334 return;
1335 }
1336 if( phantomOnly || privOnly || mx>n ){
1337 style_submenu_element("Index", "bloblist");
1338 }
@@ -1407,11 +1407,11 @@
1407 }
1408 @ </tr>
1409 }
1410 @ </table>
1411 db_finalize(&q);
1412 style_finish_page();
1413 }
1414
1415 /*
1416 ** Output HTML that shows a table of all public phantoms.
1417 */
@@ -1489,11 +1489,11 @@
1489 }
1490 if( g.perm.Write ){
1491 style_submenu_element("Artifact Stats", "artifact_stats");
1492 }
1493 table_of_public_phantoms();
1494 style_finish_page();
1495 }
1496
1497 /*
1498 ** WEBPAGE: bigbloblist
1499 **
@@ -1553,11 +1553,11 @@
1553 @ </tr>
1554 }
1555 @ </tbody></table>
1556 db_finalize(&q);
1557 style_table_sorter();
1558 style_finish_page();
1559 }
1560
1561 /*
1562 ** COMMAND: test-unsent
1563 **
@@ -1677,7 +1677,7 @@
1677 collision_report("SELECT (SELECT uuid FROM blob WHERE rid=objid)"
1678 " FROM event WHERE event.type='ci'"
1679 " ORDER BY 1");
1680 @ <h1>Hash Prefix Collisions on All Artifacts</h1>
1681 collision_report("SELECT uuid FROM blob ORDER BY 1");
1682 style_finish_page();
1683 }
1684
+2 -1
--- src/path.c
+++ src/path.c
@@ -617,10 +617,11 @@
617617
int nRename;
618618
int nCheckin;
619619
620620
login_check_credentials();
621621
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
622
+ style_set_current_feature("test");
622623
if( P("all")!=0 ){
623624
style_header("List Of All Filename Changes");
624625
db_multi_exec("%s", zRenameQuery/*safe-for-%s*/);
625626
style_submenu_element("Distinct", "%R/test-rename-list");
626627
}else{
@@ -651,7 +652,7 @@
651652
@ <td>%z(href("%R/info/%!S",zUuid))%S(zUuid)</a></td></tr>
652653
}
653654
@ </tbody></table>
654655
db_finalize(&q);
655656
style_table_sorter();
656
- style_finish_page("test");
657
+ style_finish_page();
657658
}
658659
--- src/path.c
+++ src/path.c
@@ -617,10 +617,11 @@
617 int nRename;
618 int nCheckin;
619
620 login_check_credentials();
621 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
 
622 if( P("all")!=0 ){
623 style_header("List Of All Filename Changes");
624 db_multi_exec("%s", zRenameQuery/*safe-for-%s*/);
625 style_submenu_element("Distinct", "%R/test-rename-list");
626 }else{
@@ -651,7 +652,7 @@
651 @ <td>%z(href("%R/info/%!S",zUuid))%S(zUuid)</a></td></tr>
652 }
653 @ </tbody></table>
654 db_finalize(&q);
655 style_table_sorter();
656 style_finish_page("test");
657 }
658
--- src/path.c
+++ src/path.c
@@ -617,10 +617,11 @@
617 int nRename;
618 int nCheckin;
619
620 login_check_credentials();
621 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
622 style_set_current_feature("test");
623 if( P("all")!=0 ){
624 style_header("List Of All Filename Changes");
625 db_multi_exec("%s", zRenameQuery/*safe-for-%s*/);
626 style_submenu_element("Distinct", "%R/test-rename-list");
627 }else{
@@ -651,7 +652,7 @@
652 @ <td>%z(href("%R/info/%!S",zUuid))%S(zUuid)</a></td></tr>
653 }
654 @ </tbody></table>
655 db_finalize(&q);
656 style_table_sorter();
657 style_finish_page();
658 }
659
+2 -1
--- src/piechart.c
+++ src/piechart.c
@@ -277,10 +277,11 @@
277277
int width;
278278
int height;
279279
int i, j;
280280
281281
login_check_credentials();
282
+ style_set_current_feature("test");
282283
style_header("Pie Chart Test");
283284
db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);");
284285
db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)");
285286
zData = PD("data","");
286287
width = atoi(PD("width","800"));
@@ -328,7 +329,7 @@
328329
@ <li> <a href='test-piechart?data=2,2,2,2,2,44,44,2,2,2,2,2'>Case 2</a>
329330
@ <li> <a href='test-piechart?data=20,2,2,2,2,2,2,2,2,2,2,80'>Case 3</a>
330331
@ <li> <a href='test-piechart?data=80,2,2,2,2,2,2,2,2,2,2,20'>Case 4</a>
331332
@ <li> <a href='test-piechart?data=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2'>Case 5</a>
332333
@ </ul>
333
- style_finish_page("test");
334
+ style_finish_page();
334335
}
335336
--- src/piechart.c
+++ src/piechart.c
@@ -277,10 +277,11 @@
277 int width;
278 int height;
279 int i, j;
280
281 login_check_credentials();
 
282 style_header("Pie Chart Test");
283 db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);");
284 db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)");
285 zData = PD("data","");
286 width = atoi(PD("width","800"));
@@ -328,7 +329,7 @@
328 @ <li> <a href='test-piechart?data=2,2,2,2,2,44,44,2,2,2,2,2'>Case 2</a>
329 @ <li> <a href='test-piechart?data=20,2,2,2,2,2,2,2,2,2,2,80'>Case 3</a>
330 @ <li> <a href='test-piechart?data=80,2,2,2,2,2,2,2,2,2,2,20'>Case 4</a>
331 @ <li> <a href='test-piechart?data=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2'>Case 5</a>
332 @ </ul>
333 style_finish_page("test");
334 }
335
--- src/piechart.c
+++ src/piechart.c
@@ -277,10 +277,11 @@
277 int width;
278 int height;
279 int i, j;
280
281 login_check_credentials();
282 style_set_current_feature("test");
283 style_header("Pie Chart Test");
284 db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);");
285 db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)");
286 zData = PD("data","");
287 width = atoi(PD("width","800"));
@@ -328,7 +329,7 @@
329 @ <li> <a href='test-piechart?data=2,2,2,2,2,44,44,2,2,2,2,2'>Case 2</a>
330 @ <li> <a href='test-piechart?data=20,2,2,2,2,2,2,2,2,2,2,80'>Case 3</a>
331 @ <li> <a href='test-piechart?data=80,2,2,2,2,2,2,2,2,2,2,20'>Case 4</a>
332 @ <li> <a href='test-piechart?data=2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2'>Case 5</a>
333 @ </ul>
334 style_finish_page();
335 }
336
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -374,11 +374,11 @@
374374
} CX("</div>"/*sbs-wrapper*/);
375375
builtin_fossil_js_bundle_or("fetch", "copybutton", "popupwidget",
376376
"storage", "pikchr", NULL);
377377
builtin_request_js("fossil.page.pikchrshow.js");
378378
builtin_fulfill_js_requests();
379
- style_finish_page("pikchrshow");
379
+ style_finish_page();
380380
}
381381
382382
/*
383383
** COMMAND: pikchr*
384384
**
385385
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -374,11 +374,11 @@
374 } CX("</div>"/*sbs-wrapper*/);
375 builtin_fossil_js_bundle_or("fetch", "copybutton", "popupwidget",
376 "storage", "pikchr", NULL);
377 builtin_request_js("fossil.page.pikchrshow.js");
378 builtin_fulfill_js_requests();
379 style_finish_page("pikchrshow");
380 }
381
382 /*
383 ** COMMAND: pikchr*
384 **
385
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -374,11 +374,11 @@
374 } CX("</div>"/*sbs-wrapper*/);
375 builtin_fossil_js_bundle_or("fetch", "copybutton", "popupwidget",
376 "storage", "pikchr", NULL);
377 builtin_request_js("fossil.page.pikchrshow.js");
378 builtin_fulfill_js_requests();
379 style_finish_page();
380 }
381
382 /*
383 ** COMMAND: pikchr*
384 **
385
+2 -1
--- src/printf.c
+++ src/printf.c
@@ -1116,15 +1116,16 @@
11161116
#endif
11171117
if( g.cgiOutput==1 && g.db ){
11181118
g.cgiOutput = 2;
11191119
cgi_reset_content();
11201120
cgi_set_content_type("text/html");
1121
+ style_set_current_feature("error");
11211122
style_header("Bad Request");
11221123
etag_cancel();
11231124
@ <p class="generalError">%h(z)</p>
11241125
cgi_set_status(400, "Bad Request");
1125
- style_finish_page("error");
1126
+ style_finish_page();
11261127
cgi_reply();
11271128
}else if( !g.fQuiet ){
11281129
fossil_force_newline();
11291130
fossil_trace("%s\n", z);
11301131
}
11311132
--- src/printf.c
+++ src/printf.c
@@ -1116,15 +1116,16 @@
1116 #endif
1117 if( g.cgiOutput==1 && g.db ){
1118 g.cgiOutput = 2;
1119 cgi_reset_content();
1120 cgi_set_content_type("text/html");
 
1121 style_header("Bad Request");
1122 etag_cancel();
1123 @ <p class="generalError">%h(z)</p>
1124 cgi_set_status(400, "Bad Request");
1125 style_finish_page("error");
1126 cgi_reply();
1127 }else if( !g.fQuiet ){
1128 fossil_force_newline();
1129 fossil_trace("%s\n", z);
1130 }
1131
--- src/printf.c
+++ src/printf.c
@@ -1116,15 +1116,16 @@
1116 #endif
1117 if( g.cgiOutput==1 && g.db ){
1118 g.cgiOutput = 2;
1119 cgi_reset_content();
1120 cgi_set_content_type("text/html");
1121 style_set_current_feature("error");
1122 style_header("Bad Request");
1123 etag_cancel();
1124 @ <p class="generalError">%h(z)</p>
1125 cgi_set_status(400, "Bad Request");
1126 style_finish_page();
1127 cgi_reply();
1128 }else if( !g.fQuiet ){
1129 fossil_force_newline();
1130 fossil_trace("%s\n", z);
1131 }
1132
+2 -1
--- src/repolist.c
+++ src/repolist.c
@@ -245,14 +245,15 @@
245245
/* This case runs if remote_repository_info() found a repository
246246
** that has the "repolist_skin" property set to non-zero and left
247247
** that repository open in g.db. Use the skin of that repository
248248
** for display. */
249249
login_check_credentials();
250
+ style_set_current_feature("repolist");
250251
style_header("Repository List");
251252
@ %s(blob_str(&html))
252253
style_table_sorter();
253
- style_finish_page("repolist");
254
+ style_finish_page();
254255
}else{
255256
/* If no repositories were found that had the "repolist_skin"
256257
** property set, then use a default skin */
257258
@ <html>
258259
@ <head>
259260
--- src/repolist.c
+++ src/repolist.c
@@ -245,14 +245,15 @@
245 /* This case runs if remote_repository_info() found a repository
246 ** that has the "repolist_skin" property set to non-zero and left
247 ** that repository open in g.db. Use the skin of that repository
248 ** for display. */
249 login_check_credentials();
 
250 style_header("Repository List");
251 @ %s(blob_str(&html))
252 style_table_sorter();
253 style_finish_page("repolist");
254 }else{
255 /* If no repositories were found that had the "repolist_skin"
256 ** property set, then use a default skin */
257 @ <html>
258 @ <head>
259
--- src/repolist.c
+++ src/repolist.c
@@ -245,14 +245,15 @@
245 /* This case runs if remote_repository_info() found a repository
246 ** that has the "repolist_skin" property set to non-zero and left
247 ** that repository open in g.db. Use the skin of that repository
248 ** for display. */
249 login_check_credentials();
250 style_set_current_feature("repolist");
251 style_header("Repository List");
252 @ %s(blob_str(&html))
253 style_table_sorter();
254 style_finish_page();
255 }else{
256 /* If no repositories were found that had the "repolist_skin"
257 ** property set, then use a default skin */
258 @ <html>
259 @ <head>
260
+10 -7
--- src/report.c
+++ src/report.c
@@ -97,11 +97,11 @@
9797
Th_Render(zScript);
9898
9999
blob_reset(&ril);
100100
if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);
101101
102
- style_finish_page("reportlist");
102
+ style_finish_page();
103103
}
104104
105105
/*
106106
** Remove whitespace from both ends of a string.
107107
*/
@@ -325,14 +325,15 @@
325325
return;
326326
}
327327
rn = atoi(PD("rn","0"));
328328
db_prepare(&q, "SELECT title, sqlcode, owner, cols "
329329
"FROM reportfmt WHERE rn=%d",rn);
330
+ style_set_current_feature("report");
330331
style_header("SQL For Report Format Number %d", rn);
331332
if( db_step(&q)!=SQLITE_ROW ){
332333
@ <p>Unknown report number: %d(rn)</p>
333
- style_finish_page("report");
334
+ style_finish_page();
334335
db_finalize(&q);
335336
return;
336337
}
337338
zTitle = db_column_text(&q, 0);
338339
zSQL = db_column_text(&q, 1);
@@ -350,11 +351,11 @@
350351
@ <td width=15></td><td valign="top">
351352
output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3");
352353
@ </td>
353354
@ </tr></table>
354355
report_format_hints();
355
- style_finish_page("report");
356
+ style_finish_page();
356357
db_finalize(&q);
357358
}
358359
359360
/*
360361
** WEBPAGE: rptnew
@@ -381,10 +382,11 @@
381382
login_check_credentials();
382383
if( !g.perm.TktFmt ){
383384
login_needed(g.anon.TktFmt);
384385
return;
385386
}
387
+ style_set_current_feature("report");
386388
/*view_add_functions(0);*/
387389
rn = atoi(PD("rn","0"));
388390
zTitle = P("t");
389391
zOwner = PD("w",g.zLogin);
390392
z = P("s");
@@ -410,11 +412,11 @@
410412
@ <input type="hidden" name="rn" value="%d(rn)">
411413
login_insert_csrf_secret();
412414
@ <input type="submit" name="del2" value="Delete The Report">
413415
@ <input type="submit" name="can" value="Cancel">
414416
@ </form>
415
- style_finish_page("report");
417
+ style_finish_page();
416418
return;
417419
}else if( P("can") ){
418420
/* user cancelled */
419421
cgi_redirect("reportlist");
420422
return;
@@ -502,20 +504,20 @@
502504
if( !g.perm.Admin && fossil_strcmp(zOwner,g.zLogin)!=0 ){
503505
@ <p>This report format is owned by %h(zOwner). You are not allowed
504506
@ to change it.</p>
505507
@ </form>
506508
report_format_hints();
507
- style_finish_page("report");
509
+ style_finish_page();
508510
return;
509511
}
510512
@ <input type="submit" value="Apply Changes" />
511513
if( rn>0 ){
512514
@ <input type="submit" value="Delete This Report" name="del1" />
513515
}
514516
@ </div></form>
515517
report_format_hints();
516
- style_finish_page("report");
518
+ style_finish_page();
517519
}
518520
519521
/*
520522
** Output a bunch of text that provides information about report
521523
** formats
@@ -1029,10 +1031,11 @@
10291031
count = 0;
10301032
if( !tabs ){
10311033
struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
10321034
10331035
db_multi_exec("PRAGMA empty_result_callbacks=ON");
1036
+ style_set_current_feature("report");
10341037
style_submenu_element("Raw", "rptview?tablist=1&%h", PD("QUERY_STRING",""));
10351038
if( g.perm.Admin
10361039
|| (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
10371040
style_submenu_element("Edit", "rptedit?rn=%d", rn);
10381041
}
@@ -1057,11 +1060,11 @@
10571060
@ <p class="reportError">Error: %h(zErr1)</p>
10581061
}else if( zErr2 ){
10591062
@ <p class="reportError">Error: %h(zErr2)</p>
10601063
}
10611064
style_table_sorter();
1062
- style_finish_page("report");
1065
+ style_finish_page();
10631066
}else{
10641067
report_restrict_sql(&zErr1);
10651068
db_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2);
10661069
report_unrestrict_sql();
10671070
cgi_set_content_type("text/plain");
10681071
--- src/report.c
+++ src/report.c
@@ -97,11 +97,11 @@
97 Th_Render(zScript);
98
99 blob_reset(&ril);
100 if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);
101
102 style_finish_page("reportlist");
103 }
104
105 /*
106 ** Remove whitespace from both ends of a string.
107 */
@@ -325,14 +325,15 @@
325 return;
326 }
327 rn = atoi(PD("rn","0"));
328 db_prepare(&q, "SELECT title, sqlcode, owner, cols "
329 "FROM reportfmt WHERE rn=%d",rn);
 
330 style_header("SQL For Report Format Number %d", rn);
331 if( db_step(&q)!=SQLITE_ROW ){
332 @ <p>Unknown report number: %d(rn)</p>
333 style_finish_page("report");
334 db_finalize(&q);
335 return;
336 }
337 zTitle = db_column_text(&q, 0);
338 zSQL = db_column_text(&q, 1);
@@ -350,11 +351,11 @@
350 @ <td width=15></td><td valign="top">
351 output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3");
352 @ </td>
353 @ </tr></table>
354 report_format_hints();
355 style_finish_page("report");
356 db_finalize(&q);
357 }
358
359 /*
360 ** WEBPAGE: rptnew
@@ -381,10 +382,11 @@
381 login_check_credentials();
382 if( !g.perm.TktFmt ){
383 login_needed(g.anon.TktFmt);
384 return;
385 }
 
386 /*view_add_functions(0);*/
387 rn = atoi(PD("rn","0"));
388 zTitle = P("t");
389 zOwner = PD("w",g.zLogin);
390 z = P("s");
@@ -410,11 +412,11 @@
410 @ <input type="hidden" name="rn" value="%d(rn)">
411 login_insert_csrf_secret();
412 @ <input type="submit" name="del2" value="Delete The Report">
413 @ <input type="submit" name="can" value="Cancel">
414 @ </form>
415 style_finish_page("report");
416 return;
417 }else if( P("can") ){
418 /* user cancelled */
419 cgi_redirect("reportlist");
420 return;
@@ -502,20 +504,20 @@
502 if( !g.perm.Admin && fossil_strcmp(zOwner,g.zLogin)!=0 ){
503 @ <p>This report format is owned by %h(zOwner). You are not allowed
504 @ to change it.</p>
505 @ </form>
506 report_format_hints();
507 style_finish_page("report");
508 return;
509 }
510 @ <input type="submit" value="Apply Changes" />
511 if( rn>0 ){
512 @ <input type="submit" value="Delete This Report" name="del1" />
513 }
514 @ </div></form>
515 report_format_hints();
516 style_finish_page("report");
517 }
518
519 /*
520 ** Output a bunch of text that provides information about report
521 ** formats
@@ -1029,10 +1031,11 @@
1029 count = 0;
1030 if( !tabs ){
1031 struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1032
1033 db_multi_exec("PRAGMA empty_result_callbacks=ON");
 
1034 style_submenu_element("Raw", "rptview?tablist=1&%h", PD("QUERY_STRING",""));
1035 if( g.perm.Admin
1036 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1037 style_submenu_element("Edit", "rptedit?rn=%d", rn);
1038 }
@@ -1057,11 +1060,11 @@
1057 @ <p class="reportError">Error: %h(zErr1)</p>
1058 }else if( zErr2 ){
1059 @ <p class="reportError">Error: %h(zErr2)</p>
1060 }
1061 style_table_sorter();
1062 style_finish_page("report");
1063 }else{
1064 report_restrict_sql(&zErr1);
1065 db_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2);
1066 report_unrestrict_sql();
1067 cgi_set_content_type("text/plain");
1068
--- src/report.c
+++ src/report.c
@@ -97,11 +97,11 @@
97 Th_Render(zScript);
98
99 blob_reset(&ril);
100 if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);
101
102 style_finish_page();
103 }
104
105 /*
106 ** Remove whitespace from both ends of a string.
107 */
@@ -325,14 +325,15 @@
325 return;
326 }
327 rn = atoi(PD("rn","0"));
328 db_prepare(&q, "SELECT title, sqlcode, owner, cols "
329 "FROM reportfmt WHERE rn=%d",rn);
330 style_set_current_feature("report");
331 style_header("SQL For Report Format Number %d", rn);
332 if( db_step(&q)!=SQLITE_ROW ){
333 @ <p>Unknown report number: %d(rn)</p>
334 style_finish_page();
335 db_finalize(&q);
336 return;
337 }
338 zTitle = db_column_text(&q, 0);
339 zSQL = db_column_text(&q, 1);
@@ -350,11 +351,11 @@
351 @ <td width=15></td><td valign="top">
352 output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3");
353 @ </td>
354 @ </tr></table>
355 report_format_hints();
356 style_finish_page();
357 db_finalize(&q);
358 }
359
360 /*
361 ** WEBPAGE: rptnew
@@ -381,10 +382,11 @@
382 login_check_credentials();
383 if( !g.perm.TktFmt ){
384 login_needed(g.anon.TktFmt);
385 return;
386 }
387 style_set_current_feature("report");
388 /*view_add_functions(0);*/
389 rn = atoi(PD("rn","0"));
390 zTitle = P("t");
391 zOwner = PD("w",g.zLogin);
392 z = P("s");
@@ -410,11 +412,11 @@
412 @ <input type="hidden" name="rn" value="%d(rn)">
413 login_insert_csrf_secret();
414 @ <input type="submit" name="del2" value="Delete The Report">
415 @ <input type="submit" name="can" value="Cancel">
416 @ </form>
417 style_finish_page();
418 return;
419 }else if( P("can") ){
420 /* user cancelled */
421 cgi_redirect("reportlist");
422 return;
@@ -502,20 +504,20 @@
504 if( !g.perm.Admin && fossil_strcmp(zOwner,g.zLogin)!=0 ){
505 @ <p>This report format is owned by %h(zOwner). You are not allowed
506 @ to change it.</p>
507 @ </form>
508 report_format_hints();
509 style_finish_page();
510 return;
511 }
512 @ <input type="submit" value="Apply Changes" />
513 if( rn>0 ){
514 @ <input type="submit" value="Delete This Report" name="del1" />
515 }
516 @ </div></form>
517 report_format_hints();
518 style_finish_page();
519 }
520
521 /*
522 ** Output a bunch of text that provides information about report
523 ** formats
@@ -1029,10 +1031,11 @@
1031 count = 0;
1032 if( !tabs ){
1033 struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1034
1035 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1036 style_set_current_feature("report");
1037 style_submenu_element("Raw", "rptview?tablist=1&%h", PD("QUERY_STRING",""));
1038 if( g.perm.Admin
1039 || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){
1040 style_submenu_element("Edit", "rptedit?rn=%d", rn);
1041 }
@@ -1057,11 +1060,11 @@
1060 @ <p class="reportError">Error: %h(zErr1)</p>
1061 }else if( zErr2 ){
1062 @ <p class="reportError">Error: %h(zErr2)</p>
1063 }
1064 style_table_sorter();
1065 style_finish_page();
1066 }else{
1067 report_restrict_sql(&zErr1);
1068 db_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2);
1069 report_unrestrict_sql();
1070 cgi_set_content_type("text/plain");
1071
+6 -5
--- src/search.c
+++ src/search.c
@@ -1212,11 +1212,11 @@
12121212
*/
12131213
void search_page(void){
12141214
login_check_credentials();
12151215
style_header("Search");
12161216
search_screen(SRCH_ALL, 1);
1217
- style_finish_page("search");
1217
+ style_finish_page();
12181218
}
12191219
12201220
12211221
/*
12221222
** This is a helper function for search_stext(). Writing into pOut
@@ -1979,13 +1979,14 @@
19791979
const char *zIdxed = P("ixed");
19801980
int id;
19811981
int cnt1 = 0, cnt2 = 0, cnt3 = 0;
19821982
login_check_credentials();
19831983
if( !g.perm.Admin ){ login_needed(0); return; }
1984
+ style_set_current_feature("test");
19841985
if( !search_index_exists() ){
19851986
@ <p>Indexed search is disabled
1986
- style_finish_page("report");
1987
+ style_finish_page();
19871988
return;
19881989
}
19891990
search_sql_setup(g.db);
19901991
style_submenu_element("Setup","%R/srchsetup");
19911992
if( zId!=0 && (id = atoi(zId))>0 ){
@@ -2025,11 +2026,11 @@
20252026
style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=1",zDocId[0]);
20262027
zName = mprintf("Unindexed '%c' docs",zDocId[0]);
20272028
style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=0",zDocId[0]);
20282029
}
20292030
db_finalize(&q);
2030
- style_finish_page("test");
2031
+ style_finish_page();
20312032
return;
20322033
}
20332034
if( zType!=0 && zType[0]!=0 && zType[1]==0 &&
20342035
zIdxed!=0 && (zIdxed[0]=='1' || zIdxed[0]=='0') && zIdxed[1]==0
20352036
){
@@ -2055,11 +2056,11 @@
20552056
@ <li> <a href='test-ftsdocs?id=%d(db_column_int(&q,0))'>
20562057
@ %h(db_column_text(&q,1))</a>
20572058
}
20582059
@ </ul>
20592060
db_finalize(&q);
2060
- style_finish_page("test");
2061
+ style_finish_page();
20612062
return;
20622063
}
20632064
style_header("Summary of ftsdocs");
20642065
db_prepare(&q,
20652066
"SELECT type, sum(idxed IS TRUE), sum(idxed IS FALSE), count(*)"
@@ -2099,7 +2100,7 @@
20992100
@ </tbody><tfooter>
21002101
@ <tr><th>Total<th align="right">%d(cnt1)<th align="right">%d(cnt2)
21012102
@ <th align="right">%d(cnt3)
21022103
@ </tfooter>
21032104
@ </table>
2104
- style_finish_page("test");
2105
+ style_finish_page();
21052106
}
21062107
--- src/search.c
+++ src/search.c
@@ -1212,11 +1212,11 @@
1212 */
1213 void search_page(void){
1214 login_check_credentials();
1215 style_header("Search");
1216 search_screen(SRCH_ALL, 1);
1217 style_finish_page("search");
1218 }
1219
1220
1221 /*
1222 ** This is a helper function for search_stext(). Writing into pOut
@@ -1979,13 +1979,14 @@
1979 const char *zIdxed = P("ixed");
1980 int id;
1981 int cnt1 = 0, cnt2 = 0, cnt3 = 0;
1982 login_check_credentials();
1983 if( !g.perm.Admin ){ login_needed(0); return; }
 
1984 if( !search_index_exists() ){
1985 @ <p>Indexed search is disabled
1986 style_finish_page("report");
1987 return;
1988 }
1989 search_sql_setup(g.db);
1990 style_submenu_element("Setup","%R/srchsetup");
1991 if( zId!=0 && (id = atoi(zId))>0 ){
@@ -2025,11 +2026,11 @@
2025 style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=1",zDocId[0]);
2026 zName = mprintf("Unindexed '%c' docs",zDocId[0]);
2027 style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=0",zDocId[0]);
2028 }
2029 db_finalize(&q);
2030 style_finish_page("test");
2031 return;
2032 }
2033 if( zType!=0 && zType[0]!=0 && zType[1]==0 &&
2034 zIdxed!=0 && (zIdxed[0]=='1' || zIdxed[0]=='0') && zIdxed[1]==0
2035 ){
@@ -2055,11 +2056,11 @@
2055 @ <li> <a href='test-ftsdocs?id=%d(db_column_int(&q,0))'>
2056 @ %h(db_column_text(&q,1))</a>
2057 }
2058 @ </ul>
2059 db_finalize(&q);
2060 style_finish_page("test");
2061 return;
2062 }
2063 style_header("Summary of ftsdocs");
2064 db_prepare(&q,
2065 "SELECT type, sum(idxed IS TRUE), sum(idxed IS FALSE), count(*)"
@@ -2099,7 +2100,7 @@
2099 @ </tbody><tfooter>
2100 @ <tr><th>Total<th align="right">%d(cnt1)<th align="right">%d(cnt2)
2101 @ <th align="right">%d(cnt3)
2102 @ </tfooter>
2103 @ </table>
2104 style_finish_page("test");
2105 }
2106
--- src/search.c
+++ src/search.c
@@ -1212,11 +1212,11 @@
1212 */
1213 void search_page(void){
1214 login_check_credentials();
1215 style_header("Search");
1216 search_screen(SRCH_ALL, 1);
1217 style_finish_page();
1218 }
1219
1220
1221 /*
1222 ** This is a helper function for search_stext(). Writing into pOut
@@ -1979,13 +1979,14 @@
1979 const char *zIdxed = P("ixed");
1980 int id;
1981 int cnt1 = 0, cnt2 = 0, cnt3 = 0;
1982 login_check_credentials();
1983 if( !g.perm.Admin ){ login_needed(0); return; }
1984 style_set_current_feature("test");
1985 if( !search_index_exists() ){
1986 @ <p>Indexed search is disabled
1987 style_finish_page();
1988 return;
1989 }
1990 search_sql_setup(g.db);
1991 style_submenu_element("Setup","%R/srchsetup");
1992 if( zId!=0 && (id = atoi(zId))>0 ){
@@ -2025,11 +2026,11 @@
2026 style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=1",zDocId[0]);
2027 zName = mprintf("Unindexed '%c' docs",zDocId[0]);
2028 style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=0",zDocId[0]);
2029 }
2030 db_finalize(&q);
2031 style_finish_page();
2032 return;
2033 }
2034 if( zType!=0 && zType[0]!=0 && zType[1]==0 &&
2035 zIdxed!=0 && (zIdxed[0]=='1' || zIdxed[0]=='0') && zIdxed[1]==0
2036 ){
@@ -2055,11 +2056,11 @@
2056 @ <li> <a href='test-ftsdocs?id=%d(db_column_int(&q,0))'>
2057 @ %h(db_column_text(&q,1))</a>
2058 }
2059 @ </ul>
2060 db_finalize(&q);
2061 style_finish_page();
2062 return;
2063 }
2064 style_header("Summary of ftsdocs");
2065 db_prepare(&q,
2066 "SELECT type, sum(idxed IS TRUE), sum(idxed IS FALSE), count(*)"
@@ -2099,7 +2100,7 @@
2100 @ </tbody><tfooter>
2101 @ <tr><th>Total<th align="right">%d(cnt1)<th align="right">%d(cnt2)
2102 @ <th align="right">%d(cnt3)
2103 @ </tfooter>
2104 @ </table>
2105 style_finish_page();
2106 }
2107
--- src/security_audit.c
+++ src/security_audit.c
@@ -591,11 +591,11 @@
591591
table_of_public_phantoms();
592592
@ </li>
593593
}
594594
595595
@ </ol>
596
- style_finish_page("secaudit");
596
+ style_finish_page();
597597
}
598598
599599
/*
600600
** WEBPAGE: takeitprivate
601601
**
@@ -633,11 +633,11 @@
633633
@ <form action="%s(g.zPath)" method="post">
634634
@ <input type="submit" name="apply" value="Make It Private">
635635
@ <input type="submit" name="cancel" value="Cancel">
636636
@ </form>
637637
638
- style_finish_page("takeitprivate");
638
+ style_finish_page();
639639
}
640640
641641
/*
642642
** The maximum number of bytes of log to show
643643
*/
@@ -674,11 +674,11 @@
674674
@ If the server is running using one of
675675
@ the "fossil http" or "fossil server" commands then add
676676
@ a command-line option "--errorlog <i>FILENAME</i>" to that
677677
@ command.
678678
@ </ol>
679
- style_finish_page("errorlog");
679
+ style_finish_page();
680680
return;
681681
}
682682
if( P("truncate1") && cgi_csrf_safe(1) ){
683683
fclose(fopen(g.zErrlog,"w"));
684684
}
@@ -694,20 +694,20 @@
694694
@ <form action="%R/errorlog" method="POST">
695695
@ <p>Confirm that you want to truncate the %,lld(szFile)-byte error log:
696696
@ <input type="submit" name="truncate1" value="Confirm">
697697
@ <input type="submit" name="cancel" value="Cancel">
698698
@ </form>
699
- style_finish_page("errorlog");
699
+ style_finish_page();
700700
return;
701701
}
702702
@ <p>The server error log at "%h(g.zErrlog)" is %,lld(szFile) bytes in size.
703703
style_submenu_element("Download", "%R/errorlog?download");
704704
style_submenu_element("Truncate", "%R/errorlog?truncate");
705705
in = fossil_fopen(g.zErrlog, "rb");
706706
if( in==0 ){
707707
@ <p class='generalError'>Unable to open that file for reading!</p>
708
- style_finish_page("errorlog");
708
+ style_finish_page();
709709
return;
710710
}
711711
if( szFile>MXSHOWLOG && P("all")==0 ){
712712
@ <form action="%R/errorlog" method="POST">
713713
@ <p>Only the last %,d(MXSHOWLOG) bytes are shown.
@@ -720,7 +720,7 @@
720720
while( fgets(z, sizeof(z), in) ){
721721
@ %h(z)\
722722
}
723723
fclose(in);
724724
@ </pre>
725
- style_finish_page("errorlog");
725
+ style_finish_page();
726726
}
727727
--- src/security_audit.c
+++ src/security_audit.c
@@ -591,11 +591,11 @@
591 table_of_public_phantoms();
592 @ </li>
593 }
594
595 @ </ol>
596 style_finish_page("secaudit");
597 }
598
599 /*
600 ** WEBPAGE: takeitprivate
601 **
@@ -633,11 +633,11 @@
633 @ <form action="%s(g.zPath)" method="post">
634 @ <input type="submit" name="apply" value="Make It Private">
635 @ <input type="submit" name="cancel" value="Cancel">
636 @ </form>
637
638 style_finish_page("takeitprivate");
639 }
640
641 /*
642 ** The maximum number of bytes of log to show
643 */
@@ -674,11 +674,11 @@
674 @ If the server is running using one of
675 @ the "fossil http" or "fossil server" commands then add
676 @ a command-line option "--errorlog <i>FILENAME</i>" to that
677 @ command.
678 @ </ol>
679 style_finish_page("errorlog");
680 return;
681 }
682 if( P("truncate1") && cgi_csrf_safe(1) ){
683 fclose(fopen(g.zErrlog,"w"));
684 }
@@ -694,20 +694,20 @@
694 @ <form action="%R/errorlog" method="POST">
695 @ <p>Confirm that you want to truncate the %,lld(szFile)-byte error log:
696 @ <input type="submit" name="truncate1" value="Confirm">
697 @ <input type="submit" name="cancel" value="Cancel">
698 @ </form>
699 style_finish_page("errorlog");
700 return;
701 }
702 @ <p>The server error log at "%h(g.zErrlog)" is %,lld(szFile) bytes in size.
703 style_submenu_element("Download", "%R/errorlog?download");
704 style_submenu_element("Truncate", "%R/errorlog?truncate");
705 in = fossil_fopen(g.zErrlog, "rb");
706 if( in==0 ){
707 @ <p class='generalError'>Unable to open that file for reading!</p>
708 style_finish_page("errorlog");
709 return;
710 }
711 if( szFile>MXSHOWLOG && P("all")==0 ){
712 @ <form action="%R/errorlog" method="POST">
713 @ <p>Only the last %,d(MXSHOWLOG) bytes are shown.
@@ -720,7 +720,7 @@
720 while( fgets(z, sizeof(z), in) ){
721 @ %h(z)\
722 }
723 fclose(in);
724 @ </pre>
725 style_finish_page("errorlog");
726 }
727
--- src/security_audit.c
+++ src/security_audit.c
@@ -591,11 +591,11 @@
591 table_of_public_phantoms();
592 @ </li>
593 }
594
595 @ </ol>
596 style_finish_page();
597 }
598
599 /*
600 ** WEBPAGE: takeitprivate
601 **
@@ -633,11 +633,11 @@
633 @ <form action="%s(g.zPath)" method="post">
634 @ <input type="submit" name="apply" value="Make It Private">
635 @ <input type="submit" name="cancel" value="Cancel">
636 @ </form>
637
638 style_finish_page();
639 }
640
641 /*
642 ** The maximum number of bytes of log to show
643 */
@@ -674,11 +674,11 @@
674 @ If the server is running using one of
675 @ the "fossil http" or "fossil server" commands then add
676 @ a command-line option "--errorlog <i>FILENAME</i>" to that
677 @ command.
678 @ </ol>
679 style_finish_page();
680 return;
681 }
682 if( P("truncate1") && cgi_csrf_safe(1) ){
683 fclose(fopen(g.zErrlog,"w"));
684 }
@@ -694,20 +694,20 @@
694 @ <form action="%R/errorlog" method="POST">
695 @ <p>Confirm that you want to truncate the %,lld(szFile)-byte error log:
696 @ <input type="submit" name="truncate1" value="Confirm">
697 @ <input type="submit" name="cancel" value="Cancel">
698 @ </form>
699 style_finish_page();
700 return;
701 }
702 @ <p>The server error log at "%h(g.zErrlog)" is %,lld(szFile) bytes in size.
703 style_submenu_element("Download", "%R/errorlog?download");
704 style_submenu_element("Truncate", "%R/errorlog?truncate");
705 in = fossil_fopen(g.zErrlog, "rb");
706 if( in==0 ){
707 @ <p class='generalError'>Unable to open that file for reading!</p>
708 style_finish_page();
709 return;
710 }
711 if( szFile>MXSHOWLOG && P("all")==0 ){
712 @ <form action="%R/errorlog" method="POST">
713 @ <p>Only the last %,d(MXSHOWLOG) bytes are shown.
@@ -720,7 +720,7 @@
720 while( fgets(z, sizeof(z), in) ){
721 @ %h(z)\
722 }
723 fclose(in);
724 @ </pre>
725 style_finish_page();
726 }
727
+30 -15
--- src/setup.c
+++ src/setup.c
@@ -73,10 +73,11 @@
7373
if( !g.perm.Admin ){
7474
login_needed(0);
7575
}
7676
setup_user = g.perm.Setup;
7777
78
+ style_set_current_feature("setup");
7879
style_header("Server Administration");
7980
8081
/* Make sure the header contains <base href="...">. Issue a warning
8182
** if it does not. */
8283
if( !cgi_header_contains("<base href=") ){
@@ -175,11 +176,11 @@
175176
setup_menu_entry("TH1", "admin_th1",
176177
"Enter raw TH1 commands");
177178
}
178179
@ </table>
179180
180
- style_finish_page("setup");
181
+ style_finish_page();
181182
}
182183
183184
/*
184185
** Generate a checkbox for an attribute.
185186
*/
@@ -339,10 +340,11 @@
339340
if( !g.perm.Setup ){
340341
login_needed(0);
341342
return;
342343
}
343344
345
+ style_set_current_feature("setup");
344346
style_header("Access Control Settings");
345347
db_begin_transaction();
346348
@ <form action="%R/setup_access" method="post"><div>
347349
login_insert_csrf_secret();
348350
@ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -576,11 +578,11 @@
576578
577579
@ <hr />
578580
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
579581
@ </div></form>
580582
db_end_transaction(0);
581
- style_finish_page("setup");
583
+ style_finish_page();
582584
}
583585
584586
/*
585587
** WEBPAGE: setup_login_group
586588
**
@@ -608,10 +610,11 @@
608610
if( P("join")!=0 ){
609611
login_group_join(zRepo, 1, zLogin, zPw, zNewName, &zErrMsg);
610612
}else if( P("leave") ){
611613
login_group_leave(&zErrMsg);
612614
}
615
+ style_set_current_feature("setup");
613616
style_header("Login Group Configuration");
614617
if( zErrMsg ){
615618
@ <p class="generalError">%s(zErrMsg)</p>
616619
}
617620
zGroup = login_group_name();
@@ -704,11 +707,11 @@
704707
}
705708
db_finalize(&q);
706709
@ </tbody></table>
707710
style_table_sorter();
708711
}
709
- style_finish_page("setup");
712
+ style_finish_page();
710713
}
711714
712715
/*
713716
** WEBPAGE: setup_timeline
714717
**
@@ -729,10 +732,11 @@
729732
if( !g.perm.Admin ){
730733
login_needed(0);
731734
return;
732735
}
733736
737
+ style_set_current_feature("setup");
734738
style_header("Timeline Display Preferences");
735739
db_begin_transaction();
736740
@ <form action="%R/setup_timeline" method="post"><div>
737741
login_insert_csrf_secret();
738742
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
@@ -843,11 +847,11 @@
843847
844848
@ <hr />
845849
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
846850
@ </div></form>
847851
db_end_transaction(0);
848
- style_finish_page("setup");
852
+ style_finish_page();
849853
}
850854
851855
/*
852856
** WEBPAGE: setup_settings
853857
**
@@ -864,10 +868,11 @@
864868
if( !g.perm.Setup ){
865869
login_needed(0);
866870
return;
867871
}
868872
873
+ style_set_current_feature("setup");
869874
style_header("Settings");
870875
if(!g.repositoryOpen){
871876
/* Provide read-only access to versioned settings,
872877
but only if no repo file was explicitly provided. */
873878
db_open_local(0);
@@ -936,11 +941,11 @@
936941
}
937942
}
938943
@ </td></tr></table>
939944
@ </div></form>
940945
db_end_transaction(0);
941
- style_finish_page("setup");
946
+ style_finish_page();
942947
}
943948
944949
/*
945950
** WEBPAGE: setup_config
946951
**
@@ -951,10 +956,11 @@
951956
if( !g.perm.Setup ){
952957
login_needed(0);
953958
return;
954959
}
955960
961
+ style_set_current_feature("setup");
956962
style_header("WWW Configuration");
957963
db_begin_transaction();
958964
@ <form action="%R/setup_config" method="post"><div>
959965
login_insert_csrf_secret();
960966
@ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -1032,11 +1038,11 @@
10321038
@ (Property: sitemap-contact)
10331039
@ <hr />
10341040
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
10351041
@ </div></form>
10361042
db_end_transaction(0);
1037
- style_finish_page("setup");
1043
+ style_finish_page();
10381044
}
10391045
10401046
/*
10411047
** WEBPAGE: setup_wiki
10421048
**
@@ -1047,10 +1053,11 @@
10471053
if( !g.perm.Setup ){
10481054
login_needed(0);
10491055
return;
10501056
}
10511057
1058
+ style_set_current_feature("setup");
10521059
style_header("Wiki Configuration");
10531060
db_begin_transaction();
10541061
@ <form action="%R/setup_wiki" method="post"><div>
10551062
login_insert_csrf_secret();
10561063
@ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -1108,11 +1115,11 @@
11081115
@ (Property: "wiki-use-html")
11091116
@ <hr />
11101117
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
11111118
@ </div></form>
11121119
db_end_transaction(0);
1113
- style_finish_page("setup");
1120
+ style_finish_page();
11141121
}
11151122
11161123
/*
11171124
** WEBPAGE: setup_modreq
11181125
**
@@ -1123,10 +1130,11 @@
11231130
if( !g.perm.Admin ){
11241131
login_needed(0);
11251132
return;
11261133
}
11271134
1135
+ style_set_current_feature("setup");
11281136
style_header("Moderator For Wiki And Tickets");
11291137
db_begin_transaction();
11301138
@ <form action="%R/setup_modreq" method="post"><div>
11311139
login_insert_csrf_secret();
11321140
@ <hr />
@@ -1154,11 +1162,11 @@
11541162
11551163
@ <hr />
11561164
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
11571165
@ </div></form>
11581166
db_end_transaction(0);
1159
- style_finish_page("setup");
1167
+ style_finish_page();
11601168
11611169
}
11621170
11631171
/*
11641172
** WEBPAGE: setup_adunit
@@ -1180,10 +1188,11 @@
11801188
cgi_replace_parameter("adunit","");
11811189
cgi_replace_parameter("adright","");
11821190
setup_incr_cfgcnt();
11831191
}
11841192
1193
+ style_set_current_feature("setup");
11851194
style_header("Edit Ad Unit");
11861195
@ <form action="%R/setup_adunit" method="post"><div>
11871196
login_insert_csrf_secret();
11881197
@ <b>Banner Ad-Unit:</b><br />
11891198
textarea_attribute("", 6, 80, "adunit", "adunit", "", 0);
@@ -1235,11 +1244,11 @@
12351244
@ border: 1px solid #f11;
12361245
@ background-color: #fcc;
12371246
@ '&gt;Demo Ad&lt;/div&gt;
12381247
@ </pre></blockquote>
12391248
@ </li>
1240
- style_finish_page("setup");
1249
+ style_finish_page();
12411250
db_end_transaction(0);
12421251
}
12431252
12441253
/*
12451254
** WEBPAGE: setup_logo
@@ -1361,10 +1370,11 @@
13611370
);
13621371
db_protect_pop();
13631372
db_end_transaction(0);
13641373
cgi_redirect("setup_logo");
13651374
}
1375
+ style_set_current_feature("setup");
13661376
style_header("Edit Project Logo And Background");
13671377
@ <p>The current project logo has a MIME-Type of <b>%h(zLogoMime)</b>
13681378
@ and looks like this:</p>
13691379
@ <blockquote><p><img src="%R/logo/%z(zLogoMtime)" \
13701380
@ alt="logo" border="1" />
@@ -1437,11 +1447,11 @@
14371447
@ <hr />
14381448
@
14391449
@ <p><span class="note">Note:</span> Your browser has probably cached these
14401450
@ images, so you may need to press the Reload button before changes will
14411451
@ take effect. </p>
1442
- style_finish_page("setup");
1452
+ style_finish_page();
14431453
db_end_transaction(0);
14441454
}
14451455
14461456
/*
14471457
** Prevent the RAW SQL feature from being used to ATTACH a different
@@ -1481,10 +1491,11 @@
14811491
login_needed(0);
14821492
return;
14831493
}
14841494
add_content_sql_commands(g.db);
14851495
zQ = cgi_csrf_safe(1) ? P("q") : 0;
1496
+ style_set_current_feature("setup");
14861497
style_header("Raw SQL Commands");
14871498
@ <p><b>Caution:</b> There are no restrictions on the SQL that can be
14881499
@ run by this page. You can do serious and irrepairable damage to the
14891500
@ repository. Proceed with extreme caution.</p>
14901501
@
@@ -1599,11 +1610,11 @@
15991610
}
16001611
sqlite3_finalize(pStmt);
16011612
@ </table>
16021613
}
16031614
}
1604
- style_finish_page("setup");
1615
+ style_finish_page();
16051616
}
16061617
16071618
16081619
/*
16091620
** WEBPAGE: admin_th1
@@ -1618,10 +1629,11 @@
16181629
login_check_credentials();
16191630
if( !g.perm.Setup ){
16201631
login_needed(0);
16211632
return;
16221633
}
1634
+ style_set_current_feature("setup");
16231635
style_header("Raw TH1 Commands");
16241636
@ <p><b>Caution:</b> There are no restrictions on the TH1 that can be
16251637
@ run by this page. If Tcl integration was enabled at compile-time and
16261638
@ the "tcl" setting is enabled, Tcl commands may be run as well.</p>
16271639
@
@@ -1643,11 +1655,11 @@
16431655
@ <pre class="th1result">%h(zR)</pre>
16441656
}else{
16451657
@ <pre class="th1error">%h(zR)</pre>
16461658
}
16471659
}
1648
- style_finish_page("setup");
1660
+ style_finish_page();
16491661
}
16501662
16511663
/*
16521664
** WEBPAGE: admin_log
16531665
**
@@ -1664,10 +1676,11 @@
16641676
login_check_credentials();
16651677
if( !g.perm.Admin ){
16661678
login_needed(0);
16671679
return;
16681680
}
1681
+ style_set_current_feature("setup");
16691682
style_header("Admin Log");
16701683
create_admin_log_table();
16711684
limit = atoi(PD("n","200"));
16721685
ofst = atoi(PD("x","0"));
16731686
fLogEnabled = db_get_boolean("admin-log", 0);
@@ -1710,11 +1723,11 @@
17101723
db_finalize(&stLog);
17111724
@ </tbody></table>
17121725
if( counter>ofst+limit ){
17131726
@ <p><a href="admin_log?n=%d(limit)&x=%d(limit+ofst)">[Older]</a></p>
17141727
}
1715
- style_finish_page("setup");
1728
+ style_finish_page();
17161729
}
17171730
17181731
/*
17191732
** WEBPAGE: srchsetup
17201733
**
@@ -1724,10 +1737,11 @@
17241737
login_check_credentials();
17251738
if( !g.perm.Admin ){
17261739
login_needed(0);
17271740
return;
17281741
}
1742
+ style_set_current_feature("setup");
17291743
style_header("Search Configuration");
17301744
@ <form action="%R/srchsetup" method="post"><div>
17311745
login_insert_csrf_secret();
17321746
@ <div style="text-align:center;font-weight:bold;">
17331747
@ Server-specific settings that affect the
@@ -1790,11 +1804,11 @@
17901804
@ larger repositories.</p>
17911805
onoff_attribute("Use Porter Stemmer","search-stemmer","ss",0,0);
17921806
@ <p><input type="submit" name="fts1" value="Create A Full-Text Index">
17931807
}
17941808
@ </div></form>
1795
- style_finish_page("setup");
1809
+ style_finish_page();
17961810
}
17971811
17981812
/*
17991813
** A URL Alias originally called zOldName is now zNewName/zValue.
18001814
** Write SQL to make this change into pSql.
@@ -1849,10 +1863,11 @@
18491863
login_check_credentials();
18501864
if( !g.perm.Admin ){
18511865
login_needed(0);
18521866
return;
18531867
}
1868
+ style_set_current_feature("setup");
18541869
style_header("URL Alias Configuration");
18551870
if( P("submit")!=0 ){
18561871
Blob token;
18571872
Blob sql;
18581873
const char *zNewName;
@@ -1948,7 +1963,7 @@
19481963
@ <p>To delete an entry from the alias table, change its name or value to an
19491964
@ empty string and press "Apply Changes".
19501965
@
19511966
@ <p>To add a new alias, fill in the name and value in the bottom row
19521967
@ of the table above and press "Apply Changes".
1953
- style_finish_page("setup");
1968
+ style_finish_page();
19541969
}
19551970
--- src/setup.c
+++ src/setup.c
@@ -73,10 +73,11 @@
73 if( !g.perm.Admin ){
74 login_needed(0);
75 }
76 setup_user = g.perm.Setup;
77
 
78 style_header("Server Administration");
79
80 /* Make sure the header contains <base href="...">. Issue a warning
81 ** if it does not. */
82 if( !cgi_header_contains("<base href=") ){
@@ -175,11 +176,11 @@
175 setup_menu_entry("TH1", "admin_th1",
176 "Enter raw TH1 commands");
177 }
178 @ </table>
179
180 style_finish_page("setup");
181 }
182
183 /*
184 ** Generate a checkbox for an attribute.
185 */
@@ -339,10 +340,11 @@
339 if( !g.perm.Setup ){
340 login_needed(0);
341 return;
342 }
343
 
344 style_header("Access Control Settings");
345 db_begin_transaction();
346 @ <form action="%R/setup_access" method="post"><div>
347 login_insert_csrf_secret();
348 @ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -576,11 +578,11 @@
576
577 @ <hr />
578 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
579 @ </div></form>
580 db_end_transaction(0);
581 style_finish_page("setup");
582 }
583
584 /*
585 ** WEBPAGE: setup_login_group
586 **
@@ -608,10 +610,11 @@
608 if( P("join")!=0 ){
609 login_group_join(zRepo, 1, zLogin, zPw, zNewName, &zErrMsg);
610 }else if( P("leave") ){
611 login_group_leave(&zErrMsg);
612 }
 
613 style_header("Login Group Configuration");
614 if( zErrMsg ){
615 @ <p class="generalError">%s(zErrMsg)</p>
616 }
617 zGroup = login_group_name();
@@ -704,11 +707,11 @@
704 }
705 db_finalize(&q);
706 @ </tbody></table>
707 style_table_sorter();
708 }
709 style_finish_page("setup");
710 }
711
712 /*
713 ** WEBPAGE: setup_timeline
714 **
@@ -729,10 +732,11 @@
729 if( !g.perm.Admin ){
730 login_needed(0);
731 return;
732 }
733
 
734 style_header("Timeline Display Preferences");
735 db_begin_transaction();
736 @ <form action="%R/setup_timeline" method="post"><div>
737 login_insert_csrf_secret();
738 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
@@ -843,11 +847,11 @@
843
844 @ <hr />
845 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
846 @ </div></form>
847 db_end_transaction(0);
848 style_finish_page("setup");
849 }
850
851 /*
852 ** WEBPAGE: setup_settings
853 **
@@ -864,10 +868,11 @@
864 if( !g.perm.Setup ){
865 login_needed(0);
866 return;
867 }
868
 
869 style_header("Settings");
870 if(!g.repositoryOpen){
871 /* Provide read-only access to versioned settings,
872 but only if no repo file was explicitly provided. */
873 db_open_local(0);
@@ -936,11 +941,11 @@
936 }
937 }
938 @ </td></tr></table>
939 @ </div></form>
940 db_end_transaction(0);
941 style_finish_page("setup");
942 }
943
944 /*
945 ** WEBPAGE: setup_config
946 **
@@ -951,10 +956,11 @@
951 if( !g.perm.Setup ){
952 login_needed(0);
953 return;
954 }
955
 
956 style_header("WWW Configuration");
957 db_begin_transaction();
958 @ <form action="%R/setup_config" method="post"><div>
959 login_insert_csrf_secret();
960 @ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -1032,11 +1038,11 @@
1032 @ (Property: sitemap-contact)
1033 @ <hr />
1034 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1035 @ </div></form>
1036 db_end_transaction(0);
1037 style_finish_page("setup");
1038 }
1039
1040 /*
1041 ** WEBPAGE: setup_wiki
1042 **
@@ -1047,10 +1053,11 @@
1047 if( !g.perm.Setup ){
1048 login_needed(0);
1049 return;
1050 }
1051
 
1052 style_header("Wiki Configuration");
1053 db_begin_transaction();
1054 @ <form action="%R/setup_wiki" method="post"><div>
1055 login_insert_csrf_secret();
1056 @ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -1108,11 +1115,11 @@
1108 @ (Property: "wiki-use-html")
1109 @ <hr />
1110 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1111 @ </div></form>
1112 db_end_transaction(0);
1113 style_finish_page("setup");
1114 }
1115
1116 /*
1117 ** WEBPAGE: setup_modreq
1118 **
@@ -1123,10 +1130,11 @@
1123 if( !g.perm.Admin ){
1124 login_needed(0);
1125 return;
1126 }
1127
 
1128 style_header("Moderator For Wiki And Tickets");
1129 db_begin_transaction();
1130 @ <form action="%R/setup_modreq" method="post"><div>
1131 login_insert_csrf_secret();
1132 @ <hr />
@@ -1154,11 +1162,11 @@
1154
1155 @ <hr />
1156 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1157 @ </div></form>
1158 db_end_transaction(0);
1159 style_finish_page("setup");
1160
1161 }
1162
1163 /*
1164 ** WEBPAGE: setup_adunit
@@ -1180,10 +1188,11 @@
1180 cgi_replace_parameter("adunit","");
1181 cgi_replace_parameter("adright","");
1182 setup_incr_cfgcnt();
1183 }
1184
 
1185 style_header("Edit Ad Unit");
1186 @ <form action="%R/setup_adunit" method="post"><div>
1187 login_insert_csrf_secret();
1188 @ <b>Banner Ad-Unit:</b><br />
1189 textarea_attribute("", 6, 80, "adunit", "adunit", "", 0);
@@ -1235,11 +1244,11 @@
1235 @ border: 1px solid #f11;
1236 @ background-color: #fcc;
1237 @ '&gt;Demo Ad&lt;/div&gt;
1238 @ </pre></blockquote>
1239 @ </li>
1240 style_finish_page("setup");
1241 db_end_transaction(0);
1242 }
1243
1244 /*
1245 ** WEBPAGE: setup_logo
@@ -1361,10 +1370,11 @@
1361 );
1362 db_protect_pop();
1363 db_end_transaction(0);
1364 cgi_redirect("setup_logo");
1365 }
 
1366 style_header("Edit Project Logo And Background");
1367 @ <p>The current project logo has a MIME-Type of <b>%h(zLogoMime)</b>
1368 @ and looks like this:</p>
1369 @ <blockquote><p><img src="%R/logo/%z(zLogoMtime)" \
1370 @ alt="logo" border="1" />
@@ -1437,11 +1447,11 @@
1437 @ <hr />
1438 @
1439 @ <p><span class="note">Note:</span> Your browser has probably cached these
1440 @ images, so you may need to press the Reload button before changes will
1441 @ take effect. </p>
1442 style_finish_page("setup");
1443 db_end_transaction(0);
1444 }
1445
1446 /*
1447 ** Prevent the RAW SQL feature from being used to ATTACH a different
@@ -1481,10 +1491,11 @@
1481 login_needed(0);
1482 return;
1483 }
1484 add_content_sql_commands(g.db);
1485 zQ = cgi_csrf_safe(1) ? P("q") : 0;
 
1486 style_header("Raw SQL Commands");
1487 @ <p><b>Caution:</b> There are no restrictions on the SQL that can be
1488 @ run by this page. You can do serious and irrepairable damage to the
1489 @ repository. Proceed with extreme caution.</p>
1490 @
@@ -1599,11 +1610,11 @@
1599 }
1600 sqlite3_finalize(pStmt);
1601 @ </table>
1602 }
1603 }
1604 style_finish_page("setup");
1605 }
1606
1607
1608 /*
1609 ** WEBPAGE: admin_th1
@@ -1618,10 +1629,11 @@
1618 login_check_credentials();
1619 if( !g.perm.Setup ){
1620 login_needed(0);
1621 return;
1622 }
 
1623 style_header("Raw TH1 Commands");
1624 @ <p><b>Caution:</b> There are no restrictions on the TH1 that can be
1625 @ run by this page. If Tcl integration was enabled at compile-time and
1626 @ the "tcl" setting is enabled, Tcl commands may be run as well.</p>
1627 @
@@ -1643,11 +1655,11 @@
1643 @ <pre class="th1result">%h(zR)</pre>
1644 }else{
1645 @ <pre class="th1error">%h(zR)</pre>
1646 }
1647 }
1648 style_finish_page("setup");
1649 }
1650
1651 /*
1652 ** WEBPAGE: admin_log
1653 **
@@ -1664,10 +1676,11 @@
1664 login_check_credentials();
1665 if( !g.perm.Admin ){
1666 login_needed(0);
1667 return;
1668 }
 
1669 style_header("Admin Log");
1670 create_admin_log_table();
1671 limit = atoi(PD("n","200"));
1672 ofst = atoi(PD("x","0"));
1673 fLogEnabled = db_get_boolean("admin-log", 0);
@@ -1710,11 +1723,11 @@
1710 db_finalize(&stLog);
1711 @ </tbody></table>
1712 if( counter>ofst+limit ){
1713 @ <p><a href="admin_log?n=%d(limit)&x=%d(limit+ofst)">[Older]</a></p>
1714 }
1715 style_finish_page("setup");
1716 }
1717
1718 /*
1719 ** WEBPAGE: srchsetup
1720 **
@@ -1724,10 +1737,11 @@
1724 login_check_credentials();
1725 if( !g.perm.Admin ){
1726 login_needed(0);
1727 return;
1728 }
 
1729 style_header("Search Configuration");
1730 @ <form action="%R/srchsetup" method="post"><div>
1731 login_insert_csrf_secret();
1732 @ <div style="text-align:center;font-weight:bold;">
1733 @ Server-specific settings that affect the
@@ -1790,11 +1804,11 @@
1790 @ larger repositories.</p>
1791 onoff_attribute("Use Porter Stemmer","search-stemmer","ss",0,0);
1792 @ <p><input type="submit" name="fts1" value="Create A Full-Text Index">
1793 }
1794 @ </div></form>
1795 style_finish_page("setup");
1796 }
1797
1798 /*
1799 ** A URL Alias originally called zOldName is now zNewName/zValue.
1800 ** Write SQL to make this change into pSql.
@@ -1849,10 +1863,11 @@
1849 login_check_credentials();
1850 if( !g.perm.Admin ){
1851 login_needed(0);
1852 return;
1853 }
 
1854 style_header("URL Alias Configuration");
1855 if( P("submit")!=0 ){
1856 Blob token;
1857 Blob sql;
1858 const char *zNewName;
@@ -1948,7 +1963,7 @@
1948 @ <p>To delete an entry from the alias table, change its name or value to an
1949 @ empty string and press "Apply Changes".
1950 @
1951 @ <p>To add a new alias, fill in the name and value in the bottom row
1952 @ of the table above and press "Apply Changes".
1953 style_finish_page("setup");
1954 }
1955
--- src/setup.c
+++ src/setup.c
@@ -73,10 +73,11 @@
73 if( !g.perm.Admin ){
74 login_needed(0);
75 }
76 setup_user = g.perm.Setup;
77
78 style_set_current_feature("setup");
79 style_header("Server Administration");
80
81 /* Make sure the header contains <base href="...">. Issue a warning
82 ** if it does not. */
83 if( !cgi_header_contains("<base href=") ){
@@ -175,11 +176,11 @@
176 setup_menu_entry("TH1", "admin_th1",
177 "Enter raw TH1 commands");
178 }
179 @ </table>
180
181 style_finish_page();
182 }
183
184 /*
185 ** Generate a checkbox for an attribute.
186 */
@@ -339,10 +340,11 @@
340 if( !g.perm.Setup ){
341 login_needed(0);
342 return;
343 }
344
345 style_set_current_feature("setup");
346 style_header("Access Control Settings");
347 db_begin_transaction();
348 @ <form action="%R/setup_access" method="post"><div>
349 login_insert_csrf_secret();
350 @ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -576,11 +578,11 @@
578
579 @ <hr />
580 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
581 @ </div></form>
582 db_end_transaction(0);
583 style_finish_page();
584 }
585
586 /*
587 ** WEBPAGE: setup_login_group
588 **
@@ -608,10 +610,11 @@
610 if( P("join")!=0 ){
611 login_group_join(zRepo, 1, zLogin, zPw, zNewName, &zErrMsg);
612 }else if( P("leave") ){
613 login_group_leave(&zErrMsg);
614 }
615 style_set_current_feature("setup");
616 style_header("Login Group Configuration");
617 if( zErrMsg ){
618 @ <p class="generalError">%s(zErrMsg)</p>
619 }
620 zGroup = login_group_name();
@@ -704,11 +707,11 @@
707 }
708 db_finalize(&q);
709 @ </tbody></table>
710 style_table_sorter();
711 }
712 style_finish_page();
713 }
714
715 /*
716 ** WEBPAGE: setup_timeline
717 **
@@ -729,10 +732,11 @@
732 if( !g.perm.Admin ){
733 login_needed(0);
734 return;
735 }
736
737 style_set_current_feature("setup");
738 style_header("Timeline Display Preferences");
739 db_begin_transaction();
740 @ <form action="%R/setup_timeline" method="post"><div>
741 login_insert_csrf_secret();
742 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
@@ -843,11 +847,11 @@
847
848 @ <hr />
849 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
850 @ </div></form>
851 db_end_transaction(0);
852 style_finish_page();
853 }
854
855 /*
856 ** WEBPAGE: setup_settings
857 **
@@ -864,10 +868,11 @@
868 if( !g.perm.Setup ){
869 login_needed(0);
870 return;
871 }
872
873 style_set_current_feature("setup");
874 style_header("Settings");
875 if(!g.repositoryOpen){
876 /* Provide read-only access to versioned settings,
877 but only if no repo file was explicitly provided. */
878 db_open_local(0);
@@ -936,11 +941,11 @@
941 }
942 }
943 @ </td></tr></table>
944 @ </div></form>
945 db_end_transaction(0);
946 style_finish_page();
947 }
948
949 /*
950 ** WEBPAGE: setup_config
951 **
@@ -951,10 +956,11 @@
956 if( !g.perm.Setup ){
957 login_needed(0);
958 return;
959 }
960
961 style_set_current_feature("setup");
962 style_header("WWW Configuration");
963 db_begin_transaction();
964 @ <form action="%R/setup_config" method="post"><div>
965 login_insert_csrf_secret();
966 @ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -1032,11 +1038,11 @@
1038 @ (Property: sitemap-contact)
1039 @ <hr />
1040 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1041 @ </div></form>
1042 db_end_transaction(0);
1043 style_finish_page();
1044 }
1045
1046 /*
1047 ** WEBPAGE: setup_wiki
1048 **
@@ -1047,10 +1053,11 @@
1053 if( !g.perm.Setup ){
1054 login_needed(0);
1055 return;
1056 }
1057
1058 style_set_current_feature("setup");
1059 style_header("Wiki Configuration");
1060 db_begin_transaction();
1061 @ <form action="%R/setup_wiki" method="post"><div>
1062 login_insert_csrf_secret();
1063 @ <input type="submit" name="submit" value="Apply Changes" /></p>
@@ -1108,11 +1115,11 @@
1115 @ (Property: "wiki-use-html")
1116 @ <hr />
1117 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1118 @ </div></form>
1119 db_end_transaction(0);
1120 style_finish_page();
1121 }
1122
1123 /*
1124 ** WEBPAGE: setup_modreq
1125 **
@@ -1123,10 +1130,11 @@
1130 if( !g.perm.Admin ){
1131 login_needed(0);
1132 return;
1133 }
1134
1135 style_set_current_feature("setup");
1136 style_header("Moderator For Wiki And Tickets");
1137 db_begin_transaction();
1138 @ <form action="%R/setup_modreq" method="post"><div>
1139 login_insert_csrf_secret();
1140 @ <hr />
@@ -1154,11 +1162,11 @@
1162
1163 @ <hr />
1164 @ <p><input type="submit" name="submit" value="Apply Changes" /></p>
1165 @ </div></form>
1166 db_end_transaction(0);
1167 style_finish_page();
1168
1169 }
1170
1171 /*
1172 ** WEBPAGE: setup_adunit
@@ -1180,10 +1188,11 @@
1188 cgi_replace_parameter("adunit","");
1189 cgi_replace_parameter("adright","");
1190 setup_incr_cfgcnt();
1191 }
1192
1193 style_set_current_feature("setup");
1194 style_header("Edit Ad Unit");
1195 @ <form action="%R/setup_adunit" method="post"><div>
1196 login_insert_csrf_secret();
1197 @ <b>Banner Ad-Unit:</b><br />
1198 textarea_attribute("", 6, 80, "adunit", "adunit", "", 0);
@@ -1235,11 +1244,11 @@
1244 @ border: 1px solid #f11;
1245 @ background-color: #fcc;
1246 @ '&gt;Demo Ad&lt;/div&gt;
1247 @ </pre></blockquote>
1248 @ </li>
1249 style_finish_page();
1250 db_end_transaction(0);
1251 }
1252
1253 /*
1254 ** WEBPAGE: setup_logo
@@ -1361,10 +1370,11 @@
1370 );
1371 db_protect_pop();
1372 db_end_transaction(0);
1373 cgi_redirect("setup_logo");
1374 }
1375 style_set_current_feature("setup");
1376 style_header("Edit Project Logo And Background");
1377 @ <p>The current project logo has a MIME-Type of <b>%h(zLogoMime)</b>
1378 @ and looks like this:</p>
1379 @ <blockquote><p><img src="%R/logo/%z(zLogoMtime)" \
1380 @ alt="logo" border="1" />
@@ -1437,11 +1447,11 @@
1447 @ <hr />
1448 @
1449 @ <p><span class="note">Note:</span> Your browser has probably cached these
1450 @ images, so you may need to press the Reload button before changes will
1451 @ take effect. </p>
1452 style_finish_page();
1453 db_end_transaction(0);
1454 }
1455
1456 /*
1457 ** Prevent the RAW SQL feature from being used to ATTACH a different
@@ -1481,10 +1491,11 @@
1491 login_needed(0);
1492 return;
1493 }
1494 add_content_sql_commands(g.db);
1495 zQ = cgi_csrf_safe(1) ? P("q") : 0;
1496 style_set_current_feature("setup");
1497 style_header("Raw SQL Commands");
1498 @ <p><b>Caution:</b> There are no restrictions on the SQL that can be
1499 @ run by this page. You can do serious and irrepairable damage to the
1500 @ repository. Proceed with extreme caution.</p>
1501 @
@@ -1599,11 +1610,11 @@
1610 }
1611 sqlite3_finalize(pStmt);
1612 @ </table>
1613 }
1614 }
1615 style_finish_page();
1616 }
1617
1618
1619 /*
1620 ** WEBPAGE: admin_th1
@@ -1618,10 +1629,11 @@
1629 login_check_credentials();
1630 if( !g.perm.Setup ){
1631 login_needed(0);
1632 return;
1633 }
1634 style_set_current_feature("setup");
1635 style_header("Raw TH1 Commands");
1636 @ <p><b>Caution:</b> There are no restrictions on the TH1 that can be
1637 @ run by this page. If Tcl integration was enabled at compile-time and
1638 @ the "tcl" setting is enabled, Tcl commands may be run as well.</p>
1639 @
@@ -1643,11 +1655,11 @@
1655 @ <pre class="th1result">%h(zR)</pre>
1656 }else{
1657 @ <pre class="th1error">%h(zR)</pre>
1658 }
1659 }
1660 style_finish_page();
1661 }
1662
1663 /*
1664 ** WEBPAGE: admin_log
1665 **
@@ -1664,10 +1676,11 @@
1676 login_check_credentials();
1677 if( !g.perm.Admin ){
1678 login_needed(0);
1679 return;
1680 }
1681 style_set_current_feature("setup");
1682 style_header("Admin Log");
1683 create_admin_log_table();
1684 limit = atoi(PD("n","200"));
1685 ofst = atoi(PD("x","0"));
1686 fLogEnabled = db_get_boolean("admin-log", 0);
@@ -1710,11 +1723,11 @@
1723 db_finalize(&stLog);
1724 @ </tbody></table>
1725 if( counter>ofst+limit ){
1726 @ <p><a href="admin_log?n=%d(limit)&x=%d(limit+ofst)">[Older]</a></p>
1727 }
1728 style_finish_page();
1729 }
1730
1731 /*
1732 ** WEBPAGE: srchsetup
1733 **
@@ -1724,10 +1737,11 @@
1737 login_check_credentials();
1738 if( !g.perm.Admin ){
1739 login_needed(0);
1740 return;
1741 }
1742 style_set_current_feature("setup");
1743 style_header("Search Configuration");
1744 @ <form action="%R/srchsetup" method="post"><div>
1745 login_insert_csrf_secret();
1746 @ <div style="text-align:center;font-weight:bold;">
1747 @ Server-specific settings that affect the
@@ -1790,11 +1804,11 @@
1804 @ larger repositories.</p>
1805 onoff_attribute("Use Porter Stemmer","search-stemmer","ss",0,0);
1806 @ <p><input type="submit" name="fts1" value="Create A Full-Text Index">
1807 }
1808 @ </div></form>
1809 style_finish_page();
1810 }
1811
1812 /*
1813 ** A URL Alias originally called zOldName is now zNewName/zValue.
1814 ** Write SQL to make this change into pSql.
@@ -1849,10 +1863,11 @@
1863 login_check_credentials();
1864 if( !g.perm.Admin ){
1865 login_needed(0);
1866 return;
1867 }
1868 style_set_current_feature("setup");
1869 style_header("URL Alias Configuration");
1870 if( P("submit")!=0 ){
1871 Blob token;
1872 Blob sql;
1873 const char *zNewName;
@@ -1948,7 +1963,7 @@
1963 @ <p>To delete an entry from the alias table, change its name or value to an
1964 @ empty string and press "Apply Changes".
1965 @
1966 @ <p>To add a new alias, fill in the name and value in the bottom row
1967 @ of the table above and press "Apply Changes".
1968 style_finish_page();
1969 }
1970
+12 -7
--- src/setupuser.c
+++ src/setupuser.c
@@ -52,10 +52,11 @@
5252
style_submenu_element("Log", "access_log");
5353
style_submenu_element("Help", "setup_ulist_notes");
5454
if( alert_tables_exist() ){
5555
style_submenu_element("Subscribers", "subscribers");
5656
}
57
+ style_set_current_feature("setup");
5758
style_header("User List");
5859
if( (zWith==0 || zWith[0]==0) && !bUnusedOnly ){
5960
@ <table border=1 cellpadding=2 cellspacing=0 class='userTable'>
6061
@ <thead><tr>
6162
@ <th>Category
@@ -202,11 +203,11 @@
202203
fossil_free(zAge);
203204
}
204205
@ </tbody></table>
205206
db_finalize(&s);
206207
style_table_sorter();
207
- style_finish_page("setupuser");
208
+ style_finish_page();
208209
}
209210
210211
/*
211212
** WEBPAGE: setup_ulist_notes
212213
**
@@ -213,10 +214,11 @@
213214
** A documentation page showing notes about user configuration. This
214215
** information used to be a side-bar on the user list page, but has been
215216
** factored out for improved presentation.
216217
*/
217218
void setup_ulist_notes(void){
219
+ style_set_current_feature("setup");
218220
style_header("User Configuration Notes");
219221
@ <h1>User Configuration Notes:</h1>
220222
@ <ol>
221223
@ <li><p>
222224
@ Every user, logged in or not, inherits the privileges of
@@ -248,20 +250,21 @@
248250
@
249251
@ <li><p>The permission flags are as follows:</p>
250252
capabilities_table(CAPCLASS_ALL);
251253
@ </li>
252254
@ </ol>
253
- style_finish_page("setupuser");
255
+ style_finish_page();
254256
}
255257
256258
/*
257259
** WEBPAGE: setup_ucap_list
258260
**
259261
** A documentation page showing the meaning of the various user capabilities
260262
** code letters.
261263
*/
262264
void setup_ucap_list(void){
265
+ style_set_current_feature("setup");
263266
style_header("User Capability Codes");
264267
@ <h1>All capabilities</h1>
265268
capabilities_table(CAPCLASS_ALL);
266269
@ <h1>Capabilities associated with checked-in content</h1>
267270
capabilities_table(CAPCLASS_CODE);
@@ -275,11 +278,11 @@
275278
capabilities_table(CAPCLASS_WIKI);
276279
@ <h1>Administrative capabilities</h1>
277280
capabilities_table(CAPCLASS_SUPER);
278281
@ <h1>Miscellaneous capabilities</h1>
279282
capabilities_table(CAPCLASS_OTHER);
280
- style_finish_page("setupuser");
283
+ style_finish_page();
281284
}
282285
283286
/*
284287
** Return true if zPw is a valid password string. A valid
285288
** password string is:
@@ -363,10 +366,12 @@
363366
"User \"%s\" has %d or more artifacts in the block-chain. "
364367
"Delete anyhow?",
365368
P("login")/*safe-for-%s*/, n);
366369
}
367370
}
371
+
372
+ style_set_current_feature("setup");
368373
369374
/* If we have all the necessary information, write the new or
370375
** modified user record. After writing the user record, redirect
371376
** to the page that displays a list of users.
372377
*/
@@ -409,11 +414,11 @@
409414
style_header("User Creation Error");
410415
@ <span class="loginError">Empty login not allowed.</span>
411416
@
412417
@ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
413418
@ [Bummer]</a></p>
414
- style_finish_page("setupuser");
419
+ style_finish_page();
415420
return;
416421
}
417422
if( isValidPwString(zPw) ){
418423
zPw = sha1_shared_secret(zPw, zLogin, 0);
419424
}else{
@@ -426,11 +431,11 @@
426431
@ <span class="loginError">Login "%h(zLogin)" is already used by
427432
@ a different user.</span>
428433
@
429434
@ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
430435
@ [Bummer]</a></p>
431
- style_finish_page("setupuser");
436
+ style_finish_page();
432437
return;
433438
}
434439
login_verify_csrf_secret();
435440
db_unprotect(PROTECT_USER);
436441
db_multi_exec(
@@ -478,11 +483,11 @@
478483
admin_log( "Error updating user '%q': %s'.", zLogin, zErr );
479484
@ <span class="loginError">%h(zErr)</span>
480485
@
481486
@ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
482487
@ [Bummer]</a></p>
483
- style_finish_page("setupuser");
488
+ style_finish_page();
484489
return;
485490
}
486491
}
487492
cgi_redirect(cgi_referer("setup_ulist"));
488493
return;
@@ -896,7 +901,7 @@
896901
@ template for users who are allowed more access than
897902
@ <span class="usertype">anonymous</span>,
898903
@ but less than a <span class="usertype">developer</span>.
899904
@ </p></li>
900905
@ </ul>
901
- style_finish_page("setupuser");
906
+ style_finish_page();
902907
}
903908
--- src/setupuser.c
+++ src/setupuser.c
@@ -52,10 +52,11 @@
52 style_submenu_element("Log", "access_log");
53 style_submenu_element("Help", "setup_ulist_notes");
54 if( alert_tables_exist() ){
55 style_submenu_element("Subscribers", "subscribers");
56 }
 
57 style_header("User List");
58 if( (zWith==0 || zWith[0]==0) && !bUnusedOnly ){
59 @ <table border=1 cellpadding=2 cellspacing=0 class='userTable'>
60 @ <thead><tr>
61 @ <th>Category
@@ -202,11 +203,11 @@
202 fossil_free(zAge);
203 }
204 @ </tbody></table>
205 db_finalize(&s);
206 style_table_sorter();
207 style_finish_page("setupuser");
208 }
209
210 /*
211 ** WEBPAGE: setup_ulist_notes
212 **
@@ -213,10 +214,11 @@
213 ** A documentation page showing notes about user configuration. This
214 ** information used to be a side-bar on the user list page, but has been
215 ** factored out for improved presentation.
216 */
217 void setup_ulist_notes(void){
 
218 style_header("User Configuration Notes");
219 @ <h1>User Configuration Notes:</h1>
220 @ <ol>
221 @ <li><p>
222 @ Every user, logged in or not, inherits the privileges of
@@ -248,20 +250,21 @@
248 @
249 @ <li><p>The permission flags are as follows:</p>
250 capabilities_table(CAPCLASS_ALL);
251 @ </li>
252 @ </ol>
253 style_finish_page("setupuser");
254 }
255
256 /*
257 ** WEBPAGE: setup_ucap_list
258 **
259 ** A documentation page showing the meaning of the various user capabilities
260 ** code letters.
261 */
262 void setup_ucap_list(void){
 
263 style_header("User Capability Codes");
264 @ <h1>All capabilities</h1>
265 capabilities_table(CAPCLASS_ALL);
266 @ <h1>Capabilities associated with checked-in content</h1>
267 capabilities_table(CAPCLASS_CODE);
@@ -275,11 +278,11 @@
275 capabilities_table(CAPCLASS_WIKI);
276 @ <h1>Administrative capabilities</h1>
277 capabilities_table(CAPCLASS_SUPER);
278 @ <h1>Miscellaneous capabilities</h1>
279 capabilities_table(CAPCLASS_OTHER);
280 style_finish_page("setupuser");
281 }
282
283 /*
284 ** Return true if zPw is a valid password string. A valid
285 ** password string is:
@@ -363,10 +366,12 @@
363 "User \"%s\" has %d or more artifacts in the block-chain. "
364 "Delete anyhow?",
365 P("login")/*safe-for-%s*/, n);
366 }
367 }
 
 
368
369 /* If we have all the necessary information, write the new or
370 ** modified user record. After writing the user record, redirect
371 ** to the page that displays a list of users.
372 */
@@ -409,11 +414,11 @@
409 style_header("User Creation Error");
410 @ <span class="loginError">Empty login not allowed.</span>
411 @
412 @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
413 @ [Bummer]</a></p>
414 style_finish_page("setupuser");
415 return;
416 }
417 if( isValidPwString(zPw) ){
418 zPw = sha1_shared_secret(zPw, zLogin, 0);
419 }else{
@@ -426,11 +431,11 @@
426 @ <span class="loginError">Login "%h(zLogin)" is already used by
427 @ a different user.</span>
428 @
429 @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
430 @ [Bummer]</a></p>
431 style_finish_page("setupuser");
432 return;
433 }
434 login_verify_csrf_secret();
435 db_unprotect(PROTECT_USER);
436 db_multi_exec(
@@ -478,11 +483,11 @@
478 admin_log( "Error updating user '%q': %s'.", zLogin, zErr );
479 @ <span class="loginError">%h(zErr)</span>
480 @
481 @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
482 @ [Bummer]</a></p>
483 style_finish_page("setupuser");
484 return;
485 }
486 }
487 cgi_redirect(cgi_referer("setup_ulist"));
488 return;
@@ -896,7 +901,7 @@
896 @ template for users who are allowed more access than
897 @ <span class="usertype">anonymous</span>,
898 @ but less than a <span class="usertype">developer</span>.
899 @ </p></li>
900 @ </ul>
901 style_finish_page("setupuser");
902 }
903
--- src/setupuser.c
+++ src/setupuser.c
@@ -52,10 +52,11 @@
52 style_submenu_element("Log", "access_log");
53 style_submenu_element("Help", "setup_ulist_notes");
54 if( alert_tables_exist() ){
55 style_submenu_element("Subscribers", "subscribers");
56 }
57 style_set_current_feature("setup");
58 style_header("User List");
59 if( (zWith==0 || zWith[0]==0) && !bUnusedOnly ){
60 @ <table border=1 cellpadding=2 cellspacing=0 class='userTable'>
61 @ <thead><tr>
62 @ <th>Category
@@ -202,11 +203,11 @@
203 fossil_free(zAge);
204 }
205 @ </tbody></table>
206 db_finalize(&s);
207 style_table_sorter();
208 style_finish_page();
209 }
210
211 /*
212 ** WEBPAGE: setup_ulist_notes
213 **
@@ -213,10 +214,11 @@
214 ** A documentation page showing notes about user configuration. This
215 ** information used to be a side-bar on the user list page, but has been
216 ** factored out for improved presentation.
217 */
218 void setup_ulist_notes(void){
219 style_set_current_feature("setup");
220 style_header("User Configuration Notes");
221 @ <h1>User Configuration Notes:</h1>
222 @ <ol>
223 @ <li><p>
224 @ Every user, logged in or not, inherits the privileges of
@@ -248,20 +250,21 @@
250 @
251 @ <li><p>The permission flags are as follows:</p>
252 capabilities_table(CAPCLASS_ALL);
253 @ </li>
254 @ </ol>
255 style_finish_page();
256 }
257
258 /*
259 ** WEBPAGE: setup_ucap_list
260 **
261 ** A documentation page showing the meaning of the various user capabilities
262 ** code letters.
263 */
264 void setup_ucap_list(void){
265 style_set_current_feature("setup");
266 style_header("User Capability Codes");
267 @ <h1>All capabilities</h1>
268 capabilities_table(CAPCLASS_ALL);
269 @ <h1>Capabilities associated with checked-in content</h1>
270 capabilities_table(CAPCLASS_CODE);
@@ -275,11 +278,11 @@
278 capabilities_table(CAPCLASS_WIKI);
279 @ <h1>Administrative capabilities</h1>
280 capabilities_table(CAPCLASS_SUPER);
281 @ <h1>Miscellaneous capabilities</h1>
282 capabilities_table(CAPCLASS_OTHER);
283 style_finish_page();
284 }
285
286 /*
287 ** Return true if zPw is a valid password string. A valid
288 ** password string is:
@@ -363,10 +366,12 @@
366 "User \"%s\" has %d or more artifacts in the block-chain. "
367 "Delete anyhow?",
368 P("login")/*safe-for-%s*/, n);
369 }
370 }
371
372 style_set_current_feature("setup");
373
374 /* If we have all the necessary information, write the new or
375 ** modified user record. After writing the user record, redirect
376 ** to the page that displays a list of users.
377 */
@@ -409,11 +414,11 @@
414 style_header("User Creation Error");
415 @ <span class="loginError">Empty login not allowed.</span>
416 @
417 @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
418 @ [Bummer]</a></p>
419 style_finish_page();
420 return;
421 }
422 if( isValidPwString(zPw) ){
423 zPw = sha1_shared_secret(zPw, zLogin, 0);
424 }else{
@@ -426,11 +431,11 @@
431 @ <span class="loginError">Login "%h(zLogin)" is already used by
432 @ a different user.</span>
433 @
434 @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
435 @ [Bummer]</a></p>
436 style_finish_page();
437 return;
438 }
439 login_verify_csrf_secret();
440 db_unprotect(PROTECT_USER);
441 db_multi_exec(
@@ -478,11 +483,11 @@
483 admin_log( "Error updating user '%q': %s'.", zLogin, zErr );
484 @ <span class="loginError">%h(zErr)</span>
485 @
486 @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)">
487 @ [Bummer]</a></p>
488 style_finish_page();
489 return;
490 }
491 }
492 cgi_redirect(cgi_referer("setup_ulist"));
493 return;
@@ -896,7 +901,7 @@
901 @ template for users who are allowed more access than
902 @ <span class="usertype">anonymous</span>,
903 @ but less than a <span class="usertype">developer</span>.
904 @ </p></li>
905 @ </ul>
906 style_finish_page();
907 }
908
+3 -3
--- src/shun.c
+++ src/shun.c
@@ -263,11 +263,11 @@
263263
if( cnt==0 ){
264264
@ <i>no artifacts are shunned on this server</i>
265265
}
266266
db_finalize(&q);
267267
@ </p></blockquote>
268
- style_finish_page("shun");
268
+ style_finish_page();
269269
fossil_free(zCanonical);
270270
}
271271
272272
/*
273273
** Remove from the BLOB table all artifacts that are in the SHUN table.
@@ -403,11 +403,11 @@
403403
@ </tr>
404404
}
405405
}
406406
db_finalize(&q);
407407
@ </table>
408
- style_finish_page("rcvfromlist");
408
+ style_finish_page();
409409
}
410410
411411
/*
412412
** WEBPAGE: rcvfrom
413413
**
@@ -549,7 +549,7 @@
549549
@ </td></tr>
550550
}
551551
}
552552
@ </table>
553553
db_finalize(&q);
554
- style_finish_page("rcvfrom");
554
+ style_finish_page();
555555
}
556556
--- src/shun.c
+++ src/shun.c
@@ -263,11 +263,11 @@
263 if( cnt==0 ){
264 @ <i>no artifacts are shunned on this server</i>
265 }
266 db_finalize(&q);
267 @ </p></blockquote>
268 style_finish_page("shun");
269 fossil_free(zCanonical);
270 }
271
272 /*
273 ** Remove from the BLOB table all artifacts that are in the SHUN table.
@@ -403,11 +403,11 @@
403 @ </tr>
404 }
405 }
406 db_finalize(&q);
407 @ </table>
408 style_finish_page("rcvfromlist");
409 }
410
411 /*
412 ** WEBPAGE: rcvfrom
413 **
@@ -549,7 +549,7 @@
549 @ </td></tr>
550 }
551 }
552 @ </table>
553 db_finalize(&q);
554 style_finish_page("rcvfrom");
555 }
556
--- src/shun.c
+++ src/shun.c
@@ -263,11 +263,11 @@
263 if( cnt==0 ){
264 @ <i>no artifacts are shunned on this server</i>
265 }
266 db_finalize(&q);
267 @ </p></blockquote>
268 style_finish_page();
269 fossil_free(zCanonical);
270 }
271
272 /*
273 ** Remove from the BLOB table all artifacts that are in the SHUN table.
@@ -403,11 +403,11 @@
403 @ </tr>
404 }
405 }
406 db_finalize(&q);
407 @ </table>
408 style_finish_page();
409 }
410
411 /*
412 ** WEBPAGE: rcvfrom
413 **
@@ -549,7 +549,7 @@
549 @ </td></tr>
550 }
551 }
552 @ </table>
553 db_finalize(&q);
554 style_finish_page();
555 }
556
+5 -3
--- src/sitemap.c
+++ src/sitemap.c
@@ -221,11 +221,11 @@
221221
if( isPopup ){
222222
@ <li>%z(href("%R/sitemap"))Site Map</a></li>
223223
}
224224
@ </ul>
225225
if( !isPopup ){
226
- style_finish_page("sitemap");
226
+ style_finish_page();
227227
}
228228
}
229229
230230
/*
231231
** WEBPAGE: sitemap-test
@@ -236,10 +236,11 @@
236236
*/
237237
void sitemap_test_page(void){
238238
int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */
239239
240240
login_check_credentials();
241
+ style_set_current_feature("sitemap");
241242
if( P("popup")!=0 && cgi_csrf_safe(0) ){
242243
/* If this is a POST from the same origin with the popup=1 parameter,
243244
** then disable anti-robot defenses */
244245
isPopup = 1;
245246
g.perm.Hyperlink = 1;
@@ -273,11 +274,11 @@
273274
}
274275
@ <li>%z(href("%R/cookies"))Content of display preference cookie</a></li>
275276
@ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li>
276277
@ <li>%z(href("%R/test-piechart"))Pie-Chart generator test</a></li>
277278
if( !isPopup ){
278
- style_finish_page("sitemap");
279
+ style_finish_page();
279280
}
280281
}
281282
282283
/*
283284
** WEBPAGE: sitemap-timeline
@@ -287,10 +288,11 @@
287288
*/
288289
void sitemap_timeline_page(void){
289290
int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */
290291
291292
login_check_credentials();
293
+ style_set_current_feature("sitemap");
292294
if( P("popup")!=0 && cgi_csrf_safe(0) ){
293295
/* If this is a POST from the same origin with the popup=1 parameter,
294296
** then disable anti-robot defenses */
295297
isPopup = 1;
296298
g.perm.Hyperlink = 1;
@@ -313,8 +315,8 @@
313315
@ <li>%z(href("%R/timewarps"))Timewarps</a></li>
314316
@ <li>%z(href("%R/timeline?ubg"))Color-coded by user</a></li>
315317
@ <li>%z(href("%R/timeline?deltabg"))Delta vs. baseline manifests</a></li>
316318
@ </ul>
317319
if( !isPopup ){
318
- style_finish_page("sitemap");
320
+ style_finish_page();
319321
}
320322
}
321323
--- src/sitemap.c
+++ src/sitemap.c
@@ -221,11 +221,11 @@
221 if( isPopup ){
222 @ <li>%z(href("%R/sitemap"))Site Map</a></li>
223 }
224 @ </ul>
225 if( !isPopup ){
226 style_finish_page("sitemap");
227 }
228 }
229
230 /*
231 ** WEBPAGE: sitemap-test
@@ -236,10 +236,11 @@
236 */
237 void sitemap_test_page(void){
238 int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */
239
240 login_check_credentials();
 
241 if( P("popup")!=0 && cgi_csrf_safe(0) ){
242 /* If this is a POST from the same origin with the popup=1 parameter,
243 ** then disable anti-robot defenses */
244 isPopup = 1;
245 g.perm.Hyperlink = 1;
@@ -273,11 +274,11 @@
273 }
274 @ <li>%z(href("%R/cookies"))Content of display preference cookie</a></li>
275 @ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li>
276 @ <li>%z(href("%R/test-piechart"))Pie-Chart generator test</a></li>
277 if( !isPopup ){
278 style_finish_page("sitemap");
279 }
280 }
281
282 /*
283 ** WEBPAGE: sitemap-timeline
@@ -287,10 +288,11 @@
287 */
288 void sitemap_timeline_page(void){
289 int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */
290
291 login_check_credentials();
 
292 if( P("popup")!=0 && cgi_csrf_safe(0) ){
293 /* If this is a POST from the same origin with the popup=1 parameter,
294 ** then disable anti-robot defenses */
295 isPopup = 1;
296 g.perm.Hyperlink = 1;
@@ -313,8 +315,8 @@
313 @ <li>%z(href("%R/timewarps"))Timewarps</a></li>
314 @ <li>%z(href("%R/timeline?ubg"))Color-coded by user</a></li>
315 @ <li>%z(href("%R/timeline?deltabg"))Delta vs. baseline manifests</a></li>
316 @ </ul>
317 if( !isPopup ){
318 style_finish_page("sitemap");
319 }
320 }
321
--- src/sitemap.c
+++ src/sitemap.c
@@ -221,11 +221,11 @@
221 if( isPopup ){
222 @ <li>%z(href("%R/sitemap"))Site Map</a></li>
223 }
224 @ </ul>
225 if( !isPopup ){
226 style_finish_page();
227 }
228 }
229
230 /*
231 ** WEBPAGE: sitemap-test
@@ -236,10 +236,11 @@
236 */
237 void sitemap_test_page(void){
238 int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */
239
240 login_check_credentials();
241 style_set_current_feature("sitemap");
242 if( P("popup")!=0 && cgi_csrf_safe(0) ){
243 /* If this is a POST from the same origin with the popup=1 parameter,
244 ** then disable anti-robot defenses */
245 isPopup = 1;
246 g.perm.Hyperlink = 1;
@@ -273,11 +274,11 @@
274 }
275 @ <li>%z(href("%R/cookies"))Content of display preference cookie</a></li>
276 @ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li>
277 @ <li>%z(href("%R/test-piechart"))Pie-Chart generator test</a></li>
278 if( !isPopup ){
279 style_finish_page();
280 }
281 }
282
283 /*
284 ** WEBPAGE: sitemap-timeline
@@ -287,10 +288,11 @@
288 */
289 void sitemap_timeline_page(void){
290 int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */
291
292 login_check_credentials();
293 style_set_current_feature("sitemap");
294 if( P("popup")!=0 && cgi_csrf_safe(0) ){
295 /* If this is a POST from the same origin with the popup=1 parameter,
296 ** then disable anti-robot defenses */
297 isPopup = 1;
298 g.perm.Hyperlink = 1;
@@ -313,8 +315,8 @@
315 @ <li>%z(href("%R/timewarps"))Timewarps</a></li>
316 @ <li>%z(href("%R/timeline?ubg"))Color-coded by user</a></li>
317 @ <li>%z(href("%R/timeline?deltabg"))Delta vs. baseline manifests</a></li>
318 @ </ul>
319 if( !isPopup ){
320 style_finish_page();
321 }
322 }
323
+12 -6
--- src/skins.c
+++ src/skins.c
@@ -387,10 +387,11 @@
387387
zOldName = P("sn");
388388
zNewName = P("newname");
389389
if( zOldName==0 ) return 0;
390390
if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){
391391
if( zNewName==0 ) zNewName = zOldName;
392
+ style_set_current_feature("skins");
392393
style_header("Rename A Skin");
393394
if( ex ){
394395
@ <p><span class="generalError">There is already another skin
395396
@ named "%h(zNewName)". Choose a different name.</span></p>
396397
}
@@ -404,11 +405,11 @@
404405
@ <input type="submit" name="rename" value="Rename">
405406
@ <input type="submit" name="canren" value="Cancel">
406407
@ </table>
407408
login_insert_csrf_secret();
408409
@ </div></form>
409
- style_finish_page("skins");
410
+ style_finish_page();
410411
return 1;
411412
}
412413
db_unprotect(PROTECT_CONFIG);
413414
db_multi_exec(
414415
"UPDATE config SET name='skin:%q' WHERE name='skin:%q';",
@@ -429,10 +430,11 @@
429430
zNewName = P("svname");
430431
if( zNewName && zNewName[0]!=0 ){
431432
}
432433
if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){
433434
if( zNewName==0 ) zNewName = "";
435
+ style_set_current_feature("skins");
434436
style_header("Save Current Skin");
435437
if( ex ){
436438
@ <p><span class="generalError">There is already another skin
437439
@ named "%h(zNewName)". Choose a different name.</span></p>
438440
}
@@ -444,11 +446,11 @@
444446
@ <input type="submit" name="save" value="Save">
445447
@ <input type="submit" name="cansave" value="Cancel">
446448
@ </table>
447449
login_insert_csrf_secret();
448450
@ </div></form>
449
- style_finish_page("skins");
451
+ style_finish_page();
450452
return 1;
451453
}
452454
db_unprotect(PROTECT_CONFIG);
453455
db_multi_exec(
454456
"INSERT OR IGNORE INTO config(name, value, mtime)"
@@ -483,10 +485,12 @@
483485
zCurrent = getSkin(0);
484486
for(i=0; i<count(aBuiltinSkin); i++){
485487
aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel);
486488
}
487489
490
+ style_set_current_feature("skins");
491
+
488492
if( cgi_csrf_safe(1) ){
489493
/* Process requests to delete a user-defined skin */
490494
if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){
491495
style_header("Confirm Custom Skin Delete");
492496
@ <form action="%R/setup_skin_admin" method="post"><div>
@@ -495,11 +499,11 @@
495499
@ <input type="hidden" name="sn" value="%h(P("sn"))" />
496500
@ <input type="submit" name="del2" value="Confirm - Delete The Skin" />
497501
@ <input type="submit" name="cancel" value="Cancel - Do Not Delete" />
498502
login_insert_csrf_secret();
499503
@ </div></form>
500
- style_finish_page("skins");
504
+ style_finish_page();
501505
db_end_transaction(1);
502506
return;
503507
}
504508
if( P("del2")!=0 && (zName = skinVarName(P("sn"), 1))!=0 ){
505509
db_unprotect(PROTECT_CONFIG);
@@ -648,11 +652,11 @@
648652
@ </form></tr>
649653
}
650654
db_finalize(&q);
651655
652656
@ </table>
653
- style_finish_page("skins");
657
+ style_finish_page();
654658
db_end_transaction(0);
655659
}
656660
657661
/*
658662
** Generate HTML for a <select> that lists all the available skin names,
@@ -796,10 +800,11 @@
796800
zContent = zDflt;
797801
isRevert = 1;
798802
}
799803
800804
db_begin_transaction();
805
+ style_set_current_feature("skins");
801806
style_header("%s", zTitle);
802807
for(j=0; j<count(aSkinAttr); j++){
803808
style_submenu_element(aSkinAttr[j].zSubmenu,
804809
"%R/setup_skinedit?w=%d&basis=%h&sk=%d",j,zBasis,iSkin);
805810
}
@@ -845,11 +850,11 @@
845850
blob_reset(&from);
846851
blob_reset(&to);
847852
blob_reset(&out);
848853
}
849854
@ </div></form>
850
- style_finish_page("skins");
855
+ style_finish_page();
851856
db_end_transaction(0);
852857
}
853858
854859
/*
855860
** Try to initialize draft skin iSkin to the built-in or preexisting
@@ -962,10 +967,11 @@
962967
/* Publish the draft skin */
963968
if( P("pub7")!=0 && PB("pub7ck1") && PB("pub7ck2") ){
964969
skin_publish(iSkin);
965970
}
966971
972
+ style_set_current_feature("skins");
967973
style_header("Customize Skin");
968974
969975
@ <p>Customize the look of this Fossil repository by making changes
970976
@ to the CSS, Header, Footer, and Detail Settings in one of nine "draft"
971977
@ configurations. Then, after verifying that all is working correctly,
@@ -1123,7 +1129,7 @@
11231129
}else{
11241130
@ <p>Visit the <a href='%R/setup_skin_admin'>Skin Admin</a> page
11251131
@ for cleanup and recovery actions.
11261132
}
11271133
builtin_request_js("skin.js");
1128
- style_finish_page("skins");
1134
+ style_finish_page();
11291135
}
11301136
--- src/skins.c
+++ src/skins.c
@@ -387,10 +387,11 @@
387 zOldName = P("sn");
388 zNewName = P("newname");
389 if( zOldName==0 ) return 0;
390 if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){
391 if( zNewName==0 ) zNewName = zOldName;
 
392 style_header("Rename A Skin");
393 if( ex ){
394 @ <p><span class="generalError">There is already another skin
395 @ named "%h(zNewName)". Choose a different name.</span></p>
396 }
@@ -404,11 +405,11 @@
404 @ <input type="submit" name="rename" value="Rename">
405 @ <input type="submit" name="canren" value="Cancel">
406 @ </table>
407 login_insert_csrf_secret();
408 @ </div></form>
409 style_finish_page("skins");
410 return 1;
411 }
412 db_unprotect(PROTECT_CONFIG);
413 db_multi_exec(
414 "UPDATE config SET name='skin:%q' WHERE name='skin:%q';",
@@ -429,10 +430,11 @@
429 zNewName = P("svname");
430 if( zNewName && zNewName[0]!=0 ){
431 }
432 if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){
433 if( zNewName==0 ) zNewName = "";
 
434 style_header("Save Current Skin");
435 if( ex ){
436 @ <p><span class="generalError">There is already another skin
437 @ named "%h(zNewName)". Choose a different name.</span></p>
438 }
@@ -444,11 +446,11 @@
444 @ <input type="submit" name="save" value="Save">
445 @ <input type="submit" name="cansave" value="Cancel">
446 @ </table>
447 login_insert_csrf_secret();
448 @ </div></form>
449 style_finish_page("skins");
450 return 1;
451 }
452 db_unprotect(PROTECT_CONFIG);
453 db_multi_exec(
454 "INSERT OR IGNORE INTO config(name, value, mtime)"
@@ -483,10 +485,12 @@
483 zCurrent = getSkin(0);
484 for(i=0; i<count(aBuiltinSkin); i++){
485 aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel);
486 }
487
 
 
488 if( cgi_csrf_safe(1) ){
489 /* Process requests to delete a user-defined skin */
490 if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){
491 style_header("Confirm Custom Skin Delete");
492 @ <form action="%R/setup_skin_admin" method="post"><div>
@@ -495,11 +499,11 @@
495 @ <input type="hidden" name="sn" value="%h(P("sn"))" />
496 @ <input type="submit" name="del2" value="Confirm - Delete The Skin" />
497 @ <input type="submit" name="cancel" value="Cancel - Do Not Delete" />
498 login_insert_csrf_secret();
499 @ </div></form>
500 style_finish_page("skins");
501 db_end_transaction(1);
502 return;
503 }
504 if( P("del2")!=0 && (zName = skinVarName(P("sn"), 1))!=0 ){
505 db_unprotect(PROTECT_CONFIG);
@@ -648,11 +652,11 @@
648 @ </form></tr>
649 }
650 db_finalize(&q);
651
652 @ </table>
653 style_finish_page("skins");
654 db_end_transaction(0);
655 }
656
657 /*
658 ** Generate HTML for a <select> that lists all the available skin names,
@@ -796,10 +800,11 @@
796 zContent = zDflt;
797 isRevert = 1;
798 }
799
800 db_begin_transaction();
 
801 style_header("%s", zTitle);
802 for(j=0; j<count(aSkinAttr); j++){
803 style_submenu_element(aSkinAttr[j].zSubmenu,
804 "%R/setup_skinedit?w=%d&basis=%h&sk=%d",j,zBasis,iSkin);
805 }
@@ -845,11 +850,11 @@
845 blob_reset(&from);
846 blob_reset(&to);
847 blob_reset(&out);
848 }
849 @ </div></form>
850 style_finish_page("skins");
851 db_end_transaction(0);
852 }
853
854 /*
855 ** Try to initialize draft skin iSkin to the built-in or preexisting
@@ -962,10 +967,11 @@
962 /* Publish the draft skin */
963 if( P("pub7")!=0 && PB("pub7ck1") && PB("pub7ck2") ){
964 skin_publish(iSkin);
965 }
966
 
967 style_header("Customize Skin");
968
969 @ <p>Customize the look of this Fossil repository by making changes
970 @ to the CSS, Header, Footer, and Detail Settings in one of nine "draft"
971 @ configurations. Then, after verifying that all is working correctly,
@@ -1123,7 +1129,7 @@
1123 }else{
1124 @ <p>Visit the <a href='%R/setup_skin_admin'>Skin Admin</a> page
1125 @ for cleanup and recovery actions.
1126 }
1127 builtin_request_js("skin.js");
1128 style_finish_page("skins");
1129 }
1130
--- src/skins.c
+++ src/skins.c
@@ -387,10 +387,11 @@
387 zOldName = P("sn");
388 zNewName = P("newname");
389 if( zOldName==0 ) return 0;
390 if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){
391 if( zNewName==0 ) zNewName = zOldName;
392 style_set_current_feature("skins");
393 style_header("Rename A Skin");
394 if( ex ){
395 @ <p><span class="generalError">There is already another skin
396 @ named "%h(zNewName)". Choose a different name.</span></p>
397 }
@@ -404,11 +405,11 @@
405 @ <input type="submit" name="rename" value="Rename">
406 @ <input type="submit" name="canren" value="Cancel">
407 @ </table>
408 login_insert_csrf_secret();
409 @ </div></form>
410 style_finish_page();
411 return 1;
412 }
413 db_unprotect(PROTECT_CONFIG);
414 db_multi_exec(
415 "UPDATE config SET name='skin:%q' WHERE name='skin:%q';",
@@ -429,10 +430,11 @@
430 zNewName = P("svname");
431 if( zNewName && zNewName[0]!=0 ){
432 }
433 if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){
434 if( zNewName==0 ) zNewName = "";
435 style_set_current_feature("skins");
436 style_header("Save Current Skin");
437 if( ex ){
438 @ <p><span class="generalError">There is already another skin
439 @ named "%h(zNewName)". Choose a different name.</span></p>
440 }
@@ -444,11 +446,11 @@
446 @ <input type="submit" name="save" value="Save">
447 @ <input type="submit" name="cansave" value="Cancel">
448 @ </table>
449 login_insert_csrf_secret();
450 @ </div></form>
451 style_finish_page();
452 return 1;
453 }
454 db_unprotect(PROTECT_CONFIG);
455 db_multi_exec(
456 "INSERT OR IGNORE INTO config(name, value, mtime)"
@@ -483,10 +485,12 @@
485 zCurrent = getSkin(0);
486 for(i=0; i<count(aBuiltinSkin); i++){
487 aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel);
488 }
489
490 style_set_current_feature("skins");
491
492 if( cgi_csrf_safe(1) ){
493 /* Process requests to delete a user-defined skin */
494 if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){
495 style_header("Confirm Custom Skin Delete");
496 @ <form action="%R/setup_skin_admin" method="post"><div>
@@ -495,11 +499,11 @@
499 @ <input type="hidden" name="sn" value="%h(P("sn"))" />
500 @ <input type="submit" name="del2" value="Confirm - Delete The Skin" />
501 @ <input type="submit" name="cancel" value="Cancel - Do Not Delete" />
502 login_insert_csrf_secret();
503 @ </div></form>
504 style_finish_page();
505 db_end_transaction(1);
506 return;
507 }
508 if( P("del2")!=0 && (zName = skinVarName(P("sn"), 1))!=0 ){
509 db_unprotect(PROTECT_CONFIG);
@@ -648,11 +652,11 @@
652 @ </form></tr>
653 }
654 db_finalize(&q);
655
656 @ </table>
657 style_finish_page();
658 db_end_transaction(0);
659 }
660
661 /*
662 ** Generate HTML for a <select> that lists all the available skin names,
@@ -796,10 +800,11 @@
800 zContent = zDflt;
801 isRevert = 1;
802 }
803
804 db_begin_transaction();
805 style_set_current_feature("skins");
806 style_header("%s", zTitle);
807 for(j=0; j<count(aSkinAttr); j++){
808 style_submenu_element(aSkinAttr[j].zSubmenu,
809 "%R/setup_skinedit?w=%d&basis=%h&sk=%d",j,zBasis,iSkin);
810 }
@@ -845,11 +850,11 @@
850 blob_reset(&from);
851 blob_reset(&to);
852 blob_reset(&out);
853 }
854 @ </div></form>
855 style_finish_page();
856 db_end_transaction(0);
857 }
858
859 /*
860 ** Try to initialize draft skin iSkin to the built-in or preexisting
@@ -962,10 +967,11 @@
967 /* Publish the draft skin */
968 if( P("pub7")!=0 && PB("pub7ck1") && PB("pub7ck2") ){
969 skin_publish(iSkin);
970 }
971
972 style_set_current_feature("skins");
973 style_header("Customize Skin");
974
975 @ <p>Customize the look of this Fossil repository by making changes
976 @ to the CSS, Header, Footer, and Detail Settings in one of nine "draft"
977 @ configurations. Then, after verifying that all is working correctly,
@@ -1123,7 +1129,7 @@
1129 }else{
1130 @ <p>Visit the <a href='%R/setup_skin_admin'>Skin Admin</a> page
1131 @ for cleanup and recovery actions.
1132 }
1133 builtin_request_js("skin.js");
1134 style_finish_page();
1135 }
1136
+4 -2
--- src/smtp.c
+++ src/smtp.c
@@ -769,10 +769,11 @@
769769
if( !g.perm.Setup ){
770770
login_needed(0);
771771
return;
772772
}
773773
db_begin_transaction();
774
+ style_set_current_feature("smtp");
774775
style_header("Email Server Setup");
775776
if( db_table_exists("repository","emailroute") ){
776777
style_submenu_element("emailblob table", "%R/emailblob");
777778
style_submenu_element("emailoutq table", "%R/emailoutq");
778779
db_prepare(&q, "SELECT eaddr, epolicy FROM emailroute ORDER BY 1");
@@ -805,11 +806,11 @@
805806
@ <form method="POST" action="%R/setup_smtp_route">
806807
@ <input type="submit" value="New">
807808
@ &larr; Add a new email address
808809
@ </form>
809810
@ </table>
810
- style_finish_page("smtp");
811
+ style_finish_page();
811812
db_end_transaction(0);
812813
}
813814
814815
/*
815816
** WEBPAGE: setup_smtp_route
@@ -833,10 +834,11 @@
833834
login_check_credentials();
834835
if( !g.perm.Setup ){
835836
login_needed(0);
836837
return;
837838
}
839
+ style_set_current_feature("smtp");
838840
style_header("Email Route Editor");
839841
840842
if( P("edit") && cgi_csrf_safe(1) && zEAddr!=0 && zEPolicy!=0 ){
841843
smtp_server_schema(0);
842844
if( (zOAddr==0 || fossil_strcmp(zEAddr,zOAddr)!=0) ){
@@ -924,11 +926,11 @@
924926
@ with USER.LOGIN=<i>login-name</i>.
925927
@ </ul>
926928
@
927929
@ <p>To delete a route &rarr; erase all text from the "Routing" field then
928930
@ press the "Apply" button.
929
- style_finish_page("smtp");
931
+ style_finish_page();
930932
}
931933
932934
#if LOCAL_INTERFACE
933935
/*
934936
** State information for the server
935937
--- src/smtp.c
+++ src/smtp.c
@@ -769,10 +769,11 @@
769 if( !g.perm.Setup ){
770 login_needed(0);
771 return;
772 }
773 db_begin_transaction();
 
774 style_header("Email Server Setup");
775 if( db_table_exists("repository","emailroute") ){
776 style_submenu_element("emailblob table", "%R/emailblob");
777 style_submenu_element("emailoutq table", "%R/emailoutq");
778 db_prepare(&q, "SELECT eaddr, epolicy FROM emailroute ORDER BY 1");
@@ -805,11 +806,11 @@
805 @ <form method="POST" action="%R/setup_smtp_route">
806 @ <input type="submit" value="New">
807 @ &larr; Add a new email address
808 @ </form>
809 @ </table>
810 style_finish_page("smtp");
811 db_end_transaction(0);
812 }
813
814 /*
815 ** WEBPAGE: setup_smtp_route
@@ -833,10 +834,11 @@
833 login_check_credentials();
834 if( !g.perm.Setup ){
835 login_needed(0);
836 return;
837 }
 
838 style_header("Email Route Editor");
839
840 if( P("edit") && cgi_csrf_safe(1) && zEAddr!=0 && zEPolicy!=0 ){
841 smtp_server_schema(0);
842 if( (zOAddr==0 || fossil_strcmp(zEAddr,zOAddr)!=0) ){
@@ -924,11 +926,11 @@
924 @ with USER.LOGIN=<i>login-name</i>.
925 @ </ul>
926 @
927 @ <p>To delete a route &rarr; erase all text from the "Routing" field then
928 @ press the "Apply" button.
929 style_finish_page("smtp");
930 }
931
932 #if LOCAL_INTERFACE
933 /*
934 ** State information for the server
935
--- src/smtp.c
+++ src/smtp.c
@@ -769,10 +769,11 @@
769 if( !g.perm.Setup ){
770 login_needed(0);
771 return;
772 }
773 db_begin_transaction();
774 style_set_current_feature("smtp");
775 style_header("Email Server Setup");
776 if( db_table_exists("repository","emailroute") ){
777 style_submenu_element("emailblob table", "%R/emailblob");
778 style_submenu_element("emailoutq table", "%R/emailoutq");
779 db_prepare(&q, "SELECT eaddr, epolicy FROM emailroute ORDER BY 1");
@@ -805,11 +806,11 @@
806 @ <form method="POST" action="%R/setup_smtp_route">
807 @ <input type="submit" value="New">
808 @ &larr; Add a new email address
809 @ </form>
810 @ </table>
811 style_finish_page();
812 db_end_transaction(0);
813 }
814
815 /*
816 ** WEBPAGE: setup_smtp_route
@@ -833,10 +834,11 @@
834 login_check_credentials();
835 if( !g.perm.Setup ){
836 login_needed(0);
837 return;
838 }
839 style_set_current_feature("smtp");
840 style_header("Email Route Editor");
841
842 if( P("edit") && cgi_csrf_safe(1) && zEAddr!=0 && zEPolicy!=0 ){
843 smtp_server_schema(0);
844 if( (zOAddr==0 || fossil_strcmp(zEAddr,zOAddr)!=0) ){
@@ -924,11 +926,11 @@
926 @ with USER.LOGIN=<i>login-name</i>.
927 @ </ul>
928 @
929 @ <p>To delete a route &rarr; erase all text from the "Routing" field then
930 @ press the "Apply" button.
931 style_finish_page();
932 }
933
934 #if LOCAL_INTERFACE
935 /*
936 ** State information for the server
937
+12 -7
--- src/stat.c
+++ src/stat.c
@@ -288,11 +288,11 @@
288288
if( g.perm.Admin && alert_enabled() ){
289289
stats_for_email();
290290
}
291291
292292
@ </table>
293
- style_finish_page("stat");
293
+ style_finish_page();
294294
}
295295
296296
/*
297297
** COMMAND: dbstat
298298
**
@@ -459,10 +459,11 @@
459459
sqlite3_int64 iNow;
460460
char *zRemote;
461461
login_check_credentials();
462462
if( !g.perm.Admin ){ login_needed(0); return; }
463463
464
+ style_set_current_feature("stat");
464465
style_header("URLs and Checkouts");
465466
style_adunit_config(ADUNIT_RIGHT_OK);
466467
style_submenu_element("Stat", "stat");
467468
style_submenu_element("Schema", "repo_schema");
468469
iNow = db_int64(0, "SELECT strftime('%%s','now')");
@@ -516,11 +517,11 @@
516517
}else{
517518
@ <p>%h(zRemote)</p>
518519
}
519520
@ </div>
520521
}
521
- style_finish_page("stat");
522
+ style_finish_page();
522523
}
523524
524525
/*
525526
** WEBPAGE: repo_schema
526527
**
@@ -531,10 +532,11 @@
531532
Blob sql;
532533
const char *zArg = P("n");
533534
login_check_credentials();
534535
if( !g.perm.Admin ){ login_needed(0); return; }
535536
537
+ style_set_current_feature("stat");
536538
style_header("Repository Schema");
537539
style_adunit_config(ADUNIT_RIGHT_OK);
538540
style_submenu_element("Stat", "stat");
539541
style_submenu_element("URLs", "urllist");
540542
if( sqlite3_compileoption_used("ENABLE_DBSTAT_VTAB") ){
@@ -574,11 +576,11 @@
574576
db_finalize(&q);
575577
}else{
576578
style_submenu_element("Stat1","repo_stat1");
577579
}
578580
}
579
- style_finish_page("stat");
581
+ style_finish_page();
580582
}
581583
582584
/*
583585
** WEBPAGE: repo_stat1
584586
**
@@ -586,10 +588,11 @@
586588
*/
587589
void repo_stat1_page(void){
588590
login_check_credentials();
589591
if( !g.perm.Admin ){ login_needed(0); return; }
590592
593
+ style_set_current_feature("stat");
591594
style_header("Repository STAT1 Table");
592595
style_adunit_config(ADUNIT_RIGHT_OK);
593596
style_submenu_element("Stat", "stat");
594597
style_submenu_element("Schema", "repo_schema");
595598
if( db_table_exists("repository","sqlite_stat1") ){
@@ -606,11 +609,11 @@
606609
@ INSERT INTO sqlite_stat1 VALUES('%z(zUrl)%h(zTab)</a>','%h(zIdx)','%h(zStat)');
607610
}
608611
@ </pre>
609612
db_finalize(&q);
610613
}
611
- style_finish_page("stat");
614
+ style_finish_page();
612615
}
613616
614617
/*
615618
** WEBPAGE: repo-tabsize
616619
**
@@ -621,10 +624,11 @@
621624
sqlite3_int64 fsize;
622625
char zBuf[100];
623626
624627
login_check_credentials();
625628
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
629
+ style_set_current_feature("stat");
626630
style_header("Repository Table Sizes");
627631
style_adunit_config(ADUNIT_RIGHT_OK);
628632
style_submenu_element("Stat", "stat");
629633
if( g.perm.Admin ){
630634
style_submenu_element("Schema", "repo_schema");
@@ -678,11 +682,11 @@
678682
@ <h2>%h(file_tail(g.zLocalDbName)) Size: %s(zBuf)</h2>
679683
@ <center><svg width='800' height='500'>
680684
piechart_render(800,500,PIE_OTHER|PIE_PERCENT);
681685
@ </svg></center>
682686
}
683
- style_finish_page("stat");
687
+ style_finish_page();
684688
}
685689
686690
/*
687691
** Gather statistics on artifact types, counts, and sizes.
688692
**
@@ -798,10 +802,11 @@
798802
login_needed(g.anon.Write);
799803
return;
800804
}
801805
load_control();
802806
807
+ style_set_current_feature("stat");
803808
style_header("Artifact Statistics");
804809
style_submenu_element("Repository Stats", "stat");
805810
style_submenu_element("Artifact List", "bloblist");
806811
gather_artifact_stats(1);
807812
@@ -819,11 +824,11 @@
819824
sumCmpr = db_column_int64(&q, 4);
820825
sumExp = db_column_int64(&q, 5);
821826
db_finalize(&q);
822827
if( nTotal==0 ){
823828
@ No artifacts in this repository!
824
- style_finish_page("stat");
829
+ style_finish_page();
825830
return;
826831
}
827832
avgCmpr = (double)sumCmpr/nTotal;
828833
avgExp = (double)sumExp/nTotal;
829834
@@ -964,7 +969,7 @@
964969
}
965970
@ </tbody></table></div>
966971
db_finalize(&q);
967972
}
968973
style_table_sorter();
969
- style_finish_page("stat");
974
+ style_finish_page();
970975
}
971976
--- src/stat.c
+++ src/stat.c
@@ -288,11 +288,11 @@
288 if( g.perm.Admin && alert_enabled() ){
289 stats_for_email();
290 }
291
292 @ </table>
293 style_finish_page("stat");
294 }
295
296 /*
297 ** COMMAND: dbstat
298 **
@@ -459,10 +459,11 @@
459 sqlite3_int64 iNow;
460 char *zRemote;
461 login_check_credentials();
462 if( !g.perm.Admin ){ login_needed(0); return; }
463
 
464 style_header("URLs and Checkouts");
465 style_adunit_config(ADUNIT_RIGHT_OK);
466 style_submenu_element("Stat", "stat");
467 style_submenu_element("Schema", "repo_schema");
468 iNow = db_int64(0, "SELECT strftime('%%s','now')");
@@ -516,11 +517,11 @@
516 }else{
517 @ <p>%h(zRemote)</p>
518 }
519 @ </div>
520 }
521 style_finish_page("stat");
522 }
523
524 /*
525 ** WEBPAGE: repo_schema
526 **
@@ -531,10 +532,11 @@
531 Blob sql;
532 const char *zArg = P("n");
533 login_check_credentials();
534 if( !g.perm.Admin ){ login_needed(0); return; }
535
 
536 style_header("Repository Schema");
537 style_adunit_config(ADUNIT_RIGHT_OK);
538 style_submenu_element("Stat", "stat");
539 style_submenu_element("URLs", "urllist");
540 if( sqlite3_compileoption_used("ENABLE_DBSTAT_VTAB") ){
@@ -574,11 +576,11 @@
574 db_finalize(&q);
575 }else{
576 style_submenu_element("Stat1","repo_stat1");
577 }
578 }
579 style_finish_page("stat");
580 }
581
582 /*
583 ** WEBPAGE: repo_stat1
584 **
@@ -586,10 +588,11 @@
586 */
587 void repo_stat1_page(void){
588 login_check_credentials();
589 if( !g.perm.Admin ){ login_needed(0); return; }
590
 
591 style_header("Repository STAT1 Table");
592 style_adunit_config(ADUNIT_RIGHT_OK);
593 style_submenu_element("Stat", "stat");
594 style_submenu_element("Schema", "repo_schema");
595 if( db_table_exists("repository","sqlite_stat1") ){
@@ -606,11 +609,11 @@
606 @ INSERT INTO sqlite_stat1 VALUES('%z(zUrl)%h(zTab)</a>','%h(zIdx)','%h(zStat)');
607 }
608 @ </pre>
609 db_finalize(&q);
610 }
611 style_finish_page("stat");
612 }
613
614 /*
615 ** WEBPAGE: repo-tabsize
616 **
@@ -621,10 +624,11 @@
621 sqlite3_int64 fsize;
622 char zBuf[100];
623
624 login_check_credentials();
625 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
 
626 style_header("Repository Table Sizes");
627 style_adunit_config(ADUNIT_RIGHT_OK);
628 style_submenu_element("Stat", "stat");
629 if( g.perm.Admin ){
630 style_submenu_element("Schema", "repo_schema");
@@ -678,11 +682,11 @@
678 @ <h2>%h(file_tail(g.zLocalDbName)) Size: %s(zBuf)</h2>
679 @ <center><svg width='800' height='500'>
680 piechart_render(800,500,PIE_OTHER|PIE_PERCENT);
681 @ </svg></center>
682 }
683 style_finish_page("stat");
684 }
685
686 /*
687 ** Gather statistics on artifact types, counts, and sizes.
688 **
@@ -798,10 +802,11 @@
798 login_needed(g.anon.Write);
799 return;
800 }
801 load_control();
802
 
803 style_header("Artifact Statistics");
804 style_submenu_element("Repository Stats", "stat");
805 style_submenu_element("Artifact List", "bloblist");
806 gather_artifact_stats(1);
807
@@ -819,11 +824,11 @@
819 sumCmpr = db_column_int64(&q, 4);
820 sumExp = db_column_int64(&q, 5);
821 db_finalize(&q);
822 if( nTotal==0 ){
823 @ No artifacts in this repository!
824 style_finish_page("stat");
825 return;
826 }
827 avgCmpr = (double)sumCmpr/nTotal;
828 avgExp = (double)sumExp/nTotal;
829
@@ -964,7 +969,7 @@
964 }
965 @ </tbody></table></div>
966 db_finalize(&q);
967 }
968 style_table_sorter();
969 style_finish_page("stat");
970 }
971
--- src/stat.c
+++ src/stat.c
@@ -288,11 +288,11 @@
288 if( g.perm.Admin && alert_enabled() ){
289 stats_for_email();
290 }
291
292 @ </table>
293 style_finish_page();
294 }
295
296 /*
297 ** COMMAND: dbstat
298 **
@@ -459,10 +459,11 @@
459 sqlite3_int64 iNow;
460 char *zRemote;
461 login_check_credentials();
462 if( !g.perm.Admin ){ login_needed(0); return; }
463
464 style_set_current_feature("stat");
465 style_header("URLs and Checkouts");
466 style_adunit_config(ADUNIT_RIGHT_OK);
467 style_submenu_element("Stat", "stat");
468 style_submenu_element("Schema", "repo_schema");
469 iNow = db_int64(0, "SELECT strftime('%%s','now')");
@@ -516,11 +517,11 @@
517 }else{
518 @ <p>%h(zRemote)</p>
519 }
520 @ </div>
521 }
522 style_finish_page();
523 }
524
525 /*
526 ** WEBPAGE: repo_schema
527 **
@@ -531,10 +532,11 @@
532 Blob sql;
533 const char *zArg = P("n");
534 login_check_credentials();
535 if( !g.perm.Admin ){ login_needed(0); return; }
536
537 style_set_current_feature("stat");
538 style_header("Repository Schema");
539 style_adunit_config(ADUNIT_RIGHT_OK);
540 style_submenu_element("Stat", "stat");
541 style_submenu_element("URLs", "urllist");
542 if( sqlite3_compileoption_used("ENABLE_DBSTAT_VTAB") ){
@@ -574,11 +576,11 @@
576 db_finalize(&q);
577 }else{
578 style_submenu_element("Stat1","repo_stat1");
579 }
580 }
581 style_finish_page();
582 }
583
584 /*
585 ** WEBPAGE: repo_stat1
586 **
@@ -586,10 +588,11 @@
588 */
589 void repo_stat1_page(void){
590 login_check_credentials();
591 if( !g.perm.Admin ){ login_needed(0); return; }
592
593 style_set_current_feature("stat");
594 style_header("Repository STAT1 Table");
595 style_adunit_config(ADUNIT_RIGHT_OK);
596 style_submenu_element("Stat", "stat");
597 style_submenu_element("Schema", "repo_schema");
598 if( db_table_exists("repository","sqlite_stat1") ){
@@ -606,11 +609,11 @@
609 @ INSERT INTO sqlite_stat1 VALUES('%z(zUrl)%h(zTab)</a>','%h(zIdx)','%h(zStat)');
610 }
611 @ </pre>
612 db_finalize(&q);
613 }
614 style_finish_page();
615 }
616
617 /*
618 ** WEBPAGE: repo-tabsize
619 **
@@ -621,10 +624,11 @@
624 sqlite3_int64 fsize;
625 char zBuf[100];
626
627 login_check_credentials();
628 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
629 style_set_current_feature("stat");
630 style_header("Repository Table Sizes");
631 style_adunit_config(ADUNIT_RIGHT_OK);
632 style_submenu_element("Stat", "stat");
633 if( g.perm.Admin ){
634 style_submenu_element("Schema", "repo_schema");
@@ -678,11 +682,11 @@
682 @ <h2>%h(file_tail(g.zLocalDbName)) Size: %s(zBuf)</h2>
683 @ <center><svg width='800' height='500'>
684 piechart_render(800,500,PIE_OTHER|PIE_PERCENT);
685 @ </svg></center>
686 }
687 style_finish_page();
688 }
689
690 /*
691 ** Gather statistics on artifact types, counts, and sizes.
692 **
@@ -798,10 +802,11 @@
802 login_needed(g.anon.Write);
803 return;
804 }
805 load_control();
806
807 style_set_current_feature("stat");
808 style_header("Artifact Statistics");
809 style_submenu_element("Repository Stats", "stat");
810 style_submenu_element("Artifact List", "bloblist");
811 gather_artifact_stats(1);
812
@@ -819,11 +824,11 @@
824 sumCmpr = db_column_int64(&q, 4);
825 sumExp = db_column_int64(&q, 5);
826 db_finalize(&q);
827 if( nTotal==0 ){
828 @ No artifacts in this repository!
829 style_finish_page();
830 return;
831 }
832 avgCmpr = (double)sumCmpr/nTotal;
833 avgExp = (double)sumExp/nTotal;
834
@@ -964,7 +969,7 @@
969 }
970 @ </tbody></table></div>
971 db_finalize(&q);
972 }
973 style_table_sorter();
974 style_finish_page();
975 }
976
+1 -1
--- src/statrep.c
+++ src/statrep.c
@@ -825,7 +825,7 @@
825825
break;
826826
case RPT_LASTCHNG:
827827
stats_report_last_change();
828828
break;
829829
}
830
- style_finish_page("reports");
830
+ style_finish_page();
831831
}
832832
--- src/statrep.c
+++ src/statrep.c
@@ -825,7 +825,7 @@
825 break;
826 case RPT_LASTCHNG:
827 stats_report_last_change();
828 break;
829 }
830 style_finish_page("reports");
831 }
832
--- src/statrep.c
+++ src/statrep.c
@@ -825,7 +825,7 @@
825 break;
826 case RPT_LASTCHNG:
827 stats_report_last_change();
828 break;
829 }
830 style_finish_page();
831 }
832
+43 -11
--- src/style.c
+++ src/style.c
@@ -33,11 +33,11 @@
3333
** style_submenu_checkbox()
3434
** style_submenu_binary()
3535
** style_submenu_multichoice()
3636
** style_submenu_sql()
3737
**
38
-** prior to calling style_footer(). The style_footer() routine
38
+** prior to calling style_finish_page(). The style_finish_page() routine
3939
** will generate the appropriate HTML text just below the main
4040
** menu.
4141
*/
4242
static struct Submenu {
4343
const char *zLabel; /* Button label */
@@ -567,19 +567,52 @@
567567
@ <title>$<project_name>: $<title></title>
568568
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \
569569
@ href="$home/timeline.rss" />
570570
@ <link rel="stylesheet" href="$stylesheet_url" type="text/css" />
571571
@ </head>
572
-@ <body>
572
+@ <body class="$current_feature">
573573
;
574574
575575
/*
576576
** Returns the default page header.
577577
*/
578578
const char *get_default_header(){
579579
return zDfltHeader;
580580
}
581
+
582
+/*
583
+** Given a URL path, extract the first element as a "feature" name,
584
+** used as the <body class="FEATURE"> value by default, though
585
+** later-running code may override this, typically to group multiple
586
+** Fossil UI URLs into a single "feature" so you can have per-feature
587
+** CSS rules.
588
+**
589
+** For example, "body.forum div.markdown blockquote" targets only
590
+** block quotes made in forum posts, leaving other Markdown quotes
591
+** alone. Because feature class "forum" groups /forummain, /forumpost,
592
+** and /forume2, it works across all renderings of Markdown to HTML
593
+** within the Fossil forum feature.
594
+*/
595
+static const char* feature_from_page_path(const char *zPath){
596
+ const char* zSlash = strchr(zPath, '/');
597
+ if (zSlash) {
598
+ return fossil_strndup(zPath, zSlash - zPath);
599
+ } else {
600
+ return zPath;
601
+ }
602
+}
603
+
604
+/*
605
+** Override the value of the TH1 variable current_feature, its default
606
+** set by feature_from_page_path(). We do not call this from
607
+** style_init_th1_vars() because that uses Th_MaybeStore() instead to
608
+** allow webpage implementations to call this before style_header()
609
+** to override that "maybe" default with something better.
610
+*/
611
+void style_set_current_feature(const char* zFeature){
612
+ Th_Store("current_feature", zFeature);
613
+}
581614
582615
/*
583616
** Initialize all the default TH1 variables
584617
*/
585618
static void style_init_th1_vars(const char *zTitle){
@@ -613,10 +646,11 @@
613646
image_url_var("logo");
614647
image_url_var("background");
615648
if( !login_is_nobody() ){
616649
Th_Store("login", g.zLogin);
617650
}
651
+ Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) );
618652
}
619653
620654
/*
621655
** Draw the header.
622656
*/
@@ -749,16 +783,12 @@
749783
** been received.
750784
**
751785
** * Finalizes the page content.
752786
**
753787
** * Appends the footer.
754
-**
755
-** The zPageType argument is a class name inserted in the <div> that
756
-** surrounds the page content. CSS can use this to have different styles
757
-** according to the page type.
758788
*/
759
-void style_finish_page(const char* zPageType){
789
+void style_finish_page(){
760790
const char *zFooter;
761791
const char *zAd = 0;
762792
unsigned int mAdFlags = 0;
763793
764794
if( !headerHasBeenGenerated ) return;
@@ -886,11 +916,11 @@
886916
@ <div class="adunit_banner">
887917
cgi_append_content(zAd, -1);
888918
@ </div>
889919
}
890920
891
- @ <div class="content %s(zPageType)"><span id="debugMsg"></span>
921
+ @ <div class="content"><span id="debugMsg"></span>
892922
cgi_destination(CGI_BODY);
893923
894924
if( sideboxUsed ){
895925
@ <div class="endContent"></div>
896926
}
@@ -1151,10 +1181,11 @@
11511181
login_check_credentials();
11521182
if( g.perm.Admin || g.perm.Setup || db_get_boolean("test_env_enable",0) ){
11531183
isAuth = 1;
11541184
}
11551185
cgi_load_environment();
1186
+ style_set_current_feature("error");
11561187
if( zFormat[0] ){
11571188
va_list ap;
11581189
va_start(ap, zFormat);
11591190
zErr = vmprintf(zFormat, ap);
11601191
va_end(ap);
@@ -1206,15 +1237,15 @@
12061237
@ %h(blob_str(&g.httpHeader))
12071238
@ </pre>
12081239
}
12091240
}
12101241
if( zErr && zErr[0] ){
1211
- style_finish_page("error");
1242
+ style_finish_page();
12121243
cgi_reply();
12131244
fossil_exit(1);
12141245
}else{
1215
- style_finish_page("test");
1246
+ style_finish_page();
12161247
}
12171248
}
12181249
12191250
/*
12201251
** Generate a Not Yet Implemented error page.
@@ -1243,14 +1274,15 @@
12431274
zMsg = vmprintf(zFormat, ap);
12441275
va_end(ap);
12451276
}else{
12461277
zMsg = "Not Found";
12471278
}
1279
+ style_set_current_feature("enotfound");
12481280
style_header("Not Found");
12491281
@ <p>%h(zMsg)</p>
12501282
cgi_set_status(404, "Not Found");
1251
- style_finish_page("enotfound");
1283
+ style_finish_page();
12521284
}
12531285
12541286
#if INTERFACE
12551287
# define webpage_assert(T) if(!(T)){webpage_assert_page(__FILE__,__LINE__,#T);}
12561288
#endif
12571289
--- src/style.c
+++ src/style.c
@@ -33,11 +33,11 @@
33 ** style_submenu_checkbox()
34 ** style_submenu_binary()
35 ** style_submenu_multichoice()
36 ** style_submenu_sql()
37 **
38 ** prior to calling style_footer(). The style_footer() routine
39 ** will generate the appropriate HTML text just below the main
40 ** menu.
41 */
42 static struct Submenu {
43 const char *zLabel; /* Button label */
@@ -567,19 +567,52 @@
567 @ <title>$<project_name>: $<title></title>
568 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \
569 @ href="$home/timeline.rss" />
570 @ <link rel="stylesheet" href="$stylesheet_url" type="text/css" />
571 @ </head>
572 @ <body>
573 ;
574
575 /*
576 ** Returns the default page header.
577 */
578 const char *get_default_header(){
579 return zDfltHeader;
580 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
581
582 /*
583 ** Initialize all the default TH1 variables
584 */
585 static void style_init_th1_vars(const char *zTitle){
@@ -613,10 +646,11 @@
613 image_url_var("logo");
614 image_url_var("background");
615 if( !login_is_nobody() ){
616 Th_Store("login", g.zLogin);
617 }
 
618 }
619
620 /*
621 ** Draw the header.
622 */
@@ -749,16 +783,12 @@
749 ** been received.
750 **
751 ** * Finalizes the page content.
752 **
753 ** * Appends the footer.
754 **
755 ** The zPageType argument is a class name inserted in the <div> that
756 ** surrounds the page content. CSS can use this to have different styles
757 ** according to the page type.
758 */
759 void style_finish_page(const char* zPageType){
760 const char *zFooter;
761 const char *zAd = 0;
762 unsigned int mAdFlags = 0;
763
764 if( !headerHasBeenGenerated ) return;
@@ -886,11 +916,11 @@
886 @ <div class="adunit_banner">
887 cgi_append_content(zAd, -1);
888 @ </div>
889 }
890
891 @ <div class="content %s(zPageType)"><span id="debugMsg"></span>
892 cgi_destination(CGI_BODY);
893
894 if( sideboxUsed ){
895 @ <div class="endContent"></div>
896 }
@@ -1151,10 +1181,11 @@
1151 login_check_credentials();
1152 if( g.perm.Admin || g.perm.Setup || db_get_boolean("test_env_enable",0) ){
1153 isAuth = 1;
1154 }
1155 cgi_load_environment();
 
1156 if( zFormat[0] ){
1157 va_list ap;
1158 va_start(ap, zFormat);
1159 zErr = vmprintf(zFormat, ap);
1160 va_end(ap);
@@ -1206,15 +1237,15 @@
1206 @ %h(blob_str(&g.httpHeader))
1207 @ </pre>
1208 }
1209 }
1210 if( zErr && zErr[0] ){
1211 style_finish_page("error");
1212 cgi_reply();
1213 fossil_exit(1);
1214 }else{
1215 style_finish_page("test");
1216 }
1217 }
1218
1219 /*
1220 ** Generate a Not Yet Implemented error page.
@@ -1243,14 +1274,15 @@
1243 zMsg = vmprintf(zFormat, ap);
1244 va_end(ap);
1245 }else{
1246 zMsg = "Not Found";
1247 }
 
1248 style_header("Not Found");
1249 @ <p>%h(zMsg)</p>
1250 cgi_set_status(404, "Not Found");
1251 style_finish_page("enotfound");
1252 }
1253
1254 #if INTERFACE
1255 # define webpage_assert(T) if(!(T)){webpage_assert_page(__FILE__,__LINE__,#T);}
1256 #endif
1257
--- src/style.c
+++ src/style.c
@@ -33,11 +33,11 @@
33 ** style_submenu_checkbox()
34 ** style_submenu_binary()
35 ** style_submenu_multichoice()
36 ** style_submenu_sql()
37 **
38 ** prior to calling style_finish_page(). The style_finish_page() routine
39 ** will generate the appropriate HTML text just below the main
40 ** menu.
41 */
42 static struct Submenu {
43 const char *zLabel; /* Button label */
@@ -567,19 +567,52 @@
567 @ <title>$<project_name>: $<title></title>
568 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \
569 @ href="$home/timeline.rss" />
570 @ <link rel="stylesheet" href="$stylesheet_url" type="text/css" />
571 @ </head>
572 @ <body class="$current_feature">
573 ;
574
575 /*
576 ** Returns the default page header.
577 */
578 const char *get_default_header(){
579 return zDfltHeader;
580 }
581
582 /*
583 ** Given a URL path, extract the first element as a "feature" name,
584 ** used as the <body class="FEATURE"> value by default, though
585 ** later-running code may override this, typically to group multiple
586 ** Fossil UI URLs into a single "feature" so you can have per-feature
587 ** CSS rules.
588 **
589 ** For example, "body.forum div.markdown blockquote" targets only
590 ** block quotes made in forum posts, leaving other Markdown quotes
591 ** alone. Because feature class "forum" groups /forummain, /forumpost,
592 ** and /forume2, it works across all renderings of Markdown to HTML
593 ** within the Fossil forum feature.
594 */
595 static const char* feature_from_page_path(const char *zPath){
596 const char* zSlash = strchr(zPath, '/');
597 if (zSlash) {
598 return fossil_strndup(zPath, zSlash - zPath);
599 } else {
600 return zPath;
601 }
602 }
603
604 /*
605 ** Override the value of the TH1 variable current_feature, its default
606 ** set by feature_from_page_path(). We do not call this from
607 ** style_init_th1_vars() because that uses Th_MaybeStore() instead to
608 ** allow webpage implementations to call this before style_header()
609 ** to override that "maybe" default with something better.
610 */
611 void style_set_current_feature(const char* zFeature){
612 Th_Store("current_feature", zFeature);
613 }
614
615 /*
616 ** Initialize all the default TH1 variables
617 */
618 static void style_init_th1_vars(const char *zTitle){
@@ -613,10 +646,11 @@
646 image_url_var("logo");
647 image_url_var("background");
648 if( !login_is_nobody() ){
649 Th_Store("login", g.zLogin);
650 }
651 Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) );
652 }
653
654 /*
655 ** Draw the header.
656 */
@@ -749,16 +783,12 @@
783 ** been received.
784 **
785 ** * Finalizes the page content.
786 **
787 ** * Appends the footer.
 
 
 
 
788 */
789 void style_finish_page(){
790 const char *zFooter;
791 const char *zAd = 0;
792 unsigned int mAdFlags = 0;
793
794 if( !headerHasBeenGenerated ) return;
@@ -886,11 +916,11 @@
916 @ <div class="adunit_banner">
917 cgi_append_content(zAd, -1);
918 @ </div>
919 }
920
921 @ <div class="content"><span id="debugMsg"></span>
922 cgi_destination(CGI_BODY);
923
924 if( sideboxUsed ){
925 @ <div class="endContent"></div>
926 }
@@ -1151,10 +1181,11 @@
1181 login_check_credentials();
1182 if( g.perm.Admin || g.perm.Setup || db_get_boolean("test_env_enable",0) ){
1183 isAuth = 1;
1184 }
1185 cgi_load_environment();
1186 style_set_current_feature("error");
1187 if( zFormat[0] ){
1188 va_list ap;
1189 va_start(ap, zFormat);
1190 zErr = vmprintf(zFormat, ap);
1191 va_end(ap);
@@ -1206,15 +1237,15 @@
1237 @ %h(blob_str(&g.httpHeader))
1238 @ </pre>
1239 }
1240 }
1241 if( zErr && zErr[0] ){
1242 style_finish_page();
1243 cgi_reply();
1244 fossil_exit(1);
1245 }else{
1246 style_finish_page();
1247 }
1248 }
1249
1250 /*
1251 ** Generate a Not Yet Implemented error page.
@@ -1243,14 +1274,15 @@
1274 zMsg = vmprintf(zFormat, ap);
1275 va_end(ap);
1276 }else{
1277 zMsg = "Not Found";
1278 }
1279 style_set_current_feature("enotfound");
1280 style_header("Not Found");
1281 @ <p>%h(zMsg)</p>
1282 cgi_set_status(404, "Not Found");
1283 style_finish_page();
1284 }
1285
1286 #if INTERFACE
1287 # define webpage_assert(T) if(!(T)){webpage_assert_page(__FILE__,__LINE__,#T);}
1288 #endif
1289
+2 -2
--- src/tag.c
+++ src/tag.c
@@ -724,11 +724,11 @@
724724
@ <li><span class="tagDsp">%h(zName)</span></li>
725725
}
726726
}
727727
@ </ul>
728728
db_finalize(&q);
729
- style_finish_page("taglist");
729
+ style_finish_page();
730730
}
731731
732732
/*
733733
** WEBPAGE: /tagtimeline
734734
**
@@ -781,7 +781,7 @@
781781
if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
782782
if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
783783
www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
784784
db_finalize(&q);
785785
@ <br />
786
- style_finish_page("tagtimeline");
786
+ style_finish_page();
787787
}
788788
--- src/tag.c
+++ src/tag.c
@@ -724,11 +724,11 @@
724 @ <li><span class="tagDsp">%h(zName)</span></li>
725 }
726 }
727 @ </ul>
728 db_finalize(&q);
729 style_finish_page("taglist");
730 }
731
732 /*
733 ** WEBPAGE: /tagtimeline
734 **
@@ -781,7 +781,7 @@
781 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
782 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
783 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
784 db_finalize(&q);
785 @ <br />
786 style_finish_page("tagtimeline");
787 }
788
--- src/tag.c
+++ src/tag.c
@@ -724,11 +724,11 @@
724 @ <li><span class="tagDsp">%h(zName)</span></li>
725 }
726 }
727 @ </ul>
728 db_finalize(&q);
729 style_finish_page();
730 }
731
732 /*
733 ** WEBPAGE: /tagtimeline
734 **
@@ -781,7 +781,7 @@
781 if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
782 if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
783 www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0);
784 db_finalize(&q);
785 @ <br />
786 style_finish_page();
787 }
788
+2 -2
--- src/tar.c
+++ src/tar.c
@@ -785,11 +785,11 @@
785785
}
786786
if( zExclude ){
787787
@ zExclude = "%h(zExclude)"<br />
788788
}
789789
@ zKey = "%h(zKey)"
790
- style_finish_page("tarball");
790
+ style_finish_page();
791791
return;
792792
}
793793
if( referred_from_login() ){
794794
style_header("Tarball Download");
795795
@ <form action='%R/tarball/%h(zName).tar.gz'>
@@ -796,11 +796,11 @@
796796
cgi_query_parameters_to_hidden();
797797
@ <p>Tarball named <b>%h(zName).tar.gz</b> holding the content
798798
@ of check-in <b>%h(zRid)</b>:
799799
@ <input type="submit" value="Download" />
800800
@ </form>
801
- style_finish_page("tarball");
801
+ style_finish_page();
802802
return;
803803
}
804804
blob_zero(&tarball);
805805
if( cache_read(&tarball, zKey)==0 ){
806806
tarball_of_checkin(rid, &tarball, zName, pInclude, pExclude);
807807
--- src/tar.c
+++ src/tar.c
@@ -785,11 +785,11 @@
785 }
786 if( zExclude ){
787 @ zExclude = "%h(zExclude)"<br />
788 }
789 @ zKey = "%h(zKey)"
790 style_finish_page("tarball");
791 return;
792 }
793 if( referred_from_login() ){
794 style_header("Tarball Download");
795 @ <form action='%R/tarball/%h(zName).tar.gz'>
@@ -796,11 +796,11 @@
796 cgi_query_parameters_to_hidden();
797 @ <p>Tarball named <b>%h(zName).tar.gz</b> holding the content
798 @ of check-in <b>%h(zRid)</b>:
799 @ <input type="submit" value="Download" />
800 @ </form>
801 style_finish_page("tarball");
802 return;
803 }
804 blob_zero(&tarball);
805 if( cache_read(&tarball, zKey)==0 ){
806 tarball_of_checkin(rid, &tarball, zName, pInclude, pExclude);
807
--- src/tar.c
+++ src/tar.c
@@ -785,11 +785,11 @@
785 }
786 if( zExclude ){
787 @ zExclude = "%h(zExclude)"<br />
788 }
789 @ zKey = "%h(zKey)"
790 style_finish_page();
791 return;
792 }
793 if( referred_from_login() ){
794 style_header("Tarball Download");
795 @ <form action='%R/tarball/%h(zName).tar.gz'>
@@ -796,11 +796,11 @@
796 cgi_query_parameters_to_hidden();
797 @ <p>Tarball named <b>%h(zName).tar.gz</b> holding the content
798 @ of check-in <b>%h(zRid)</b>:
799 @ <input type="submit" value="Download" />
800 @ </form>
801 style_finish_page();
802 return;
803 }
804 blob_zero(&tarball);
805 if( cache_read(&tarball, zKey)==0 ){
806 tarball_of_checkin(rid, &tarball, zName, pInclude, pExclude);
807
+1 -1
--- src/th_main.c
+++ src/th_main.c
@@ -1478,11 +1478,11 @@
14781478
){
14791479
if( argc!=1 ){
14801480
return Th_WrongNumArgs(interp, "styleFooter");
14811481
}
14821482
if( Th_IsRepositoryOpen() ){
1483
- style_finish_page("th1"); /* TODO: add optional parameter to pass along? */
1483
+ style_finish_page();
14841484
Th_SetResult(interp, 0, 0);
14851485
return TH_OK;
14861486
}else{
14871487
Th_SetResult(interp, "repository unavailable", -1);
14881488
return TH_ERROR;
14891489
--- src/th_main.c
+++ src/th_main.c
@@ -1478,11 +1478,11 @@
1478 ){
1479 if( argc!=1 ){
1480 return Th_WrongNumArgs(interp, "styleFooter");
1481 }
1482 if( Th_IsRepositoryOpen() ){
1483 style_finish_page("th1"); /* TODO: add optional parameter to pass along? */
1484 Th_SetResult(interp, 0, 0);
1485 return TH_OK;
1486 }else{
1487 Th_SetResult(interp, "repository unavailable", -1);
1488 return TH_ERROR;
1489
--- src/th_main.c
+++ src/th_main.c
@@ -1478,11 +1478,11 @@
1478 ){
1479 if( argc!=1 ){
1480 return Th_WrongNumArgs(interp, "styleFooter");
1481 }
1482 if( Th_IsRepositoryOpen() ){
1483 style_finish_page();
1484 Th_SetResult(interp, 0, 0);
1485 return TH_OK;
1486 }else{
1487 Th_SetResult(interp, "repository unavailable", -1);
1488 return TH_ERROR;
1489
+6 -4
--- src/timeline.c
+++ src/timeline.c
@@ -189,10 +189,11 @@
189189
const char *zBr;
190190
char zNm[10];
191191
int i, cnt;
192192
login_check_credentials();
193193
194
+ style_set_current_feature("test");
194195
style_header("Hash Color Test");
195196
for(i=cnt=0; i<10; i++){
196197
sqlite3_snprintf(sizeof(zNm),zNm,"b%d",i);
197198
zBr = P(zNm);
198199
if( zBr && zBr[0] ){
@@ -214,11 +215,11 @@
214215
zBr = P(zNm);
215216
@ <input type="text" size="30" name='%s(zNm)' value='%h(PD(zNm,""))'><br />
216217
}
217218
@ <input type="submit">
218219
@ </form>
219
- style_finish_page("test");
220
+ style_finish_page();
220221
}
221222
222223
/*
223224
** Return a new timelineTable id.
224225
*/
@@ -2729,11 +2730,11 @@
27292730
if( zOlderButton ){
27302731
@ %z(chref("button","%s",zOlderButton))%h(zOlderButtonLabel)\
27312732
@ &nbsp;&darr;</a>
27322733
}
27332734
document_emit_js(/*handles pikchrs rendered above*/);
2734
- style_finish_page("timeline");
2735
+ style_finish_page();
27352736
}
27362737
27372738
/*
27382739
** The input query q selects various records. Print a human-readable
27392740
** summary of those records.
@@ -3188,10 +3189,11 @@
31883189
login_check_credentials();
31893190
if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki && !g.perm.RdForum) ){
31903191
login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
31913192
return;
31923193
}
3194
+ style_set_current_feature("timeline");
31933195
style_header("Today In History");
31943196
zToday = (char*)P("today");
31953197
if( zToday ){
31963198
zToday = timeline_expand_datetime(zToday);
31973199
if( !fossil_isdate(zToday) ) zToday = 0;
@@ -3235,11 +3237,11 @@
32353237
@ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
32363238
@ </small></h2>
32373239
www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0, 0);
32383240
}
32393241
db_finalize(&q);
3240
- style_finish_page("timeline");
3242
+ style_finish_page();
32413243
}
32423244
32433245
32443246
/*
32453247
** COMMAND: test-timewarp-list
@@ -3341,7 +3343,7 @@
33413343
if( cnt==0 ){
33423344
@ <p>No timewarps in this repository</p>
33433345
}else{
33443346
@ </tbody></table></div>
33453347
}
3346
- style_finish_page("timewarps");
3348
+ style_finish_page();
33473349
}
33483350
--- src/timeline.c
+++ src/timeline.c
@@ -189,10 +189,11 @@
189 const char *zBr;
190 char zNm[10];
191 int i, cnt;
192 login_check_credentials();
193
 
194 style_header("Hash Color Test");
195 for(i=cnt=0; i<10; i++){
196 sqlite3_snprintf(sizeof(zNm),zNm,"b%d",i);
197 zBr = P(zNm);
198 if( zBr && zBr[0] ){
@@ -214,11 +215,11 @@
214 zBr = P(zNm);
215 @ <input type="text" size="30" name='%s(zNm)' value='%h(PD(zNm,""))'><br />
216 }
217 @ <input type="submit">
218 @ </form>
219 style_finish_page("test");
220 }
221
222 /*
223 ** Return a new timelineTable id.
224 */
@@ -2729,11 +2730,11 @@
2729 if( zOlderButton ){
2730 @ %z(chref("button","%s",zOlderButton))%h(zOlderButtonLabel)\
2731 @ &nbsp;&darr;</a>
2732 }
2733 document_emit_js(/*handles pikchrs rendered above*/);
2734 style_finish_page("timeline");
2735 }
2736
2737 /*
2738 ** The input query q selects various records. Print a human-readable
2739 ** summary of those records.
@@ -3188,10 +3189,11 @@
3188 login_check_credentials();
3189 if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki && !g.perm.RdForum) ){
3190 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
3191 return;
3192 }
 
3193 style_header("Today In History");
3194 zToday = (char*)P("today");
3195 if( zToday ){
3196 zToday = timeline_expand_datetime(zToday);
3197 if( !fossil_isdate(zToday) ) zToday = 0;
@@ -3235,11 +3237,11 @@
3235 @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
3236 @ </small></h2>
3237 www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0, 0);
3238 }
3239 db_finalize(&q);
3240 style_finish_page("timeline");
3241 }
3242
3243
3244 /*
3245 ** COMMAND: test-timewarp-list
@@ -3341,7 +3343,7 @@
3341 if( cnt==0 ){
3342 @ <p>No timewarps in this repository</p>
3343 }else{
3344 @ </tbody></table></div>
3345 }
3346 style_finish_page("timewarps");
3347 }
3348
--- src/timeline.c
+++ src/timeline.c
@@ -189,10 +189,11 @@
189 const char *zBr;
190 char zNm[10];
191 int i, cnt;
192 login_check_credentials();
193
194 style_set_current_feature("test");
195 style_header("Hash Color Test");
196 for(i=cnt=0; i<10; i++){
197 sqlite3_snprintf(sizeof(zNm),zNm,"b%d",i);
198 zBr = P(zNm);
199 if( zBr && zBr[0] ){
@@ -214,11 +215,11 @@
215 zBr = P(zNm);
216 @ <input type="text" size="30" name='%s(zNm)' value='%h(PD(zNm,""))'><br />
217 }
218 @ <input type="submit">
219 @ </form>
220 style_finish_page();
221 }
222
223 /*
224 ** Return a new timelineTable id.
225 */
@@ -2729,11 +2730,11 @@
2730 if( zOlderButton ){
2731 @ %z(chref("button","%s",zOlderButton))%h(zOlderButtonLabel)\
2732 @ &nbsp;&darr;</a>
2733 }
2734 document_emit_js(/*handles pikchrs rendered above*/);
2735 style_finish_page();
2736 }
2737
2738 /*
2739 ** The input query q selects various records. Print a human-readable
2740 ** summary of those records.
@@ -3188,10 +3189,11 @@
3189 login_check_credentials();
3190 if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki && !g.perm.RdForum) ){
3191 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
3192 return;
3193 }
3194 style_set_current_feature("timeline");
3195 style_header("Today In History");
3196 zToday = (char*)P("today");
3197 if( zToday ){
3198 zToday = timeline_expand_datetime(zToday);
3199 if( !fossil_isdate(zToday) ) zToday = 0;
@@ -3235,11 +3237,11 @@
3237 @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\
3238 @ </small></h2>
3239 www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0, 0);
3240 }
3241 db_finalize(&q);
3242 style_finish_page();
3243 }
3244
3245
3246 /*
3247 ** COMMAND: test-timewarp-list
@@ -3341,7 +3343,7 @@
3343 if( cnt==0 ){
3344 @ <p>No timewarps in this repository</p>
3345 }else{
3346 @ </tbody></table></div>
3347 }
3348 style_finish_page();
3349 }
3350
+17 -11
--- src/tkt.c
+++ src/tkt.c
@@ -585,10 +585,11 @@
585585
if( P("plaintext") ){
586586
style_submenu_element("Formatted", "%R/tktview/%s", zUuid);
587587
}else{
588588
style_submenu_element("Plaintext", "%R/tktview/%s?plaintext", zUuid);
589589
}
590
+ style_set_current_feature("tkt");
590591
style_header("View Ticket");
591592
if( showTimeline ){
592593
int tagid = db_int(0,"SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
593594
zUuid);
594595
if( tagid ){
@@ -618,11 +619,11 @@
618619
" WHERE tkt_uuid GLOB '%q*'", zUuid);
619620
if( zFullName ){
620621
attachment_list(zFullName, "<hr /><h2>Attachments:</h2><ul>");
621622
}
622623
623
- style_finish_page("tkt");
624
+ style_finish_page();
624625
}
625626
626627
/*
627628
** TH1 command: append_field FIELD STRING
628629
**
@@ -815,10 +816,11 @@
815816
login_check_credentials();
816817
if( !g.perm.NewTkt ){ login_needed(g.anon.NewTkt); return; }
817818
if( P("cancel") ){
818819
cgi_redirect("home");
819820
}
821
+ style_set_current_feature("tkt");
820822
style_header("New Ticket");
821823
ticket_standard_submenu(T_ALL_BUT(T_NEW));
822824
if( g.thTrace ) Th_Trace("BEGIN_TKTNEW<br />\n", -1);
823825
ticket_init();
824826
initializeVariablesFromCGI();
@@ -841,11 +843,11 @@
841843
return;
842844
}
843845
captcha_generate(0);
844846
@ </form>
845847
if( g.thTrace ) Th_Trace("END_TKTVIEW<br />\n", -1);
846
- style_finish_page("tkt");
848
+ style_finish_page();
847849
}
848850
849851
/*
850852
** WEBPAGE: tktedit
851853
** WEBPAGE: debug_tktedit
@@ -870,28 +872,29 @@
870872
}
871873
zName = P("name");
872874
if( P("cancel") ){
873875
cgi_redirectf("tktview?name=%T", zName);
874876
}
877
+ style_set_current_feature("tkt");
875878
style_header("Edit Ticket");
876879
if( zName==0 || (nName = strlen(zName))<4 || nName>HNAME_LEN_SHA1
877880
|| !validate16(zName,nName) ){
878881
@ <span class="tktError">Not a valid ticket id: "%h(zName)"</span>
879
- style_finish_page("tkt");
882
+ style_finish_page();
880883
return;
881884
}
882885
nRec = db_int(0, "SELECT count(*) FROM ticket WHERE tkt_uuid GLOB '%q*'",
883886
zName);
884887
if( nRec==0 ){
885888
@ <span class="tktError">No such ticket: "%h(zName)"</span>
886
- style_finish_page("tkt");
889
+ style_finish_page();
887890
return;
888891
}
889892
if( nRec>1 ){
890893
@ <span class="tktError">%d(nRec) tickets begin with:
891894
@ "%h(zName)"</span>
892
- style_finish_page("tkt");
895
+ style_finish_page();
893896
return;
894897
}
895898
if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
896899
ticket_init();
897900
getAllTicketFields();
@@ -912,11 +915,11 @@
912915
return;
913916
}
914917
captcha_generate(0);
915918
@ </form>
916919
if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
917
- style_finish_page("tkt");
920
+ style_finish_page();
918921
}
919922
920923
/*
921924
** Check the ticket table schema in zSchema to see if it appears to
922925
** be well-formed. If everything is OK, return NULL. If something is
@@ -1035,22 +1038,23 @@
10351038
if( zType[0]=='c' ){
10361039
zTitle = mprintf("Check-ins Associated With Ticket %h", zUuid);
10371040
}else{
10381041
zTitle = mprintf("Timeline Of Ticket %h", zUuid);
10391042
}
1043
+ style_set_current_feature("tkt");
10401044
style_header("%z", zTitle);
10411045
10421046
sqlite3_snprintf(6, zGlobPattern, "%s", zUuid);
10431047
canonical16(zGlobPattern, strlen(zGlobPattern));
10441048
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
10451049
if( tagid==0 ){
10461050
@ No such ticket: %h(zUuid)
1047
- style_finish_page("tkt");
1051
+ style_finish_page();
10481052
return;
10491053
}
10501054
tkt_draw_timeline(tagid, zType);
1051
- style_finish_page("tkt");
1055
+ style_finish_page();
10521056
}
10531057
10541058
/*
10551059
** WEBPAGE: tkthistory
10561060
** URL: /tkthistory?name=TICKETUUID
@@ -1084,16 +1088,17 @@
10841088
if( P("raw")!=0 ){
10851089
style_submenu_element("Decoded", "%R/tkthistory/%s", zUuid);
10861090
}else if( g.perm.Admin ){
10871091
style_submenu_element("Raw", "%R/tkthistory/%s?raw", zUuid);
10881092
}
1093
+ style_set_current_feature("tkt");
10891094
style_header("%z", zTitle);
10901095
10911096
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
10921097
if( tagid==0 ){
10931098
@ No such ticket: %h(zUuid)
1094
- style_finish_page("tkt");
1099
+ style_finish_page();
10951100
return;
10961101
}
10971102
if( P("raw")!=0 ){
10981103
@ <h2>Raw Artifacts Associated With Ticket %h(zUuid)</h2>
10991104
}else{
@@ -1162,11 +1167,11 @@
11621167
}
11631168
db_finalize(&q);
11641169
if( nChng ){
11651170
@ </ol>
11661171
}
1167
- style_finish_page("tkt");
1172
+ style_finish_page();
11681173
}
11691174
11701175
/*
11711176
** Return TRUE if the given BLOB contains a newline character.
11721177
*/
@@ -1611,10 +1616,11 @@
16111616
**
16121617
** Full-text search of all current tickets
16131618
*/
16141619
void tkt_srchpage(void){
16151620
login_check_credentials();
1621
+ style_set_current_feature("tkt");
16161622
style_header("Ticket Search");
16171623
ticket_standard_submenu(T_ALL_BUT(T_SRCH));
16181624
search_screen(SRCH_TKT, 0);
1619
- style_finish_page("tkt");
1625
+ style_finish_page();
16201626
}
16211627
--- src/tkt.c
+++ src/tkt.c
@@ -585,10 +585,11 @@
585 if( P("plaintext") ){
586 style_submenu_element("Formatted", "%R/tktview/%s", zUuid);
587 }else{
588 style_submenu_element("Plaintext", "%R/tktview/%s?plaintext", zUuid);
589 }
 
590 style_header("View Ticket");
591 if( showTimeline ){
592 int tagid = db_int(0,"SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
593 zUuid);
594 if( tagid ){
@@ -618,11 +619,11 @@
618 " WHERE tkt_uuid GLOB '%q*'", zUuid);
619 if( zFullName ){
620 attachment_list(zFullName, "<hr /><h2>Attachments:</h2><ul>");
621 }
622
623 style_finish_page("tkt");
624 }
625
626 /*
627 ** TH1 command: append_field FIELD STRING
628 **
@@ -815,10 +816,11 @@
815 login_check_credentials();
816 if( !g.perm.NewTkt ){ login_needed(g.anon.NewTkt); return; }
817 if( P("cancel") ){
818 cgi_redirect("home");
819 }
 
820 style_header("New Ticket");
821 ticket_standard_submenu(T_ALL_BUT(T_NEW));
822 if( g.thTrace ) Th_Trace("BEGIN_TKTNEW<br />\n", -1);
823 ticket_init();
824 initializeVariablesFromCGI();
@@ -841,11 +843,11 @@
841 return;
842 }
843 captcha_generate(0);
844 @ </form>
845 if( g.thTrace ) Th_Trace("END_TKTVIEW<br />\n", -1);
846 style_finish_page("tkt");
847 }
848
849 /*
850 ** WEBPAGE: tktedit
851 ** WEBPAGE: debug_tktedit
@@ -870,28 +872,29 @@
870 }
871 zName = P("name");
872 if( P("cancel") ){
873 cgi_redirectf("tktview?name=%T", zName);
874 }
 
875 style_header("Edit Ticket");
876 if( zName==0 || (nName = strlen(zName))<4 || nName>HNAME_LEN_SHA1
877 || !validate16(zName,nName) ){
878 @ <span class="tktError">Not a valid ticket id: "%h(zName)"</span>
879 style_finish_page("tkt");
880 return;
881 }
882 nRec = db_int(0, "SELECT count(*) FROM ticket WHERE tkt_uuid GLOB '%q*'",
883 zName);
884 if( nRec==0 ){
885 @ <span class="tktError">No such ticket: "%h(zName)"</span>
886 style_finish_page("tkt");
887 return;
888 }
889 if( nRec>1 ){
890 @ <span class="tktError">%d(nRec) tickets begin with:
891 @ "%h(zName)"</span>
892 style_finish_page("tkt");
893 return;
894 }
895 if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
896 ticket_init();
897 getAllTicketFields();
@@ -912,11 +915,11 @@
912 return;
913 }
914 captcha_generate(0);
915 @ </form>
916 if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
917 style_finish_page("tkt");
918 }
919
920 /*
921 ** Check the ticket table schema in zSchema to see if it appears to
922 ** be well-formed. If everything is OK, return NULL. If something is
@@ -1035,22 +1038,23 @@
1035 if( zType[0]=='c' ){
1036 zTitle = mprintf("Check-ins Associated With Ticket %h", zUuid);
1037 }else{
1038 zTitle = mprintf("Timeline Of Ticket %h", zUuid);
1039 }
 
1040 style_header("%z", zTitle);
1041
1042 sqlite3_snprintf(6, zGlobPattern, "%s", zUuid);
1043 canonical16(zGlobPattern, strlen(zGlobPattern));
1044 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
1045 if( tagid==0 ){
1046 @ No such ticket: %h(zUuid)
1047 style_finish_page("tkt");
1048 return;
1049 }
1050 tkt_draw_timeline(tagid, zType);
1051 style_finish_page("tkt");
1052 }
1053
1054 /*
1055 ** WEBPAGE: tkthistory
1056 ** URL: /tkthistory?name=TICKETUUID
@@ -1084,16 +1088,17 @@
1084 if( P("raw")!=0 ){
1085 style_submenu_element("Decoded", "%R/tkthistory/%s", zUuid);
1086 }else if( g.perm.Admin ){
1087 style_submenu_element("Raw", "%R/tkthistory/%s?raw", zUuid);
1088 }
 
1089 style_header("%z", zTitle);
1090
1091 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
1092 if( tagid==0 ){
1093 @ No such ticket: %h(zUuid)
1094 style_finish_page("tkt");
1095 return;
1096 }
1097 if( P("raw")!=0 ){
1098 @ <h2>Raw Artifacts Associated With Ticket %h(zUuid)</h2>
1099 }else{
@@ -1162,11 +1167,11 @@
1162 }
1163 db_finalize(&q);
1164 if( nChng ){
1165 @ </ol>
1166 }
1167 style_finish_page("tkt");
1168 }
1169
1170 /*
1171 ** Return TRUE if the given BLOB contains a newline character.
1172 */
@@ -1611,10 +1616,11 @@
1611 **
1612 ** Full-text search of all current tickets
1613 */
1614 void tkt_srchpage(void){
1615 login_check_credentials();
 
1616 style_header("Ticket Search");
1617 ticket_standard_submenu(T_ALL_BUT(T_SRCH));
1618 search_screen(SRCH_TKT, 0);
1619 style_finish_page("tkt");
1620 }
1621
--- src/tkt.c
+++ src/tkt.c
@@ -585,10 +585,11 @@
585 if( P("plaintext") ){
586 style_submenu_element("Formatted", "%R/tktview/%s", zUuid);
587 }else{
588 style_submenu_element("Plaintext", "%R/tktview/%s?plaintext", zUuid);
589 }
590 style_set_current_feature("tkt");
591 style_header("View Ticket");
592 if( showTimeline ){
593 int tagid = db_int(0,"SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",
594 zUuid);
595 if( tagid ){
@@ -618,11 +619,11 @@
619 " WHERE tkt_uuid GLOB '%q*'", zUuid);
620 if( zFullName ){
621 attachment_list(zFullName, "<hr /><h2>Attachments:</h2><ul>");
622 }
623
624 style_finish_page();
625 }
626
627 /*
628 ** TH1 command: append_field FIELD STRING
629 **
@@ -815,10 +816,11 @@
816 login_check_credentials();
817 if( !g.perm.NewTkt ){ login_needed(g.anon.NewTkt); return; }
818 if( P("cancel") ){
819 cgi_redirect("home");
820 }
821 style_set_current_feature("tkt");
822 style_header("New Ticket");
823 ticket_standard_submenu(T_ALL_BUT(T_NEW));
824 if( g.thTrace ) Th_Trace("BEGIN_TKTNEW<br />\n", -1);
825 ticket_init();
826 initializeVariablesFromCGI();
@@ -841,11 +843,11 @@
843 return;
844 }
845 captcha_generate(0);
846 @ </form>
847 if( g.thTrace ) Th_Trace("END_TKTVIEW<br />\n", -1);
848 style_finish_page();
849 }
850
851 /*
852 ** WEBPAGE: tktedit
853 ** WEBPAGE: debug_tktedit
@@ -870,28 +872,29 @@
872 }
873 zName = P("name");
874 if( P("cancel") ){
875 cgi_redirectf("tktview?name=%T", zName);
876 }
877 style_set_current_feature("tkt");
878 style_header("Edit Ticket");
879 if( zName==0 || (nName = strlen(zName))<4 || nName>HNAME_LEN_SHA1
880 || !validate16(zName,nName) ){
881 @ <span class="tktError">Not a valid ticket id: "%h(zName)"</span>
882 style_finish_page();
883 return;
884 }
885 nRec = db_int(0, "SELECT count(*) FROM ticket WHERE tkt_uuid GLOB '%q*'",
886 zName);
887 if( nRec==0 ){
888 @ <span class="tktError">No such ticket: "%h(zName)"</span>
889 style_finish_page();
890 return;
891 }
892 if( nRec>1 ){
893 @ <span class="tktError">%d(nRec) tickets begin with:
894 @ "%h(zName)"</span>
895 style_finish_page();
896 return;
897 }
898 if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
899 ticket_init();
900 getAllTicketFields();
@@ -912,11 +915,11 @@
915 return;
916 }
917 captcha_generate(0);
918 @ </form>
919 if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
920 style_finish_page();
921 }
922
923 /*
924 ** Check the ticket table schema in zSchema to see if it appears to
925 ** be well-formed. If everything is OK, return NULL. If something is
@@ -1035,22 +1038,23 @@
1038 if( zType[0]=='c' ){
1039 zTitle = mprintf("Check-ins Associated With Ticket %h", zUuid);
1040 }else{
1041 zTitle = mprintf("Timeline Of Ticket %h", zUuid);
1042 }
1043 style_set_current_feature("tkt");
1044 style_header("%z", zTitle);
1045
1046 sqlite3_snprintf(6, zGlobPattern, "%s", zUuid);
1047 canonical16(zGlobPattern, strlen(zGlobPattern));
1048 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
1049 if( tagid==0 ){
1050 @ No such ticket: %h(zUuid)
1051 style_finish_page();
1052 return;
1053 }
1054 tkt_draw_timeline(tagid, zType);
1055 style_finish_page();
1056 }
1057
1058 /*
1059 ** WEBPAGE: tkthistory
1060 ** URL: /tkthistory?name=TICKETUUID
@@ -1084,16 +1088,17 @@
1088 if( P("raw")!=0 ){
1089 style_submenu_element("Decoded", "%R/tkthistory/%s", zUuid);
1090 }else if( g.perm.Admin ){
1091 style_submenu_element("Raw", "%R/tkthistory/%s?raw", zUuid);
1092 }
1093 style_set_current_feature("tkt");
1094 style_header("%z", zTitle);
1095
1096 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid);
1097 if( tagid==0 ){
1098 @ No such ticket: %h(zUuid)
1099 style_finish_page();
1100 return;
1101 }
1102 if( P("raw")!=0 ){
1103 @ <h2>Raw Artifacts Associated With Ticket %h(zUuid)</h2>
1104 }else{
@@ -1162,11 +1167,11 @@
1167 }
1168 db_finalize(&q);
1169 if( nChng ){
1170 @ </ol>
1171 }
1172 style_finish_page();
1173 }
1174
1175 /*
1176 ** Return TRUE if the given BLOB contains a newline character.
1177 */
@@ -1611,10 +1616,11 @@
1616 **
1617 ** Full-text search of all current tickets
1618 */
1619 void tkt_srchpage(void){
1620 login_check_credentials();
1621 style_set_current_feature("tkt");
1622 style_header("Ticket Search");
1623 ticket_standard_submenu(T_ALL_BUT(T_SRCH));
1624 search_screen(SRCH_TKT, 0);
1625 style_finish_page();
1626 }
1627
+6 -3
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -54,11 +54,11 @@
5454
setup_menu_entry("Report Template", "tktsetup_rpttplt",
5555
"The default ticket report format.");
5656
setup_menu_entry("Key Template", "tktsetup_keytplt",
5757
"The default color key for reports.");
5858
@ </table>
59
- style_finish_page("tktsetup");
59
+ style_finish_page();
6060
}
6161
6262
/*
6363
** NOTE: When changing the table definition below, also change the
6464
** equivalent definition found in schema.c.
@@ -123,18 +123,20 @@
123123
login_check_credentials();
124124
if( !g.perm.Setup ){
125125
login_needed(0);
126126
return;
127127
}
128
+ style_set_current_feature("tktsetup");
128129
if( PB("setup") ){
129130
cgi_redirect("tktsetup");
130131
}
131132
isSubmit = P("submit")!=0;
132133
z = P("x");
133134
if( z==0 ){
134135
z = db_get(zDbField, zDfltValue);
135136
}
137
+ style_set_current_feature("tktsetup");
136138
style_header("Edit %s", zTitle);
137139
if( P("clear")!=0 ){
138140
login_verify_csrf_secret();
139141
db_unset(zDbField, 0);
140142
if( xRebuild ) xRebuild();
@@ -163,11 +165,11 @@
163165
@ <hr />
164166
@ <h2>Default %s(zTitle)</h2>
165167
@ <blockquote><pre>
166168
@ %h(zDfltValue)
167169
@ </pre></blockquote>
168
- style_finish_page("tktsetup");
170
+ style_finish_page();
169171
}
170172
171173
/*
172174
** WEBPAGE: tktsetup_tab
173175
** Administrative page for defining the "ticket" table used
@@ -901,10 +903,11 @@
901903
}
902904
903905
if( P("setup") ){
904906
cgi_redirect("tktsetup");
905907
}
908
+ style_set_current_feature("tktsetup");
906909
style_header("Ticket Display On Timelines");
907910
db_begin_transaction();
908911
@ <form action="%R/tktsetup_timeline" method="post"><div>
909912
login_insert_csrf_secret();
910913
@@ -934,8 +937,8 @@
934937
@ <input type="submit" name="submit" value="Apply Changes" />
935938
@ <input type="submit" name="setup" value="Cancel" />
936939
@ </p>
937940
@ </div></form>
938941
db_end_transaction(0);
939
- style_finish_page("tktsetup");
942
+ style_finish_page();
940943
941944
}
942945
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -54,11 +54,11 @@
54 setup_menu_entry("Report Template", "tktsetup_rpttplt",
55 "The default ticket report format.");
56 setup_menu_entry("Key Template", "tktsetup_keytplt",
57 "The default color key for reports.");
58 @ </table>
59 style_finish_page("tktsetup");
60 }
61
62 /*
63 ** NOTE: When changing the table definition below, also change the
64 ** equivalent definition found in schema.c.
@@ -123,18 +123,20 @@
123 login_check_credentials();
124 if( !g.perm.Setup ){
125 login_needed(0);
126 return;
127 }
 
128 if( PB("setup") ){
129 cgi_redirect("tktsetup");
130 }
131 isSubmit = P("submit")!=0;
132 z = P("x");
133 if( z==0 ){
134 z = db_get(zDbField, zDfltValue);
135 }
 
136 style_header("Edit %s", zTitle);
137 if( P("clear")!=0 ){
138 login_verify_csrf_secret();
139 db_unset(zDbField, 0);
140 if( xRebuild ) xRebuild();
@@ -163,11 +165,11 @@
163 @ <hr />
164 @ <h2>Default %s(zTitle)</h2>
165 @ <blockquote><pre>
166 @ %h(zDfltValue)
167 @ </pre></blockquote>
168 style_finish_page("tktsetup");
169 }
170
171 /*
172 ** WEBPAGE: tktsetup_tab
173 ** Administrative page for defining the "ticket" table used
@@ -901,10 +903,11 @@
901 }
902
903 if( P("setup") ){
904 cgi_redirect("tktsetup");
905 }
 
906 style_header("Ticket Display On Timelines");
907 db_begin_transaction();
908 @ <form action="%R/tktsetup_timeline" method="post"><div>
909 login_insert_csrf_secret();
910
@@ -934,8 +937,8 @@
934 @ <input type="submit" name="submit" value="Apply Changes" />
935 @ <input type="submit" name="setup" value="Cancel" />
936 @ </p>
937 @ </div></form>
938 db_end_transaction(0);
939 style_finish_page("tktsetup");
940
941 }
942
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -54,11 +54,11 @@
54 setup_menu_entry("Report Template", "tktsetup_rpttplt",
55 "The default ticket report format.");
56 setup_menu_entry("Key Template", "tktsetup_keytplt",
57 "The default color key for reports.");
58 @ </table>
59 style_finish_page();
60 }
61
62 /*
63 ** NOTE: When changing the table definition below, also change the
64 ** equivalent definition found in schema.c.
@@ -123,18 +123,20 @@
123 login_check_credentials();
124 if( !g.perm.Setup ){
125 login_needed(0);
126 return;
127 }
128 style_set_current_feature("tktsetup");
129 if( PB("setup") ){
130 cgi_redirect("tktsetup");
131 }
132 isSubmit = P("submit")!=0;
133 z = P("x");
134 if( z==0 ){
135 z = db_get(zDbField, zDfltValue);
136 }
137 style_set_current_feature("tktsetup");
138 style_header("Edit %s", zTitle);
139 if( P("clear")!=0 ){
140 login_verify_csrf_secret();
141 db_unset(zDbField, 0);
142 if( xRebuild ) xRebuild();
@@ -163,11 +165,11 @@
165 @ <hr />
166 @ <h2>Default %s(zTitle)</h2>
167 @ <blockquote><pre>
168 @ %h(zDfltValue)
169 @ </pre></blockquote>
170 style_finish_page();
171 }
172
173 /*
174 ** WEBPAGE: tktsetup_tab
175 ** Administrative page for defining the "ticket" table used
@@ -901,10 +903,11 @@
903 }
904
905 if( P("setup") ){
906 cgi_redirect("tktsetup");
907 }
908 style_set_current_feature("tktsetup");
909 style_header("Ticket Display On Timelines");
910 db_begin_transaction();
911 @ <form action="%R/tktsetup_timeline" method="post"><div>
912 login_insert_csrf_secret();
913
@@ -934,8 +937,8 @@
937 @ <input type="submit" name="submit" value="Apply Changes" />
938 @ <input type="submit" name="setup" value="Cancel" />
939 @ </p>
940 @ </div></form>
941 db_end_transaction(0);
942 style_finish_page();
943
944 }
945
--- src/unversioned.c
+++ src/unversioned.c
@@ -546,11 +546,11 @@
546546
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
547547
etag_check(ETAG_DATA,0);
548548
style_header("Unversioned Files");
549549
if( !db_table_exists("repository","unversioned") ){
550550
@ No unversioned files on this server
551
- style_finish_page("uvlist");
551
+ style_finish_page();
552552
return;
553553
}
554554
if( PB("byage") ) zOrderBy = "mtime DESC";
555555
if( PB("showdel") ) showDel = 1;
556556
db_prepare(&q,
@@ -632,11 +632,11 @@
632632
@ </tfoot>
633633
@ </table></div>
634634
}else{
635635
@ No unversioned files on this server.
636636
}
637
- style_finish_page("uvlist");
637
+ style_finish_page();
638638
}
639639
640640
/*
641641
** WEBPAGE: juvlist
642642
**
643643
--- src/unversioned.c
+++ src/unversioned.c
@@ -546,11 +546,11 @@
546 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
547 etag_check(ETAG_DATA,0);
548 style_header("Unversioned Files");
549 if( !db_table_exists("repository","unversioned") ){
550 @ No unversioned files on this server
551 style_finish_page("uvlist");
552 return;
553 }
554 if( PB("byage") ) zOrderBy = "mtime DESC";
555 if( PB("showdel") ) showDel = 1;
556 db_prepare(&q,
@@ -632,11 +632,11 @@
632 @ </tfoot>
633 @ </table></div>
634 }else{
635 @ No unversioned files on this server.
636 }
637 style_finish_page("uvlist");
638 }
639
640 /*
641 ** WEBPAGE: juvlist
642 **
643
--- src/unversioned.c
+++ src/unversioned.c
@@ -546,11 +546,11 @@
546 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
547 etag_check(ETAG_DATA,0);
548 style_header("Unversioned Files");
549 if( !db_table_exists("repository","unversioned") ){
550 @ No unversioned files on this server
551 style_finish_page();
552 return;
553 }
554 if( PB("byage") ) zOrderBy = "mtime DESC";
555 if( PB("showdel") ) showDel = 1;
556 db_prepare(&q,
@@ -632,11 +632,11 @@
632 @ </tfoot>
633 @ </table></div>
634 }else{
635 @ No unversioned files on this server.
636 }
637 style_finish_page();
638 }
639
640 /*
641 ** WEBPAGE: juvlist
642 **
643
+1 -1
--- src/user.c
+++ src/user.c
@@ -772,7 +772,7 @@
772772
@ <label><input type="checkbox" name="delall">
773773
@ Delete all entries</input></label>
774774
@ <input type="submit" name="delallbtn" value="Delete"></input>
775775
@ </form>
776776
style_table_sorter();
777
- style_finish_page("access_log");
777
+ style_finish_page();
778778
}
779779
--- src/user.c
+++ src/user.c
@@ -772,7 +772,7 @@
772 @ <label><input type="checkbox" name="delall">
773 @ Delete all entries</input></label>
774 @ <input type="submit" name="delallbtn" value="Delete"></input>
775 @ </form>
776 style_table_sorter();
777 style_finish_page("access_log");
778 }
779
--- src/user.c
+++ src/user.c
@@ -772,7 +772,7 @@
772 @ <label><input type="checkbox" name="delall">
773 @ Delete all entries</input></label>
774 @ <input type="submit" name="delallbtn" value="Delete"></input>
775 @ </form>
776 style_table_sorter();
777 style_finish_page();
778 }
779
+9 -5
--- src/webmail.c
+++ src/webmail.c
@@ -407,10 +407,11 @@
407407
emailid
408408
);
409409
if( zUser ) blob_append_sql(&sql, " AND euser=%Q", zUser);
410410
db_prepare_blob(&q, &sql);
411411
blob_reset(&sql);
412
+ style_set_current_feature("webmail");
412413
style_header("Message %d",emailid);
413414
if( db_step(&q)==SQLITE_ROW ){
414415
Blob msg = db_column_text_as_blob(&q, 0);
415416
int eFormat = atoi(PD("f","0"));
416417
eState = db_column_int(&q, 1);
@@ -513,11 +514,11 @@
513514
style_submenu_element("Delete", "%s",
514515
url_render(pUrl,"trash","1",zENum,"1"));
515516
}
516517
517518
db_end_transaction(0);
518
- style_finish_page("webmail");
519
+ style_finish_page();
519520
return;
520521
}
521522
522523
/*
523524
** Scan the query parameters looking for parameters with name of the
@@ -610,14 +611,15 @@
610611
login_check_credentials();
611612
if( !login_is_individual() ){
612613
login_needed(0);
613614
return;
614615
}
616
+ style_set_current_feature("webmail");
615617
if( !db_table_exists("repository","emailbox") ){
616618
style_header("Webmail Not Available");
617619
@ <p>This repository is not configured to provide webmail</p>
618
- style_finish_page("webmail");
620
+ style_finish_page();
619621
return;
620622
}
621623
add_content_sql_commands(g.db);
622624
emailid = atoi(PD("id","0"));
623625
url_initialize(&url, "webmail");
@@ -757,11 +759,11 @@
757759
@ for(i=0; i<x.length; i++){
758760
@ x[i].checked = true;
759761
@ }
760762
@ }
761763
@ </script>
762
- style_finish_page("webmail");
764
+ style_finish_page();
763765
db_end_transaction(0);
764766
}
765767
766768
/*
767769
** WEBPAGE: emailblob
@@ -780,10 +782,11 @@
780782
if( !g.perm.Setup ){
781783
login_needed(0);
782784
return;
783785
}
784786
add_content_sql_commands(g.db);
787
+ style_set_current_feature("webmail");
785788
style_header("emailblob table");
786789
if( id>0 ){
787790
style_submenu_element("Index", "%R/emailblob");
788791
@ <ul>
789792
db_prepare(&q, "SELECT emailid FROM emailblob WHERE ets=%d", id);
@@ -854,11 +857,11 @@
854857
}
855858
@ </tbody></table>
856859
db_finalize(&q);
857860
style_table_sorter();
858861
}
859
- style_finish_page("webmail");
862
+ style_finish_page();
860863
}
861864
862865
/*
863866
** WEBPAGE: emailoutq
864867
**
@@ -872,10 +875,11 @@
872875
if( !g.perm.Setup ){
873876
login_needed(0);
874877
return;
875878
}
876879
add_content_sql_commands(g.db);
880
+ style_set_current_feature("webmail");
877881
style_header("emailoutq table");
878882
style_submenu_element("emailblob table","%R/emailblob");
879883
db_prepare(&q,
880884
"SELECT edomain, efrom, eto, emsgid, "
881885
" datetime(ectime,'unixepoch'),"
@@ -911,7 +915,7 @@
911915
}
912916
}
913917
@ </tbody></table>
914918
db_finalize(&q);
915919
style_table_sorter();
916
- style_finish_page("webmail");
920
+ style_finish_page();
917921
}
918922
--- src/webmail.c
+++ src/webmail.c
@@ -407,10 +407,11 @@
407 emailid
408 );
409 if( zUser ) blob_append_sql(&sql, " AND euser=%Q", zUser);
410 db_prepare_blob(&q, &sql);
411 blob_reset(&sql);
 
412 style_header("Message %d",emailid);
413 if( db_step(&q)==SQLITE_ROW ){
414 Blob msg = db_column_text_as_blob(&q, 0);
415 int eFormat = atoi(PD("f","0"));
416 eState = db_column_int(&q, 1);
@@ -513,11 +514,11 @@
513 style_submenu_element("Delete", "%s",
514 url_render(pUrl,"trash","1",zENum,"1"));
515 }
516
517 db_end_transaction(0);
518 style_finish_page("webmail");
519 return;
520 }
521
522 /*
523 ** Scan the query parameters looking for parameters with name of the
@@ -610,14 +611,15 @@
610 login_check_credentials();
611 if( !login_is_individual() ){
612 login_needed(0);
613 return;
614 }
 
615 if( !db_table_exists("repository","emailbox") ){
616 style_header("Webmail Not Available");
617 @ <p>This repository is not configured to provide webmail</p>
618 style_finish_page("webmail");
619 return;
620 }
621 add_content_sql_commands(g.db);
622 emailid = atoi(PD("id","0"));
623 url_initialize(&url, "webmail");
@@ -757,11 +759,11 @@
757 @ for(i=0; i<x.length; i++){
758 @ x[i].checked = true;
759 @ }
760 @ }
761 @ </script>
762 style_finish_page("webmail");
763 db_end_transaction(0);
764 }
765
766 /*
767 ** WEBPAGE: emailblob
@@ -780,10 +782,11 @@
780 if( !g.perm.Setup ){
781 login_needed(0);
782 return;
783 }
784 add_content_sql_commands(g.db);
 
785 style_header("emailblob table");
786 if( id>0 ){
787 style_submenu_element("Index", "%R/emailblob");
788 @ <ul>
789 db_prepare(&q, "SELECT emailid FROM emailblob WHERE ets=%d", id);
@@ -854,11 +857,11 @@
854 }
855 @ </tbody></table>
856 db_finalize(&q);
857 style_table_sorter();
858 }
859 style_finish_page("webmail");
860 }
861
862 /*
863 ** WEBPAGE: emailoutq
864 **
@@ -872,10 +875,11 @@
872 if( !g.perm.Setup ){
873 login_needed(0);
874 return;
875 }
876 add_content_sql_commands(g.db);
 
877 style_header("emailoutq table");
878 style_submenu_element("emailblob table","%R/emailblob");
879 db_prepare(&q,
880 "SELECT edomain, efrom, eto, emsgid, "
881 " datetime(ectime,'unixepoch'),"
@@ -911,7 +915,7 @@
911 }
912 }
913 @ </tbody></table>
914 db_finalize(&q);
915 style_table_sorter();
916 style_finish_page("webmail");
917 }
918
--- src/webmail.c
+++ src/webmail.c
@@ -407,10 +407,11 @@
407 emailid
408 );
409 if( zUser ) blob_append_sql(&sql, " AND euser=%Q", zUser);
410 db_prepare_blob(&q, &sql);
411 blob_reset(&sql);
412 style_set_current_feature("webmail");
413 style_header("Message %d",emailid);
414 if( db_step(&q)==SQLITE_ROW ){
415 Blob msg = db_column_text_as_blob(&q, 0);
416 int eFormat = atoi(PD("f","0"));
417 eState = db_column_int(&q, 1);
@@ -513,11 +514,11 @@
514 style_submenu_element("Delete", "%s",
515 url_render(pUrl,"trash","1",zENum,"1"));
516 }
517
518 db_end_transaction(0);
519 style_finish_page();
520 return;
521 }
522
523 /*
524 ** Scan the query parameters looking for parameters with name of the
@@ -610,14 +611,15 @@
611 login_check_credentials();
612 if( !login_is_individual() ){
613 login_needed(0);
614 return;
615 }
616 style_set_current_feature("webmail");
617 if( !db_table_exists("repository","emailbox") ){
618 style_header("Webmail Not Available");
619 @ <p>This repository is not configured to provide webmail</p>
620 style_finish_page();
621 return;
622 }
623 add_content_sql_commands(g.db);
624 emailid = atoi(PD("id","0"));
625 url_initialize(&url, "webmail");
@@ -757,11 +759,11 @@
759 @ for(i=0; i<x.length; i++){
760 @ x[i].checked = true;
761 @ }
762 @ }
763 @ </script>
764 style_finish_page();
765 db_end_transaction(0);
766 }
767
768 /*
769 ** WEBPAGE: emailblob
@@ -780,10 +782,11 @@
782 if( !g.perm.Setup ){
783 login_needed(0);
784 return;
785 }
786 add_content_sql_commands(g.db);
787 style_set_current_feature("webmail");
788 style_header("emailblob table");
789 if( id>0 ){
790 style_submenu_element("Index", "%R/emailblob");
791 @ <ul>
792 db_prepare(&q, "SELECT emailid FROM emailblob WHERE ets=%d", id);
@@ -854,11 +857,11 @@
857 }
858 @ </tbody></table>
859 db_finalize(&q);
860 style_table_sorter();
861 }
862 style_finish_page();
863 }
864
865 /*
866 ** WEBPAGE: emailoutq
867 **
@@ -872,10 +875,11 @@
875 if( !g.perm.Setup ){
876 login_needed(0);
877 return;
878 }
879 add_content_sql_commands(g.db);
880 style_set_current_feature("webmail");
881 style_header("emailoutq table");
882 style_submenu_element("emailblob table","%R/emailblob");
883 db_prepare(&q,
884 "SELECT edomain, efrom, eto, emsgid, "
885 " datetime(ectime,'unixepoch'),"
@@ -911,7 +915,7 @@
915 }
916 }
917 @ </tbody></table>
918 db_finalize(&q);
919 style_table_sorter();
920 style_finish_page();
921 }
922
+30 -15
--- src/wiki.c
+++ src/wiki.c
@@ -62,15 +62,16 @@
6262
** Check a wiki name. If it is not well-formed, then issue an error
6363
** and return true. If it is well-formed, return false.
6464
*/
6565
static int check_name(const char *z){
6666
if( !wiki_name_is_wellformed((const unsigned char *)z) ){
67
+ style_set_current_feature("wiki");
6768
style_header("Wiki Page Name Error");
6869
@ The wiki name "<span class="wikiError">%h(z)</span>" is not well-formed.
6970
@ Rules for wiki page names:
7071
well_formed_wiki_name_rules();
71
- style_finish_page("wiki");
72
+ style_finish_page();
7273
return 1;
7374
}
7475
return 0;
7576
}
7677
@@ -134,18 +135,19 @@
134135
cgi_set_parameter_nocopy("name", g.zExtra, 1);
135136
g.isHome = 1;
136137
wiki_page();
137138
return;
138139
}
140
+ style_set_current_feature("wiki");
139141
style_header("Home");
140142
@ <p>This is a stub home-page for the project.
141143
@ To fill in this page, first go to
142144
@ %z(href("%R/setup_config"))setup/config</a>
143145
@ and establish a "Project Name". Then create a
144146
@ wiki page with that name. The content of that wiki page
145147
@ will be displayed in place of this message.</p>
146
- style_finish_page("wiki");
148
+ style_finish_page();
147149
}
148150
149151
/*
150152
** Return true if the given pagename is the name of the sandbox
151153
*/
@@ -229,10 +231,11 @@
229231
** Show a summary of the Markdown wiki formatting rules.
230232
*/
231233
void markdown_rules_page(void){
232234
Blob x;
233235
int fTxt = P("txt")!=0;
236
+ style_set_current_feature("wiki");
234237
style_header("Markdown Formatting Rules");
235238
if( fTxt ){
236239
style_submenu_element("Formatted", "%R/md_rules");
237240
}else{
238241
style_submenu_element("Plain-Text", "%R/md_rules?txt=1");
@@ -242,11 +245,11 @@
242245
blob_materialize(&x);
243246
interwiki_append_map_table(&x);
244247
safe_html_context(DOCSRC_TRUSTED);
245248
wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown");
246249
blob_reset(&x);
247
- style_finish_page("wiki");
250
+ style_finish_page();
248251
}
249252
250253
/*
251254
** WEBPAGE: wiki_rules
252255
**
@@ -253,10 +256,11 @@
253256
** Show a summary of the wiki formatting rules.
254257
*/
255258
void wiki_rules_page(void){
256259
Blob x;
257260
int fTxt = P("txt")!=0;
261
+ style_set_current_feature("wiki");
258262
style_header("Wiki Formatting Rules");
259263
if( fTxt ){
260264
style_submenu_element("Formatted", "%R/wiki_rules");
261265
}else{
262266
style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1");
@@ -266,25 +270,26 @@
266270
blob_materialize(&x);
267271
interwiki_append_map_table(&x);
268272
safe_html_context(DOCSRC_TRUSTED);
269273
wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki");
270274
blob_reset(&x);
271
- style_finish_page("wiki");
275
+ style_finish_page();
272276
}
273277
274278
/*
275279
** WEBPAGE: markup_help
276280
**
277281
** Show links to the md_rules and wiki_rules pages.
278282
*/
279283
void markup_help_page(void){
284
+ style_set_current_feature("wiki");
280285
style_header("Fossil Markup Styles");
281286
@ <ul>
282287
@ <li><p>%z(href("%R/wiki_rules"))Fossil Wiki Formatting Rules</a></p></li>
283288
@ <li><p>%z(href("%R/md_rules"))Markdown Formatting Rules</a></p></li>
284289
@ </ul>
285
- style_finish_page("wiki");
290
+ style_finish_page();
286291
}
287292
288293
/*
289294
** Returns non-zero if moderation is required for wiki changes and wiki
290295
** attachments.
@@ -344,10 +349,11 @@
344349
** A generic landing page for wiki.
345350
*/
346351
void wiki_helppage(void){
347352
login_check_credentials();
348353
if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
354
+ style_set_current_feature("wiki");
349355
style_header("Wiki Help");
350356
wiki_standard_submenu(W_ALL_BUT(W_HELP));
351357
@ <h2>Wiki Links</h2>
352358
@ <ul>
353359
@ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li>
@@ -369,11 +375,11 @@
369375
if( search_restrict(SRCH_WIKI)!=0 ){
370376
@ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key
371377
@ words</li>
372378
}
373379
@ </ul>
374
- style_finish_page("wiki");
380
+ style_finish_page();
375381
return;
376382
}
377383
378384
/*
379385
** WEBPAGE: wikisrch
@@ -381,14 +387,15 @@
381387
**
382388
** Full-text search of all current wiki text
383389
*/
384390
void wiki_srchpage(void){
385391
login_check_credentials();
392
+ style_set_current_feature("wiki");
386393
style_header("Wiki Search");
387394
wiki_standard_submenu(W_HELP|W_LIST|W_SANDBOX);
388395
search_screen(SRCH_WIKI, 0);
389
- style_finish_page("wiki");
396
+ style_finish_page();
390397
}
391398
392399
/* Return values from wiki_page_type() */
393400
#if INTERFACE
394401
# define WIKITYPE_UNKNOWN (-1)
@@ -446,10 +453,11 @@
446453
static int wiki_page_header(
447454
int eType, /* Page type. Might be WIKITYPE_UNKNOWN */
448455
const char *zPageName, /* Name of the page */
449456
const char *zExtra /* Extra prefix text on the page header */
450457
){
458
+ style_set_current_feature("wiki");
451459
if( eType==WIKITYPE_UNKNOWN ) eType = wiki_page_type(zPageName);
452460
switch( eType ){
453461
case WIKITYPE_NORMAL: {
454462
style_header("%s%s", zExtra, zPageName);
455463
break;
@@ -597,11 +605,11 @@
597605
blob_reset(&wiki);
598606
}
599607
attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>");
600608
manifest_destroy(pWiki);
601609
document_emit_js(/*for optional pikchr support*/);
602
- style_finish_page("wiki");
610
+ style_finish_page();
603611
}
604612
605613
/*
606614
** Write a wiki artifact into the repository
607615
*/
@@ -1138,10 +1146,11 @@
11381146
if( !g.perm.RdWiki ){
11391147
login_needed(g.anon.RdWiki);
11401148
return;
11411149
}
11421150
}
1151
+ style_set_current_feature("wiki");
11431152
style_header("Wiki Editor");
11441153
style_emit_noscript_for_js_page();
11451154
11461155
/* Status bar */
11471156
CX("<div id='fossil-status-bar' "
@@ -1344,11 +1353,11 @@
13441353
CX("}catch(e){"
13451354
"fossil.error(e); console.error('Exception:',e);"
13461355
"}\n");
13471356
CX("});\n"/*fossil.onPageLoad()*/);
13481357
style_script_end();
1349
- style_finish_page("wiki");
1358
+ style_finish_page();
13501359
}
13511360
13521361
/*
13531362
** WEBPAGE: wikinew
13541363
** URL /wikinew
@@ -1367,10 +1376,11 @@
13671376
zName = PD("name","");
13681377
zMimetype = wiki_filter_mimetypes(P("mimetype"));
13691378
if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){
13701379
cgi_redirectf("wikiedit?name=%T&mimetype=%s", zName, zMimetype);
13711380
}
1381
+ style_set_current_feature("wiki");
13721382
style_header("Create A New Wiki Page");
13731383
wiki_standard_submenu(W_ALL_BUT(W_NEW));
13741384
@ <p>Rules for wiki page names:</p>
13751385
well_formed_wiki_name_rules();
13761386
form_begin(0, "%R/wikinew");
@@ -1382,11 +1392,11 @@
13821392
@ </p></form>
13831393
if( zName[0] ){
13841394
@ <p><span class="wikiError">
13851395
@ "%h(zName)" is not a valid wiki page name!</span></p>
13861396
}
1387
- style_finish_page("wiki");
1397
+ style_finish_page();
13881398
}
13891399
13901400
13911401
/*
13921402
** Append the wiki text for an remark to the end of the given BLOB.
@@ -1513,10 +1523,11 @@
15131523
if( P("cancel")!=0 ){
15141524
cgi_redirectf("wiki?name=%T", zPageName);
15151525
return;
15161526
}
15171527
style_set_current_page("%T?name=%T", g.zPath, zPageName);
1528
+ style_set_current_feature("wiki");
15181529
style_header("Append Comment To: %s", zPageName);
15191530
if( !goodCaptcha ){
15201531
@ <p class="generalError">Error: Incorrect security code.</p>
15211532
}
15221533
if( P("preview")!=0 ){
@@ -1544,11 +1555,11 @@
15441555
@ <input type="submit" name="preview" value="Preview Your Comment" />
15451556
@ <input type="submit" name="submit" value="Append Your Changes" />
15461557
@ <input type="submit" name="cancel" value="Cancel" />
15471558
captcha_generate(0);
15481559
@ </form>
1549
- style_finish_page("wiki");
1560
+ style_finish_page();
15501561
}
15511562
15521563
/*
15531564
** WEBPAGE: whistory
15541565
** URL: /whistory?name=PAGENAME
@@ -1564,10 +1575,11 @@
15641575
Blob sql;
15651576
Stmt q;
15661577
login_check_credentials();
15671578
if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
15681579
zPageName = PD("name","");
1580
+ style_set_current_feature("wiki");
15691581
style_header("History Of %s", zPageName);
15701582
blob_init(&sql, 0, 0);
15711583
blob_append(&sql, timeline_query_for_www(), -1);
15721584
blob_append_sql(&sql,
15731585
"AND event.objid IN ("
@@ -1582,11 +1594,11 @@
15821594
www_print_timeline(&q,
15831595
TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_REFS,
15841596
0, 0, 0, 0, 0, 0);
15851597
db_finalize(&q);
15861598
blob_reset(&sql);
1587
- style_finish_page("wiki");
1599
+ style_finish_page();
15881600
}
15891601
15901602
/*
15911603
** WEBPAGE: wdiff
15921604
**
@@ -1645,20 +1657,21 @@
16451657
}
16461658
nextRid = wiki_next(wiki_tagid(pW1->zWikiTitle),pW1->rDate);
16471659
if( nextRid ){
16481660
style_submenu_element("Next", "%R/wdiff?rid=%d", nextRid);
16491661
}
1662
+ style_set_current_feature("wiki");
16501663
style_header("Changes To %s", pW1->zWikiTitle);
16511664
blob_zero(&d);
16521665
diffFlags = construct_diff_flags(1);
16531666
text_diff(&w2, &w1, &d, 0, diffFlags | DIFF_HTML | DIFF_LINENO);
16541667
@ <pre class="udiff">
16551668
@ %s(blob_str(&d))
16561669
@ <pre>
16571670
manifest_destroy(pW1);
16581671
manifest_destroy(pW2);
1659
- style_finish_page("wiki");
1672
+ style_finish_page();
16601673
}
16611674
16621675
/*
16631676
** A query that returns information about all wiki pages.
16641677
**
@@ -1701,10 +1714,11 @@
17011714
int showAll = P("all")!=0;
17021715
int showRid = P("showid")!=0;
17031716
17041717
login_check_credentials();
17051718
if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
1719
+ style_set_current_feature("wiki");
17061720
style_header("Available Wiki Pages");
17071721
if( showAll ){
17081722
style_submenu_element("Active", "%R/wcontent");
17091723
}else{
17101724
style_submenu_element("All", "%R/wcontent?all=1");
@@ -1756,11 +1770,11 @@
17561770
fossil_free(zWDisplayName);
17571771
}
17581772
@ </tbody></table></div>
17591773
db_finalize(&q);
17601774
style_table_sorter();
1761
- style_finish_page("wiki");
1775
+ style_finish_page();
17621776
}
17631777
17641778
/*
17651779
** WEBPAGE: wfind
17661780
**
@@ -1771,10 +1785,11 @@
17711785
Stmt q;
17721786
const char *zTitle;
17731787
login_check_credentials();
17741788
if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
17751789
zTitle = PD("title","*");
1790
+ style_set_current_feature("wiki");
17761791
style_header("Wiki Pages Found");
17771792
@ <ul>
17781793
db_prepare(&q,
17791794
"SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'"
17801795
" ORDER BY lower(tagname) /*sort*/" ,
@@ -1783,11 +1798,11 @@
17831798
const char *zName = db_column_text(&q, 0);
17841799
@ <li>%z(href("%R/wiki?name=%T",zName))%h(zName)</a></li>
17851800
}
17861801
db_finalize(&q);
17871802
@ </ul>
1788
- style_finish_page("wiki");
1803
+ style_finish_page();
17891804
}
17901805
17911806
/*
17921807
** Add a new wiki page to the repository. The page name is
17931808
** given by the zPageName parameter. rid must be zero to create
17941809
--- src/wiki.c
+++ src/wiki.c
@@ -62,15 +62,16 @@
62 ** Check a wiki name. If it is not well-formed, then issue an error
63 ** and return true. If it is well-formed, return false.
64 */
65 static int check_name(const char *z){
66 if( !wiki_name_is_wellformed((const unsigned char *)z) ){
 
67 style_header("Wiki Page Name Error");
68 @ The wiki name "<span class="wikiError">%h(z)</span>" is not well-formed.
69 @ Rules for wiki page names:
70 well_formed_wiki_name_rules();
71 style_finish_page("wiki");
72 return 1;
73 }
74 return 0;
75 }
76
@@ -134,18 +135,19 @@
134 cgi_set_parameter_nocopy("name", g.zExtra, 1);
135 g.isHome = 1;
136 wiki_page();
137 return;
138 }
 
139 style_header("Home");
140 @ <p>This is a stub home-page for the project.
141 @ To fill in this page, first go to
142 @ %z(href("%R/setup_config"))setup/config</a>
143 @ and establish a "Project Name". Then create a
144 @ wiki page with that name. The content of that wiki page
145 @ will be displayed in place of this message.</p>
146 style_finish_page("wiki");
147 }
148
149 /*
150 ** Return true if the given pagename is the name of the sandbox
151 */
@@ -229,10 +231,11 @@
229 ** Show a summary of the Markdown wiki formatting rules.
230 */
231 void markdown_rules_page(void){
232 Blob x;
233 int fTxt = P("txt")!=0;
 
234 style_header("Markdown Formatting Rules");
235 if( fTxt ){
236 style_submenu_element("Formatted", "%R/md_rules");
237 }else{
238 style_submenu_element("Plain-Text", "%R/md_rules?txt=1");
@@ -242,11 +245,11 @@
242 blob_materialize(&x);
243 interwiki_append_map_table(&x);
244 safe_html_context(DOCSRC_TRUSTED);
245 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown");
246 blob_reset(&x);
247 style_finish_page("wiki");
248 }
249
250 /*
251 ** WEBPAGE: wiki_rules
252 **
@@ -253,10 +256,11 @@
253 ** Show a summary of the wiki formatting rules.
254 */
255 void wiki_rules_page(void){
256 Blob x;
257 int fTxt = P("txt")!=0;
 
258 style_header("Wiki Formatting Rules");
259 if( fTxt ){
260 style_submenu_element("Formatted", "%R/wiki_rules");
261 }else{
262 style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1");
@@ -266,25 +270,26 @@
266 blob_materialize(&x);
267 interwiki_append_map_table(&x);
268 safe_html_context(DOCSRC_TRUSTED);
269 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki");
270 blob_reset(&x);
271 style_finish_page("wiki");
272 }
273
274 /*
275 ** WEBPAGE: markup_help
276 **
277 ** Show links to the md_rules and wiki_rules pages.
278 */
279 void markup_help_page(void){
 
280 style_header("Fossil Markup Styles");
281 @ <ul>
282 @ <li><p>%z(href("%R/wiki_rules"))Fossil Wiki Formatting Rules</a></p></li>
283 @ <li><p>%z(href("%R/md_rules"))Markdown Formatting Rules</a></p></li>
284 @ </ul>
285 style_finish_page("wiki");
286 }
287
288 /*
289 ** Returns non-zero if moderation is required for wiki changes and wiki
290 ** attachments.
@@ -344,10 +349,11 @@
344 ** A generic landing page for wiki.
345 */
346 void wiki_helppage(void){
347 login_check_credentials();
348 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
 
349 style_header("Wiki Help");
350 wiki_standard_submenu(W_ALL_BUT(W_HELP));
351 @ <h2>Wiki Links</h2>
352 @ <ul>
353 @ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li>
@@ -369,11 +375,11 @@
369 if( search_restrict(SRCH_WIKI)!=0 ){
370 @ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key
371 @ words</li>
372 }
373 @ </ul>
374 style_finish_page("wiki");
375 return;
376 }
377
378 /*
379 ** WEBPAGE: wikisrch
@@ -381,14 +387,15 @@
381 **
382 ** Full-text search of all current wiki text
383 */
384 void wiki_srchpage(void){
385 login_check_credentials();
 
386 style_header("Wiki Search");
387 wiki_standard_submenu(W_HELP|W_LIST|W_SANDBOX);
388 search_screen(SRCH_WIKI, 0);
389 style_finish_page("wiki");
390 }
391
392 /* Return values from wiki_page_type() */
393 #if INTERFACE
394 # define WIKITYPE_UNKNOWN (-1)
@@ -446,10 +453,11 @@
446 static int wiki_page_header(
447 int eType, /* Page type. Might be WIKITYPE_UNKNOWN */
448 const char *zPageName, /* Name of the page */
449 const char *zExtra /* Extra prefix text on the page header */
450 ){
 
451 if( eType==WIKITYPE_UNKNOWN ) eType = wiki_page_type(zPageName);
452 switch( eType ){
453 case WIKITYPE_NORMAL: {
454 style_header("%s%s", zExtra, zPageName);
455 break;
@@ -597,11 +605,11 @@
597 blob_reset(&wiki);
598 }
599 attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>");
600 manifest_destroy(pWiki);
601 document_emit_js(/*for optional pikchr support*/);
602 style_finish_page("wiki");
603 }
604
605 /*
606 ** Write a wiki artifact into the repository
607 */
@@ -1138,10 +1146,11 @@
1138 if( !g.perm.RdWiki ){
1139 login_needed(g.anon.RdWiki);
1140 return;
1141 }
1142 }
 
1143 style_header("Wiki Editor");
1144 style_emit_noscript_for_js_page();
1145
1146 /* Status bar */
1147 CX("<div id='fossil-status-bar' "
@@ -1344,11 +1353,11 @@
1344 CX("}catch(e){"
1345 "fossil.error(e); console.error('Exception:',e);"
1346 "}\n");
1347 CX("});\n"/*fossil.onPageLoad()*/);
1348 style_script_end();
1349 style_finish_page("wiki");
1350 }
1351
1352 /*
1353 ** WEBPAGE: wikinew
1354 ** URL /wikinew
@@ -1367,10 +1376,11 @@
1367 zName = PD("name","");
1368 zMimetype = wiki_filter_mimetypes(P("mimetype"));
1369 if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){
1370 cgi_redirectf("wikiedit?name=%T&mimetype=%s", zName, zMimetype);
1371 }
 
1372 style_header("Create A New Wiki Page");
1373 wiki_standard_submenu(W_ALL_BUT(W_NEW));
1374 @ <p>Rules for wiki page names:</p>
1375 well_formed_wiki_name_rules();
1376 form_begin(0, "%R/wikinew");
@@ -1382,11 +1392,11 @@
1382 @ </p></form>
1383 if( zName[0] ){
1384 @ <p><span class="wikiError">
1385 @ "%h(zName)" is not a valid wiki page name!</span></p>
1386 }
1387 style_finish_page("wiki");
1388 }
1389
1390
1391 /*
1392 ** Append the wiki text for an remark to the end of the given BLOB.
@@ -1513,10 +1523,11 @@
1513 if( P("cancel")!=0 ){
1514 cgi_redirectf("wiki?name=%T", zPageName);
1515 return;
1516 }
1517 style_set_current_page("%T?name=%T", g.zPath, zPageName);
 
1518 style_header("Append Comment To: %s", zPageName);
1519 if( !goodCaptcha ){
1520 @ <p class="generalError">Error: Incorrect security code.</p>
1521 }
1522 if( P("preview")!=0 ){
@@ -1544,11 +1555,11 @@
1544 @ <input type="submit" name="preview" value="Preview Your Comment" />
1545 @ <input type="submit" name="submit" value="Append Your Changes" />
1546 @ <input type="submit" name="cancel" value="Cancel" />
1547 captcha_generate(0);
1548 @ </form>
1549 style_finish_page("wiki");
1550 }
1551
1552 /*
1553 ** WEBPAGE: whistory
1554 ** URL: /whistory?name=PAGENAME
@@ -1564,10 +1575,11 @@
1564 Blob sql;
1565 Stmt q;
1566 login_check_credentials();
1567 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
1568 zPageName = PD("name","");
 
1569 style_header("History Of %s", zPageName);
1570 blob_init(&sql, 0, 0);
1571 blob_append(&sql, timeline_query_for_www(), -1);
1572 blob_append_sql(&sql,
1573 "AND event.objid IN ("
@@ -1582,11 +1594,11 @@
1582 www_print_timeline(&q,
1583 TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_REFS,
1584 0, 0, 0, 0, 0, 0);
1585 db_finalize(&q);
1586 blob_reset(&sql);
1587 style_finish_page("wiki");
1588 }
1589
1590 /*
1591 ** WEBPAGE: wdiff
1592 **
@@ -1645,20 +1657,21 @@
1645 }
1646 nextRid = wiki_next(wiki_tagid(pW1->zWikiTitle),pW1->rDate);
1647 if( nextRid ){
1648 style_submenu_element("Next", "%R/wdiff?rid=%d", nextRid);
1649 }
 
1650 style_header("Changes To %s", pW1->zWikiTitle);
1651 blob_zero(&d);
1652 diffFlags = construct_diff_flags(1);
1653 text_diff(&w2, &w1, &d, 0, diffFlags | DIFF_HTML | DIFF_LINENO);
1654 @ <pre class="udiff">
1655 @ %s(blob_str(&d))
1656 @ <pre>
1657 manifest_destroy(pW1);
1658 manifest_destroy(pW2);
1659 style_finish_page("wiki");
1660 }
1661
1662 /*
1663 ** A query that returns information about all wiki pages.
1664 **
@@ -1701,10 +1714,11 @@
1701 int showAll = P("all")!=0;
1702 int showRid = P("showid")!=0;
1703
1704 login_check_credentials();
1705 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
 
1706 style_header("Available Wiki Pages");
1707 if( showAll ){
1708 style_submenu_element("Active", "%R/wcontent");
1709 }else{
1710 style_submenu_element("All", "%R/wcontent?all=1");
@@ -1756,11 +1770,11 @@
1756 fossil_free(zWDisplayName);
1757 }
1758 @ </tbody></table></div>
1759 db_finalize(&q);
1760 style_table_sorter();
1761 style_finish_page("wiki");
1762 }
1763
1764 /*
1765 ** WEBPAGE: wfind
1766 **
@@ -1771,10 +1785,11 @@
1771 Stmt q;
1772 const char *zTitle;
1773 login_check_credentials();
1774 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
1775 zTitle = PD("title","*");
 
1776 style_header("Wiki Pages Found");
1777 @ <ul>
1778 db_prepare(&q,
1779 "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'"
1780 " ORDER BY lower(tagname) /*sort*/" ,
@@ -1783,11 +1798,11 @@
1783 const char *zName = db_column_text(&q, 0);
1784 @ <li>%z(href("%R/wiki?name=%T",zName))%h(zName)</a></li>
1785 }
1786 db_finalize(&q);
1787 @ </ul>
1788 style_finish_page("wiki");
1789 }
1790
1791 /*
1792 ** Add a new wiki page to the repository. The page name is
1793 ** given by the zPageName parameter. rid must be zero to create
1794
--- src/wiki.c
+++ src/wiki.c
@@ -62,15 +62,16 @@
62 ** Check a wiki name. If it is not well-formed, then issue an error
63 ** and return true. If it is well-formed, return false.
64 */
65 static int check_name(const char *z){
66 if( !wiki_name_is_wellformed((const unsigned char *)z) ){
67 style_set_current_feature("wiki");
68 style_header("Wiki Page Name Error");
69 @ The wiki name "<span class="wikiError">%h(z)</span>" is not well-formed.
70 @ Rules for wiki page names:
71 well_formed_wiki_name_rules();
72 style_finish_page();
73 return 1;
74 }
75 return 0;
76 }
77
@@ -134,18 +135,19 @@
135 cgi_set_parameter_nocopy("name", g.zExtra, 1);
136 g.isHome = 1;
137 wiki_page();
138 return;
139 }
140 style_set_current_feature("wiki");
141 style_header("Home");
142 @ <p>This is a stub home-page for the project.
143 @ To fill in this page, first go to
144 @ %z(href("%R/setup_config"))setup/config</a>
145 @ and establish a "Project Name". Then create a
146 @ wiki page with that name. The content of that wiki page
147 @ will be displayed in place of this message.</p>
148 style_finish_page();
149 }
150
151 /*
152 ** Return true if the given pagename is the name of the sandbox
153 */
@@ -229,10 +231,11 @@
231 ** Show a summary of the Markdown wiki formatting rules.
232 */
233 void markdown_rules_page(void){
234 Blob x;
235 int fTxt = P("txt")!=0;
236 style_set_current_feature("wiki");
237 style_header("Markdown Formatting Rules");
238 if( fTxt ){
239 style_submenu_element("Formatted", "%R/md_rules");
240 }else{
241 style_submenu_element("Plain-Text", "%R/md_rules?txt=1");
@@ -242,11 +245,11 @@
245 blob_materialize(&x);
246 interwiki_append_map_table(&x);
247 safe_html_context(DOCSRC_TRUSTED);
248 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown");
249 blob_reset(&x);
250 style_finish_page();
251 }
252
253 /*
254 ** WEBPAGE: wiki_rules
255 **
@@ -253,10 +256,11 @@
256 ** Show a summary of the wiki formatting rules.
257 */
258 void wiki_rules_page(void){
259 Blob x;
260 int fTxt = P("txt")!=0;
261 style_set_current_feature("wiki");
262 style_header("Wiki Formatting Rules");
263 if( fTxt ){
264 style_submenu_element("Formatted", "%R/wiki_rules");
265 }else{
266 style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1");
@@ -266,25 +270,26 @@
270 blob_materialize(&x);
271 interwiki_append_map_table(&x);
272 safe_html_context(DOCSRC_TRUSTED);
273 wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki");
274 blob_reset(&x);
275 style_finish_page();
276 }
277
278 /*
279 ** WEBPAGE: markup_help
280 **
281 ** Show links to the md_rules and wiki_rules pages.
282 */
283 void markup_help_page(void){
284 style_set_current_feature("wiki");
285 style_header("Fossil Markup Styles");
286 @ <ul>
287 @ <li><p>%z(href("%R/wiki_rules"))Fossil Wiki Formatting Rules</a></p></li>
288 @ <li><p>%z(href("%R/md_rules"))Markdown Formatting Rules</a></p></li>
289 @ </ul>
290 style_finish_page();
291 }
292
293 /*
294 ** Returns non-zero if moderation is required for wiki changes and wiki
295 ** attachments.
@@ -344,10 +349,11 @@
349 ** A generic landing page for wiki.
350 */
351 void wiki_helppage(void){
352 login_check_credentials();
353 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
354 style_set_current_feature("wiki");
355 style_header("Wiki Help");
356 wiki_standard_submenu(W_ALL_BUT(W_HELP));
357 @ <h2>Wiki Links</h2>
358 @ <ul>
359 @ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li>
@@ -369,11 +375,11 @@
375 if( search_restrict(SRCH_WIKI)!=0 ){
376 @ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key
377 @ words</li>
378 }
379 @ </ul>
380 style_finish_page();
381 return;
382 }
383
384 /*
385 ** WEBPAGE: wikisrch
@@ -381,14 +387,15 @@
387 **
388 ** Full-text search of all current wiki text
389 */
390 void wiki_srchpage(void){
391 login_check_credentials();
392 style_set_current_feature("wiki");
393 style_header("Wiki Search");
394 wiki_standard_submenu(W_HELP|W_LIST|W_SANDBOX);
395 search_screen(SRCH_WIKI, 0);
396 style_finish_page();
397 }
398
399 /* Return values from wiki_page_type() */
400 #if INTERFACE
401 # define WIKITYPE_UNKNOWN (-1)
@@ -446,10 +453,11 @@
453 static int wiki_page_header(
454 int eType, /* Page type. Might be WIKITYPE_UNKNOWN */
455 const char *zPageName, /* Name of the page */
456 const char *zExtra /* Extra prefix text on the page header */
457 ){
458 style_set_current_feature("wiki");
459 if( eType==WIKITYPE_UNKNOWN ) eType = wiki_page_type(zPageName);
460 switch( eType ){
461 case WIKITYPE_NORMAL: {
462 style_header("%s%s", zExtra, zPageName);
463 break;
@@ -597,11 +605,11 @@
605 blob_reset(&wiki);
606 }
607 attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>");
608 manifest_destroy(pWiki);
609 document_emit_js(/*for optional pikchr support*/);
610 style_finish_page();
611 }
612
613 /*
614 ** Write a wiki artifact into the repository
615 */
@@ -1138,10 +1146,11 @@
1146 if( !g.perm.RdWiki ){
1147 login_needed(g.anon.RdWiki);
1148 return;
1149 }
1150 }
1151 style_set_current_feature("wiki");
1152 style_header("Wiki Editor");
1153 style_emit_noscript_for_js_page();
1154
1155 /* Status bar */
1156 CX("<div id='fossil-status-bar' "
@@ -1344,11 +1353,11 @@
1353 CX("}catch(e){"
1354 "fossil.error(e); console.error('Exception:',e);"
1355 "}\n");
1356 CX("});\n"/*fossil.onPageLoad()*/);
1357 style_script_end();
1358 style_finish_page();
1359 }
1360
1361 /*
1362 ** WEBPAGE: wikinew
1363 ** URL /wikinew
@@ -1367,10 +1376,11 @@
1376 zName = PD("name","");
1377 zMimetype = wiki_filter_mimetypes(P("mimetype"));
1378 if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){
1379 cgi_redirectf("wikiedit?name=%T&mimetype=%s", zName, zMimetype);
1380 }
1381 style_set_current_feature("wiki");
1382 style_header("Create A New Wiki Page");
1383 wiki_standard_submenu(W_ALL_BUT(W_NEW));
1384 @ <p>Rules for wiki page names:</p>
1385 well_formed_wiki_name_rules();
1386 form_begin(0, "%R/wikinew");
@@ -1382,11 +1392,11 @@
1392 @ </p></form>
1393 if( zName[0] ){
1394 @ <p><span class="wikiError">
1395 @ "%h(zName)" is not a valid wiki page name!</span></p>
1396 }
1397 style_finish_page();
1398 }
1399
1400
1401 /*
1402 ** Append the wiki text for an remark to the end of the given BLOB.
@@ -1513,10 +1523,11 @@
1523 if( P("cancel")!=0 ){
1524 cgi_redirectf("wiki?name=%T", zPageName);
1525 return;
1526 }
1527 style_set_current_page("%T?name=%T", g.zPath, zPageName);
1528 style_set_current_feature("wiki");
1529 style_header("Append Comment To: %s", zPageName);
1530 if( !goodCaptcha ){
1531 @ <p class="generalError">Error: Incorrect security code.</p>
1532 }
1533 if( P("preview")!=0 ){
@@ -1544,11 +1555,11 @@
1555 @ <input type="submit" name="preview" value="Preview Your Comment" />
1556 @ <input type="submit" name="submit" value="Append Your Changes" />
1557 @ <input type="submit" name="cancel" value="Cancel" />
1558 captcha_generate(0);
1559 @ </form>
1560 style_finish_page();
1561 }
1562
1563 /*
1564 ** WEBPAGE: whistory
1565 ** URL: /whistory?name=PAGENAME
@@ -1564,10 +1575,11 @@
1575 Blob sql;
1576 Stmt q;
1577 login_check_credentials();
1578 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
1579 zPageName = PD("name","");
1580 style_set_current_feature("wiki");
1581 style_header("History Of %s", zPageName);
1582 blob_init(&sql, 0, 0);
1583 blob_append(&sql, timeline_query_for_www(), -1);
1584 blob_append_sql(&sql,
1585 "AND event.objid IN ("
@@ -1582,11 +1594,11 @@
1594 www_print_timeline(&q,
1595 TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_REFS,
1596 0, 0, 0, 0, 0, 0);
1597 db_finalize(&q);
1598 blob_reset(&sql);
1599 style_finish_page();
1600 }
1601
1602 /*
1603 ** WEBPAGE: wdiff
1604 **
@@ -1645,20 +1657,21 @@
1657 }
1658 nextRid = wiki_next(wiki_tagid(pW1->zWikiTitle),pW1->rDate);
1659 if( nextRid ){
1660 style_submenu_element("Next", "%R/wdiff?rid=%d", nextRid);
1661 }
1662 style_set_current_feature("wiki");
1663 style_header("Changes To %s", pW1->zWikiTitle);
1664 blob_zero(&d);
1665 diffFlags = construct_diff_flags(1);
1666 text_diff(&w2, &w1, &d, 0, diffFlags | DIFF_HTML | DIFF_LINENO);
1667 @ <pre class="udiff">
1668 @ %s(blob_str(&d))
1669 @ <pre>
1670 manifest_destroy(pW1);
1671 manifest_destroy(pW2);
1672 style_finish_page();
1673 }
1674
1675 /*
1676 ** A query that returns information about all wiki pages.
1677 **
@@ -1701,10 +1714,11 @@
1714 int showAll = P("all")!=0;
1715 int showRid = P("showid")!=0;
1716
1717 login_check_credentials();
1718 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
1719 style_set_current_feature("wiki");
1720 style_header("Available Wiki Pages");
1721 if( showAll ){
1722 style_submenu_element("Active", "%R/wcontent");
1723 }else{
1724 style_submenu_element("All", "%R/wcontent?all=1");
@@ -1756,11 +1770,11 @@
1770 fossil_free(zWDisplayName);
1771 }
1772 @ </tbody></table></div>
1773 db_finalize(&q);
1774 style_table_sorter();
1775 style_finish_page();
1776 }
1777
1778 /*
1779 ** WEBPAGE: wfind
1780 **
@@ -1771,10 +1785,11 @@
1785 Stmt q;
1786 const char *zTitle;
1787 login_check_credentials();
1788 if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; }
1789 zTitle = PD("title","*");
1790 style_set_current_feature("wiki");
1791 style_header("Wiki Pages Found");
1792 @ <ul>
1793 db_prepare(&q,
1794 "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'"
1795 " ORDER BY lower(tagname) /*sort*/" ,
@@ -1783,11 +1798,11 @@
1798 const char *zName = db_column_text(&q, 0);
1799 @ <li>%z(href("%R/wiki?name=%T",zName))%h(zName)</a></li>
1800 }
1801 db_finalize(&q);
1802 @ </ul>
1803 style_finish_page();
1804 }
1805
1806 /*
1807 ** Add a new wiki page to the repository. The page name is
1808 ** given by the zPageName parameter. rid must be zero to create
1809
+3 -2
--- src/xfersetup.c
+++ src/xfersetup.c
@@ -85,11 +85,11 @@
8585
client_sync(syncFlags, 0, 0, 0);
8686
@ </pre>
8787
}
8888
}
8989
90
- style_finish_page("xfersetup");
90
+ style_finish_page();
9191
}
9292
9393
/*
9494
** Common implementation for the transfer setup editor pages.
9595
*/
@@ -116,10 +116,11 @@
116116
isSubmit = P("submit")!=0;
117117
z = P("x");
118118
if( z==0 ){
119119
z = db_get(zDbField, zDfltValue);
120120
}
121
+ style_set_current_feature("xfersetup");
121122
style_header("Edit %s", zTitle);
122123
if( P("clear")!=0 ){
123124
login_verify_csrf_secret();
124125
db_unset(zDbField, 0);
125126
if( xRebuild ) xRebuild();
@@ -150,11 +151,11 @@
150151
@ <h2>Default %s(zTitle)</h2>
151152
@ <blockquote><pre>
152153
@ %h(zDfltValue)
153154
@ </pre></blockquote>
154155
}
155
- style_finish_page("xfersetup");
156
+ style_finish_page();
156157
}
157158
158159
static const char *zDefaultXferCommon = 0;
159160
160161
/*
161162
--- src/xfersetup.c
+++ src/xfersetup.c
@@ -85,11 +85,11 @@
85 client_sync(syncFlags, 0, 0, 0);
86 @ </pre>
87 }
88 }
89
90 style_finish_page("xfersetup");
91 }
92
93 /*
94 ** Common implementation for the transfer setup editor pages.
95 */
@@ -116,10 +116,11 @@
116 isSubmit = P("submit")!=0;
117 z = P("x");
118 if( z==0 ){
119 z = db_get(zDbField, zDfltValue);
120 }
 
121 style_header("Edit %s", zTitle);
122 if( P("clear")!=0 ){
123 login_verify_csrf_secret();
124 db_unset(zDbField, 0);
125 if( xRebuild ) xRebuild();
@@ -150,11 +151,11 @@
150 @ <h2>Default %s(zTitle)</h2>
151 @ <blockquote><pre>
152 @ %h(zDfltValue)
153 @ </pre></blockquote>
154 }
155 style_finish_page("xfersetup");
156 }
157
158 static const char *zDefaultXferCommon = 0;
159
160 /*
161
--- src/xfersetup.c
+++ src/xfersetup.c
@@ -85,11 +85,11 @@
85 client_sync(syncFlags, 0, 0, 0);
86 @ </pre>
87 }
88 }
89
90 style_finish_page();
91 }
92
93 /*
94 ** Common implementation for the transfer setup editor pages.
95 */
@@ -116,10 +116,11 @@
116 isSubmit = P("submit")!=0;
117 z = P("x");
118 if( z==0 ){
119 z = db_get(zDbField, zDfltValue);
120 }
121 style_set_current_feature("xfersetup");
122 style_header("Edit %s", zTitle);
123 if( P("clear")!=0 ){
124 login_verify_csrf_secret();
125 db_unset(zDbField, 0);
126 if( xRebuild ) xRebuild();
@@ -150,11 +151,11 @@
151 @ <h2>Default %s(zTitle)</h2>
152 @ <blockquote><pre>
153 @ %h(zDfltValue)
154 @ </pre></blockquote>
155 }
156 style_finish_page();
157 }
158
159 static const char *zDefaultXferCommon = 0;
160
161 /*
162
+3 -2
--- src/zip.c
+++ src/zip.c
@@ -944,10 +944,11 @@
944944
if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
945945
if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
946946
zKey = blob_str(&cacheKey);
947947
etag_check(ETAG_HASH, zKey);
948948
949
+ style_set_current_feature("zip");
949950
if( P("debug")!=0 ){
950951
style_header("%s Archive Generator Debug Screen", zType);
951952
@ zName = "%h(zName)"<br />
952953
@ rid = %d(rid)<br />
953954
if( zInclude ){
@@ -955,11 +956,11 @@
955956
}
956957
if( zExclude ){
957958
@ zExclude = "%h(zExclude)"<br />
958959
}
959960
@ zKey = "%h(zKey)"
960
- style_finish_page("zip");
961
+ style_finish_page();
961962
return;
962963
}
963964
if( referred_from_login() ){
964965
style_header("%s Archive Download", zType);
965966
@ <form action='%R/%s(g.zPath)/%h(zName).%s(g.zPath)'>
@@ -966,11 +967,11 @@
966967
cgi_query_parameters_to_hidden();
967968
@ <p>%s(zType) Archive named <b>%h(zName).%s(g.zPath)</b>
968969
@ holding the content of check-in <b>%h(zRid)</b>:
969970
@ <input type="submit" value="Download" />
970971
@ </form>
971
- style_finish_page("zip");
972
+ style_finish_page();
972973
return;
973974
}
974975
blob_zero(&zip);
975976
if( cache_read(&zip, zKey)==0 ){
976977
zip_of_checkin(eType, rid, &zip, zName, pInclude, pExclude);
977978
--- src/zip.c
+++ src/zip.c
@@ -944,10 +944,11 @@
944 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
945 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
946 zKey = blob_str(&cacheKey);
947 etag_check(ETAG_HASH, zKey);
948
 
949 if( P("debug")!=0 ){
950 style_header("%s Archive Generator Debug Screen", zType);
951 @ zName = "%h(zName)"<br />
952 @ rid = %d(rid)<br />
953 if( zInclude ){
@@ -955,11 +956,11 @@
955 }
956 if( zExclude ){
957 @ zExclude = "%h(zExclude)"<br />
958 }
959 @ zKey = "%h(zKey)"
960 style_finish_page("zip");
961 return;
962 }
963 if( referred_from_login() ){
964 style_header("%s Archive Download", zType);
965 @ <form action='%R/%s(g.zPath)/%h(zName).%s(g.zPath)'>
@@ -966,11 +967,11 @@
966 cgi_query_parameters_to_hidden();
967 @ <p>%s(zType) Archive named <b>%h(zName).%s(g.zPath)</b>
968 @ holding the content of check-in <b>%h(zRid)</b>:
969 @ <input type="submit" value="Download" />
970 @ </form>
971 style_finish_page("zip");
972 return;
973 }
974 blob_zero(&zip);
975 if( cache_read(&zip, zKey)==0 ){
976 zip_of_checkin(eType, rid, &zip, zName, pInclude, pExclude);
977
--- src/zip.c
+++ src/zip.c
@@ -944,10 +944,11 @@
944 if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
945 if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
946 zKey = blob_str(&cacheKey);
947 etag_check(ETAG_HASH, zKey);
948
949 style_set_current_feature("zip");
950 if( P("debug")!=0 ){
951 style_header("%s Archive Generator Debug Screen", zType);
952 @ zName = "%h(zName)"<br />
953 @ rid = %d(rid)<br />
954 if( zInclude ){
@@ -955,11 +956,11 @@
956 }
957 if( zExclude ){
958 @ zExclude = "%h(zExclude)"<br />
959 }
960 @ zKey = "%h(zKey)"
961 style_finish_page();
962 return;
963 }
964 if( referred_from_login() ){
965 style_header("%s Archive Download", zType);
966 @ <form action='%R/%s(g.zPath)/%h(zName).%s(g.zPath)'>
@@ -966,11 +967,11 @@
967 cgi_query_parameters_to_hidden();
968 @ <p>%s(zType) Archive named <b>%h(zName).%s(g.zPath)</b>
969 @ holding the content of check-in <b>%h(zRid)</b>:
970 @ <input type="submit" value="Download" />
971 @ </form>
972 style_finish_page();
973 return;
974 }
975 blob_zero(&zip);
976 if( cache_read(&zip, zKey)==0 ){
977 zip_of_checkin(eType, rid, &zip, zName, pInclude, pExclude);
978
--- www/contribute.wiki
+++ www/contribute.wiki
@@ -1,83 +1,124 @@
11
<title>Contributing To Fossil</title>
22
3
-Users are encouraged to contributed enhancements back to the Fossil
3
+Fossil users are encouraged to contributed enhancements back to the
44
project. This note outlines some of the procedures for making
55
useful contributions.
66
77
<h2>1.0 Contributor Agreement</h2>
88
9
-In order to accept your contributions, we <u>must</u> have a
9
+In order to accept non-trivial contributions, we <u>must</u> have a
1010
[./copyright-release.pdf | Contributor Agreement (PDF)]
1111
(or [./copyright-release.html | as HTML]) on file for you. We require
1212
this in order to maintain clear title to the Fossil code and prevent
1313
the introduction of code with incompatible licenses or other entanglements
14
-that might cause legal problems for Fossil users. Many larger companies
15
-and other lawyer-rich organizations require this as a precondition to using
14
+that might cause legal problems for Fossil users. Many
15
+lawyer-rich organizations require this as a precondition to using
1616
Fossil.
1717
1818
If you do not wish to submit a Contributor Agreement, we would still
1919
welcome your suggestions and example code, but we will not use your code
20
-directly - we will be forced to re-implement your changes from scratch which
20
+directly: we will be forced to re-implement your changes from scratch, which
2121
might take longer.
22
+
23
+We've made exceptions for "trivial" changes in the past, but the
24
+definition of that term is up to the project leader.
2225
2326
<h2>2.0 Submitting Patches</h2>
2427
2528
Suggested changes or bug fixes can be submitted by creating a patch
26
-against the current source tree. Email patches to
29
+against the current source tree:
30
+
31
+ <tt>fossil diff -i > my-change.patch</tt>
32
+
33
+Post patches to
34
+[https://fossil-scm.org/forum | the forum] or email them to
2735
<a href="mailto:[email protected]">[email protected]</a>. Be sure to
2836
describe in detail what the patch does and which version of Fossil
29
-it is written against.
30
-
31
-A contributor agreement is not strictly necessary to submit a patch.
32
-However, without a contributor agreement on file, your patch will be
33
-used for reference only - it will not be applied to the code. This
34
-may delay acceptance of your patch.
35
-
36
-Your patches or changes might not be accepted even if you do have
37
+it is written against. It's best to make patches against tip-of-trunk
38
+rather than against past releases.
39
+
40
+If your change is more complicated than a patch can properly encode, you
41
+may submit [/help?cmd=bundle | a Fossil bundle] instead. Unlike patches,
42
+bundles can contain multiple commits, check-in comments, file renames,
43
+file deletions, branching decisions, and more which <tt>patch(1)</tt>
44
+files cannot. It's best to make a bundle of a new branch so the change
45
+can be integrated, tested, enhanced, and merged down to trunk in a
46
+controlled fashion.
47
+
48
+A contributor agreement is not strictly necessary to submit a patch or bundle,
49
+but without a contributor agreement on file, your contribution will be
50
+used for reference only: it will not be applied to the code. This
51
+may delay acceptance of your contribution.
52
+
53
+Your contribution might not be accepted even if you do have
3754
a contributor agreement on file. Please do not take this personally
38
-or as an affront to your coding ability. Sometimes patches are rejected
55
+or as an affront to your coding ability. Sometimes contributions are rejected
3956
because they seem to be taking the project in a direction that the
40
-architect does not want to go. Or, there might be an alternative
57
+architect does not want to go. In other cases, there might be an alternative
4158
implementation of the same feature being prepared separately.
4259
4360
<h2>3.0 Check-in Privileges</h2>
4461
4562
Check-in privileges are granted on a case-by-case basis. Your chances
4663
of getting check-in privileges are much improved if you have a history
47
-of submitting quality patches and/or making thoughtful posts on the
48
-[http://www.mail-archive.com/[email protected]/ | mailing list].
49
-A contributor agreement is, of course, a prerequisite for check-in
64
+of submitting quality patches and/or making thoughtful posts on
65
+[https://fossil-scm.org/forum | the forum].
66
+A signed contributor agreement is, of course, a prerequisite for check-in
5067
privileges.</p>
5168
5269
Contributors are asked to make all non-trivial changes on a branch. The
5370
Fossil Architect (Richard Hipp) will merge changes onto the trunk.</p>
5471
55
-Contributors are required to following the
72
+Contributors are required to follow the
5673
[./checkin.wiki | pre-checkin checklist] prior to every check-in to
5774
the Fossil self-hosting repository. This checklist is short and succinct
5875
and should only require a few seconds to follow. Contributors
5976
should print out a copy of the pre-checkin checklist and keep
60
-it on a note card beside their workstations, for quick reference.
77
+it on a note card beside their workstations for quick reference.
6178
6279
Contributors should review the
6380
[./style.wiki | Coding Style Guidelines] and mimic the coding style
6481
used through the rest of the Fossil source code. Your code should
6582
blend in. A third-party reader should be unable to distinguish your
6683
code from any other code in the source corpus.
6784
6885
<h2>4.0 Testing</h2>
6986
70
-Fossil has the beginnings of a
71
-[../test/release-checklist.wiki | release checklist] but this is an
72
-area that needs further work. (Your contributions here are welcomed!)
73
-Contributors with check-in privileges are expected to run the release
74
-checklist on any major changes they contribute, and if appropriate expand
75
-the checklist and/or the automated test scripts to cover their additions.
76
-
77
-
78
-<h2>5.0 See Also</h2>
87
+Fossil's [../test/release-checklist.wiki | release checklist] is of
88
+primary benefit to the project leader, followed by him at release time,
89
+but contributors are encouraged to run through its steps when making
90
+major changes, since if the change doesn't pass this checklist, it won't
91
+be included in the next release.
92
+
93
+<h2>5.0 UI and Documentation Language</h2>
94
+
95
+The Fossil project uses American English in its web interface and
96
+documentation. Until there is some provision for translating the UI and
97
+docs into other languages and dialects, we ask that you do not commit
98
+changes that conflict with this.
99
+
100
+We aren't opposed to such a project, but it would be a huge amount of
101
+work, which no one's stepped up to do yet. Not only is each individual
102
+translation a large ongoing job its own right, there is no
103
+infrastructure for it yet, so the first few translations will be harder
104
+than any future translation built on that infrastructure.
105
+
106
+More immediately, we're likely to reject, revert, or rework commits that
107
+use other English dialects. One example that comes up occasionally is
108
+"artefact" versus "artifact." The UI and docs use the American English
109
+spelling pervasively, so you have poor options if you insist on
110
+"artefact:"
111
+
112
+ * attempt to slip one-off changes by your peers
113
+ * attempt to change all American English usages to Commonwealth English
114
+ * make the Fossil UI and docs translatable, then contribute a
115
+ Commonwealth English translation
116
+
117
+Only the latter is likely to succeed.
118
+
119
+<h2>6.0 See Also</h2>
79120
80121
* [./build.wiki | How To Compile And Install Fossil]
81122
* [./makefile.wiki | The Fossil Build Process]
82123
* [./tech_overview.wiki | A Technical Overview of Fossil]
83124
* [./adding_code.wiki | Adding Features To Fossil]
84125
--- www/contribute.wiki
+++ www/contribute.wiki
@@ -1,83 +1,124 @@
1 <title>Contributing To Fossil</title>
2
3 Users are encouraged to contributed enhancements back to the Fossil
4 project. This note outlines some of the procedures for making
5 useful contributions.
6
7 <h2>1.0 Contributor Agreement</h2>
8
9 In order to accept your contributions, we <u>must</u> have a
10 [./copyright-release.pdf | Contributor Agreement (PDF)]
11 (or [./copyright-release.html | as HTML]) on file for you. We require
12 this in order to maintain clear title to the Fossil code and prevent
13 the introduction of code with incompatible licenses or other entanglements
14 that might cause legal problems for Fossil users. Many larger companies
15 and other lawyer-rich organizations require this as a precondition to using
16 Fossil.
17
18 If you do not wish to submit a Contributor Agreement, we would still
19 welcome your suggestions and example code, but we will not use your code
20 directly - we will be forced to re-implement your changes from scratch which
21 might take longer.
 
 
 
22
23 <h2>2.0 Submitting Patches</h2>
24
25 Suggested changes or bug fixes can be submitted by creating a patch
26 against the current source tree. Email patches to
 
 
 
 
 
27 <a href="mailto:[email protected]">[email protected]</a>. Be sure to
28 describe in detail what the patch does and which version of Fossil
29 it is written against.
30
31 A contributor agreement is not strictly necessary to submit a patch.
32 However, without a contributor agreement on file, your patch will be
33 used for reference only - it will not be applied to the code. This
34 may delay acceptance of your patch.
35
36 Your patches or changes might not be accepted even if you do have
 
 
 
 
 
 
 
 
 
37 a contributor agreement on file. Please do not take this personally
38 or as an affront to your coding ability. Sometimes patches are rejected
39 because they seem to be taking the project in a direction that the
40 architect does not want to go. Or, there might be an alternative
41 implementation of the same feature being prepared separately.
42
43 <h2>3.0 Check-in Privileges</h2>
44
45 Check-in privileges are granted on a case-by-case basis. Your chances
46 of getting check-in privileges are much improved if you have a history
47 of submitting quality patches and/or making thoughtful posts on the
48 [http://www.mail-archive.com/[email protected]/ | mailing list].
49 A contributor agreement is, of course, a prerequisite for check-in
50 privileges.</p>
51
52 Contributors are asked to make all non-trivial changes on a branch. The
53 Fossil Architect (Richard Hipp) will merge changes onto the trunk.</p>
54
55 Contributors are required to following the
56 [./checkin.wiki | pre-checkin checklist] prior to every check-in to
57 the Fossil self-hosting repository. This checklist is short and succinct
58 and should only require a few seconds to follow. Contributors
59 should print out a copy of the pre-checkin checklist and keep
60 it on a note card beside their workstations, for quick reference.
61
62 Contributors should review the
63 [./style.wiki | Coding Style Guidelines] and mimic the coding style
64 used through the rest of the Fossil source code. Your code should
65 blend in. A third-party reader should be unable to distinguish your
66 code from any other code in the source corpus.
67
68 <h2>4.0 Testing</h2>
69
70 Fossil has the beginnings of a
71 [../test/release-checklist.wiki | release checklist] but this is an
72 area that needs further work. (Your contributions here are welcomed!)
73 Contributors with check-in privileges are expected to run the release
74 checklist on any major changes they contribute, and if appropriate expand
75 the checklist and/or the automated test scripts to cover their additions.
76
77
78 <h2>5.0 See Also</h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
80 * [./build.wiki | How To Compile And Install Fossil]
81 * [./makefile.wiki | The Fossil Build Process]
82 * [./tech_overview.wiki | A Technical Overview of Fossil]
83 * [./adding_code.wiki | Adding Features To Fossil]
84
--- www/contribute.wiki
+++ www/contribute.wiki
@@ -1,83 +1,124 @@
1 <title>Contributing To Fossil</title>
2
3 Fossil users are encouraged to contributed enhancements back to the
4 project. This note outlines some of the procedures for making
5 useful contributions.
6
7 <h2>1.0 Contributor Agreement</h2>
8
9 In order to accept non-trivial contributions, we <u>must</u> have a
10 [./copyright-release.pdf | Contributor Agreement (PDF)]
11 (or [./copyright-release.html | as HTML]) on file for you. We require
12 this in order to maintain clear title to the Fossil code and prevent
13 the introduction of code with incompatible licenses or other entanglements
14 that might cause legal problems for Fossil users. Many
15 lawyer-rich organizations require this as a precondition to using
16 Fossil.
17
18 If you do not wish to submit a Contributor Agreement, we would still
19 welcome your suggestions and example code, but we will not use your code
20 directly: we will be forced to re-implement your changes from scratch, which
21 might take longer.
22
23 We've made exceptions for "trivial" changes in the past, but the
24 definition of that term is up to the project leader.
25
26 <h2>2.0 Submitting Patches</h2>
27
28 Suggested changes or bug fixes can be submitted by creating a patch
29 against the current source tree:
30
31 <tt>fossil diff -i > my-change.patch</tt>
32
33 Post patches to
34 [https://fossil-scm.org/forum | the forum] or email them to
35 <a href="mailto:[email protected]">[email protected]</a>. Be sure to
36 describe in detail what the patch does and which version of Fossil
37 it is written against. It's best to make patches against tip-of-trunk
38 rather than against past releases.
39
40 If your change is more complicated than a patch can properly encode, you
41 may submit [/help?cmd=bundle | a Fossil bundle] instead. Unlike patches,
42 bundles can contain multiple commits, check-in comments, file renames,
43 file deletions, branching decisions, and more which <tt>patch(1)</tt>
44 files cannot. It's best to make a bundle of a new branch so the change
45 can be integrated, tested, enhanced, and merged down to trunk in a
46 controlled fashion.
47
48 A contributor agreement is not strictly necessary to submit a patch or bundle,
49 but without a contributor agreement on file, your contribution will be
50 used for reference only: it will not be applied to the code. This
51 may delay acceptance of your contribution.
52
53 Your contribution might not be accepted even if you do have
54 a contributor agreement on file. Please do not take this personally
55 or as an affront to your coding ability. Sometimes contributions are rejected
56 because they seem to be taking the project in a direction that the
57 architect does not want to go. In other cases, there might be an alternative
58 implementation of the same feature being prepared separately.
59
60 <h2>3.0 Check-in Privileges</h2>
61
62 Check-in privileges are granted on a case-by-case basis. Your chances
63 of getting check-in privileges are much improved if you have a history
64 of submitting quality patches and/or making thoughtful posts on
65 [https://fossil-scm.org/forum | the forum].
66 A signed contributor agreement is, of course, a prerequisite for check-in
67 privileges.</p>
68
69 Contributors are asked to make all non-trivial changes on a branch. The
70 Fossil Architect (Richard Hipp) will merge changes onto the trunk.</p>
71
72 Contributors are required to follow the
73 [./checkin.wiki | pre-checkin checklist] prior to every check-in to
74 the Fossil self-hosting repository. This checklist is short and succinct
75 and should only require a few seconds to follow. Contributors
76 should print out a copy of the pre-checkin checklist and keep
77 it on a note card beside their workstations for quick reference.
78
79 Contributors should review the
80 [./style.wiki | Coding Style Guidelines] and mimic the coding style
81 used through the rest of the Fossil source code. Your code should
82 blend in. A third-party reader should be unable to distinguish your
83 code from any other code in the source corpus.
84
85 <h2>4.0 Testing</h2>
86
87 Fossil's [../test/release-checklist.wiki | release checklist] is of
88 primary benefit to the project leader, followed by him at release time,
89 but contributors are encouraged to run through its steps when making
90 major changes, since if the change doesn't pass this checklist, it won't
91 be included in the next release.
92
93 <h2>5.0 UI and Documentation Language</h2>
94
95 The Fossil project uses American English in its web interface and
96 documentation. Until there is some provision for translating the UI and
97 docs into other languages and dialects, we ask that you do not commit
98 changes that conflict with this.
99
100 We aren't opposed to such a project, but it would be a huge amount of
101 work, which no one's stepped up to do yet. Not only is each individual
102 translation a large ongoing job its own right, there is no
103 infrastructure for it yet, so the first few translations will be harder
104 than any future translation built on that infrastructure.
105
106 More immediately, we're likely to reject, revert, or rework commits that
107 use other English dialects. One example that comes up occasionally is
108 "artefact" versus "artifact." The UI and docs use the American English
109 spelling pervasively, so you have poor options if you insist on
110 "artefact:"
111
112 * attempt to slip one-off changes by your peers
113 * attempt to change all American English usages to Commonwealth English
114 * make the Fossil UI and docs translatable, then contribute a
115 Commonwealth English translation
116
117 Only the latter is likely to succeed.
118
119 <h2>6.0 See Also</h2>
120
121 * [./build.wiki | How To Compile And Install Fossil]
122 * [./makefile.wiki | The Fossil Build Process]
123 * [./tech_overview.wiki | A Technical Overview of Fossil]
124 * [./adding_code.wiki | Adding Features To Fossil]
125
--- www/customskin.md
+++ www/customskin.md
@@ -84,11 +84,23 @@
8484
<meta http-equiv="Content-Security-Policy" content="...." />
8585
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8686
<title>....</title>
8787
<link rel="stylesheet" href="..." type="text/css" />
8888
</head>
89
- <body>
89
+ <body class="FEATURE">
90
+
91
+…where `FEATURE` is either the top-level URL element (e.g. `doc`) or a
92
+feature class that groups multiple URLs under a single name such as
93
+`forum` to contain `/forummain`, `/forumpost`, `/forume2`, etc. This
94
+allows per-feature CSS such as
95
+
96
+ body.forum div.markdown blockquote {
97
+ margin-left: 10px;
98
+ }
99
+
100
+That is, affect HTML `<blockquote>` tags specially only for forum posts
101
+written in Markdown, leaving all other block quotes alone.
90102
91103
In most cases, it is best to leave the Fossil-generated HTML Header
92104
alone. (One exception is when the administrator needs to include links
93105
to additional CSS files.) The configurable part of the skin begins
94106
with the Content Header section which should follow this template:
95107
--- www/customskin.md
+++ www/customskin.md
@@ -84,11 +84,23 @@
84 <meta http-equiv="Content-Security-Policy" content="...." />
85 <meta name="viewport" content="width=device-width, initial-scale=1.0">
86 <title>....</title>
87 <link rel="stylesheet" href="..." type="text/css" />
88 </head>
89 <body>
 
 
 
 
 
 
 
 
 
 
 
 
90
91 In most cases, it is best to leave the Fossil-generated HTML Header
92 alone. (One exception is when the administrator needs to include links
93 to additional CSS files.) The configurable part of the skin begins
94 with the Content Header section which should follow this template:
95
--- www/customskin.md
+++ www/customskin.md
@@ -84,11 +84,23 @@
84 <meta http-equiv="Content-Security-Policy" content="...." />
85 <meta name="viewport" content="width=device-width, initial-scale=1.0">
86 <title>....</title>
87 <link rel="stylesheet" href="..." type="text/css" />
88 </head>
89 <body class="FEATURE">
90
91 …where `FEATURE` is either the top-level URL element (e.g. `doc`) or a
92 feature class that groups multiple URLs under a single name such as
93 `forum` to contain `/forummain`, `/forumpost`, `/forume2`, etc. This
94 allows per-feature CSS such as
95
96 body.forum div.markdown blockquote {
97 margin-left: 10px;
98 }
99
100 That is, affect HTML `<blockquote>` tags specially only for forum posts
101 written in Markdown, leaving all other block quotes alone.
102
103 In most cases, it is best to leave the Fossil-generated HTML Header
104 alone. (One exception is when the administrator needs to include links
105 to additional CSS files.) The configurable part of the skin begins
106 with the Content Header section which should follow this template:
107
--- www/json-api/intro.md
+++ www/json-api/intro.md
@@ -140,61 +140,33 @@
140140
# Technical Problems and Considerations
141141
142142
A random list of considerations which need to be made and potential
143143
problem areas...
144144
145
-- **Binary data:** HTML4 and JavaScript have no portable way of
146
- handling binary data, so commands which could potentially deal with
147
- binary data (e.g. committing a file) are ruled out for the time
148
- being. HTML5 and accompanying JavaScript additions will binary
149
- data usable client-side. That said, a JSON interface cannot natively
150
- work with binary unless it is encoded (base64 or hex or whatever),
151
- and such encoding would have to be understood on both the server and
152
- client sides, which may rule out usage in some environments.\
153
- **Status:** deferred until needed. My current thinking is to send
154
- URLs instead of binary data, and the URLs would point to some path
155
- which produces the raw artifact content. We could read POSTed binary
156
- input, but this might require some re-tooling of fossil's innards
157
- and it precludes the use of a JSON request envelope, so it would be
158
- limited to requests which can be configured solely via GET arguments
159
- (as opposed to POST envelope/payload options). i.e. configure the
160
- JSON bits via GET and POST the binary data.
161
-- **64-bit integers:** JSON does not specify integer precision,
162
- probably because it targets many different platforms and not all
163
- of them can support more than 32 bits. JavaScript (from which JSON
164
- derives) supports 53 bits of integer precision. That said, it's
165
- "highly unlikely" that we'll have any range problems with "only"
166
- 53 bits of precision. The underlying JSON API supports *signed*
167
- 32- or 64-bit integers on both 32- and 64-bit builds, but only if
168
- "long long" or `int64_t` are available (from the C99 header
169
- `stdint.h`). Only multi-gig repositories are ever expected to use
170
- large numbers, and even then only rarely (e.g. via the "stat"
171
- command).
172
-- **Timestamps:** for portability this API uses GMT Unix Epoch
173
- timestamps. They are the most portable time representation out
174
- there, easily usable in most programming environments. (In hindsight,
175
- this should have been Unix + Milliseconds, but the API already
176
- pervasively uses seconds-precision.)
177
-- **Artifact vs. Artefact:** both are correct vis-a-vis the
178
- english language but Fossil consistently uses the former, so we’ll
179
- use that.
180
-- **Multiple logins per user:** fossil currently does not allow
181
- multiple active logins for a given user except anonymous. For all
182
- others, the most recent login wins. This is only a very minor
183
- annoyance for the HTML interface but will be more problematic for
184
- JSON clients. e.g. a user might have a ticket poller and a commit poller
185
- running, and both would need to be logged in.\
186
- **Status:** as of 20120315 (commit
187
- [*73038baaa3*](http://www.fossil-scm.org/index.html/info/73038baaa3)),
188
- fossil allows a user to be logged in multiple times (confirm: only
189
- within the same network?). The only caveat is that if any one of
190
- them logs out, it will invalidate the login session for the others.
191
- This is good enough for the time being, however. It will likely only
192
- become painful if we actually get enough apps in the wild that
193
- someone might have some running on his mobile phone and some on his
194
- PC and some on his server. The workarounds for now are (A) not to
195
- log out and (B) program apps/applets/widgets to try to re-login
196
- occasionally. Fossil will at some point expire the login, anyway.
197
- FIXME: update the expiry time on each request? To do that right we'd
198
- have to re-set the cookie on each request :/. We could optionally
199
- add a new JSON request which simply updates the login cookie
200
- lifetime (e.g. /json/keepalive or expand /json/whoami to do that).
145
+- **Binary data:** JSON is a text serialization method, and it takes
146
+ up the “payload” area of each HTTP request, so there is no
147
+ reasonable way to include binary data in the JSON message without
148
+ some sort of codec like Base64, for which there is no provision in
149
+ the current JSON API. You will therefore find no JSON API for
150
+ committing changes to a file in the repository, for example. Other
151
+ Fossil APIs such as [`/raw`](/help?cmd=/raw) or
152
+ [`/fileedit`](../fileedit-page.md) may serve you better.
153
+- **64-bit integers:** The JSON standard does not specify integer precision,
154
+ because it targets many different platforms, and not all of
155
+ them can support more than 32 bits. JavaScript (from which JSON
156
+ derives) supports 53 bits of integer precision, which may affect how
157
+ a given client-side JSON implementation sends large integers to Fossil’s JSON
158
+ API. Our JSON parser can cope with integers larger than 32 bits on input, and it
159
+ can emit them, but it requires platform support. If you’re running
160
+ Fossil on a 64-bit host, you should not run into problems in
161
+ this area, but if you’re on a legacy 32-bit only or a mixed 32/64-bit
162
+ system, it’s possible that some integers in the API could be
163
+ clipped. Realize however that this is a rare case: Fossil currently
164
+ cannot store files large enough to exceed a 32-bit `size_t` value,
165
+ and `time_t` won’t roll past 32-bit integers until 2038. We’re aware
166
+ of no other uses of integers in this API that could even in
167
+ principle exceed the range of a 32-bit integer.
168
+- **Timestamps:** For portability, this API uses UTC Unix epoch
169
+ timestamps. (`time_t`) They are the most portable time representation out
170
+ there, easily usable in most programming environments. (In
171
+ hindsight, we might better have used a higher-precision time format,
172
+ but changing that now would break API compatibility.)
201173
--- www/json-api/intro.md
+++ www/json-api/intro.md
@@ -140,61 +140,33 @@
140 # Technical Problems and Considerations
141
142 A random list of considerations which need to be made and potential
143 problem areas...
144
145 - **Binary data:** HTML4 and JavaScript have no portable way of
146 handling binary data, so commands which could potentially deal with
147 binary data (e.g. committing a file) are ruled out for the time
148 being. HTML5 and accompanying JavaScript additions will binary
149 data usable client-side. That said, a JSON interface cannot natively
150 work with binary unless it is encoded (base64 or hex or whatever),
151 and such encoding would have to be understood on both the server and
152 client sides, which may rule out usage in some environments.\
153 **Status:** deferred until needed. My current thinking is to send
154 URLs instead of binary data, and the URLs would point to some path
155 which produces the raw artifact content. We could read POSTed binary
156 input, but this might require some re-tooling of fossil's innards
157 and it precludes the use of a JSON request envelope, so it would be
158 limited to requests which can be configured solely via GET arguments
159 (as opposed to POST envelope/payload options). i.e. configure the
160 JSON bits via GET and POST the binary data.
161 - **64-bit integers:** JSON does not specify integer precision,
162 probably because it targets many different platforms and not all
163 of them can support more than 32 bits. JavaScript (from which JSON
164 derives) supports 53 bits of integer precision. That said, it's
165 "highly unlikely" that we'll have any range problems with "only"
166 53 bits of precision. The underlying JSON API supports *signed*
167 32- or 64-bit integers on both 32- and 64-bit builds, but only if
168 "long long" or `int64_t` are available (from the C99 header
169 `stdint.h`). Only multi-gig repositories are ever expected to use
170 large numbers, and even then only rarely (e.g. via the "stat"
171 command).
172 - **Timestamps:** for portability this API uses GMT Unix Epoch
173 timestamps. They are the most portable time representation out
174 there, easily usable in most programming environments. (In hindsight,
175 this should have been Unix + Milliseconds, but the API already
176 pervasively uses seconds-precision.)
177 - **Artifact vs. Artefact:** both are correct vis-a-vis the
178 english language but Fossil consistently uses the former, so we’ll
179 use that.
180 - **Multiple logins per user:** fossil currently does not allow
181 multiple active logins for a given user except anonymous. For all
182 others, the most recent login wins. This is only a very minor
183 annoyance for the HTML interface but will be more problematic for
184 JSON clients. e.g. a user might have a ticket poller and a commit poller
185 running, and both would need to be logged in.\
186 **Status:** as of 20120315 (commit
187 [*73038baaa3*](http://www.fossil-scm.org/index.html/info/73038baaa3)),
188 fossil allows a user to be logged in multiple times (confirm: only
189 within the same network?). The only caveat is that if any one of
190 them logs out, it will invalidate the login session for the others.
191 This is good enough for the time being, however. It will likely only
192 become painful if we actually get enough apps in the wild that
193 someone might have some running on his mobile phone and some on his
194 PC and some on his server. The workarounds for now are (A) not to
195 log out and (B) program apps/applets/widgets to try to re-login
196 occasionally. Fossil will at some point expire the login, anyway.
197 FIXME: update the expiry time on each request? To do that right we'd
198 have to re-set the cookie on each request :/. We could optionally
199 add a new JSON request which simply updates the login cookie
200 lifetime (e.g. /json/keepalive or expand /json/whoami to do that).
201
--- www/json-api/intro.md
+++ www/json-api/intro.md
@@ -140,61 +140,33 @@
140 # Technical Problems and Considerations
141
142 A random list of considerations which need to be made and potential
143 problem areas...
144
145 - **Binary data:** JSON is a text serialization method, and it takes
146 up the “payload” area of each HTTP request, so there is no
147 reasonable way to include binary data in the JSON message without
148 some sort of codec like Base64, for which there is no provision in
149 the current JSON API. You will therefore find no JSON API for
150 committing changes to a file in the repository, for example. Other
151 Fossil APIs such as [`/raw`](/help?cmd=/raw) or
152 [`/fileedit`](../fileedit-page.md) may serve you better.
153 - **64-bit integers:** The JSON standard does not specify integer precision,
154 because it targets many different platforms, and not all of
155 them can support more than 32 bits. JavaScript (from which JSON
156 derives) supports 53 bits of integer precision, which may affect how
157 a given client-side JSON implementation sends large integers to Fossil’s JSON
158 API. Our JSON parser can cope with integers larger than 32 bits on input, and it
159 can emit them, but it requires platform support. If you’re running
160 Fossil on a 64-bit host, you should not run into problems in
161 this area, but if you’re on a legacy 32-bit only or a mixed 32/64-bit
162 system, it’s possible that some integers in the API could be
163 clipped. Realize however that this is a rare case: Fossil currently
164 cannot store files large enough to exceed a 32-bit `size_t` value,
165 and `time_t` won’t roll past 32-bit integers until 2038. We’re aware
166 of no other uses of integers in this API that could even in
167 principle exceed the range of a 32-bit integer.
168 - **Timestamps:** For portability, this API uses UTC Unix epoch
169 timestamps. (`time_t`) They are the most portable time representation out
170 there, easily usable in most programming environments. (In
171 hindsight, we might better have used a higher-precision time format,
172 but changing that now would break API compatibility.)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173

Keyboard Shortcuts

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