Fossil SCM
Merge the styling changes from trunk into the chatroom-dev branch.
Commit
b8d6319b5a15e440b47dc9059fc2b4c9b7b5d8b6758fafeb827402ae292b163a
Parent
99689132ca06a70…
59 files changed
+1
-1
+25
-14
+9
-5
+4
-2
+6
-3
+4
-4
+2
-1
+4
-2
+4
-2
+1
-1
+1
-1
+2
-1
+2
-1
+4
-2
+10
-9
+6
-4
+2
-1
+2
-2
+4
-3
+11
-6
+22
-16
+3
-2
+2
-1
+5
-4
+3
-2
+1
-1
+6
-6
+2
-1
+2
-1
+1
-1
+2
-1
+2
-1
+10
-7
+6
-5
+6
-6
+30
-15
+12
-7
+3
-3
+5
-3
+12
-6
+4
-2
+12
-7
+1
-1
+43
-11
+2
-2
+2
-2
+1
-1
+6
-4
+17
-11
+6
-3
+2
-2
+1
-1
+9
-5
+30
-15
+3
-2
+3
-2
+71
-30
+13
-1
+28
-56
~
skins/bootstrap/header.txt
~
src/alerts.c
~
src/attach.c
~
src/backlink.c
~
src/branch.c
~
src/browse.c
~
src/builtin.c
~
src/cache.c
~
src/captcha.c
~
src/clone.c
~
src/cookies.c
~
src/descendants.c
~
src/diff.c
~
src/dispatch.c
~
src/doc.c
~
src/event.c
~
src/extcgi.c
~
src/fileedit.c
~
src/finfo.c
~
src/forum.c
~
src/info.c
~
src/interwiki.c
~
src/loadctrl.c
~
src/login.c
~
src/main.c
~
src/moderate.c
~
src/name.c
~
src/path.c
~
src/piechart.c
~
src/pikchrshow.c
~
src/printf.c
~
src/repolist.c
~
src/report.c
~
src/search.c
~
src/security_audit.c
~
src/setup.c
~
src/setupuser.c
~
src/shun.c
~
src/sitemap.c
~
src/skins.c
~
src/smtp.c
~
src/stat.c
~
src/statrep.c
~
src/style.c
~
src/tag.c
~
src/tar.c
~
src/th_main.c
~
src/timeline.c
~
src/tkt.c
~
src/tktsetup.c
~
src/unversioned.c
~
src/user.c
~
src/webmail.c
~
src/wiki.c
~
src/xfersetup.c
~
src/zip.c
~
www/contribute.wiki
~
www/customskin.md
~
www/json-api/intro.md
+1
-1
| --- skins/bootstrap/header.txt | ||
| +++ skins/bootstrap/header.txt | ||
| @@ -14,11 +14,11 @@ | ||
| 14 | 14 | if(!e) throw new Error("Expecting element with ID "+x); |
| 15 | 15 | else return e; |
| 16 | 16 | } |
| 17 | 17 | </script> |
| 18 | 18 | </head> |
| 19 | - <body data-spy="scroll" data-target=".sidebar"> | |
| 19 | + <body data-spy="scroll" data-target=".sidebar" class="$current_feature"> | |
| 20 | 20 | <div id="wrap"> |
| 21 | 21 | <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> |
| 22 | 22 | <div class="container"> |
| 23 | 23 | <div class="navbar-header"> |
| 24 | 24 | <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> |
| 25 | 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"> |
| 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 @@ | ||
| 171 | 171 | ** |
| 172 | 172 | ** If the subscriber table does exist, return 0 without doing anything. |
| 173 | 173 | */ |
| 174 | 174 | static int alert_webpages_disabled(void){ |
| 175 | 175 | if( alert_tables_exist() ) return 0; |
| 176 | + style_set_current_feature("alerts"); | |
| 176 | 177 | style_header("Email Alerts Are Disabled"); |
| 177 | 178 | @ <p>Email alerts are disabled on this server</p> |
| 178 | - style_finish_page("alerts"); | |
| 179 | + style_finish_page(); | |
| 179 | 180 | return 1; |
| 180 | 181 | } |
| 181 | 182 | |
| 182 | 183 | /* |
| 183 | 184 | ** Insert a "Subscriber List" submenu link if the current user |
| @@ -216,10 +217,11 @@ | ||
| 216 | 217 | } |
| 217 | 218 | db_begin_transaction(); |
| 218 | 219 | |
| 219 | 220 | alert_submenu_common(); |
| 220 | 221 | style_submenu_element("Send Announcement","%R/announce"); |
| 222 | + style_set_current_feature("alerts"); | |
| 221 | 223 | style_header("Email Notification Setup"); |
| 222 | 224 | @ <h1>Status</h1> |
| 223 | 225 | @ <table class="label-value"> |
| 224 | 226 | if( alert_enabled() ){ |
| 225 | 227 | stats_for_email(); |
| @@ -308,11 +310,11 @@ | ||
| 308 | 310 | @ <hr> |
| 309 | 311 | |
| 310 | 312 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 311 | 313 | @ </div></form> |
| 312 | 314 | db_end_transaction(0); |
| 313 | - style_finish_page("alerts"); | |
| 315 | + style_finish_page(); | |
| 314 | 316 | } |
| 315 | 317 | |
| 316 | 318 | #if 0 |
| 317 | 319 | /* |
| 318 | 320 | ** Encode pMsg as MIME base64 and append it to pOut |
| @@ -1364,10 +1366,11 @@ | ||
| 1364 | 1366 | } |
| 1365 | 1367 | if( !g.perm.Admin && !db_get_boolean("anon-subscribe",1) ){ |
| 1366 | 1368 | register_page(); |
| 1367 | 1369 | return; |
| 1368 | 1370 | } |
| 1371 | + style_set_current_feature("alerts"); | |
| 1369 | 1372 | alert_submenu_common(); |
| 1370 | 1373 | needCaptcha = !login_is_individual(); |
| 1371 | 1374 | if( P("submit") |
| 1372 | 1375 | && cgi_csrf_safe(1) |
| 1373 | 1376 | && subscribe_error_check(&eErr,&zErr,needCaptcha) |
| @@ -1435,11 +1438,11 @@ | ||
| 1435 | 1438 | @ <p>An email has been sent to "%h(zEAddr)". That email contains a |
| 1436 | 1439 | @ hyperlink that you must click to activate your |
| 1437 | 1440 | @ subscription.</p> |
| 1438 | 1441 | } |
| 1439 | 1442 | alert_sender_free(pSender); |
| 1440 | - style_finish_page("alerts"); | |
| 1443 | + style_finish_page(); | |
| 1441 | 1444 | } |
| 1442 | 1445 | return; |
| 1443 | 1446 | } |
| 1444 | 1447 | style_header("Signup For Email Alerts"); |
| 1445 | 1448 | if( P("submit")==0 ){ |
| @@ -1552,11 +1555,11 @@ | ||
| 1552 | 1555 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 1553 | 1556 | @ </td></tr></table></div> |
| 1554 | 1557 | } |
| 1555 | 1558 | @ </form> |
| 1556 | 1559 | fossil_free(zErr); |
| 1557 | - style_finish_page("alerts"); | |
| 1560 | + style_finish_page(); | |
| 1558 | 1561 | } |
| 1559 | 1562 | |
| 1560 | 1563 | /* |
| 1561 | 1564 | ** Either shutdown or completely delete a subscription entry given |
| 1562 | 1565 | ** by the hex value zName. Then paint a webpage that explains that |
| @@ -1572,10 +1575,11 @@ | ||
| 1572 | 1575 | if( db_step(&q)==SQLITE_ROW ){ |
| 1573 | 1576 | zEmail = db_column_text(&q, 0); |
| 1574 | 1577 | zLogin = db_column_text(&q, 1); |
| 1575 | 1578 | uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", zLogin); |
| 1576 | 1579 | } |
| 1580 | + style_set_current_feature("alerts"); | |
| 1577 | 1581 | if( zEmail==0 ){ |
| 1578 | 1582 | style_header("Unsubscribe Fail"); |
| 1579 | 1583 | @ <p>Unable to locate a subscriber with the requested key</p> |
| 1580 | 1584 | }else{ |
| 1581 | 1585 | |
| @@ -1590,11 +1594,11 @@ | ||
| 1590 | 1594 | @ <a href="%R/setup_uedit?id=%d(uid)">edit or delete |
| 1591 | 1595 | @ the corresponding user "%h(zLogin)"</a></p> |
| 1592 | 1596 | } |
| 1593 | 1597 | } |
| 1594 | 1598 | db_finalize(&q); |
| 1595 | - style_finish_page("alerts"); | |
| 1599 | + style_finish_page(); | |
| 1596 | 1600 | return; |
| 1597 | 1601 | } |
| 1598 | 1602 | |
| 1599 | 1603 | /* |
| 1600 | 1604 | ** WEBPAGE: alerts |
| @@ -1737,10 +1741,11 @@ | ||
| 1737 | 1741 | alert_unsubscribe(sid); |
| 1738 | 1742 | db_commit_transaction(); |
| 1739 | 1743 | return; |
| 1740 | 1744 | } |
| 1741 | 1745 | } |
| 1746 | + style_set_current_feature("alerts"); | |
| 1742 | 1747 | style_header("Update Subscription"); |
| 1743 | 1748 | db_prepare(&q, |
| 1744 | 1749 | "SELECT" |
| 1745 | 1750 | " semail," /* 0 */ |
| 1746 | 1751 | " sverified," /* 1 */ |
| @@ -1914,11 +1919,11 @@ | ||
| 1914 | 1919 | @ </tr> |
| 1915 | 1920 | @ </table> |
| 1916 | 1921 | @ </form> |
| 1917 | 1922 | fossil_free(zErr); |
| 1918 | 1923 | db_finalize(&q); |
| 1919 | - style_finish_page("alerts"); | |
| 1924 | + style_finish_page(); | |
| 1920 | 1925 | db_commit_transaction(); |
| 1921 | 1926 | return; |
| 1922 | 1927 | } |
| 1923 | 1928 | |
| 1924 | 1929 | /* This is the message that gets sent to describe how to change |
| @@ -1977,10 +1982,12 @@ | ||
| 1977 | 1982 | if( login_is_individual() ){ |
| 1978 | 1983 | cgi_redirectf("%R/alerts"); |
| 1979 | 1984 | return; |
| 1980 | 1985 | } |
| 1981 | 1986 | |
| 1987 | + style_set_current_feature("alerts"); | |
| 1988 | + | |
| 1982 | 1989 | zEAddr = PD("e",""); |
| 1983 | 1990 | dx = atoi(PD("dx","0")); |
| 1984 | 1991 | bSubmit = P("submit")!=0 && P("e")!=0 && cgi_csrf_safe(1); |
| 1985 | 1992 | if( bSubmit ){ |
| 1986 | 1993 | if( !captcha_is_correct(1) ){ |
| @@ -2021,11 +2028,11 @@ | ||
| 2021 | 2028 | }else{ |
| 2022 | 2029 | @ <p>An email has been sent to "%h(zEAddr)" that explains how to |
| 2023 | 2030 | @ unsubscribe and/or modify your subscription settings</p> |
| 2024 | 2031 | } |
| 2025 | 2032 | alert_sender_free(pSender); |
| 2026 | - style_finish_page("alerts"); | |
| 2033 | + style_finish_page(); | |
| 2027 | 2034 | return; |
| 2028 | 2035 | } |
| 2029 | 2036 | |
| 2030 | 2037 | /* Non-logged-in users have to enter an email address to which is |
| 2031 | 2038 | ** sent a message containing the unsubscribe link. |
| @@ -2071,11 +2078,11 @@ | ||
| 2071 | 2078 | @ </pre> |
| 2072 | 2079 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 2073 | 2080 | @ </td></tr></table></div> |
| 2074 | 2081 | @ </form> |
| 2075 | 2082 | fossil_free(zErr); |
| 2076 | - style_finish_page("alerts"); | |
| 2083 | + style_finish_page(); | |
| 2077 | 2084 | } |
| 2078 | 2085 | |
| 2079 | 2086 | /* |
| 2080 | 2087 | ** WEBPAGE: subscribers |
| 2081 | 2088 | ** |
| @@ -2098,10 +2105,11 @@ | ||
| 2098 | 2105 | login_needed(0); |
| 2099 | 2106 | return; |
| 2100 | 2107 | } |
| 2101 | 2108 | alert_submenu_common(); |
| 2102 | 2109 | style_submenu_element("Users","setup_ulist"); |
| 2110 | + style_set_current_feature("alerts"); | |
| 2103 | 2111 | style_header("Subscriber List"); |
| 2104 | 2112 | nTotal = db_int(0, "SELECT count(*) FROM subscriber"); |
| 2105 | 2113 | nPending = db_int(0, "SELECT count(*) FROM subscriber WHERE NOT sverified"); |
| 2106 | 2114 | if( nPending>0 && P("purge") && cgi_csrf_safe(0) ){ |
| 2107 | 2115 | int nNewPending; |
| @@ -2182,11 +2190,11 @@ | ||
| 2182 | 2190 | @ </tr> |
| 2183 | 2191 | } |
| 2184 | 2192 | @ </tbody></table> |
| 2185 | 2193 | db_finalize(&q); |
| 2186 | 2194 | style_table_sorter(); |
| 2187 | - style_finish_page("alerts"); | |
| 2195 | + style_finish_page(); | |
| 2188 | 2196 | } |
| 2189 | 2197 | |
| 2190 | 2198 | #if LOCAL_INTERFACE |
| 2191 | 2199 | /* |
| 2192 | 2200 | ** A single event that might appear in an alert is recorded as an |
| @@ -2799,14 +2807,15 @@ | ||
| 2799 | 2807 | unsigned int uSeed = 0; |
| 2800 | 2808 | const char *zDecoded; |
| 2801 | 2809 | char *zCaptcha = 0; |
| 2802 | 2810 | |
| 2803 | 2811 | login_check_credentials(); |
| 2812 | + style_set_current_feature("alerts"); | |
| 2804 | 2813 | if( zAdminEmail==0 || zAdminEmail[0]==0 ){ |
| 2805 | 2814 | style_header("Outbound Email Disabled"); |
| 2806 | 2815 | @ <p>Outbound email is disabled on this repository |
| 2807 | - style_finish_page("alerts"); | |
| 2816 | + style_finish_page(); | |
| 2808 | 2817 | return; |
| 2809 | 2818 | } |
| 2810 | 2819 | if( P("submit")!=0 |
| 2811 | 2820 | && P("subject")!=0 |
| 2812 | 2821 | && P("msg")!=0 |
| @@ -2834,18 +2843,19 @@ | ||
| 2834 | 2843 | }else{ |
| 2835 | 2844 | @ <p>Your message has been sent to the repository administrator. |
| 2836 | 2845 | @ Thank you for your input.</p> |
| 2837 | 2846 | } |
| 2838 | 2847 | alert_sender_free(pSender); |
| 2839 | - style_finish_page("alerts"); | |
| 2848 | + style_finish_page(); | |
| 2840 | 2849 | return; |
| 2841 | 2850 | } |
| 2842 | 2851 | if( captcha_needed() ){ |
| 2843 | 2852 | uSeed = captcha_seed(); |
| 2844 | 2853 | zDecoded = captcha_decode(uSeed); |
| 2845 | 2854 | zCaptcha = captcha_render(zDecoded); |
| 2846 | 2855 | } |
| 2856 | + style_set_current_feature("alerts"); | |
| 2847 | 2857 | style_header("Message To Administrator"); |
| 2848 | 2858 | form_begin(0, "%R/contact_admin"); |
| 2849 | 2859 | @ <p>Enter a message to the repository administrator below:</p> |
| 2850 | 2860 | @ <table class="subscribe"> |
| 2851 | 2861 | if( zCaptcha ){ |
| @@ -2881,11 +2891,11 @@ | ||
| 2881 | 2891 | @ </pre> |
| 2882 | 2892 | @ Enter the 8 characters above in the "Security Code" box<br/> |
| 2883 | 2893 | @ </td></tr></table></div> |
| 2884 | 2894 | } |
| 2885 | 2895 | @ </form> |
| 2886 | - style_finish_page("alerts"); | |
| 2896 | + style_finish_page(); | |
| 2887 | 2897 | } |
| 2888 | 2898 | |
| 2889 | 2899 | /* |
| 2890 | 2900 | ** Send an annoucement message described by query parameter. |
| 2891 | 2901 | ** Permission to do this has already been verified. |
| @@ -2971,10 +2981,11 @@ | ||
| 2971 | 2981 | login_check_credentials(); |
| 2972 | 2982 | if( !g.perm.Announce ){ |
| 2973 | 2983 | login_needed(0); |
| 2974 | 2984 | return; |
| 2975 | 2985 | } |
| 2986 | + style_set_current_feature("alerts"); | |
| 2976 | 2987 | if( fossil_strcmp(P("name"),"test1")==0 ){ |
| 2977 | 2988 | /* Visit the /announce/test1 page to see the CGI variables */ |
| 2978 | 2989 | @ <p style='border: 1px solid black; padding: 1ex;'> |
| 2979 | 2990 | cgi_print_all(0, 0); |
| 2980 | 2991 | @ </p> |
| @@ -2989,11 +3000,11 @@ | ||
| 2989 | 3000 | @ </pre></blockquote> |
| 2990 | 3001 | }else{ |
| 2991 | 3002 | @ <p>The announcement has been sent. |
| 2992 | 3003 | @ <a href="%h(PD("REQUEST_URI","/"))">Send another</a></p> |
| 2993 | 3004 | } |
| 2994 | - style_finish_page("alerts"); | |
| 3005 | + style_finish_page(); | |
| 2995 | 3006 | return; |
| 2996 | 3007 | } else if( !alert_enabled() ){ |
| 2997 | 3008 | style_header("Cannot Send Announcement"); |
| 2998 | 3009 | @ <p>Either you have no subscribers yet, or email alerts are not yet |
| 2999 | 3010 | @ <a href="https://fossil-scm.org/fossil/doc/trunk/www/alerts.md">set up</a> |
| @@ -3043,7 +3054,7 @@ | ||
| 3043 | 3054 | @ <td><input type="submit" name="submit" value="Send Message"> |
| 3044 | 3055 | } |
| 3045 | 3056 | @ </tr> |
| 3046 | 3057 | @ </table> |
| 3047 | 3058 | @ </form> |
| 3048 | - style_finish_page("alerts"); | |
| 3059 | + style_finish_page(); | |
| 3049 | 3060 | } |
| 3050 | 3061 |
| --- 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 @@ | ||
| 45 | 45 | Blob sql; |
| 46 | 46 | Stmt q; |
| 47 | 47 | |
| 48 | 48 | if( zPage && zTkt ) zTkt = 0; |
| 49 | 49 | login_check_credentials(); |
| 50 | + style_set_current_feature("attach"); | |
| 50 | 51 | blob_zero(&sql); |
| 51 | 52 | blob_append_sql(&sql, |
| 52 | 53 | "SELECT datetime(mtime,toLocal()), src, target, filename," |
| 53 | 54 | " comment, user," |
| 54 | 55 | " (SELECT uuid FROM blob WHERE rid=attachid), attachid," |
| @@ -145,11 +146,11 @@ | ||
| 145 | 146 | hyperlink_to_date(zDate, "."); |
| 146 | 147 | free(zUrlTail); |
| 147 | 148 | } |
| 148 | 149 | db_finalize(&q); |
| 149 | 150 | @ </ol> |
| 150 | - style_finish_page("attach"); | |
| 151 | + style_finish_page(); | |
| 151 | 152 | return; |
| 152 | 153 | } |
| 153 | 154 | |
| 154 | 155 | /* |
| 155 | 156 | ** WEBPAGE: attachdownload |
| @@ -176,10 +177,11 @@ | ||
| 176 | 177 | int attachid = atoi(PD("attachid","0")); |
| 177 | 178 | char *zUUID; |
| 178 | 179 | |
| 179 | 180 | if( zFile==0 ) fossil_redirect_home(); |
| 180 | 181 | login_check_credentials(); |
| 182 | + style_set_current_feature("attach"); | |
| 181 | 183 | if( zPage ){ |
| 182 | 184 | if( g.perm.RdWiki==0 ){ login_needed(g.anon.RdWiki); return; } |
| 183 | 185 | zTarget = zPage; |
| 184 | 186 | }else if( zTkt ){ |
| 185 | 187 | if( g.perm.RdTkt==0 ){ login_needed(g.anon.RdTkt); return; } |
| @@ -205,16 +207,16 @@ | ||
| 205 | 207 | ); |
| 206 | 208 | } |
| 207 | 209 | if( zUUID==0 || zUUID[0]==0 ){ |
| 208 | 210 | style_header("No Such Attachment"); |
| 209 | 211 | @ No such attachment.... |
| 210 | - style_finish_page("attach"); | |
| 212 | + style_finish_page(); | |
| 211 | 213 | return; |
| 212 | 214 | }else if( zUUID[0]=='x' ){ |
| 213 | 215 | style_header("Missing"); |
| 214 | 216 | @ Attachment has been deleted |
| 215 | - style_finish_page("attach"); | |
| 217 | + style_finish_page(); | |
| 216 | 218 | return; |
| 217 | 219 | }else{ |
| 218 | 220 | g.perm.Read = 1; |
| 219 | 221 | cgi_replace_parameter("name",zUUID); |
| 220 | 222 | if( fossil_strcmp(g.zPath,"attachview")==0 ){ |
| @@ -386,10 +388,11 @@ | ||
| 386 | 388 | (zPage!=0 && wiki_need_moderation(0)); |
| 387 | 389 | const char *zComment = PD("comment", ""); |
| 388 | 390 | attach_commit(zName, zTarget, aContent, szContent, needModerator, zComment); |
| 389 | 391 | cgi_redirect(zFrom); |
| 390 | 392 | } |
| 393 | + style_set_current_feature("attach"); | |
| 391 | 394 | style_header("Add Attachment"); |
| 392 | 395 | if( !goodCaptcha ){ |
| 393 | 396 | @ <p class="generalError">Error: Incorrect security code.</p> |
| 394 | 397 | } |
| 395 | 398 | @ <h2>Add Attachment To %s(zTargetType)</h2> |
| @@ -410,11 +413,11 @@ | ||
| 410 | 413 | @ <input type="submit" name="ok" value="Add Attachment" /> |
| 411 | 414 | @ <input type="submit" name="cancel" value="Cancel" /> |
| 412 | 415 | @ </div> |
| 413 | 416 | captcha_generate(0); |
| 414 | 417 | @ </form> |
| 415 | - style_finish_page("attach"); | |
| 418 | + style_finish_page(); | |
| 416 | 419 | fossil_free(zTargetType); |
| 417 | 420 | } |
| 418 | 421 | |
| 419 | 422 | /* |
| 420 | 423 | ** WEBPAGE: ainfo |
| @@ -539,10 +542,11 @@ | ||
| 539 | 542 | } |
| 540 | 543 | if( strcmp(zModAction,"approve")==0 ){ |
| 541 | 544 | moderation_approve('a', rid); |
| 542 | 545 | } |
| 543 | 546 | } |
| 547 | + style_set_current_feature("attach"); | |
| 544 | 548 | style_header("Attachment Details"); |
| 545 | 549 | style_submenu_element("Raw", "%R/artifact/%s", zUuid); |
| 546 | 550 | if(fShowContent){ |
| 547 | 551 | style_submenu_element("Line Numbers", "%R/ainfo/%s%s", zUuid, |
| 548 | 552 | ((zLn&&*zLn) ? "" : "?ln=0")); |
| @@ -622,11 +626,11 @@ | ||
| 622 | 626 | @ <i>(file is %d(sz) bytes of binary data)</i> |
| 623 | 627 | } |
| 624 | 628 | @ </blockquote> |
| 625 | 629 | manifest_destroy(pAttach); |
| 626 | 630 | blob_reset(&attach); |
| 627 | - style_finish_page("attach"); | |
| 631 | + style_finish_page(); | |
| 628 | 632 | } |
| 629 | 633 | |
| 630 | 634 | /* |
| 631 | 635 | ** Output HTML to show a list of attachments. |
| 632 | 636 | */ |
| 633 | 637 |
| --- 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 @@ | ||
| 76 | 76 | login_check_credentials(); |
| 77 | 77 | if( !g.perm.Read || !g.perm.RdTkt || !g.perm.RdWiki ){ |
| 78 | 78 | login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki); |
| 79 | 79 | return; |
| 80 | 80 | } |
| 81 | + style_set_current_feature("test"); | |
| 81 | 82 | style_header("Backlink Timeline (Internal Testing Use)"); |
| 82 | 83 | db_multi_exec( |
| 83 | 84 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| 84 | 85 | "DELETE FROM ok;" |
| 85 | 86 | "INSERT OR IGNORE INTO ok" |
| @@ -91,11 +92,11 @@ | ||
| 91 | 92 | blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC"); |
| 92 | 93 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 93 | 94 | www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL, |
| 94 | 95 | 0, 0, 0, 0, 0, 0); |
| 95 | 96 | db_finalize(&q); |
| 96 | - style_finish_page("test"); | |
| 97 | + style_finish_page(); | |
| 97 | 98 | } |
| 98 | 99 | |
| 99 | 100 | /* |
| 100 | 101 | ** WEBPAGE: test-backlinks |
| 101 | 102 | ** |
| @@ -107,10 +108,11 @@ | ||
| 107 | 108 | login_check_credentials(); |
| 108 | 109 | if( !g.perm.Admin ){ |
| 109 | 110 | login_needed(g.anon.Admin); |
| 110 | 111 | return; |
| 111 | 112 | } |
| 113 | + style_set_current_feature("test"); | |
| 112 | 114 | style_header("Backlink Table (Internal Testing Use)"); |
| 113 | 115 | n = db_int(0, "SELECT count(*) FROM backlink"); |
| 114 | 116 | @ <p>%d(n) backlink table entries:</p> |
| 115 | 117 | db_prepare(&q, |
| 116 | 118 | "SELECT target, srctype, srcid, datetime(mtime)," |
| @@ -152,11 +154,11 @@ | ||
| 152 | 154 | @ <td>%h(zMtime)</tr> |
| 153 | 155 | } |
| 154 | 156 | @ </tbody> |
| 155 | 157 | @ </table> |
| 156 | 158 | db_finalize(&q); |
| 157 | - style_finish_page("test"); | |
| 159 | + style_finish_page(); | |
| 158 | 160 | } |
| 159 | 161 | |
| 160 | 162 | /* |
| 161 | 163 | ** Remove all prior backlinks for the wiki page given. Then |
| 162 | 164 | ** add new backlinks for the latest version of the wiki page. |
| 163 | 165 |
| --- 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 @@ | ||
| 458 | 458 | Stmt q; |
| 459 | 459 | double rNow; |
| 460 | 460 | int show_colors = PB("colors"); |
| 461 | 461 | login_check_credentials(); |
| 462 | 462 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 463 | + style_set_current_feature("branch"); | |
| 463 | 464 | style_header("Branches"); |
| 464 | 465 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 465 | 466 | style_submenu_checkbox("colors", "Use Branch Colors", 0, 0); |
| 466 | 467 | login_anonymous_available(); |
| 467 | 468 | |
| @@ -514,11 +515,11 @@ | ||
| 514 | 515 | @ </tr> |
| 515 | 516 | } |
| 516 | 517 | @ </tbody></table></div> |
| 517 | 518 | db_finalize(&q); |
| 518 | 519 | style_table_sorter(); |
| 519 | - style_finish_page("branch"); | |
| 520 | + style_finish_page(); | |
| 520 | 521 | } |
| 521 | 522 | |
| 522 | 523 | /* |
| 523 | 524 | ** WEBPAGE: brlist |
| 524 | 525 | ** Show a list of branches. With no query parameters, a sortable table |
| @@ -556,10 +557,11 @@ | ||
| 556 | 557 | showAll = 1; |
| 557 | 558 | } |
| 558 | 559 | if( showAll ) brFlags = BRL_BOTH; |
| 559 | 560 | if( showClosed ) brFlags = BRL_CLOSED_ONLY; |
| 560 | 561 | |
| 562 | + style_set_current_feature("branch"); | |
| 561 | 563 | style_header("%s", showClosed ? "Closed Branches" : |
| 562 | 564 | showAll ? "All Branches" : "Open Branches"); |
| 563 | 565 | style_submenu_element("Timeline", "brtimeline"); |
| 564 | 566 | if( showClosed ){ |
| 565 | 567 | style_submenu_element("All", "brlist?all"); |
| @@ -622,11 +624,11 @@ | ||
| 622 | 624 | } |
| 623 | 625 | if( cnt ){ |
| 624 | 626 | @ </ul> |
| 625 | 627 | } |
| 626 | 628 | db_finalize(&q); |
| 627 | - style_finish_page("branch"); | |
| 629 | + style_finish_page(); | |
| 628 | 630 | } |
| 629 | 631 | |
| 630 | 632 | /* |
| 631 | 633 | ** This routine is called while for each check-in that is rendered by |
| 632 | 634 | ** the timeline of a "brlist" page. Add some additional hyperlinks |
| @@ -671,10 +673,11 @@ | ||
| 671 | 673 | int fOnlyHidden = PB("onlyhidden")!=0; /* The "onlyhidden" query parameter */ |
| 672 | 674 | |
| 673 | 675 | login_check_credentials(); |
| 674 | 676 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 675 | 677 | |
| 678 | + style_set_current_feature("branch"); | |
| 676 | 679 | style_header("Branches"); |
| 677 | 680 | style_submenu_element("List", "brlist"); |
| 678 | 681 | login_anonymous_available(); |
| 679 | 682 | timeline_ss_submenu(); |
| 680 | 683 | cookie_render(); |
| @@ -698,7 +701,7 @@ | ||
| 698 | 701 | if( PB("ng")==0 ) tmFlags |= TIMELINE_GRAPH; |
| 699 | 702 | if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR; |
| 700 | 703 | if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR; |
| 701 | 704 | www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, brtimeline_extra); |
| 702 | 705 | db_finalize(&q); |
| 703 | - style_finish_page("branch"); | |
| 706 | + style_finish_page(); | |
| 704 | 707 | } |
| 705 | 708 |
| --- 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 @@ | ||
| 336 | 336 | |
| 337 | 337 | /* If the "noreadme" query parameter is present, do not try to |
| 338 | 338 | ** show the content of the README file. |
| 339 | 339 | */ |
| 340 | 340 | if( P("noreadme")!=0 ){ |
| 341 | - style_finish_page("dir"); | |
| 341 | + style_finish_page(); | |
| 342 | 342 | return; |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /* If the directory contains a readme file, then display its content below |
| 346 | 346 | ** the list of files |
| @@ -397,11 +397,11 @@ | ||
| 397 | 397 | document_emit_js(); |
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | db_finalize(&q); |
| 402 | - style_finish_page("dir"); | |
| 402 | + style_finish_page(); | |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | /* |
| 406 | 406 | ** Objects used by the "tree" webpage. |
| 407 | 407 | */ |
| @@ -913,11 +913,11 @@ | ||
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 | @ </ul> |
| 916 | 916 | @ </ul></div> |
| 917 | 917 | builtin_request_js("tree.js"); |
| 918 | - style_finish_page("tree"); | |
| 918 | + style_finish_page(); | |
| 919 | 919 | |
| 920 | 920 | /* We could free memory used by sTree here if we needed to. But |
| 921 | 921 | ** the process is about to exit, so doing so would not really accomplish |
| 922 | 922 | ** anything useful. */ |
| 923 | 923 | } |
| @@ -1167,7 +1167,7 @@ | ||
| 1167 | 1167 | fossil_free(zAge); |
| 1168 | 1168 | } |
| 1169 | 1169 | @ </table></div> |
| 1170 | 1170 | db_finalize(&q1); |
| 1171 | 1171 | db_finalize(&q2); |
| 1172 | - style_finish_page("fileage"); | |
| 1172 | + style_finish_page(); | |
| 1173 | 1173 | } |
| 1174 | 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("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 @@ | ||
| 94 | 94 | ** |
| 95 | 95 | ** Show all built-in text files. |
| 96 | 96 | */ |
| 97 | 97 | void test_builtin_list_page(void){ |
| 98 | 98 | int i; |
| 99 | + style_set_current_feature("test"); | |
| 99 | 100 | style_header("Built-in Text Files"); |
| 100 | 101 | @ <ol> |
| 101 | 102 | for(i=0; i<count(aBuiltinFiles); i++){ |
| 102 | 103 | const char *z = aBuiltinFiles[i].zName; |
| 103 | 104 | char *zUrl = href("%R/builtin?name=%T&id=%.8s&mimetype=text/plain", |
| 104 | 105 | z,fossil_exe_id()); |
| 105 | 106 | @ <li>%z(zUrl)%h(z)</a> |
| 106 | 107 | } |
| 107 | 108 | @ </ol> |
| 108 | - style_finish_page("test"); | |
| 109 | + style_finish_page(); | |
| 109 | 110 | } |
| 110 | 111 | |
| 111 | 112 | /* |
| 112 | 113 | ** COMMAND: test-builtin-get |
| 113 | 114 | ** |
| 114 | 115 |
| --- 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 @@ | ||
| 353 | 353 | sqlite3_stmt *pStmt; |
| 354 | 354 | char zBuf[100]; |
| 355 | 355 | |
| 356 | 356 | login_check_credentials(); |
| 357 | 357 | if( !g.perm.Setup ){ login_needed(0); return; } |
| 358 | + style_set_current_feature("cache"); | |
| 358 | 359 | style_header("Web Cache Status"); |
| 359 | 360 | db = cacheOpen(0); |
| 360 | 361 | if( db==0 ){ |
| 361 | 362 | @ The web-page cache is disabled for this repository |
| 362 | 363 | }else{ |
| @@ -384,11 +385,11 @@ | ||
| 384 | 385 | @ <p>cache-file name: %h(zDbName)</p> |
| 385 | 386 | @ <p>cache-file size: %s(zBuf)</p> |
| 386 | 387 | fossil_free(zDbName); |
| 387 | 388 | sqlite3_close(db); |
| 388 | 389 | } |
| 389 | - style_finish_page("cache"); | |
| 390 | + style_finish_page(); | |
| 390 | 391 | } |
| 391 | 392 | |
| 392 | 393 | /* |
| 393 | 394 | ** WEBPAGE: cacheget |
| 394 | 395 | ** |
| @@ -405,13 +406,14 @@ | ||
| 405 | 406 | login_check_credentials(); |
| 406 | 407 | if( !g.perm.Setup ){ login_needed(0); return; } |
| 407 | 408 | zKey = PD("key",""); |
| 408 | 409 | blob_zero(&content); |
| 409 | 410 | if( cache_read(&content, zKey)==0 ){ |
| 411 | + style_set_current_feature("cache"); | |
| 410 | 412 | style_header("Cache Download Error"); |
| 411 | 413 | @ The cache does not contain any entry with this key: "%h(zKey)" |
| 412 | - style_finish_page("cache"); | |
| 414 | + style_finish_page(); | |
| 413 | 415 | return; |
| 414 | 416 | } |
| 415 | 417 | cgi_set_content(&content); |
| 416 | 418 | cgi_set_content_type("application/x-compressed"); |
| 417 | 419 | } |
| 418 | 420 |
| --- 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 @@ | ||
| 586 | 586 | if( zPw==0 || zPw[0]==0 ){ |
| 587 | 587 | u64 x; |
| 588 | 588 | sqlite3_randomness(sizeof(x), &x); |
| 589 | 589 | zPw = mprintf("%016llx", x); |
| 590 | 590 | } |
| 591 | + style_set_current_feature("test"); | |
| 591 | 592 | style_header("Captcha Test"); |
| 592 | 593 | @ <pre> |
| 593 | 594 | @ %s(captcha_render(zPw)) |
| 594 | 595 | @ </pre> |
| 595 | - style_finish_page("test"); | |
| 596 | + style_finish_page(); | |
| 596 | 597 | } |
| 597 | 598 | |
| 598 | 599 | /* |
| 599 | 600 | ** Check to see if the current request is coming from an agent that might |
| 600 | 601 | ** be a spider. If the agent is not a spider, then return 0 without doing |
| @@ -621,17 +622,18 @@ | ||
| 621 | 622 | cgi_set_cookie(zCookieName, "1", login_cookie_path(), 8*3600); |
| 622 | 623 | return 0; |
| 623 | 624 | } |
| 624 | 625 | |
| 625 | 626 | /* This appears to be a spider. Offer the captcha */ |
| 627 | + style_set_current_feature("captcha"); | |
| 626 | 628 | style_header("Verification"); |
| 627 | 629 | @ <form method='POST' action='%s(g.zPath)'> |
| 628 | 630 | cgi_query_parameters_to_hidden(); |
| 629 | 631 | @ <p>Please demonstrate that you are human, not a spider or robot</p> |
| 630 | 632 | captcha_generate(1); |
| 631 | 633 | @ </form> |
| 632 | - style_finish_page("captcha"); | |
| 634 | + style_finish_page(); | |
| 633 | 635 | return 1; |
| 634 | 636 | } |
| 635 | 637 | |
| 636 | 638 | /* |
| 637 | 639 | ** Generate a WAV file that reads aloud the hex digits given by |
| 638 | 640 |
| --- 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 @@ | ||
| 422 | 422 | @ <p>Clone the repository using this command: |
| 423 | 423 | @ <blockquote><pre> |
| 424 | 424 | @ fossil clone %s(g.zBaseURL) %h(zNm).fossil |
| 425 | 425 | @ </pre></blockquote> |
| 426 | 426 | } |
| 427 | - style_finish_page("download"); | |
| 427 | + style_finish_page(); | |
| 428 | 428 | } |
| 429 | 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("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 @@ | ||
| 225 | 225 | @ <li>Raw cookie value: "%h(PD("fossil_display_settings",""))" |
| 226 | 226 | for(i=0; i<cookies.nParam; i++){ |
| 227 | 227 | @ <li>%h(cookies.aParam[i].zPName): "%h(cookies.aParam[i].zPValue)" |
| 228 | 228 | } |
| 229 | 229 | @ </ul> |
| 230 | - style_finish_page("cookies"); | |
| 230 | + style_finish_page(); | |
| 231 | 231 | } |
| 232 | 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("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 |
+2
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -561,10 +561,11 @@ | ||
| 561 | 561 | } |
| 562 | 562 | if( showClosed || showAll ){ |
| 563 | 563 | style_submenu_element("Open", "%s", url_render(&url, 0, 0, 0, 0)); |
| 564 | 564 | } |
| 565 | 565 | url_reset(&url); |
| 566 | + style_set_current_feature("leaves"); | |
| 566 | 567 | style_header("Leaves"); |
| 567 | 568 | login_anonymous_available(); |
| 568 | 569 | timeline_ss_submenu(); |
| 569 | 570 | cookie_render(); |
| 570 | 571 | #if 0 |
| @@ -613,11 +614,11 @@ | ||
| 613 | 614 | if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR; |
| 614 | 615 | if( fUBg ) tmFlags |= TIMELINE_UCOLOR; |
| 615 | 616 | www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0); |
| 616 | 617 | db_finalize(&q); |
| 617 | 618 | @ <br /> |
| 618 | - style_finish_page("leaves"); | |
| 619 | + style_finish_page(); | |
| 619 | 620 | } |
| 620 | 621 | |
| 621 | 622 | #if INTERFACE |
| 622 | 623 | /* Flag parameters to compute_uses_file() */ |
| 623 | 624 | #define USESFILE_DELETE 0x01 /* Include the check-ins where file deleted */ |
| 624 | 625 |
| --- 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 @@ | ||
| 2448 | 2448 | /* compute the annotation */ |
| 2449 | 2449 | annotate_file(&ann, zFilename, zRevision, zLimit, zOrigin, annFlags); |
| 2450 | 2450 | zCI = ann.aVers[0].zMUuid; |
| 2451 | 2451 | |
| 2452 | 2452 | /* generate the web page */ |
| 2453 | + style_set_current_feature("annotate"); | |
| 2453 | 2454 | style_header("Annotation For %h", zFilename); |
| 2454 | 2455 | if( bBlame ){ |
| 2455 | 2456 | url_initialize(&url, "blame"); |
| 2456 | 2457 | }else{ |
| 2457 | 2458 | url_initialize(&url, "annotate"); |
| @@ -2556,11 +2557,11 @@ | ||
| 2556 | 2557 | } |
| 2557 | 2558 | @ %s(zPrefix) %h(z) |
| 2558 | 2559 | |
| 2559 | 2560 | } |
| 2560 | 2561 | @ </pre> |
| 2561 | - style_finish_page("annotate"); | |
| 2562 | + style_finish_page(); | |
| 2562 | 2563 | } |
| 2563 | 2564 | |
| 2564 | 2565 | /* |
| 2565 | 2566 | ** COMMAND: annotate |
| 2566 | 2567 | ** COMMAND: blame |
| 2567 | 2568 |
| --- 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 @@ | ||
| 747 | 747 | if( zCmd==0 ) zCmd = P("name"); |
| 748 | 748 | if( zCmd && *zCmd ){ |
| 749 | 749 | int rc; |
| 750 | 750 | const CmdOrPage *pCmd = 0; |
| 751 | 751 | |
| 752 | + style_set_current_feature("tkt"); | |
| 752 | 753 | style_header("Help: %s", zCmd); |
| 753 | 754 | |
| 754 | 755 | style_submenu_element("Command-List", "%R/help"); |
| 755 | 756 | rc = dispatch_name_search(zCmd, CMDFLAG_ANY|CMDFLAG_PREFIX, &pCmd); |
| 756 | 757 | if( *zCmd=='/' ){ |
| @@ -850,11 +851,11 @@ | ||
| 850 | 851 | } |
| 851 | 852 | } |
| 852 | 853 | @ </ul></div> |
| 853 | 854 | |
| 854 | 855 | } |
| 855 | - style_finish_page("help"); | |
| 856 | + style_finish_page(); | |
| 856 | 857 | } |
| 857 | 858 | |
| 858 | 859 | /* |
| 859 | 860 | ** WEBPAGE: test-all-help |
| 860 | 861 | ** |
| @@ -862,10 +863,11 @@ | ||
| 862 | 863 | */ |
| 863 | 864 | void test_all_help_page(void){ |
| 864 | 865 | int i; |
| 865 | 866 | Blob buf; |
| 866 | 867 | blob_init(&buf,0,0); |
| 868 | + style_set_current_feature("test"); | |
| 867 | 869 | style_header("All Help Text"); |
| 868 | 870 | @ <dl> |
| 869 | 871 | for(i=0; i<MX_COMMAND; i++){ |
| 870 | 872 | const char *zDesc; |
| 871 | 873 | unsigned int e = aCommand[i].eCmdFlags; |
| @@ -901,11 +903,11 @@ | ||
| 901 | 903 | help_to_html(aCommand[i].zHelp, cgi_output_blob()); |
| 902 | 904 | @ </dd> |
| 903 | 905 | } |
| 904 | 906 | @ </dl> |
| 905 | 907 | blob_reset(&buf); |
| 906 | - style_finish_page("help"); | |
| 908 | + style_finish_page(); | |
| 907 | 909 | } |
| 908 | 910 | |
| 909 | 911 | static void multi_column_list(const char **azWord, int nWord){ |
| 910 | 912 | int i, j, len; |
| 911 | 913 | int mxLen = 0; |
| 912 | 914 |
| --- 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 @@ | ||
| 555 | 555 | } |
| 556 | 556 | @ <tr><td>%s(zFlag)%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr> |
| 557 | 557 | } |
| 558 | 558 | @ </tbody></table> |
| 559 | 559 | style_table_sorter(); |
| 560 | - style_finish_page("mimetypes"); | |
| 560 | + style_finish_page(); | |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | /* |
| 564 | 564 | ** Check to see if the file in the pContent blob is "embedded HTML". Return |
| 565 | 565 | ** true if it is, and fill pTitle with the document title. |
| @@ -770,11 +770,11 @@ | ||
| 770 | 770 | }else{ |
| 771 | 771 | style_header("%s", zDefaultTitle); |
| 772 | 772 | wiki_convert(pBody, 0, WIKI_BUTTONS); |
| 773 | 773 | } |
| 774 | 774 | document_emit_js(); |
| 775 | - style_finish_page("doc"); | |
| 775 | + style_finish_page(); | |
| 776 | 776 | }else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){ |
| 777 | 777 | Blob tail = BLOB_INITIALIZER; |
| 778 | 778 | markdown_to_html(pBody, &title, &tail); |
| 779 | 779 | if( blob_size(&title)>0 ){ |
| 780 | 780 | style_header("%s", blob_str(&title)); |
| @@ -781,30 +781,30 @@ | ||
| 781 | 781 | }else{ |
| 782 | 782 | style_header("%s", zDefaultTitle); |
| 783 | 783 | } |
| 784 | 784 | convert_href_and_output(&tail); |
| 785 | 785 | document_emit_js(); |
| 786 | - style_finish_page("doc"); | |
| 786 | + style_finish_page(); | |
| 787 | 787 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| 788 | 788 | style_header("%s", zDefaultTitle); |
| 789 | 789 | @ <blockquote><pre> |
| 790 | 790 | @ %h(blob_str(pBody)) |
| 791 | 791 | @ </pre></blockquote> |
| 792 | 792 | document_emit_js(); |
| 793 | - style_finish_page("doc"); | |
| 793 | + style_finish_page(); | |
| 794 | 794 | }else if( fossil_strcmp(zMime, "text/html")==0 |
| 795 | 795 | && doc_is_embedded_html(pBody, &title) ){ |
| 796 | 796 | if( blob_size(&title)==0 ) blob_append(&title,zFilename,-1); |
| 797 | 797 | style_header("%s", blob_str(&title)); |
| 798 | 798 | convert_href_and_output(pBody); |
| 799 | 799 | document_emit_js(); |
| 800 | - style_finish_page("doc"); | |
| 800 | + style_finish_page(); | |
| 801 | 801 | }else if( fossil_strcmp(zMime, "text/x-pikchr")==0 ){ |
| 802 | 802 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 803 | 803 | style_header("%s", zDefaultTitle); |
| 804 | 804 | wiki_render_by_mimetype(pBody, zMime); |
| 805 | - style_finish_page("doc"); | |
| 805 | + style_finish_page(); | |
| 806 | 806 | #ifdef FOSSIL_ENABLE_TH1_DOCS |
| 807 | 807 | }else if( Th_AreDocsEnabled() && |
| 808 | 808 | fossil_strcmp(zMime, "application/x-th1")==0 ){ |
| 809 | 809 | int raw = P("raw")!=0; |
| 810 | 810 | if( !raw ){ |
| @@ -821,11 +821,11 @@ | ||
| 821 | 821 | }else{ |
| 822 | 822 | Th_Render(blob_str(pBody)); |
| 823 | 823 | } |
| 824 | 824 | if( !raw ){ |
| 825 | 825 | document_emit_js(); |
| 826 | - style_finish_page("doc"); | |
| 826 | + style_finish_page(); | |
| 827 | 827 | } |
| 828 | 828 | #endif |
| 829 | 829 | }else{ |
| 830 | 830 | fossil_free(style_csp(1)); |
| 831 | 831 | cgi_set_content_type(zMime); |
| @@ -906,10 +906,11 @@ | ||
| 906 | 906 | #endif |
| 907 | 907 | }; |
| 908 | 908 | |
| 909 | 909 | login_check_credentials(); |
| 910 | 910 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 911 | + style_set_current_feature("doc"); | |
| 911 | 912 | blob_init(&title, 0, 0); |
| 912 | 913 | zDfltTitle = isUV ? "" : "Documentation"; |
| 913 | 914 | db_begin_transaction(); |
| 914 | 915 | while( rid==0 && (++nMiss)<=count(azSuffix) ){ |
| 915 | 916 | zName = P("name"); |
| @@ -1029,11 +1030,11 @@ | ||
| 1029 | 1030 | style_header("Not Found"); |
| 1030 | 1031 | @ <p>Document %h(zOrigName) not found |
| 1031 | 1032 | if( fossil_strcmp(zCheckin,"ckout")!=0 ){ |
| 1032 | 1033 | @ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a> |
| 1033 | 1034 | } |
| 1034 | - style_finish_page("doc"); | |
| 1035 | + style_finish_page(); | |
| 1035 | 1036 | return; |
| 1036 | 1037 | } |
| 1037 | 1038 | |
| 1038 | 1039 | /* |
| 1039 | 1040 | ** The default logo. |
| @@ -1202,7 +1203,7 @@ | ||
| 1202 | 1203 | */ |
| 1203 | 1204 | void doc_search_page(void){ |
| 1204 | 1205 | login_check_credentials(); |
| 1205 | 1206 | style_header("Document Search"); |
| 1206 | 1207 | search_screen(SRCH_DOC, 0); |
| 1207 | - style_finish_page("docsrch"); | |
| 1208 | + style_finish_page(); | |
| 1208 | 1209 | } |
| 1209 | 1210 |
| --- 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 @@ | ||
| 110 | 110 | } |
| 111 | 111 | break; |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | db_finalize(&q1); |
| 115 | + style_set_current_feature("event"); | |
| 115 | 116 | if( rid==0 || (specRid!=0 && specRid!=rid) ){ |
| 116 | 117 | style_header("No Such Tech-Note"); |
| 117 | 118 | @ Cannot locate a technical note called <b>%h(zId)</b>. |
| 118 | - style_finish_page("event"); | |
| 119 | + style_finish_page(); | |
| 119 | 120 | return; |
| 120 | 121 | } |
| 121 | 122 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 122 | 123 | zVerbose = P("v"); |
| 123 | 124 | if( !zVerbose ){ |
| @@ -229,11 +230,11 @@ | ||
| 229 | 230 | " FROM tag" |
| 230 | 231 | " WHERE tagname GLOB 'event-%q*'", |
| 231 | 232 | zId); |
| 232 | 233 | attachment_list(zFullId, "<hr /><h2>Attachments:</h2><ul>"); |
| 233 | 234 | document_emit_js(); |
| 234 | - style_finish_page("event"); | |
| 235 | + style_finish_page(); | |
| 235 | 236 | manifest_destroy(pTNote); |
| 236 | 237 | } |
| 237 | 238 | |
| 238 | 239 | /* |
| 239 | 240 | ** Add or update a new tech note to the repository. rid is id of |
| @@ -415,10 +416,11 @@ | ||
| 415 | 416 | */ |
| 416 | 417 | if( !g.perm.Write || (rid && !g.perm.WrWiki) || (!rid && !g.perm.NewWiki) ){ |
| 417 | 418 | login_needed(g.anon.Write && (rid ? g.anon.WrWiki : g.anon.NewWiki)); |
| 418 | 419 | return; |
| 419 | 420 | } |
| 421 | + style_set_current_feature("event"); | |
| 420 | 422 | |
| 421 | 423 | /* Figure out the color */ |
| 422 | 424 | if( rid ){ |
| 423 | 425 | zClr = db_text("", "SELECT bgcolor FROM event WHERE objid=%d", rid); |
| 424 | 426 | if( zClr && zClr[0] ){ |
| @@ -473,11 +475,11 @@ | ||
| 473 | 475 | zMimetype, zComment, zTags, |
| 474 | 476 | zClrFlag[0] ? zClr : 0) ){ |
| 475 | 477 | style_header("Error"); |
| 476 | 478 | @ Internal error: Fossil tried to make an invalid artifact for |
| 477 | 479 | @ the edited technote. |
| 478 | - style_finish_page("event"); | |
| 480 | + style_finish_page(); | |
| 479 | 481 | return; |
| 480 | 482 | } |
| 481 | 483 | cgi_redirectf("%R/technote?name=%T", zId); |
| 482 | 484 | } |
| 483 | 485 | if( P("cancel")!=0 ){ |
| @@ -567,11 +569,11 @@ | ||
| 567 | 569 | if( P("preview") ){ |
| 568 | 570 | @ <input type="submit" name="submit" value="Submit" /> |
| 569 | 571 | } |
| 570 | 572 | @ </td></tr></table> |
| 571 | 573 | @ </div></form> |
| 572 | - style_finish_page("event"); | |
| 574 | + style_finish_page(); | |
| 573 | 575 | } |
| 574 | 576 | |
| 575 | 577 | /* |
| 576 | 578 | ** Add a new tech note to the repository. The timestamp is |
| 577 | 579 | ** given by the zETime parameter. rid must be zero to create |
| 578 | 580 |
| --- 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 @@ | ||
| 395 | 395 | if( !g.perm.Admin ){ |
| 396 | 396 | login_needed(0); |
| 397 | 397 | return; |
| 398 | 398 | } |
| 399 | 399 | ext_files(); |
| 400 | + style_set_current_feature("extcgi"); | |
| 400 | 401 | style_header("CGI Extension Filelist"); |
| 401 | 402 | @ <table border="0" cellspacing="0" cellpadding="3"> |
| 402 | 403 | @ <tbody> |
| 403 | 404 | db_prepare(&q, "SELECT pathname, isexe FROM sfile" |
| 404 | 405 | " ORDER BY pathname"); |
| @@ -420,7 +421,7 @@ | ||
| 420 | 421 | @ </tr> |
| 421 | 422 | } |
| 422 | 423 | db_finalize(&q); |
| 423 | 424 | @ </tbody> |
| 424 | 425 | @ </table> |
| 425 | - style_finish_page("extcgi"); | |
| 426 | + style_finish_page(); | |
| 426 | 427 | } |
| 427 | 428 |
| --- 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 @@ | ||
| 1606 | 1606 | "values matching files which may be edited online." |
| 1607 | 1607 | "</p>\n"); |
| 1608 | 1608 | }else{ |
| 1609 | 1609 | CX("<p>Online editing is disabled for this repository.</p>\n"); |
| 1610 | 1610 | } |
| 1611 | - style_finish_page("fileedit"); | |
| 1611 | + style_finish_page(); | |
| 1612 | 1612 | return; |
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | 1615 | /* Dispatch AJAX methods based tail of the request URI. |
| 1616 | 1616 | ** The AJAX parts do their own permissions/CSRF check and |
| @@ -2061,7 +2061,7 @@ | ||
| 2061 | 2061 | style_script_end(); |
| 2062 | 2062 | } |
| 2063 | 2063 | blob_reset(&err); |
| 2064 | 2064 | CheckinMiniInfo_cleanup(&cimi); |
| 2065 | 2065 | db_end_transaction(0); |
| 2066 | - style_finish_page("fileedit"); | |
| 2066 | + style_finish_page(); | |
| 2067 | 2067 | } |
| 2068 | 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("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 @@ | ||
| 367 | 367 | ridFrom = name_to_rid_www("from"); |
| 368 | 368 | zPrevDate[0] = 0; |
| 369 | 369 | cookie_render(); |
| 370 | 370 | if( fnid==0 ){ |
| 371 | 371 | @ No such file: %h(zFilename) |
| 372 | - style_finish_page("finfo"); | |
| 372 | + style_finish_page(); | |
| 373 | 373 | return; |
| 374 | 374 | } |
| 375 | 375 | if( g.perm.Admin ){ |
| 376 | 376 | style_submenu_element("MLink Table", "%R/mlink?name=%t", zFilename); |
| 377 | 377 | } |
| @@ -754,11 +754,11 @@ | ||
| 754 | 754 | @ <td></td><td></td><td></td></tr> |
| 755 | 755 | } |
| 756 | 756 | } |
| 757 | 757 | @ </table> |
| 758 | 758 | timeline_output_graph_javascript(pGraph, TIMELINE_FILEDIFF, iTableId); |
| 759 | - style_finish_page("finfo"); | |
| 759 | + style_finish_page(); | |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | 762 | /* |
| 763 | 763 | ** WEBPAGE: mlink |
| 764 | 764 | ** URL: /mlink?name=FILENAME |
| @@ -779,10 +779,11 @@ | ||
| 779 | 779 | const char *zCI = P("ci"); |
| 780 | 780 | Stmt q; |
| 781 | 781 | |
| 782 | 782 | login_check_credentials(); |
| 783 | 783 | if( !g.perm.Admin ){ login_needed(g.anon.Admin); return; } |
| 784 | + style_set_current_feature("finfo"); | |
| 784 | 785 | style_header("MLINK Table"); |
| 785 | 786 | if( zFName==0 && zCI==0 ){ |
| 786 | 787 | @ <span class='generalError'> |
| 787 | 788 | @ Requires either a name= or ci= query parameter |
| 788 | 789 | @ </span> |
| @@ -934,7 +935,7 @@ | ||
| 934 | 935 | db_finalize(&q); |
| 935 | 936 | @ </tbody> |
| 936 | 937 | @ </table> |
| 937 | 938 | @ </div> |
| 938 | 939 | } |
| 939 | - style_finish_page("finfo"); | |
| 940 | + style_finish_page(); | |
| 940 | 941 | } |
| 941 | 942 |
| --- 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 @@ | ||
| 862 | 862 | " FROM forumpost, event" |
| 863 | 863 | " WHERE event.objid=forumpost.fpid" |
| 864 | 864 | " AND forumpost.fpid=%d;", |
| 865 | 865 | fpid |
| 866 | 866 | ); |
| 867 | + style_set_current_feature("forum"); | |
| 867 | 868 | style_header("%s%s", zThreadTitle, *zThreadTitle ? "" : "Forum"); |
| 868 | 869 | fossil_free(zThreadTitle); |
| 869 | 870 | if( mode!=FD_CHRONO ){ |
| 870 | 871 | style_submenu_element("Chronological", "%R/%s/%s?t=c%s%s", g.zPath, zName, |
| 871 | 872 | bUnf ? "&unf" : "", bHist ? "&hist" : ""); |
| @@ -883,11 +884,11 @@ | ||
| 883 | 884 | /* Emit Forum Javascript. */ |
| 884 | 885 | builtin_request_js("forum.js"); |
| 885 | 886 | forum_emit_js(); |
| 886 | 887 | |
| 887 | 888 | /* Emit the page style. */ |
| 888 | - style_finish_page("forum"); | |
| 889 | + style_finish_page(); | |
| 889 | 890 | } |
| 890 | 891 | |
| 891 | 892 | /* |
| 892 | 893 | ** Return true if a forum post should be moderated. |
| 893 | 894 | */ |
| @@ -1054,10 +1055,11 @@ | ||
| 1054 | 1055 | }else{ |
| 1055 | 1056 | forumnew_page(); |
| 1056 | 1057 | } |
| 1057 | 1058 | return; |
| 1058 | 1059 | } |
| 1060 | + style_set_current_feature("forum"); | |
| 1059 | 1061 | style_header("%h As Anonymous?", isEdit ? "Reply" : "Post"); |
| 1060 | 1062 | @ <p>You are not logged in. |
| 1061 | 1063 | @ <p><table border="0" cellpadding="10"> |
| 1062 | 1064 | @ <tr><td> |
| 1063 | 1065 | @ <form action="%s(zGoto)" method="POST"> |
| @@ -1079,11 +1081,11 @@ | ||
| 1079 | 1081 | @ <input type="submit" value="Login"> |
| 1080 | 1082 | @ </form> |
| 1081 | 1083 | @ <td>Log into an existing account |
| 1082 | 1084 | @ </table> |
| 1083 | 1085 | forum_emit_js(); |
| 1084 | - style_finish_page("forum"); | |
| 1086 | + style_finish_page(); | |
| 1085 | 1087 | fossil_free(zGoto); |
| 1086 | 1088 | } |
| 1087 | 1089 | |
| 1088 | 1090 | /* |
| 1089 | 1091 | ** Write the "From: USER" line on the webpage. |
| @@ -1115,10 +1117,11 @@ | ||
| 1115 | 1117 | } |
| 1116 | 1118 | if( P("preview") && !whitespace_only(zContent) ){ |
| 1117 | 1119 | @ <h1>Preview:</h1> |
| 1118 | 1120 | forum_render(zTitle, zMimetype, zContent, "forumEdit", 1); |
| 1119 | 1121 | } |
| 1122 | + style_set_current_feature("forum"); | |
| 1120 | 1123 | style_header("New Forum Thread"); |
| 1121 | 1124 | @ <form action="%R/forume1" method="POST"> |
| 1122 | 1125 | @ <h1>New Thread:</h1> |
| 1123 | 1126 | forum_from_line(); |
| 1124 | 1127 | forum_post_widget(zTitle, zMimetype, zContent); |
| @@ -1140,11 +1143,11 @@ | ||
| 1140 | 1143 | @ Show query parameters</label> |
| 1141 | 1144 | @ </div> |
| 1142 | 1145 | } |
| 1143 | 1146 | @ </form> |
| 1144 | 1147 | forum_emit_js(); |
| 1145 | - style_finish_page("forum"); | |
| 1148 | + style_finish_page(); | |
| 1146 | 1149 | } |
| 1147 | 1150 | |
| 1148 | 1151 | /* |
| 1149 | 1152 | ** WEBPAGE: forume2 |
| 1150 | 1153 | ** |
| @@ -1214,10 +1217,11 @@ | ||
| 1214 | 1217 | cgi_redirectf("%R/forum"); |
| 1215 | 1218 | } |
| 1216 | 1219 | return; |
| 1217 | 1220 | } |
| 1218 | 1221 | } |
| 1222 | + style_set_current_feature("forum"); | |
| 1219 | 1223 | isDelete = P("nullout")!=0; |
| 1220 | 1224 | if( P("submit") |
| 1221 | 1225 | && isCsrfSafe |
| 1222 | 1226 | && (zContent = PDT("content",""))!=0 |
| 1223 | 1227 | && (!whitespace_only(zContent) || isDelete) |
| @@ -1320,11 +1324,11 @@ | ||
| 1320 | 1324 | @ Show query parameters</label> |
| 1321 | 1325 | @ </div> |
| 1322 | 1326 | } |
| 1323 | 1327 | @ </form> |
| 1324 | 1328 | forum_emit_js(); |
| 1325 | - style_finish_page("forum"); | |
| 1329 | + style_finish_page(); | |
| 1326 | 1330 | } |
| 1327 | 1331 | |
| 1328 | 1332 | /* |
| 1329 | 1333 | ** WEBPAGE: forummain |
| 1330 | 1334 | ** WEBPAGE: forum |
| @@ -1346,10 +1350,11 @@ | ||
| 1346 | 1350 | srchFlags = search_restrict(SRCH_FORUM); |
| 1347 | 1351 | if( !g.perm.RdForum ){ |
| 1348 | 1352 | login_needed(g.anon.RdForum); |
| 1349 | 1353 | return; |
| 1350 | 1354 | } |
| 1355 | + style_set_current_feature("forum"); | |
| 1351 | 1356 | style_header("Forum"); |
| 1352 | 1357 | if( g.perm.WrForum ){ |
| 1353 | 1358 | style_submenu_element("New Thread","%R/forumnew"); |
| 1354 | 1359 | }else{ |
| 1355 | 1360 | /* Can't combine this with previous case using the ternary operator |
| @@ -1362,11 +1367,11 @@ | ||
| 1362 | 1367 | style_submenu_element("Moderation Requests", "%R/modreq"); |
| 1363 | 1368 | } |
| 1364 | 1369 | if( (srchFlags & SRCH_FORUM)!=0 ){ |
| 1365 | 1370 | if( search_screen(SRCH_FORUM, 0) ){ |
| 1366 | 1371 | style_submenu_element("Recent Threads","%R/forum"); |
| 1367 | - style_finish_page("forum"); | |
| 1372 | + style_finish_page(); | |
| 1368 | 1373 | return; |
| 1369 | 1374 | } |
| 1370 | 1375 | } |
| 1371 | 1376 | iLimit = atoi(PD("n","25")); |
| 1372 | 1377 | iOfst = atoi(PD("x","0")); |
| @@ -1455,7 +1460,7 @@ | ||
| 1455 | 1460 | if( iCnt>0 ){ |
| 1456 | 1461 | @ </table></div> |
| 1457 | 1462 | }else{ |
| 1458 | 1463 | @ <h1>No forum posts found</h1> |
| 1459 | 1464 | } |
| 1460 | - style_finish_page("forum"); | |
| 1465 | + style_finish_page(); | |
| 1461 | 1466 | } |
| 1462 | 1467 |
| --- 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 @@ | ||
| 503 | 503 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 504 | 504 | rid = name_to_rid_www("name"); |
| 505 | 505 | if( rid==0 ){ |
| 506 | 506 | style_header("Check-in Information Error"); |
| 507 | 507 | @ No such object: %h(g.argv[2]) |
| 508 | - style_finish_page("ci_tags"); | |
| 508 | + style_finish_page(); | |
| 509 | 509 | return; |
| 510 | 510 | } |
| 511 | 511 | zHash = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 512 | 512 | style_header("Tags and Properties"); |
| 513 | 513 | @ <h1>Tags and Properties for Check-In \ |
| @@ -595,11 +595,11 @@ | ||
| 595 | 595 | blob_append_sql(&sql, " AND event.objid IN ok ORDER BY mtime DESC"); |
| 596 | 596 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 597 | 597 | www_print_timeline(&q, TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_NOSCROLL, |
| 598 | 598 | 0, 0, 0, rid, 0, 0); |
| 599 | 599 | db_finalize(&q); |
| 600 | - style_finish_page("ci_tags"); | |
| 600 | + style_finish_page(); | |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | /* |
| 604 | 604 | ** WEBPAGE: vinfo |
| 605 | 605 | ** WEBPAGE: ci |
| @@ -629,16 +629,17 @@ | ||
| 629 | 629 | const char *zPageHide = "ci"; /* Page that hides diffs */ |
| 630 | 630 | const char *zBrName; /* Branch name */ |
| 631 | 631 | |
| 632 | 632 | login_check_credentials(); |
| 633 | 633 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 634 | + style_set_current_feature("vinfo"); | |
| 634 | 635 | zName = P("name"); |
| 635 | 636 | rid = name_to_rid_www("name"); |
| 636 | 637 | if( rid==0 ){ |
| 637 | 638 | style_header("Check-in Information Error"); |
| 638 | 639 | @ No such object: %h(g.argv[2]) |
| 639 | - style_finish_page("vinfo"); | |
| 640 | + style_finish_page(); | |
| 640 | 641 | return; |
| 641 | 642 | } |
| 642 | 643 | zRe = P("regex"); |
| 643 | 644 | if( zRe ) re_compile(&pRe, zRe, 0); |
| 644 | 645 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -940,11 +941,11 @@ | ||
| 940 | 941 | diffFlags,pRe,mperm); |
| 941 | 942 | } |
| 942 | 943 | db_finalize(&q3); |
| 943 | 944 | append_diff_javascript(diffType==2); |
| 944 | 945 | cookie_render(); |
| 945 | - style_finish_page("vinfo"); | |
| 946 | + style_finish_page(); | |
| 946 | 947 | } |
| 947 | 948 | |
| 948 | 949 | /* |
| 949 | 950 | ** WEBPAGE: winfo |
| 950 | 951 | ** URL: /winfo?name=HASH |
| @@ -962,15 +963,16 @@ | ||
| 962 | 963 | int tagid; |
| 963 | 964 | int ridNext; |
| 964 | 965 | |
| 965 | 966 | login_check_credentials(); |
| 966 | 967 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 968 | + style_set_current_feature("winfo"); | |
| 967 | 969 | rid = name_to_rid_www("name"); |
| 968 | 970 | if( rid==0 || (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))==0 ){ |
| 969 | 971 | style_header("Wiki Page Information Error"); |
| 970 | 972 | @ No such object: %h(P("name")) |
| 971 | - style_finish_page("winfo"); | |
| 973 | + style_finish_page(); | |
| 972 | 974 | return; |
| 973 | 975 | } |
| 974 | 976 | if( g.perm.ModWiki && (zModAction = P("modaction"))!=0 ){ |
| 975 | 977 | if( strcmp(zModAction,"delete")==0 ){ |
| 976 | 978 | moderation_disapprove(rid); |
| @@ -1054,11 +1056,11 @@ | ||
| 1054 | 1056 | safe_html_context(DOCSRC_WIKI); |
| 1055 | 1057 | wiki_render_by_mimetype(&wiki, pWiki->zMimetype); |
| 1056 | 1058 | blob_reset(&wiki); |
| 1057 | 1059 | manifest_destroy(pWiki); |
| 1058 | 1060 | document_emit_js(); |
| 1059 | - style_finish_page("winfo"); | |
| 1061 | + style_finish_page(); | |
| 1060 | 1062 | } |
| 1061 | 1063 | |
| 1062 | 1064 | /* |
| 1063 | 1065 | ** Find an check-in based on query parameter zParam and parse its |
| 1064 | 1066 | ** manifest. Return the number of errors. |
| @@ -1210,10 +1212,11 @@ | ||
| 1210 | 1212 | if(zGlob && !*zGlob){ |
| 1211 | 1213 | zGlob = NULL; |
| 1212 | 1214 | } |
| 1213 | 1215 | diffFlags = construct_diff_flags(diffType); |
| 1214 | 1216 | zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":""; |
| 1217 | + style_set_current_feature("vdiff"); | |
| 1215 | 1218 | if( zBranch==0 ){ |
| 1216 | 1219 | style_submenu_element("Path", "%R/timeline?me=%T&you=%T", zFrom, zTo); |
| 1217 | 1220 | } |
| 1218 | 1221 | if( diffType!=0 ){ |
| 1219 | 1222 | style_submenu_element("Hide Diff", "%R/vdiff?%s&diff=0%s%T%s", |
| @@ -1327,11 +1330,11 @@ | ||
| 1327 | 1330 | } |
| 1328 | 1331 | } |
| 1329 | 1332 | manifest_destroy(pFrom); |
| 1330 | 1333 | manifest_destroy(pTo); |
| 1331 | 1334 | append_diff_javascript(diffType==2); |
| 1332 | - style_finish_page("vdiff"); | |
| 1335 | + style_finish_page(); | |
| 1333 | 1336 | } |
| 1334 | 1337 | |
| 1335 | 1338 | #if INTERFACE |
| 1336 | 1339 | /* |
| 1337 | 1340 | ** Possible return values from object_description() |
| @@ -1730,10 +1733,11 @@ | ||
| 1730 | 1733 | |
| 1731 | 1734 | zV1 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v1); |
| 1732 | 1735 | zV2 = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", v2); |
| 1733 | 1736 | diffFlags = construct_diff_flags(diffType) | DIFF_HTML; |
| 1734 | 1737 | |
| 1738 | + style_set_current_feature("fdiff"); | |
| 1735 | 1739 | style_header("Diff"); |
| 1736 | 1740 | style_submenu_checkbox("w", "Ignore Whitespace", 0, 0); |
| 1737 | 1741 | if( diffType==2 ){ |
| 1738 | 1742 | style_submenu_element("Unified Diff", "%R/fdiff?v1=%T&v2=%T&diff=1", |
| 1739 | 1743 | P("v1"), P("v2")); |
| @@ -1761,11 +1765,11 @@ | ||
| 1761 | 1765 | @ are shown.</b> |
| 1762 | 1766 | } |
| 1763 | 1767 | @ <hr /> |
| 1764 | 1768 | append_diff(zV1, zV2, diffFlags, pRe); |
| 1765 | 1769 | append_diff_javascript(diffType); |
| 1766 | - style_finish_page("fdiff"); | |
| 1770 | + style_finish_page(); | |
| 1767 | 1771 | } |
| 1768 | 1772 | |
| 1769 | 1773 | /* |
| 1770 | 1774 | ** WEBPAGE: raw |
| 1771 | 1775 | ** URL: /raw/ARTIFACTID |
| @@ -1965,11 +1969,11 @@ | ||
| 1965 | 1969 | @ <hr /> |
| 1966 | 1970 | content_get(rid, &content); |
| 1967 | 1971 | @ <blockquote><pre> |
| 1968 | 1972 | hexdump(&content); |
| 1969 | 1973 | @ </pre></blockquote> |
| 1970 | - style_finish_page("hexdump"); | |
| 1974 | + style_finish_page(); | |
| 1971 | 1975 | } |
| 1972 | 1976 | |
| 1973 | 1977 | /* |
| 1974 | 1978 | ** Look for "ci" and "filename" query parameters. If found, try to |
| 1975 | 1979 | ** use them to extract the record ID of an artifact for the file. |
| @@ -2234,10 +2238,11 @@ | ||
| 2234 | 2238 | int isBranchCI = 0; /* ci= refers to a branch name */ |
| 2235 | 2239 | char *zHeader = 0; |
| 2236 | 2240 | |
| 2237 | 2241 | login_check_credentials(); |
| 2238 | 2242 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 2243 | + style_set_current_feature("artifact"); | |
| 2239 | 2244 | |
| 2240 | 2245 | /* Capture and normalize the name= and ci= query parameters */ |
| 2241 | 2246 | if( zName==0 ){ |
| 2242 | 2247 | zName = P("filename"); |
| 2243 | 2248 | if( zName==0 ){ |
| @@ -2263,11 +2268,11 @@ | ||
| 2263 | 2268 | page_tree(); |
| 2264 | 2269 | return; |
| 2265 | 2270 | } |
| 2266 | 2271 | style_header("Missing name= query parameter"); |
| 2267 | 2272 | @ The name= query parameter is missing |
| 2268 | - style_finish_page("artifact"); | |
| 2273 | + style_finish_page(); | |
| 2269 | 2274 | return; |
| 2270 | 2275 | } |
| 2271 | 2276 | |
| 2272 | 2277 | url_initialize(&url, g.zPath); |
| 2273 | 2278 | url_add_parameter(&url, "name", zName); |
| @@ -2324,11 +2329,11 @@ | ||
| 2324 | 2329 | }else{ |
| 2325 | 2330 | style_header("No such artifact"); |
| 2326 | 2331 | @ Artifact '%h(zName)' does not exist in this repository. |
| 2327 | 2332 | } |
| 2328 | 2333 | if( rid==0 ){ |
| 2329 | - style_finish_page("artifact"); | |
| 2334 | + style_finish_page(); | |
| 2330 | 2335 | return; |
| 2331 | 2336 | } |
| 2332 | 2337 | } |
| 2333 | 2338 | |
| 2334 | 2339 | if( descOnly || P("verbose")!=0 ){ |
| @@ -2532,11 +2537,11 @@ | ||
| 2532 | 2537 | @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i> |
| 2533 | 2538 | } |
| 2534 | 2539 | @ </blockquote> |
| 2535 | 2540 | } |
| 2536 | 2541 | } |
| 2537 | - style_finish_page("artifact"); | |
| 2542 | + style_finish_page(); | |
| 2538 | 2543 | } |
| 2539 | 2544 | |
| 2540 | 2545 | /* |
| 2541 | 2546 | ** WEBPAGE: tinfo |
| 2542 | 2547 | ** URL: /tinfo?name=ARTIFACTID |
| @@ -2590,10 +2595,11 @@ | ||
| 2590 | 2595 | } |
| 2591 | 2596 | zTktTitle = db_table_has_column("repository", "ticket", "title" ) |
| 2592 | 2597 | ? db_text("(No title)", |
| 2593 | 2598 | "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName) |
| 2594 | 2599 | : 0; |
| 2600 | + style_set_current_feature("tinfo"); | |
| 2595 | 2601 | style_header("Ticket Change Details"); |
| 2596 | 2602 | style_submenu_element("Raw", "%R/artifact/%s", zUuid); |
| 2597 | 2603 | style_submenu_element("History", "%R/tkthistory/%s", zTktName); |
| 2598 | 2604 | style_submenu_element("Page", "%R/tktview/%t", zTktName); |
| 2599 | 2605 | style_submenu_element("Timeline", "%R/tkttimeline/%t", zTktName); |
| @@ -2639,11 +2645,11 @@ | ||
| 2639 | 2645 | |
| 2640 | 2646 | @ <div class="section">Changes</div> |
| 2641 | 2647 | @ <p> |
| 2642 | 2648 | ticket_output_change_artifact(pTktChng, 0, 1); |
| 2643 | 2649 | manifest_destroy(pTktChng); |
| 2644 | - style_finish_page("tinfo"); | |
| 2650 | + style_finish_page(); | |
| 2645 | 2651 | } |
| 2646 | 2652 | |
| 2647 | 2653 | |
| 2648 | 2654 | /* |
| 2649 | 2655 | ** WEBPAGE: info |
| @@ -2690,11 +2696,11 @@ | ||
| 2690 | 2696 | @ <p>No such object: %h(zName)</p> |
| 2691 | 2697 | if( nLen<4 ){ |
| 2692 | 2698 | @ <p>Object name should be no less than 4 characters. Ten or more |
| 2693 | 2699 | @ characters are recommended.</p> |
| 2694 | 2700 | } |
| 2695 | - style_finish_page("info"); | |
| 2701 | + style_finish_page(); | |
| 2696 | 2702 | return; |
| 2697 | 2703 | }else if( rc==2 ){ |
| 2698 | 2704 | cgi_set_parameter("src","info"); |
| 2699 | 2705 | ambiguous_page(); |
| 2700 | 2706 | return; |
| @@ -2702,11 +2708,11 @@ | ||
| 2702 | 2708 | zName = blob_str(&uuid); |
| 2703 | 2709 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%Q", zName); |
| 2704 | 2710 | if( rid==0 ){ |
| 2705 | 2711 | style_header("Broken Link"); |
| 2706 | 2712 | @ <p>No such object: %h(zName)</p> |
| 2707 | - style_finish_page("info"); | |
| 2713 | + style_finish_page(); | |
| 2708 | 2714 | return; |
| 2709 | 2715 | } |
| 2710 | 2716 | if( db_exists("SELECT 1 FROM mlink WHERE mid=%d", rid) ){ |
| 2711 | 2717 | ci_page(); |
| 2712 | 2718 | }else |
| @@ -3227,11 +3233,11 @@ | ||
| 3227 | 3233 | } |
| 3228 | 3234 | @ </td></tr> |
| 3229 | 3235 | @ </table> |
| 3230 | 3236 | @ </div></form> |
| 3231 | 3237 | builtin_request_js("ci_edit.js"); |
| 3232 | - style_finish_page("ci_edit"); | |
| 3238 | + style_finish_page(); | |
| 3233 | 3239 | } |
| 3234 | 3240 | |
| 3235 | 3241 | /* |
| 3236 | 3242 | ** Prepare an ammended commit comment. Let the user modify it using the |
| 3237 | 3243 | ** editor specified in the global_config table or either |
| 3238 | 3244 |
| --- 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 @@ | ||
| 343 | 343 | zTag, zBase, zHash, zWiki); |
| 344 | 344 | db_protect_pop(); |
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | + style_set_current_feature("interwiki"); | |
| 348 | 349 | style_header("Interwiki Map Configuration"); |
| 349 | 350 | @ <p>Interwiki links are hyperlink targets of the form |
| 350 | 351 | @ <blockquote><i>Tag</i><b>:</b><i>PageName</i></blockquote> |
| 351 | 352 | @ <p>Such links resolve to links to <i>PageName</i> on a separate server |
| 352 | 353 | @ identified by <i>Tag</i>. The Interwiki Map or "intermap" is a mapping |
| @@ -388,11 +389,11 @@ | ||
| 388 | 389 | @ No mappings are currently defined. |
| 389 | 390 | } |
| 390 | 391 | |
| 391 | 392 | if( !g.perm.Setup ){ |
| 392 | 393 | /* Do not show intermap editing fields to non-setup users */ |
| 393 | - style_finish_page("interwiki"); | |
| 394 | + style_finish_page(); | |
| 394 | 395 | return; |
| 395 | 396 | } |
| 396 | 397 | |
| 397 | 398 | @ <p>To add a new mapping, fill out the form below providing a unique name |
| 398 | 399 | @ for the tag. To edit an exist mapping, fill out the form and use the |
| @@ -421,7 +422,7 @@ | ||
| 421 | 422 | @ <tr><td></td> |
| 422 | 423 | @ <td><input type="submit" name="submit" value="Apply Changes"></td></tr> |
| 423 | 424 | @ </table> |
| 424 | 425 | @ </form> |
| 425 | 426 | |
| 426 | - style_finish_page("interwiki"); | |
| 427 | + style_finish_page(); | |
| 427 | 428 | } |
| 428 | 429 |
| --- 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 @@ | ||
| 52 | 52 | */ |
| 53 | 53 | void load_control(void){ |
| 54 | 54 | double mxLoad = atof(db_get("max-loadavg", 0)); |
| 55 | 55 | if( mxLoad<=0.0 || mxLoad>=load_average() ) return; |
| 56 | 56 | |
| 57 | + style_set_current_feature("test"); | |
| 57 | 58 | style_header("Server Overload"); |
| 58 | 59 | @ <h2>The server load is currently too high. |
| 59 | 60 | @ Please try again later.</h2> |
| 60 | 61 | @ <p>Current load average: %f(load_average()).<br /> |
| 61 | 62 | @ Load average limit: %f(mxLoad)</p> |
| 62 | - style_finish_page("test"); | |
| 63 | + style_finish_page(); | |
| 63 | 64 | cgi_set_status(503,"Server Overload"); |
| 64 | 65 | cgi_reply(); |
| 65 | 66 | exit(0); |
| 66 | 67 | } |
| 67 | 68 |
| --- 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 @@ | ||
| 656 | 656 | */ |
| 657 | 657 | login_set_user_cookie(zUsername, uid, NULL, rememberMe?0:1); |
| 658 | 658 | redirect_to_g(); |
| 659 | 659 | } |
| 660 | 660 | } |
| 661 | + style_set_current_feature("login"); | |
| 661 | 662 | style_header("Login/Logout"); |
| 662 | 663 | style_adunit_config(ADUNIT_OFF); |
| 663 | 664 | @ %s(zErrMsg) |
| 664 | 665 | if( zGoto && !noAnon ){ |
| 665 | 666 | char *zAbbrev = fossil_strdup(zGoto); |
| @@ -795,11 +796,11 @@ | ||
| 795 | 796 | @ <td><input type="submit" value="Change Password" /></td></tr> |
| 796 | 797 | @ </table> |
| 797 | 798 | @ </form> |
| 798 | 799 | } |
| 799 | 800 | } |
| 800 | - style_finish_page("login"); | |
| 801 | + style_finish_page(); | |
| 801 | 802 | } |
| 802 | 803 | |
| 803 | 804 | /* |
| 804 | 805 | ** Attempt to find login credentials for user zLogin on a peer repository |
| 805 | 806 | ** with project code zCode. Transfer those credentials to the local |
| @@ -1549,11 +1550,11 @@ | ||
| 1549 | 1550 | int doAlerts = 0; /* True if subscription is wanted too */ |
| 1550 | 1551 | if( !db_get_boolean("self-register", 0) ){ |
| 1551 | 1552 | style_header("Registration not possible"); |
| 1552 | 1553 | @ <p>This project does not allow user self-registration. Please contact the |
| 1553 | 1554 | @ project administrator to obtain an account.</p> |
| 1554 | - style_finish_page("register"); | |
| 1555 | + style_finish_page(); | |
| 1555 | 1556 | return; |
| 1556 | 1557 | } |
| 1557 | 1558 | zPerms = db_get("default-perms", "u"); |
| 1558 | 1559 | |
| 1559 | 1560 | /* Prompt the user for email alerts if this repository is configured for |
| @@ -1708,11 +1709,11 @@ | ||
| 1708 | 1709 | } |
| 1709 | 1710 | alert_sender_free(pSender); |
| 1710 | 1711 | if( zGoto ){ |
| 1711 | 1712 | @ <p><a href='%h(zGoto)'>Continue</a> |
| 1712 | 1713 | } |
| 1713 | - style_finish_page("register"); | |
| 1714 | + style_finish_page(); | |
| 1714 | 1715 | return; |
| 1715 | 1716 | } |
| 1716 | 1717 | redirect_to_g(); |
| 1717 | 1718 | } |
| 1718 | 1719 | |
| @@ -1800,11 +1801,11 @@ | ||
| 1800 | 1801 | @ %h(zCaptcha) |
| 1801 | 1802 | @ </pre> |
| 1802 | 1803 | @ Enter this 8-letter code in the "Captcha" box above. |
| 1803 | 1804 | @ </td></tr></table></div> |
| 1804 | 1805 | @ </form> |
| 1805 | - style_finish_page("register"); | |
| 1806 | + style_finish_page(); | |
| 1806 | 1807 | |
| 1807 | 1808 | free(zCaptcha); |
| 1808 | 1809 | } |
| 1809 | 1810 | |
| 1810 | 1811 | /* |
| 1811 | 1812 |
| --- 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 @@ | ||
| 1310 | 1310 | style_submenu_element("Stat", "stat"); |
| 1311 | 1311 | fossil_version_blob(&versionInfo, verboseFlag); |
| 1312 | 1312 | @ <pre> |
| 1313 | 1313 | @ %h(blob_str(&versionInfo)) |
| 1314 | 1314 | @ </pre> |
| 1315 | - style_finish_page("version"); | |
| 1315 | + style_finish_page(); | |
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | 1318 | |
| 1319 | 1319 | /* |
| 1320 | 1320 | ** Set the g.zBaseURL value to the full URL for the toplevel of |
| @@ -3049,10 +3049,11 @@ | ||
| 3049 | 3049 | login_check_credentials(); |
| 3050 | 3050 | if( !g.perm.Admin ){ |
| 3051 | 3051 | login_needed(0); |
| 3052 | 3052 | return; |
| 3053 | 3053 | } |
| 3054 | + style_set_current_feature("test"); | |
| 3054 | 3055 | style_header("Warning Test Page"); |
| 3055 | 3056 | style_submenu_element("Error Log","%R/errorlog"); |
| 3056 | 3057 | if( iCase<1 || iCase>4 ){ |
| 3057 | 3058 | @ <p>Generate a message to the <a href="%R/errorlog">error log</a> |
| 3058 | 3059 | @ by clicking on one of the following cases: |
| @@ -3097,7 +3098,7 @@ | ||
| 3097 | 3098 | cgi_reset_content(); |
| 3098 | 3099 | webpage_error("Case 7 from /test-warning"); |
| 3099 | 3100 | } |
| 3100 | 3101 | @ </ol> |
| 3101 | 3102 | @ <p>End of test</p> |
| 3102 | - style_finish_page("test"); | |
| 3103 | + style_finish_page(); | |
| 3103 | 3104 | } |
| 3104 | 3105 |
| --- 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 @@ | ||
| 189 | 189 | ); |
| 190 | 190 | db_prepare(&q, "%s", blob_sql_text(&sql)); |
| 191 | 191 | www_print_timeline(&q, 0, 0, 0, 0, 0, 0, 0); |
| 192 | 192 | db_finalize(&q); |
| 193 | 193 | } |
| 194 | - style_finish_page("modreq"); | |
| 194 | + style_finish_page(); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /* |
| 198 | 198 | ** Disapproves any entries in the modreq table which belong to any |
| 199 | 199 | ** user whose name is no longer found in the user table. This is only |
| 200 | 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("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 @@ | ||
| 668 | 668 | @ </li></ul> |
| 669 | 669 | @ </p></li> |
| 670 | 670 | } |
| 671 | 671 | @ </ol> |
| 672 | 672 | db_finalize(&q); |
| 673 | - style_finish_page("ambiguous"); | |
| 673 | + style_finish_page(); | |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | /* |
| 677 | 677 | ** Convert the name in CGI parameter zParamName into a rid and return that |
| 678 | 678 | ** rid. If the CGI parameter is missing or is not a valid artifact tag, |
| @@ -1328,11 +1328,11 @@ | ||
| 1328 | 1328 | for(i=1; i<=mx; i+=n){ |
| 1329 | 1329 | @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n)) |
| 1330 | 1330 | @ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a> |
| 1331 | 1331 | } |
| 1332 | 1332 | @ </ul> |
| 1333 | - style_finish_page("bloblist"); | |
| 1333 | + style_finish_page(); | |
| 1334 | 1334 | return; |
| 1335 | 1335 | } |
| 1336 | 1336 | if( phantomOnly || privOnly || mx>n ){ |
| 1337 | 1337 | style_submenu_element("Index", "bloblist"); |
| 1338 | 1338 | } |
| @@ -1407,11 +1407,11 @@ | ||
| 1407 | 1407 | } |
| 1408 | 1408 | @ </tr> |
| 1409 | 1409 | } |
| 1410 | 1410 | @ </table> |
| 1411 | 1411 | db_finalize(&q); |
| 1412 | - style_finish_page("bloblist"); | |
| 1412 | + style_finish_page(); | |
| 1413 | 1413 | } |
| 1414 | 1414 | |
| 1415 | 1415 | /* |
| 1416 | 1416 | ** Output HTML that shows a table of all public phantoms. |
| 1417 | 1417 | */ |
| @@ -1489,11 +1489,11 @@ | ||
| 1489 | 1489 | } |
| 1490 | 1490 | if( g.perm.Write ){ |
| 1491 | 1491 | style_submenu_element("Artifact Stats", "artifact_stats"); |
| 1492 | 1492 | } |
| 1493 | 1493 | table_of_public_phantoms(); |
| 1494 | - style_finish_page("phantoms"); | |
| 1494 | + style_finish_page(); | |
| 1495 | 1495 | } |
| 1496 | 1496 | |
| 1497 | 1497 | /* |
| 1498 | 1498 | ** WEBPAGE: bigbloblist |
| 1499 | 1499 | ** |
| @@ -1553,11 +1553,11 @@ | ||
| 1553 | 1553 | @ </tr> |
| 1554 | 1554 | } |
| 1555 | 1555 | @ </tbody></table> |
| 1556 | 1556 | db_finalize(&q); |
| 1557 | 1557 | style_table_sorter(); |
| 1558 | - style_finish_page("bigbloblist"); | |
| 1558 | + style_finish_page(); | |
| 1559 | 1559 | } |
| 1560 | 1560 | |
| 1561 | 1561 | /* |
| 1562 | 1562 | ** COMMAND: test-unsent |
| 1563 | 1563 | ** |
| @@ -1677,7 +1677,7 @@ | ||
| 1677 | 1677 | collision_report("SELECT (SELECT uuid FROM blob WHERE rid=objid)" |
| 1678 | 1678 | " FROM event WHERE event.type='ci'" |
| 1679 | 1679 | " ORDER BY 1"); |
| 1680 | 1680 | @ <h1>Hash Prefix Collisions on All Artifacts</h1> |
| 1681 | 1681 | collision_report("SELECT uuid FROM blob ORDER BY 1"); |
| 1682 | - style_finish_page("hash-collisions"); | |
| 1682 | + style_finish_page(); | |
| 1683 | 1683 | } |
| 1684 | 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("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 @@ | ||
| 617 | 617 | int nRename; |
| 618 | 618 | int nCheckin; |
| 619 | 619 | |
| 620 | 620 | login_check_credentials(); |
| 621 | 621 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 622 | + style_set_current_feature("test"); | |
| 622 | 623 | if( P("all")!=0 ){ |
| 623 | 624 | style_header("List Of All Filename Changes"); |
| 624 | 625 | db_multi_exec("%s", zRenameQuery/*safe-for-%s*/); |
| 625 | 626 | style_submenu_element("Distinct", "%R/test-rename-list"); |
| 626 | 627 | }else{ |
| @@ -651,7 +652,7 @@ | ||
| 651 | 652 | @ <td>%z(href("%R/info/%!S",zUuid))%S(zUuid)</a></td></tr> |
| 652 | 653 | } |
| 653 | 654 | @ </tbody></table> |
| 654 | 655 | db_finalize(&q); |
| 655 | 656 | style_table_sorter(); |
| 656 | - style_finish_page("test"); | |
| 657 | + style_finish_page(); | |
| 657 | 658 | } |
| 658 | 659 |
| --- 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 @@ | ||
| 277 | 277 | int width; |
| 278 | 278 | int height; |
| 279 | 279 | int i, j; |
| 280 | 280 | |
| 281 | 281 | login_check_credentials(); |
| 282 | + style_set_current_feature("test"); | |
| 282 | 283 | style_header("Pie Chart Test"); |
| 283 | 284 | db_multi_exec("CREATE TEMP TABLE piechart(amt REAL, label TEXT);"); |
| 284 | 285 | db_prepare(&ins, "INSERT INTO piechart(amt,label) VALUES(:amt,:label)"); |
| 285 | 286 | zData = PD("data",""); |
| 286 | 287 | width = atoi(PD("width","800")); |
| @@ -328,7 +329,7 @@ | ||
| 328 | 329 | @ <li> <a href='test-piechart?data=2,2,2,2,2,44,44,2,2,2,2,2'>Case 2</a> |
| 329 | 330 | @ <li> <a href='test-piechart?data=20,2,2,2,2,2,2,2,2,2,2,80'>Case 3</a> |
| 330 | 331 | @ <li> <a href='test-piechart?data=80,2,2,2,2,2,2,2,2,2,2,20'>Case 4</a> |
| 331 | 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> |
| 332 | 333 | @ </ul> |
| 333 | - style_finish_page("test"); | |
| 334 | + style_finish_page(); | |
| 334 | 335 | } |
| 335 | 336 |
| --- 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 |
+1
-1
| --- src/pikchrshow.c | ||
| +++ src/pikchrshow.c | ||
| @@ -374,11 +374,11 @@ | ||
| 374 | 374 | } CX("</div>"/*sbs-wrapper*/); |
| 375 | 375 | builtin_fossil_js_bundle_or("fetch", "copybutton", "popupwidget", |
| 376 | 376 | "storage", "pikchr", NULL); |
| 377 | 377 | builtin_request_js("fossil.page.pikchrshow.js"); |
| 378 | 378 | builtin_fulfill_js_requests(); |
| 379 | - style_finish_page("pikchrshow"); | |
| 379 | + style_finish_page(); | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /* |
| 383 | 383 | ** COMMAND: pikchr* |
| 384 | 384 | ** |
| 385 | 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("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 @@ | ||
| 1116 | 1116 | #endif |
| 1117 | 1117 | if( g.cgiOutput==1 && g.db ){ |
| 1118 | 1118 | g.cgiOutput = 2; |
| 1119 | 1119 | cgi_reset_content(); |
| 1120 | 1120 | cgi_set_content_type("text/html"); |
| 1121 | + style_set_current_feature("error"); | |
| 1121 | 1122 | style_header("Bad Request"); |
| 1122 | 1123 | etag_cancel(); |
| 1123 | 1124 | @ <p class="generalError">%h(z)</p> |
| 1124 | 1125 | cgi_set_status(400, "Bad Request"); |
| 1125 | - style_finish_page("error"); | |
| 1126 | + style_finish_page(); | |
| 1126 | 1127 | cgi_reply(); |
| 1127 | 1128 | }else if( !g.fQuiet ){ |
| 1128 | 1129 | fossil_force_newline(); |
| 1129 | 1130 | fossil_trace("%s\n", z); |
| 1130 | 1131 | } |
| 1131 | 1132 |
| --- 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 @@ | ||
| 245 | 245 | /* This case runs if remote_repository_info() found a repository |
| 246 | 246 | ** that has the "repolist_skin" property set to non-zero and left |
| 247 | 247 | ** that repository open in g.db. Use the skin of that repository |
| 248 | 248 | ** for display. */ |
| 249 | 249 | login_check_credentials(); |
| 250 | + style_set_current_feature("repolist"); | |
| 250 | 251 | style_header("Repository List"); |
| 251 | 252 | @ %s(blob_str(&html)) |
| 252 | 253 | style_table_sorter(); |
| 253 | - style_finish_page("repolist"); | |
| 254 | + style_finish_page(); | |
| 254 | 255 | }else{ |
| 255 | 256 | /* If no repositories were found that had the "repolist_skin" |
| 256 | 257 | ** property set, then use a default skin */ |
| 257 | 258 | @ <html> |
| 258 | 259 | @ <head> |
| 259 | 260 |
| --- 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 @@ | ||
| 97 | 97 | Th_Render(zScript); |
| 98 | 98 | |
| 99 | 99 | blob_reset(&ril); |
| 100 | 100 | if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1); |
| 101 | 101 | |
| 102 | - style_finish_page("reportlist"); | |
| 102 | + style_finish_page(); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /* |
| 106 | 106 | ** Remove whitespace from both ends of a string. |
| 107 | 107 | */ |
| @@ -325,14 +325,15 @@ | ||
| 325 | 325 | return; |
| 326 | 326 | } |
| 327 | 327 | rn = atoi(PD("rn","0")); |
| 328 | 328 | db_prepare(&q, "SELECT title, sqlcode, owner, cols " |
| 329 | 329 | "FROM reportfmt WHERE rn=%d",rn); |
| 330 | + style_set_current_feature("report"); | |
| 330 | 331 | style_header("SQL For Report Format Number %d", rn); |
| 331 | 332 | if( db_step(&q)!=SQLITE_ROW ){ |
| 332 | 333 | @ <p>Unknown report number: %d(rn)</p> |
| 333 | - style_finish_page("report"); | |
| 334 | + style_finish_page(); | |
| 334 | 335 | db_finalize(&q); |
| 335 | 336 | return; |
| 336 | 337 | } |
| 337 | 338 | zTitle = db_column_text(&q, 0); |
| 338 | 339 | zSQL = db_column_text(&q, 1); |
| @@ -350,11 +351,11 @@ | ||
| 350 | 351 | @ <td width=15></td><td valign="top"> |
| 351 | 352 | output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3"); |
| 352 | 353 | @ </td> |
| 353 | 354 | @ </tr></table> |
| 354 | 355 | report_format_hints(); |
| 355 | - style_finish_page("report"); | |
| 356 | + style_finish_page(); | |
| 356 | 357 | db_finalize(&q); |
| 357 | 358 | } |
| 358 | 359 | |
| 359 | 360 | /* |
| 360 | 361 | ** WEBPAGE: rptnew |
| @@ -381,10 +382,11 @@ | ||
| 381 | 382 | login_check_credentials(); |
| 382 | 383 | if( !g.perm.TktFmt ){ |
| 383 | 384 | login_needed(g.anon.TktFmt); |
| 384 | 385 | return; |
| 385 | 386 | } |
| 387 | + style_set_current_feature("report"); | |
| 386 | 388 | /*view_add_functions(0);*/ |
| 387 | 389 | rn = atoi(PD("rn","0")); |
| 388 | 390 | zTitle = P("t"); |
| 389 | 391 | zOwner = PD("w",g.zLogin); |
| 390 | 392 | z = P("s"); |
| @@ -410,11 +412,11 @@ | ||
| 410 | 412 | @ <input type="hidden" name="rn" value="%d(rn)"> |
| 411 | 413 | login_insert_csrf_secret(); |
| 412 | 414 | @ <input type="submit" name="del2" value="Delete The Report"> |
| 413 | 415 | @ <input type="submit" name="can" value="Cancel"> |
| 414 | 416 | @ </form> |
| 415 | - style_finish_page("report"); | |
| 417 | + style_finish_page(); | |
| 416 | 418 | return; |
| 417 | 419 | }else if( P("can") ){ |
| 418 | 420 | /* user cancelled */ |
| 419 | 421 | cgi_redirect("reportlist"); |
| 420 | 422 | return; |
| @@ -502,20 +504,20 @@ | ||
| 502 | 504 | if( !g.perm.Admin && fossil_strcmp(zOwner,g.zLogin)!=0 ){ |
| 503 | 505 | @ <p>This report format is owned by %h(zOwner). You are not allowed |
| 504 | 506 | @ to change it.</p> |
| 505 | 507 | @ </form> |
| 506 | 508 | report_format_hints(); |
| 507 | - style_finish_page("report"); | |
| 509 | + style_finish_page(); | |
| 508 | 510 | return; |
| 509 | 511 | } |
| 510 | 512 | @ <input type="submit" value="Apply Changes" /> |
| 511 | 513 | if( rn>0 ){ |
| 512 | 514 | @ <input type="submit" value="Delete This Report" name="del1" /> |
| 513 | 515 | } |
| 514 | 516 | @ </div></form> |
| 515 | 517 | report_format_hints(); |
| 516 | - style_finish_page("report"); | |
| 518 | + style_finish_page(); | |
| 517 | 519 | } |
| 518 | 520 | |
| 519 | 521 | /* |
| 520 | 522 | ** Output a bunch of text that provides information about report |
| 521 | 523 | ** formats |
| @@ -1029,10 +1031,11 @@ | ||
| 1029 | 1031 | count = 0; |
| 1030 | 1032 | if( !tabs ){ |
| 1031 | 1033 | struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1032 | 1034 | |
| 1033 | 1035 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1036 | + style_set_current_feature("report"); | |
| 1034 | 1037 | style_submenu_element("Raw", "rptview?tablist=1&%h", PD("QUERY_STRING","")); |
| 1035 | 1038 | if( g.perm.Admin |
| 1036 | 1039 | || (g.perm.TktFmt && g.zLogin && fossil_strcmp(g.zLogin,zOwner)==0) ){ |
| 1037 | 1040 | style_submenu_element("Edit", "rptedit?rn=%d", rn); |
| 1038 | 1041 | } |
| @@ -1057,11 +1060,11 @@ | ||
| 1057 | 1060 | @ <p class="reportError">Error: %h(zErr1)</p> |
| 1058 | 1061 | }else if( zErr2 ){ |
| 1059 | 1062 | @ <p class="reportError">Error: %h(zErr2)</p> |
| 1060 | 1063 | } |
| 1061 | 1064 | style_table_sorter(); |
| 1062 | - style_finish_page("report"); | |
| 1065 | + style_finish_page(); | |
| 1063 | 1066 | }else{ |
| 1064 | 1067 | report_restrict_sql(&zErr1); |
| 1065 | 1068 | db_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2); |
| 1066 | 1069 | report_unrestrict_sql(); |
| 1067 | 1070 | cgi_set_content_type("text/plain"); |
| 1068 | 1071 |
| --- 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 @@ | ||
| 1212 | 1212 | */ |
| 1213 | 1213 | void search_page(void){ |
| 1214 | 1214 | login_check_credentials(); |
| 1215 | 1215 | style_header("Search"); |
| 1216 | 1216 | search_screen(SRCH_ALL, 1); |
| 1217 | - style_finish_page("search"); | |
| 1217 | + style_finish_page(); | |
| 1218 | 1218 | } |
| 1219 | 1219 | |
| 1220 | 1220 | |
| 1221 | 1221 | /* |
| 1222 | 1222 | ** This is a helper function for search_stext(). Writing into pOut |
| @@ -1979,13 +1979,14 @@ | ||
| 1979 | 1979 | const char *zIdxed = P("ixed"); |
| 1980 | 1980 | int id; |
| 1981 | 1981 | int cnt1 = 0, cnt2 = 0, cnt3 = 0; |
| 1982 | 1982 | login_check_credentials(); |
| 1983 | 1983 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 1984 | + style_set_current_feature("test"); | |
| 1984 | 1985 | if( !search_index_exists() ){ |
| 1985 | 1986 | @ <p>Indexed search is disabled |
| 1986 | - style_finish_page("report"); | |
| 1987 | + style_finish_page(); | |
| 1987 | 1988 | return; |
| 1988 | 1989 | } |
| 1989 | 1990 | search_sql_setup(g.db); |
| 1990 | 1991 | style_submenu_element("Setup","%R/srchsetup"); |
| 1991 | 1992 | if( zId!=0 && (id = atoi(zId))>0 ){ |
| @@ -2025,11 +2026,11 @@ | ||
| 2025 | 2026 | style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=1",zDocId[0]); |
| 2026 | 2027 | zName = mprintf("Unindexed '%c' docs",zDocId[0]); |
| 2027 | 2028 | style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=0",zDocId[0]); |
| 2028 | 2029 | } |
| 2029 | 2030 | db_finalize(&q); |
| 2030 | - style_finish_page("test"); | |
| 2031 | + style_finish_page(); | |
| 2031 | 2032 | return; |
| 2032 | 2033 | } |
| 2033 | 2034 | if( zType!=0 && zType[0]!=0 && zType[1]==0 && |
| 2034 | 2035 | zIdxed!=0 && (zIdxed[0]=='1' || zIdxed[0]=='0') && zIdxed[1]==0 |
| 2035 | 2036 | ){ |
| @@ -2055,11 +2056,11 @@ | ||
| 2055 | 2056 | @ <li> <a href='test-ftsdocs?id=%d(db_column_int(&q,0))'> |
| 2056 | 2057 | @ %h(db_column_text(&q,1))</a> |
| 2057 | 2058 | } |
| 2058 | 2059 | @ </ul> |
| 2059 | 2060 | db_finalize(&q); |
| 2060 | - style_finish_page("test"); | |
| 2061 | + style_finish_page(); | |
| 2061 | 2062 | return; |
| 2062 | 2063 | } |
| 2063 | 2064 | style_header("Summary of ftsdocs"); |
| 2064 | 2065 | db_prepare(&q, |
| 2065 | 2066 | "SELECT type, sum(idxed IS TRUE), sum(idxed IS FALSE), count(*)" |
| @@ -2099,7 +2100,7 @@ | ||
| 2099 | 2100 | @ </tbody><tfooter> |
| 2100 | 2101 | @ <tr><th>Total<th align="right">%d(cnt1)<th align="right">%d(cnt2) |
| 2101 | 2102 | @ <th align="right">%d(cnt3) |
| 2102 | 2103 | @ </tfooter> |
| 2103 | 2104 | @ </table> |
| 2104 | - style_finish_page("test"); | |
| 2105 | + style_finish_page(); | |
| 2105 | 2106 | } |
| 2106 | 2107 |
| --- 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 |
+6
-6
| --- src/security_audit.c | ||
| +++ src/security_audit.c | ||
| @@ -591,11 +591,11 @@ | ||
| 591 | 591 | table_of_public_phantoms(); |
| 592 | 592 | @ </li> |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | @ </ol> |
| 596 | - style_finish_page("secaudit"); | |
| 596 | + style_finish_page(); | |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | /* |
| 600 | 600 | ** WEBPAGE: takeitprivate |
| 601 | 601 | ** |
| @@ -633,11 +633,11 @@ | ||
| 633 | 633 | @ <form action="%s(g.zPath)" method="post"> |
| 634 | 634 | @ <input type="submit" name="apply" value="Make It Private"> |
| 635 | 635 | @ <input type="submit" name="cancel" value="Cancel"> |
| 636 | 636 | @ </form> |
| 637 | 637 | |
| 638 | - style_finish_page("takeitprivate"); | |
| 638 | + style_finish_page(); | |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | /* |
| 642 | 642 | ** The maximum number of bytes of log to show |
| 643 | 643 | */ |
| @@ -674,11 +674,11 @@ | ||
| 674 | 674 | @ If the server is running using one of |
| 675 | 675 | @ the "fossil http" or "fossil server" commands then add |
| 676 | 676 | @ a command-line option "--errorlog <i>FILENAME</i>" to that |
| 677 | 677 | @ command. |
| 678 | 678 | @ </ol> |
| 679 | - style_finish_page("errorlog"); | |
| 679 | + style_finish_page(); | |
| 680 | 680 | return; |
| 681 | 681 | } |
| 682 | 682 | if( P("truncate1") && cgi_csrf_safe(1) ){ |
| 683 | 683 | fclose(fopen(g.zErrlog,"w")); |
| 684 | 684 | } |
| @@ -694,20 +694,20 @@ | ||
| 694 | 694 | @ <form action="%R/errorlog" method="POST"> |
| 695 | 695 | @ <p>Confirm that you want to truncate the %,lld(szFile)-byte error log: |
| 696 | 696 | @ <input type="submit" name="truncate1" value="Confirm"> |
| 697 | 697 | @ <input type="submit" name="cancel" value="Cancel"> |
| 698 | 698 | @ </form> |
| 699 | - style_finish_page("errorlog"); | |
| 699 | + style_finish_page(); | |
| 700 | 700 | return; |
| 701 | 701 | } |
| 702 | 702 | @ <p>The server error log at "%h(g.zErrlog)" is %,lld(szFile) bytes in size. |
| 703 | 703 | style_submenu_element("Download", "%R/errorlog?download"); |
| 704 | 704 | style_submenu_element("Truncate", "%R/errorlog?truncate"); |
| 705 | 705 | in = fossil_fopen(g.zErrlog, "rb"); |
| 706 | 706 | if( in==0 ){ |
| 707 | 707 | @ <p class='generalError'>Unable to open that file for reading!</p> |
| 708 | - style_finish_page("errorlog"); | |
| 708 | + style_finish_page(); | |
| 709 | 709 | return; |
| 710 | 710 | } |
| 711 | 711 | if( szFile>MXSHOWLOG && P("all")==0 ){ |
| 712 | 712 | @ <form action="%R/errorlog" method="POST"> |
| 713 | 713 | @ <p>Only the last %,d(MXSHOWLOG) bytes are shown. |
| @@ -720,7 +720,7 @@ | ||
| 720 | 720 | while( fgets(z, sizeof(z), in) ){ |
| 721 | 721 | @ %h(z)\ |
| 722 | 722 | } |
| 723 | 723 | fclose(in); |
| 724 | 724 | @ </pre> |
| 725 | - style_finish_page("errorlog"); | |
| 725 | + style_finish_page(); | |
| 726 | 726 | } |
| 727 | 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("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 @@ | ||
| 73 | 73 | if( !g.perm.Admin ){ |
| 74 | 74 | login_needed(0); |
| 75 | 75 | } |
| 76 | 76 | setup_user = g.perm.Setup; |
| 77 | 77 | |
| 78 | + style_set_current_feature("setup"); | |
| 78 | 79 | style_header("Server Administration"); |
| 79 | 80 | |
| 80 | 81 | /* Make sure the header contains <base href="...">. Issue a warning |
| 81 | 82 | ** if it does not. */ |
| 82 | 83 | if( !cgi_header_contains("<base href=") ){ |
| @@ -175,11 +176,11 @@ | ||
| 175 | 176 | setup_menu_entry("TH1", "admin_th1", |
| 176 | 177 | "Enter raw TH1 commands"); |
| 177 | 178 | } |
| 178 | 179 | @ </table> |
| 179 | 180 | |
| 180 | - style_finish_page("setup"); | |
| 181 | + style_finish_page(); | |
| 181 | 182 | } |
| 182 | 183 | |
| 183 | 184 | /* |
| 184 | 185 | ** Generate a checkbox for an attribute. |
| 185 | 186 | */ |
| @@ -339,10 +340,11 @@ | ||
| 339 | 340 | if( !g.perm.Setup ){ |
| 340 | 341 | login_needed(0); |
| 341 | 342 | return; |
| 342 | 343 | } |
| 343 | 344 | |
| 345 | + style_set_current_feature("setup"); | |
| 344 | 346 | style_header("Access Control Settings"); |
| 345 | 347 | db_begin_transaction(); |
| 346 | 348 | @ <form action="%R/setup_access" method="post"><div> |
| 347 | 349 | login_insert_csrf_secret(); |
| 348 | 350 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| @@ -576,11 +578,11 @@ | ||
| 576 | 578 | |
| 577 | 579 | @ <hr /> |
| 578 | 580 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 579 | 581 | @ </div></form> |
| 580 | 582 | db_end_transaction(0); |
| 581 | - style_finish_page("setup"); | |
| 583 | + style_finish_page(); | |
| 582 | 584 | } |
| 583 | 585 | |
| 584 | 586 | /* |
| 585 | 587 | ** WEBPAGE: setup_login_group |
| 586 | 588 | ** |
| @@ -608,10 +610,11 @@ | ||
| 608 | 610 | if( P("join")!=0 ){ |
| 609 | 611 | login_group_join(zRepo, 1, zLogin, zPw, zNewName, &zErrMsg); |
| 610 | 612 | }else if( P("leave") ){ |
| 611 | 613 | login_group_leave(&zErrMsg); |
| 612 | 614 | } |
| 615 | + style_set_current_feature("setup"); | |
| 613 | 616 | style_header("Login Group Configuration"); |
| 614 | 617 | if( zErrMsg ){ |
| 615 | 618 | @ <p class="generalError">%s(zErrMsg)</p> |
| 616 | 619 | } |
| 617 | 620 | zGroup = login_group_name(); |
| @@ -704,11 +707,11 @@ | ||
| 704 | 707 | } |
| 705 | 708 | db_finalize(&q); |
| 706 | 709 | @ </tbody></table> |
| 707 | 710 | style_table_sorter(); |
| 708 | 711 | } |
| 709 | - style_finish_page("setup"); | |
| 712 | + style_finish_page(); | |
| 710 | 713 | } |
| 711 | 714 | |
| 712 | 715 | /* |
| 713 | 716 | ** WEBPAGE: setup_timeline |
| 714 | 717 | ** |
| @@ -729,10 +732,11 @@ | ||
| 729 | 732 | if( !g.perm.Admin ){ |
| 730 | 733 | login_needed(0); |
| 731 | 734 | return; |
| 732 | 735 | } |
| 733 | 736 | |
| 737 | + style_set_current_feature("setup"); | |
| 734 | 738 | style_header("Timeline Display Preferences"); |
| 735 | 739 | db_begin_transaction(); |
| 736 | 740 | @ <form action="%R/setup_timeline" method="post"><div> |
| 737 | 741 | login_insert_csrf_secret(); |
| 738 | 742 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| @@ -843,11 +847,11 @@ | ||
| 843 | 847 | |
| 844 | 848 | @ <hr /> |
| 845 | 849 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 846 | 850 | @ </div></form> |
| 847 | 851 | db_end_transaction(0); |
| 848 | - style_finish_page("setup"); | |
| 852 | + style_finish_page(); | |
| 849 | 853 | } |
| 850 | 854 | |
| 851 | 855 | /* |
| 852 | 856 | ** WEBPAGE: setup_settings |
| 853 | 857 | ** |
| @@ -864,10 +868,11 @@ | ||
| 864 | 868 | if( !g.perm.Setup ){ |
| 865 | 869 | login_needed(0); |
| 866 | 870 | return; |
| 867 | 871 | } |
| 868 | 872 | |
| 873 | + style_set_current_feature("setup"); | |
| 869 | 874 | style_header("Settings"); |
| 870 | 875 | if(!g.repositoryOpen){ |
| 871 | 876 | /* Provide read-only access to versioned settings, |
| 872 | 877 | but only if no repo file was explicitly provided. */ |
| 873 | 878 | db_open_local(0); |
| @@ -936,11 +941,11 @@ | ||
| 936 | 941 | } |
| 937 | 942 | } |
| 938 | 943 | @ </td></tr></table> |
| 939 | 944 | @ </div></form> |
| 940 | 945 | db_end_transaction(0); |
| 941 | - style_finish_page("setup"); | |
| 946 | + style_finish_page(); | |
| 942 | 947 | } |
| 943 | 948 | |
| 944 | 949 | /* |
| 945 | 950 | ** WEBPAGE: setup_config |
| 946 | 951 | ** |
| @@ -951,10 +956,11 @@ | ||
| 951 | 956 | if( !g.perm.Setup ){ |
| 952 | 957 | login_needed(0); |
| 953 | 958 | return; |
| 954 | 959 | } |
| 955 | 960 | |
| 961 | + style_set_current_feature("setup"); | |
| 956 | 962 | style_header("WWW Configuration"); |
| 957 | 963 | db_begin_transaction(); |
| 958 | 964 | @ <form action="%R/setup_config" method="post"><div> |
| 959 | 965 | login_insert_csrf_secret(); |
| 960 | 966 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| @@ -1032,11 +1038,11 @@ | ||
| 1032 | 1038 | @ (Property: sitemap-contact) |
| 1033 | 1039 | @ <hr /> |
| 1034 | 1040 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 1035 | 1041 | @ </div></form> |
| 1036 | 1042 | db_end_transaction(0); |
| 1037 | - style_finish_page("setup"); | |
| 1043 | + style_finish_page(); | |
| 1038 | 1044 | } |
| 1039 | 1045 | |
| 1040 | 1046 | /* |
| 1041 | 1047 | ** WEBPAGE: setup_wiki |
| 1042 | 1048 | ** |
| @@ -1047,10 +1053,11 @@ | ||
| 1047 | 1053 | if( !g.perm.Setup ){ |
| 1048 | 1054 | login_needed(0); |
| 1049 | 1055 | return; |
| 1050 | 1056 | } |
| 1051 | 1057 | |
| 1058 | + style_set_current_feature("setup"); | |
| 1052 | 1059 | style_header("Wiki Configuration"); |
| 1053 | 1060 | db_begin_transaction(); |
| 1054 | 1061 | @ <form action="%R/setup_wiki" method="post"><div> |
| 1055 | 1062 | login_insert_csrf_secret(); |
| 1056 | 1063 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| @@ -1108,11 +1115,11 @@ | ||
| 1108 | 1115 | @ (Property: "wiki-use-html") |
| 1109 | 1116 | @ <hr /> |
| 1110 | 1117 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 1111 | 1118 | @ </div></form> |
| 1112 | 1119 | db_end_transaction(0); |
| 1113 | - style_finish_page("setup"); | |
| 1120 | + style_finish_page(); | |
| 1114 | 1121 | } |
| 1115 | 1122 | |
| 1116 | 1123 | /* |
| 1117 | 1124 | ** WEBPAGE: setup_modreq |
| 1118 | 1125 | ** |
| @@ -1123,10 +1130,11 @@ | ||
| 1123 | 1130 | if( !g.perm.Admin ){ |
| 1124 | 1131 | login_needed(0); |
| 1125 | 1132 | return; |
| 1126 | 1133 | } |
| 1127 | 1134 | |
| 1135 | + style_set_current_feature("setup"); | |
| 1128 | 1136 | style_header("Moderator For Wiki And Tickets"); |
| 1129 | 1137 | db_begin_transaction(); |
| 1130 | 1138 | @ <form action="%R/setup_modreq" method="post"><div> |
| 1131 | 1139 | login_insert_csrf_secret(); |
| 1132 | 1140 | @ <hr /> |
| @@ -1154,11 +1162,11 @@ | ||
| 1154 | 1162 | |
| 1155 | 1163 | @ <hr /> |
| 1156 | 1164 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 1157 | 1165 | @ </div></form> |
| 1158 | 1166 | db_end_transaction(0); |
| 1159 | - style_finish_page("setup"); | |
| 1167 | + style_finish_page(); | |
| 1160 | 1168 | |
| 1161 | 1169 | } |
| 1162 | 1170 | |
| 1163 | 1171 | /* |
| 1164 | 1172 | ** WEBPAGE: setup_adunit |
| @@ -1180,10 +1188,11 @@ | ||
| 1180 | 1188 | cgi_replace_parameter("adunit",""); |
| 1181 | 1189 | cgi_replace_parameter("adright",""); |
| 1182 | 1190 | setup_incr_cfgcnt(); |
| 1183 | 1191 | } |
| 1184 | 1192 | |
| 1193 | + style_set_current_feature("setup"); | |
| 1185 | 1194 | style_header("Edit Ad Unit"); |
| 1186 | 1195 | @ <form action="%R/setup_adunit" method="post"><div> |
| 1187 | 1196 | login_insert_csrf_secret(); |
| 1188 | 1197 | @ <b>Banner Ad-Unit:</b><br /> |
| 1189 | 1198 | textarea_attribute("", 6, 80, "adunit", "adunit", "", 0); |
| @@ -1235,11 +1244,11 @@ | ||
| 1235 | 1244 | @ border: 1px solid #f11; |
| 1236 | 1245 | @ background-color: #fcc; |
| 1237 | 1246 | @ '>Demo Ad</div> |
| 1238 | 1247 | @ </pre></blockquote> |
| 1239 | 1248 | @ </li> |
| 1240 | - style_finish_page("setup"); | |
| 1249 | + style_finish_page(); | |
| 1241 | 1250 | db_end_transaction(0); |
| 1242 | 1251 | } |
| 1243 | 1252 | |
| 1244 | 1253 | /* |
| 1245 | 1254 | ** WEBPAGE: setup_logo |
| @@ -1361,10 +1370,11 @@ | ||
| 1361 | 1370 | ); |
| 1362 | 1371 | db_protect_pop(); |
| 1363 | 1372 | db_end_transaction(0); |
| 1364 | 1373 | cgi_redirect("setup_logo"); |
| 1365 | 1374 | } |
| 1375 | + style_set_current_feature("setup"); | |
| 1366 | 1376 | style_header("Edit Project Logo And Background"); |
| 1367 | 1377 | @ <p>The current project logo has a MIME-Type of <b>%h(zLogoMime)</b> |
| 1368 | 1378 | @ and looks like this:</p> |
| 1369 | 1379 | @ <blockquote><p><img src="%R/logo/%z(zLogoMtime)" \ |
| 1370 | 1380 | @ alt="logo" border="1" /> |
| @@ -1437,11 +1447,11 @@ | ||
| 1437 | 1447 | @ <hr /> |
| 1438 | 1448 | @ |
| 1439 | 1449 | @ <p><span class="note">Note:</span> Your browser has probably cached these |
| 1440 | 1450 | @ images, so you may need to press the Reload button before changes will |
| 1441 | 1451 | @ take effect. </p> |
| 1442 | - style_finish_page("setup"); | |
| 1452 | + style_finish_page(); | |
| 1443 | 1453 | db_end_transaction(0); |
| 1444 | 1454 | } |
| 1445 | 1455 | |
| 1446 | 1456 | /* |
| 1447 | 1457 | ** Prevent the RAW SQL feature from being used to ATTACH a different |
| @@ -1481,10 +1491,11 @@ | ||
| 1481 | 1491 | login_needed(0); |
| 1482 | 1492 | return; |
| 1483 | 1493 | } |
| 1484 | 1494 | add_content_sql_commands(g.db); |
| 1485 | 1495 | zQ = cgi_csrf_safe(1) ? P("q") : 0; |
| 1496 | + style_set_current_feature("setup"); | |
| 1486 | 1497 | style_header("Raw SQL Commands"); |
| 1487 | 1498 | @ <p><b>Caution:</b> There are no restrictions on the SQL that can be |
| 1488 | 1499 | @ run by this page. You can do serious and irrepairable damage to the |
| 1489 | 1500 | @ repository. Proceed with extreme caution.</p> |
| 1490 | 1501 | @ |
| @@ -1599,11 +1610,11 @@ | ||
| 1599 | 1610 | } |
| 1600 | 1611 | sqlite3_finalize(pStmt); |
| 1601 | 1612 | @ </table> |
| 1602 | 1613 | } |
| 1603 | 1614 | } |
| 1604 | - style_finish_page("setup"); | |
| 1615 | + style_finish_page(); | |
| 1605 | 1616 | } |
| 1606 | 1617 | |
| 1607 | 1618 | |
| 1608 | 1619 | /* |
| 1609 | 1620 | ** WEBPAGE: admin_th1 |
| @@ -1618,10 +1629,11 @@ | ||
| 1618 | 1629 | login_check_credentials(); |
| 1619 | 1630 | if( !g.perm.Setup ){ |
| 1620 | 1631 | login_needed(0); |
| 1621 | 1632 | return; |
| 1622 | 1633 | } |
| 1634 | + style_set_current_feature("setup"); | |
| 1623 | 1635 | style_header("Raw TH1 Commands"); |
| 1624 | 1636 | @ <p><b>Caution:</b> There are no restrictions on the TH1 that can be |
| 1625 | 1637 | @ run by this page. If Tcl integration was enabled at compile-time and |
| 1626 | 1638 | @ the "tcl" setting is enabled, Tcl commands may be run as well.</p> |
| 1627 | 1639 | @ |
| @@ -1643,11 +1655,11 @@ | ||
| 1643 | 1655 | @ <pre class="th1result">%h(zR)</pre> |
| 1644 | 1656 | }else{ |
| 1645 | 1657 | @ <pre class="th1error">%h(zR)</pre> |
| 1646 | 1658 | } |
| 1647 | 1659 | } |
| 1648 | - style_finish_page("setup"); | |
| 1660 | + style_finish_page(); | |
| 1649 | 1661 | } |
| 1650 | 1662 | |
| 1651 | 1663 | /* |
| 1652 | 1664 | ** WEBPAGE: admin_log |
| 1653 | 1665 | ** |
| @@ -1664,10 +1676,11 @@ | ||
| 1664 | 1676 | login_check_credentials(); |
| 1665 | 1677 | if( !g.perm.Admin ){ |
| 1666 | 1678 | login_needed(0); |
| 1667 | 1679 | return; |
| 1668 | 1680 | } |
| 1681 | + style_set_current_feature("setup"); | |
| 1669 | 1682 | style_header("Admin Log"); |
| 1670 | 1683 | create_admin_log_table(); |
| 1671 | 1684 | limit = atoi(PD("n","200")); |
| 1672 | 1685 | ofst = atoi(PD("x","0")); |
| 1673 | 1686 | fLogEnabled = db_get_boolean("admin-log", 0); |
| @@ -1710,11 +1723,11 @@ | ||
| 1710 | 1723 | db_finalize(&stLog); |
| 1711 | 1724 | @ </tbody></table> |
| 1712 | 1725 | if( counter>ofst+limit ){ |
| 1713 | 1726 | @ <p><a href="admin_log?n=%d(limit)&x=%d(limit+ofst)">[Older]</a></p> |
| 1714 | 1727 | } |
| 1715 | - style_finish_page("setup"); | |
| 1728 | + style_finish_page(); | |
| 1716 | 1729 | } |
| 1717 | 1730 | |
| 1718 | 1731 | /* |
| 1719 | 1732 | ** WEBPAGE: srchsetup |
| 1720 | 1733 | ** |
| @@ -1724,10 +1737,11 @@ | ||
| 1724 | 1737 | login_check_credentials(); |
| 1725 | 1738 | if( !g.perm.Admin ){ |
| 1726 | 1739 | login_needed(0); |
| 1727 | 1740 | return; |
| 1728 | 1741 | } |
| 1742 | + style_set_current_feature("setup"); | |
| 1729 | 1743 | style_header("Search Configuration"); |
| 1730 | 1744 | @ <form action="%R/srchsetup" method="post"><div> |
| 1731 | 1745 | login_insert_csrf_secret(); |
| 1732 | 1746 | @ <div style="text-align:center;font-weight:bold;"> |
| 1733 | 1747 | @ Server-specific settings that affect the |
| @@ -1790,11 +1804,11 @@ | ||
| 1790 | 1804 | @ larger repositories.</p> |
| 1791 | 1805 | onoff_attribute("Use Porter Stemmer","search-stemmer","ss",0,0); |
| 1792 | 1806 | @ <p><input type="submit" name="fts1" value="Create A Full-Text Index"> |
| 1793 | 1807 | } |
| 1794 | 1808 | @ </div></form> |
| 1795 | - style_finish_page("setup"); | |
| 1809 | + style_finish_page(); | |
| 1796 | 1810 | } |
| 1797 | 1811 | |
| 1798 | 1812 | /* |
| 1799 | 1813 | ** A URL Alias originally called zOldName is now zNewName/zValue. |
| 1800 | 1814 | ** Write SQL to make this change into pSql. |
| @@ -1849,10 +1863,11 @@ | ||
| 1849 | 1863 | login_check_credentials(); |
| 1850 | 1864 | if( !g.perm.Admin ){ |
| 1851 | 1865 | login_needed(0); |
| 1852 | 1866 | return; |
| 1853 | 1867 | } |
| 1868 | + style_set_current_feature("setup"); | |
| 1854 | 1869 | style_header("URL Alias Configuration"); |
| 1855 | 1870 | if( P("submit")!=0 ){ |
| 1856 | 1871 | Blob token; |
| 1857 | 1872 | Blob sql; |
| 1858 | 1873 | const char *zNewName; |
| @@ -1948,7 +1963,7 @@ | ||
| 1948 | 1963 | @ <p>To delete an entry from the alias table, change its name or value to an |
| 1949 | 1964 | @ empty string and press "Apply Changes". |
| 1950 | 1965 | @ |
| 1951 | 1966 | @ <p>To add a new alias, fill in the name and value in the bottom row |
| 1952 | 1967 | @ of the table above and press "Apply Changes". |
| 1953 | - style_finish_page("setup"); | |
| 1968 | + style_finish_page(); | |
| 1954 | 1969 | } |
| 1955 | 1970 |
| --- 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 | @ '>Demo Ad</div> |
| 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 | @ '>Demo Ad</div> |
| 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 @@ | ||
| 52 | 52 | style_submenu_element("Log", "access_log"); |
| 53 | 53 | style_submenu_element("Help", "setup_ulist_notes"); |
| 54 | 54 | if( alert_tables_exist() ){ |
| 55 | 55 | style_submenu_element("Subscribers", "subscribers"); |
| 56 | 56 | } |
| 57 | + style_set_current_feature("setup"); | |
| 57 | 58 | style_header("User List"); |
| 58 | 59 | if( (zWith==0 || zWith[0]==0) && !bUnusedOnly ){ |
| 59 | 60 | @ <table border=1 cellpadding=2 cellspacing=0 class='userTable'> |
| 60 | 61 | @ <thead><tr> |
| 61 | 62 | @ <th>Category |
| @@ -202,11 +203,11 @@ | ||
| 202 | 203 | fossil_free(zAge); |
| 203 | 204 | } |
| 204 | 205 | @ </tbody></table> |
| 205 | 206 | db_finalize(&s); |
| 206 | 207 | style_table_sorter(); |
| 207 | - style_finish_page("setupuser"); | |
| 208 | + style_finish_page(); | |
| 208 | 209 | } |
| 209 | 210 | |
| 210 | 211 | /* |
| 211 | 212 | ** WEBPAGE: setup_ulist_notes |
| 212 | 213 | ** |
| @@ -213,10 +214,11 @@ | ||
| 213 | 214 | ** A documentation page showing notes about user configuration. This |
| 214 | 215 | ** information used to be a side-bar on the user list page, but has been |
| 215 | 216 | ** factored out for improved presentation. |
| 216 | 217 | */ |
| 217 | 218 | void setup_ulist_notes(void){ |
| 219 | + style_set_current_feature("setup"); | |
| 218 | 220 | style_header("User Configuration Notes"); |
| 219 | 221 | @ <h1>User Configuration Notes:</h1> |
| 220 | 222 | @ <ol> |
| 221 | 223 | @ <li><p> |
| 222 | 224 | @ Every user, logged in or not, inherits the privileges of |
| @@ -248,20 +250,21 @@ | ||
| 248 | 250 | @ |
| 249 | 251 | @ <li><p>The permission flags are as follows:</p> |
| 250 | 252 | capabilities_table(CAPCLASS_ALL); |
| 251 | 253 | @ </li> |
| 252 | 254 | @ </ol> |
| 253 | - style_finish_page("setupuser"); | |
| 255 | + style_finish_page(); | |
| 254 | 256 | } |
| 255 | 257 | |
| 256 | 258 | /* |
| 257 | 259 | ** WEBPAGE: setup_ucap_list |
| 258 | 260 | ** |
| 259 | 261 | ** A documentation page showing the meaning of the various user capabilities |
| 260 | 262 | ** code letters. |
| 261 | 263 | */ |
| 262 | 264 | void setup_ucap_list(void){ |
| 265 | + style_set_current_feature("setup"); | |
| 263 | 266 | style_header("User Capability Codes"); |
| 264 | 267 | @ <h1>All capabilities</h1> |
| 265 | 268 | capabilities_table(CAPCLASS_ALL); |
| 266 | 269 | @ <h1>Capabilities associated with checked-in content</h1> |
| 267 | 270 | capabilities_table(CAPCLASS_CODE); |
| @@ -275,11 +278,11 @@ | ||
| 275 | 278 | capabilities_table(CAPCLASS_WIKI); |
| 276 | 279 | @ <h1>Administrative capabilities</h1> |
| 277 | 280 | capabilities_table(CAPCLASS_SUPER); |
| 278 | 281 | @ <h1>Miscellaneous capabilities</h1> |
| 279 | 282 | capabilities_table(CAPCLASS_OTHER); |
| 280 | - style_finish_page("setupuser"); | |
| 283 | + style_finish_page(); | |
| 281 | 284 | } |
| 282 | 285 | |
| 283 | 286 | /* |
| 284 | 287 | ** Return true if zPw is a valid password string. A valid |
| 285 | 288 | ** password string is: |
| @@ -363,10 +366,12 @@ | ||
| 363 | 366 | "User \"%s\" has %d or more artifacts in the block-chain. " |
| 364 | 367 | "Delete anyhow?", |
| 365 | 368 | P("login")/*safe-for-%s*/, n); |
| 366 | 369 | } |
| 367 | 370 | } |
| 371 | + | |
| 372 | + style_set_current_feature("setup"); | |
| 368 | 373 | |
| 369 | 374 | /* If we have all the necessary information, write the new or |
| 370 | 375 | ** modified user record. After writing the user record, redirect |
| 371 | 376 | ** to the page that displays a list of users. |
| 372 | 377 | */ |
| @@ -409,11 +414,11 @@ | ||
| 409 | 414 | style_header("User Creation Error"); |
| 410 | 415 | @ <span class="loginError">Empty login not allowed.</span> |
| 411 | 416 | @ |
| 412 | 417 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> |
| 413 | 418 | @ [Bummer]</a></p> |
| 414 | - style_finish_page("setupuser"); | |
| 419 | + style_finish_page(); | |
| 415 | 420 | return; |
| 416 | 421 | } |
| 417 | 422 | if( isValidPwString(zPw) ){ |
| 418 | 423 | zPw = sha1_shared_secret(zPw, zLogin, 0); |
| 419 | 424 | }else{ |
| @@ -426,11 +431,11 @@ | ||
| 426 | 431 | @ <span class="loginError">Login "%h(zLogin)" is already used by |
| 427 | 432 | @ a different user.</span> |
| 428 | 433 | @ |
| 429 | 434 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> |
| 430 | 435 | @ [Bummer]</a></p> |
| 431 | - style_finish_page("setupuser"); | |
| 436 | + style_finish_page(); | |
| 432 | 437 | return; |
| 433 | 438 | } |
| 434 | 439 | login_verify_csrf_secret(); |
| 435 | 440 | db_unprotect(PROTECT_USER); |
| 436 | 441 | db_multi_exec( |
| @@ -478,11 +483,11 @@ | ||
| 478 | 483 | admin_log( "Error updating user '%q': %s'.", zLogin, zErr ); |
| 479 | 484 | @ <span class="loginError">%h(zErr)</span> |
| 480 | 485 | @ |
| 481 | 486 | @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> |
| 482 | 487 | @ [Bummer]</a></p> |
| 483 | - style_finish_page("setupuser"); | |
| 488 | + style_finish_page(); | |
| 484 | 489 | return; |
| 485 | 490 | } |
| 486 | 491 | } |
| 487 | 492 | cgi_redirect(cgi_referer("setup_ulist")); |
| 488 | 493 | return; |
| @@ -896,7 +901,7 @@ | ||
| 896 | 901 | @ template for users who are allowed more access than |
| 897 | 902 | @ <span class="usertype">anonymous</span>, |
| 898 | 903 | @ but less than a <span class="usertype">developer</span>. |
| 899 | 904 | @ </p></li> |
| 900 | 905 | @ </ul> |
| 901 | - style_finish_page("setupuser"); | |
| 906 | + style_finish_page(); | |
| 902 | 907 | } |
| 903 | 908 |
| --- 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 @@ | ||
| 263 | 263 | if( cnt==0 ){ |
| 264 | 264 | @ <i>no artifacts are shunned on this server</i> |
| 265 | 265 | } |
| 266 | 266 | db_finalize(&q); |
| 267 | 267 | @ </p></blockquote> |
| 268 | - style_finish_page("shun"); | |
| 268 | + style_finish_page(); | |
| 269 | 269 | fossil_free(zCanonical); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | /* |
| 273 | 273 | ** Remove from the BLOB table all artifacts that are in the SHUN table. |
| @@ -403,11 +403,11 @@ | ||
| 403 | 403 | @ </tr> |
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | db_finalize(&q); |
| 407 | 407 | @ </table> |
| 408 | - style_finish_page("rcvfromlist"); | |
| 408 | + style_finish_page(); | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | /* |
| 412 | 412 | ** WEBPAGE: rcvfrom |
| 413 | 413 | ** |
| @@ -549,7 +549,7 @@ | ||
| 549 | 549 | @ </td></tr> |
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | @ </table> |
| 553 | 553 | db_finalize(&q); |
| 554 | - style_finish_page("rcvfrom"); | |
| 554 | + style_finish_page(); | |
| 555 | 555 | } |
| 556 | 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("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 @@ | ||
| 221 | 221 | if( isPopup ){ |
| 222 | 222 | @ <li>%z(href("%R/sitemap"))Site Map</a></li> |
| 223 | 223 | } |
| 224 | 224 | @ </ul> |
| 225 | 225 | if( !isPopup ){ |
| 226 | - style_finish_page("sitemap"); | |
| 226 | + style_finish_page(); | |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /* |
| 231 | 231 | ** WEBPAGE: sitemap-test |
| @@ -236,10 +236,11 @@ | ||
| 236 | 236 | */ |
| 237 | 237 | void sitemap_test_page(void){ |
| 238 | 238 | int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */ |
| 239 | 239 | |
| 240 | 240 | login_check_credentials(); |
| 241 | + style_set_current_feature("sitemap"); | |
| 241 | 242 | if( P("popup")!=0 && cgi_csrf_safe(0) ){ |
| 242 | 243 | /* If this is a POST from the same origin with the popup=1 parameter, |
| 243 | 244 | ** then disable anti-robot defenses */ |
| 244 | 245 | isPopup = 1; |
| 245 | 246 | g.perm.Hyperlink = 1; |
| @@ -273,11 +274,11 @@ | ||
| 273 | 274 | } |
| 274 | 275 | @ <li>%z(href("%R/cookies"))Content of display preference cookie</a></li> |
| 275 | 276 | @ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li> |
| 276 | 277 | @ <li>%z(href("%R/test-piechart"))Pie-Chart generator test</a></li> |
| 277 | 278 | if( !isPopup ){ |
| 278 | - style_finish_page("sitemap"); | |
| 279 | + style_finish_page(); | |
| 279 | 280 | } |
| 280 | 281 | } |
| 281 | 282 | |
| 282 | 283 | /* |
| 283 | 284 | ** WEBPAGE: sitemap-timeline |
| @@ -287,10 +288,11 @@ | ||
| 287 | 288 | */ |
| 288 | 289 | void sitemap_timeline_page(void){ |
| 289 | 290 | int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */ |
| 290 | 291 | |
| 291 | 292 | login_check_credentials(); |
| 293 | + style_set_current_feature("sitemap"); | |
| 292 | 294 | if( P("popup")!=0 && cgi_csrf_safe(0) ){ |
| 293 | 295 | /* If this is a POST from the same origin with the popup=1 parameter, |
| 294 | 296 | ** then disable anti-robot defenses */ |
| 295 | 297 | isPopup = 1; |
| 296 | 298 | g.perm.Hyperlink = 1; |
| @@ -313,8 +315,8 @@ | ||
| 313 | 315 | @ <li>%z(href("%R/timewarps"))Timewarps</a></li> |
| 314 | 316 | @ <li>%z(href("%R/timeline?ubg"))Color-coded by user</a></li> |
| 315 | 317 | @ <li>%z(href("%R/timeline?deltabg"))Delta vs. baseline manifests</a></li> |
| 316 | 318 | @ </ul> |
| 317 | 319 | if( !isPopup ){ |
| 318 | - style_finish_page("sitemap"); | |
| 320 | + style_finish_page(); | |
| 319 | 321 | } |
| 320 | 322 | } |
| 321 | 323 |
| --- 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 @@ | ||
| 387 | 387 | zOldName = P("sn"); |
| 388 | 388 | zNewName = P("newname"); |
| 389 | 389 | if( zOldName==0 ) return 0; |
| 390 | 390 | if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){ |
| 391 | 391 | if( zNewName==0 ) zNewName = zOldName; |
| 392 | + style_set_current_feature("skins"); | |
| 392 | 393 | style_header("Rename A Skin"); |
| 393 | 394 | if( ex ){ |
| 394 | 395 | @ <p><span class="generalError">There is already another skin |
| 395 | 396 | @ named "%h(zNewName)". Choose a different name.</span></p> |
| 396 | 397 | } |
| @@ -404,11 +405,11 @@ | ||
| 404 | 405 | @ <input type="submit" name="rename" value="Rename"> |
| 405 | 406 | @ <input type="submit" name="canren" value="Cancel"> |
| 406 | 407 | @ </table> |
| 407 | 408 | login_insert_csrf_secret(); |
| 408 | 409 | @ </div></form> |
| 409 | - style_finish_page("skins"); | |
| 410 | + style_finish_page(); | |
| 410 | 411 | return 1; |
| 411 | 412 | } |
| 412 | 413 | db_unprotect(PROTECT_CONFIG); |
| 413 | 414 | db_multi_exec( |
| 414 | 415 | "UPDATE config SET name='skin:%q' WHERE name='skin:%q';", |
| @@ -429,10 +430,11 @@ | ||
| 429 | 430 | zNewName = P("svname"); |
| 430 | 431 | if( zNewName && zNewName[0]!=0 ){ |
| 431 | 432 | } |
| 432 | 433 | if( zNewName==0 || zNewName[0]==0 || (ex = skinExists(zNewName))!=0 ){ |
| 433 | 434 | if( zNewName==0 ) zNewName = ""; |
| 435 | + style_set_current_feature("skins"); | |
| 434 | 436 | style_header("Save Current Skin"); |
| 435 | 437 | if( ex ){ |
| 436 | 438 | @ <p><span class="generalError">There is already another skin |
| 437 | 439 | @ named "%h(zNewName)". Choose a different name.</span></p> |
| 438 | 440 | } |
| @@ -444,11 +446,11 @@ | ||
| 444 | 446 | @ <input type="submit" name="save" value="Save"> |
| 445 | 447 | @ <input type="submit" name="cansave" value="Cancel"> |
| 446 | 448 | @ </table> |
| 447 | 449 | login_insert_csrf_secret(); |
| 448 | 450 | @ </div></form> |
| 449 | - style_finish_page("skins"); | |
| 451 | + style_finish_page(); | |
| 450 | 452 | return 1; |
| 451 | 453 | } |
| 452 | 454 | db_unprotect(PROTECT_CONFIG); |
| 453 | 455 | db_multi_exec( |
| 454 | 456 | "INSERT OR IGNORE INTO config(name, value, mtime)" |
| @@ -483,10 +485,12 @@ | ||
| 483 | 485 | zCurrent = getSkin(0); |
| 484 | 486 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 485 | 487 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 486 | 488 | } |
| 487 | 489 | |
| 490 | + style_set_current_feature("skins"); | |
| 491 | + | |
| 488 | 492 | if( cgi_csrf_safe(1) ){ |
| 489 | 493 | /* Process requests to delete a user-defined skin */ |
| 490 | 494 | if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| 491 | 495 | style_header("Confirm Custom Skin Delete"); |
| 492 | 496 | @ <form action="%R/setup_skin_admin" method="post"><div> |
| @@ -495,11 +499,11 @@ | ||
| 495 | 499 | @ <input type="hidden" name="sn" value="%h(P("sn"))" /> |
| 496 | 500 | @ <input type="submit" name="del2" value="Confirm - Delete The Skin" /> |
| 497 | 501 | @ <input type="submit" name="cancel" value="Cancel - Do Not Delete" /> |
| 498 | 502 | login_insert_csrf_secret(); |
| 499 | 503 | @ </div></form> |
| 500 | - style_finish_page("skins"); | |
| 504 | + style_finish_page(); | |
| 501 | 505 | db_end_transaction(1); |
| 502 | 506 | return; |
| 503 | 507 | } |
| 504 | 508 | if( P("del2")!=0 && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| 505 | 509 | db_unprotect(PROTECT_CONFIG); |
| @@ -648,11 +652,11 @@ | ||
| 648 | 652 | @ </form></tr> |
| 649 | 653 | } |
| 650 | 654 | db_finalize(&q); |
| 651 | 655 | |
| 652 | 656 | @ </table> |
| 653 | - style_finish_page("skins"); | |
| 657 | + style_finish_page(); | |
| 654 | 658 | db_end_transaction(0); |
| 655 | 659 | } |
| 656 | 660 | |
| 657 | 661 | /* |
| 658 | 662 | ** Generate HTML for a <select> that lists all the available skin names, |
| @@ -796,10 +800,11 @@ | ||
| 796 | 800 | zContent = zDflt; |
| 797 | 801 | isRevert = 1; |
| 798 | 802 | } |
| 799 | 803 | |
| 800 | 804 | db_begin_transaction(); |
| 805 | + style_set_current_feature("skins"); | |
| 801 | 806 | style_header("%s", zTitle); |
| 802 | 807 | for(j=0; j<count(aSkinAttr); j++){ |
| 803 | 808 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 804 | 809 | "%R/setup_skinedit?w=%d&basis=%h&sk=%d",j,zBasis,iSkin); |
| 805 | 810 | } |
| @@ -845,11 +850,11 @@ | ||
| 845 | 850 | blob_reset(&from); |
| 846 | 851 | blob_reset(&to); |
| 847 | 852 | blob_reset(&out); |
| 848 | 853 | } |
| 849 | 854 | @ </div></form> |
| 850 | - style_finish_page("skins"); | |
| 855 | + style_finish_page(); | |
| 851 | 856 | db_end_transaction(0); |
| 852 | 857 | } |
| 853 | 858 | |
| 854 | 859 | /* |
| 855 | 860 | ** Try to initialize draft skin iSkin to the built-in or preexisting |
| @@ -962,10 +967,11 @@ | ||
| 962 | 967 | /* Publish the draft skin */ |
| 963 | 968 | if( P("pub7")!=0 && PB("pub7ck1") && PB("pub7ck2") ){ |
| 964 | 969 | skin_publish(iSkin); |
| 965 | 970 | } |
| 966 | 971 | |
| 972 | + style_set_current_feature("skins"); | |
| 967 | 973 | style_header("Customize Skin"); |
| 968 | 974 | |
| 969 | 975 | @ <p>Customize the look of this Fossil repository by making changes |
| 970 | 976 | @ to the CSS, Header, Footer, and Detail Settings in one of nine "draft" |
| 971 | 977 | @ configurations. Then, after verifying that all is working correctly, |
| @@ -1123,7 +1129,7 @@ | ||
| 1123 | 1129 | }else{ |
| 1124 | 1130 | @ <p>Visit the <a href='%R/setup_skin_admin'>Skin Admin</a> page |
| 1125 | 1131 | @ for cleanup and recovery actions. |
| 1126 | 1132 | } |
| 1127 | 1133 | builtin_request_js("skin.js"); |
| 1128 | - style_finish_page("skins"); | |
| 1134 | + style_finish_page(); | |
| 1129 | 1135 | } |
| 1130 | 1136 |
| --- 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 @@ | ||
| 769 | 769 | if( !g.perm.Setup ){ |
| 770 | 770 | login_needed(0); |
| 771 | 771 | return; |
| 772 | 772 | } |
| 773 | 773 | db_begin_transaction(); |
| 774 | + style_set_current_feature("smtp"); | |
| 774 | 775 | style_header("Email Server Setup"); |
| 775 | 776 | if( db_table_exists("repository","emailroute") ){ |
| 776 | 777 | style_submenu_element("emailblob table", "%R/emailblob"); |
| 777 | 778 | style_submenu_element("emailoutq table", "%R/emailoutq"); |
| 778 | 779 | db_prepare(&q, "SELECT eaddr, epolicy FROM emailroute ORDER BY 1"); |
| @@ -805,11 +806,11 @@ | ||
| 805 | 806 | @ <form method="POST" action="%R/setup_smtp_route"> |
| 806 | 807 | @ <input type="submit" value="New"> |
| 807 | 808 | @ ← Add a new email address |
| 808 | 809 | @ </form> |
| 809 | 810 | @ </table> |
| 810 | - style_finish_page("smtp"); | |
| 811 | + style_finish_page(); | |
| 811 | 812 | db_end_transaction(0); |
| 812 | 813 | } |
| 813 | 814 | |
| 814 | 815 | /* |
| 815 | 816 | ** WEBPAGE: setup_smtp_route |
| @@ -833,10 +834,11 @@ | ||
| 833 | 834 | login_check_credentials(); |
| 834 | 835 | if( !g.perm.Setup ){ |
| 835 | 836 | login_needed(0); |
| 836 | 837 | return; |
| 837 | 838 | } |
| 839 | + style_set_current_feature("smtp"); | |
| 838 | 840 | style_header("Email Route Editor"); |
| 839 | 841 | |
| 840 | 842 | if( P("edit") && cgi_csrf_safe(1) && zEAddr!=0 && zEPolicy!=0 ){ |
| 841 | 843 | smtp_server_schema(0); |
| 842 | 844 | if( (zOAddr==0 || fossil_strcmp(zEAddr,zOAddr)!=0) ){ |
| @@ -924,11 +926,11 @@ | ||
| 924 | 926 | @ with USER.LOGIN=<i>login-name</i>. |
| 925 | 927 | @ </ul> |
| 926 | 928 | @ |
| 927 | 929 | @ <p>To delete a route → erase all text from the "Routing" field then |
| 928 | 930 | @ press the "Apply" button. |
| 929 | - style_finish_page("smtp"); | |
| 931 | + style_finish_page(); | |
| 930 | 932 | } |
| 931 | 933 | |
| 932 | 934 | #if LOCAL_INTERFACE |
| 933 | 935 | /* |
| 934 | 936 | ** State information for the server |
| 935 | 937 |
| --- 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 | @ ← 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 → 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 | @ ← 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 → 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 @@ | ||
| 288 | 288 | if( g.perm.Admin && alert_enabled() ){ |
| 289 | 289 | stats_for_email(); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | @ </table> |
| 293 | - style_finish_page("stat"); | |
| 293 | + style_finish_page(); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /* |
| 297 | 297 | ** COMMAND: dbstat |
| 298 | 298 | ** |
| @@ -459,10 +459,11 @@ | ||
| 459 | 459 | sqlite3_int64 iNow; |
| 460 | 460 | char *zRemote; |
| 461 | 461 | login_check_credentials(); |
| 462 | 462 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 463 | 463 | |
| 464 | + style_set_current_feature("stat"); | |
| 464 | 465 | style_header("URLs and Checkouts"); |
| 465 | 466 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 466 | 467 | style_submenu_element("Stat", "stat"); |
| 467 | 468 | style_submenu_element("Schema", "repo_schema"); |
| 468 | 469 | iNow = db_int64(0, "SELECT strftime('%%s','now')"); |
| @@ -516,11 +517,11 @@ | ||
| 516 | 517 | }else{ |
| 517 | 518 | @ <p>%h(zRemote)</p> |
| 518 | 519 | } |
| 519 | 520 | @ </div> |
| 520 | 521 | } |
| 521 | - style_finish_page("stat"); | |
| 522 | + style_finish_page(); | |
| 522 | 523 | } |
| 523 | 524 | |
| 524 | 525 | /* |
| 525 | 526 | ** WEBPAGE: repo_schema |
| 526 | 527 | ** |
| @@ -531,10 +532,11 @@ | ||
| 531 | 532 | Blob sql; |
| 532 | 533 | const char *zArg = P("n"); |
| 533 | 534 | login_check_credentials(); |
| 534 | 535 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 535 | 536 | |
| 537 | + style_set_current_feature("stat"); | |
| 536 | 538 | style_header("Repository Schema"); |
| 537 | 539 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 538 | 540 | style_submenu_element("Stat", "stat"); |
| 539 | 541 | style_submenu_element("URLs", "urllist"); |
| 540 | 542 | if( sqlite3_compileoption_used("ENABLE_DBSTAT_VTAB") ){ |
| @@ -574,11 +576,11 @@ | ||
| 574 | 576 | db_finalize(&q); |
| 575 | 577 | }else{ |
| 576 | 578 | style_submenu_element("Stat1","repo_stat1"); |
| 577 | 579 | } |
| 578 | 580 | } |
| 579 | - style_finish_page("stat"); | |
| 581 | + style_finish_page(); | |
| 580 | 582 | } |
| 581 | 583 | |
| 582 | 584 | /* |
| 583 | 585 | ** WEBPAGE: repo_stat1 |
| 584 | 586 | ** |
| @@ -586,10 +588,11 @@ | ||
| 586 | 588 | */ |
| 587 | 589 | void repo_stat1_page(void){ |
| 588 | 590 | login_check_credentials(); |
| 589 | 591 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 590 | 592 | |
| 593 | + style_set_current_feature("stat"); | |
| 591 | 594 | style_header("Repository STAT1 Table"); |
| 592 | 595 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 593 | 596 | style_submenu_element("Stat", "stat"); |
| 594 | 597 | style_submenu_element("Schema", "repo_schema"); |
| 595 | 598 | if( db_table_exists("repository","sqlite_stat1") ){ |
| @@ -606,11 +609,11 @@ | ||
| 606 | 609 | @ INSERT INTO sqlite_stat1 VALUES('%z(zUrl)%h(zTab)</a>','%h(zIdx)','%h(zStat)'); |
| 607 | 610 | } |
| 608 | 611 | @ </pre> |
| 609 | 612 | db_finalize(&q); |
| 610 | 613 | } |
| 611 | - style_finish_page("stat"); | |
| 614 | + style_finish_page(); | |
| 612 | 615 | } |
| 613 | 616 | |
| 614 | 617 | /* |
| 615 | 618 | ** WEBPAGE: repo-tabsize |
| 616 | 619 | ** |
| @@ -621,10 +624,11 @@ | ||
| 621 | 624 | sqlite3_int64 fsize; |
| 622 | 625 | char zBuf[100]; |
| 623 | 626 | |
| 624 | 627 | login_check_credentials(); |
| 625 | 628 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 629 | + style_set_current_feature("stat"); | |
| 626 | 630 | style_header("Repository Table Sizes"); |
| 627 | 631 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 628 | 632 | style_submenu_element("Stat", "stat"); |
| 629 | 633 | if( g.perm.Admin ){ |
| 630 | 634 | style_submenu_element("Schema", "repo_schema"); |
| @@ -678,11 +682,11 @@ | ||
| 678 | 682 | @ <h2>%h(file_tail(g.zLocalDbName)) Size: %s(zBuf)</h2> |
| 679 | 683 | @ <center><svg width='800' height='500'> |
| 680 | 684 | piechart_render(800,500,PIE_OTHER|PIE_PERCENT); |
| 681 | 685 | @ </svg></center> |
| 682 | 686 | } |
| 683 | - style_finish_page("stat"); | |
| 687 | + style_finish_page(); | |
| 684 | 688 | } |
| 685 | 689 | |
| 686 | 690 | /* |
| 687 | 691 | ** Gather statistics on artifact types, counts, and sizes. |
| 688 | 692 | ** |
| @@ -798,10 +802,11 @@ | ||
| 798 | 802 | login_needed(g.anon.Write); |
| 799 | 803 | return; |
| 800 | 804 | } |
| 801 | 805 | load_control(); |
| 802 | 806 | |
| 807 | + style_set_current_feature("stat"); | |
| 803 | 808 | style_header("Artifact Statistics"); |
| 804 | 809 | style_submenu_element("Repository Stats", "stat"); |
| 805 | 810 | style_submenu_element("Artifact List", "bloblist"); |
| 806 | 811 | gather_artifact_stats(1); |
| 807 | 812 | |
| @@ -819,11 +824,11 @@ | ||
| 819 | 824 | sumCmpr = db_column_int64(&q, 4); |
| 820 | 825 | sumExp = db_column_int64(&q, 5); |
| 821 | 826 | db_finalize(&q); |
| 822 | 827 | if( nTotal==0 ){ |
| 823 | 828 | @ No artifacts in this repository! |
| 824 | - style_finish_page("stat"); | |
| 829 | + style_finish_page(); | |
| 825 | 830 | return; |
| 826 | 831 | } |
| 827 | 832 | avgCmpr = (double)sumCmpr/nTotal; |
| 828 | 833 | avgExp = (double)sumExp/nTotal; |
| 829 | 834 | |
| @@ -964,7 +969,7 @@ | ||
| 964 | 969 | } |
| 965 | 970 | @ </tbody></table></div> |
| 966 | 971 | db_finalize(&q); |
| 967 | 972 | } |
| 968 | 973 | style_table_sorter(); |
| 969 | - style_finish_page("stat"); | |
| 974 | + style_finish_page(); | |
| 970 | 975 | } |
| 971 | 976 |
| --- 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 @@ | ||
| 825 | 825 | break; |
| 826 | 826 | case RPT_LASTCHNG: |
| 827 | 827 | stats_report_last_change(); |
| 828 | 828 | break; |
| 829 | 829 | } |
| 830 | - style_finish_page("reports"); | |
| 830 | + style_finish_page(); | |
| 831 | 831 | } |
| 832 | 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("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 @@ | ||
| 33 | 33 | ** style_submenu_checkbox() |
| 34 | 34 | ** style_submenu_binary() |
| 35 | 35 | ** style_submenu_multichoice() |
| 36 | 36 | ** style_submenu_sql() |
| 37 | 37 | ** |
| 38 | -** prior to calling style_footer(). The style_footer() routine | |
| 38 | +** prior to calling style_finish_page(). The style_finish_page() routine | |
| 39 | 39 | ** will generate the appropriate HTML text just below the main |
| 40 | 40 | ** menu. |
| 41 | 41 | */ |
| 42 | 42 | static struct Submenu { |
| 43 | 43 | const char *zLabel; /* Button label */ |
| @@ -567,19 +567,52 @@ | ||
| 567 | 567 | @ <title>$<project_name>: $<title></title> |
| 568 | 568 | @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \ |
| 569 | 569 | @ href="$home/timeline.rss" /> |
| 570 | 570 | @ <link rel="stylesheet" href="$stylesheet_url" type="text/css" /> |
| 571 | 571 | @ </head> |
| 572 | -@ <body> | |
| 572 | +@ <body class="$current_feature"> | |
| 573 | 573 | ; |
| 574 | 574 | |
| 575 | 575 | /* |
| 576 | 576 | ** Returns the default page header. |
| 577 | 577 | */ |
| 578 | 578 | const char *get_default_header(){ |
| 579 | 579 | return zDfltHeader; |
| 580 | 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 | +} | |
| 581 | 614 | |
| 582 | 615 | /* |
| 583 | 616 | ** Initialize all the default TH1 variables |
| 584 | 617 | */ |
| 585 | 618 | static void style_init_th1_vars(const char *zTitle){ |
| @@ -613,10 +646,11 @@ | ||
| 613 | 646 | image_url_var("logo"); |
| 614 | 647 | image_url_var("background"); |
| 615 | 648 | if( !login_is_nobody() ){ |
| 616 | 649 | Th_Store("login", g.zLogin); |
| 617 | 650 | } |
| 651 | + Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) ); | |
| 618 | 652 | } |
| 619 | 653 | |
| 620 | 654 | /* |
| 621 | 655 | ** Draw the header. |
| 622 | 656 | */ |
| @@ -749,16 +783,12 @@ | ||
| 749 | 783 | ** been received. |
| 750 | 784 | ** |
| 751 | 785 | ** * Finalizes the page content. |
| 752 | 786 | ** |
| 753 | 787 | ** * 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 | 788 | */ |
| 759 | -void style_finish_page(const char* zPageType){ | |
| 789 | +void style_finish_page(){ | |
| 760 | 790 | const char *zFooter; |
| 761 | 791 | const char *zAd = 0; |
| 762 | 792 | unsigned int mAdFlags = 0; |
| 763 | 793 | |
| 764 | 794 | if( !headerHasBeenGenerated ) return; |
| @@ -886,11 +916,11 @@ | ||
| 886 | 916 | @ <div class="adunit_banner"> |
| 887 | 917 | cgi_append_content(zAd, -1); |
| 888 | 918 | @ </div> |
| 889 | 919 | } |
| 890 | 920 | |
| 891 | - @ <div class="content %s(zPageType)"><span id="debugMsg"></span> | |
| 921 | + @ <div class="content"><span id="debugMsg"></span> | |
| 892 | 922 | cgi_destination(CGI_BODY); |
| 893 | 923 | |
| 894 | 924 | if( sideboxUsed ){ |
| 895 | 925 | @ <div class="endContent"></div> |
| 896 | 926 | } |
| @@ -1151,10 +1181,11 @@ | ||
| 1151 | 1181 | login_check_credentials(); |
| 1152 | 1182 | if( g.perm.Admin || g.perm.Setup || db_get_boolean("test_env_enable",0) ){ |
| 1153 | 1183 | isAuth = 1; |
| 1154 | 1184 | } |
| 1155 | 1185 | cgi_load_environment(); |
| 1186 | + style_set_current_feature("error"); | |
| 1156 | 1187 | if( zFormat[0] ){ |
| 1157 | 1188 | va_list ap; |
| 1158 | 1189 | va_start(ap, zFormat); |
| 1159 | 1190 | zErr = vmprintf(zFormat, ap); |
| 1160 | 1191 | va_end(ap); |
| @@ -1206,15 +1237,15 @@ | ||
| 1206 | 1237 | @ %h(blob_str(&g.httpHeader)) |
| 1207 | 1238 | @ </pre> |
| 1208 | 1239 | } |
| 1209 | 1240 | } |
| 1210 | 1241 | if( zErr && zErr[0] ){ |
| 1211 | - style_finish_page("error"); | |
| 1242 | + style_finish_page(); | |
| 1212 | 1243 | cgi_reply(); |
| 1213 | 1244 | fossil_exit(1); |
| 1214 | 1245 | }else{ |
| 1215 | - style_finish_page("test"); | |
| 1246 | + style_finish_page(); | |
| 1216 | 1247 | } |
| 1217 | 1248 | } |
| 1218 | 1249 | |
| 1219 | 1250 | /* |
| 1220 | 1251 | ** Generate a Not Yet Implemented error page. |
| @@ -1243,14 +1274,15 @@ | ||
| 1243 | 1274 | zMsg = vmprintf(zFormat, ap); |
| 1244 | 1275 | va_end(ap); |
| 1245 | 1276 | }else{ |
| 1246 | 1277 | zMsg = "Not Found"; |
| 1247 | 1278 | } |
| 1279 | + style_set_current_feature("enotfound"); | |
| 1248 | 1280 | style_header("Not Found"); |
| 1249 | 1281 | @ <p>%h(zMsg)</p> |
| 1250 | 1282 | cgi_set_status(404, "Not Found"); |
| 1251 | - style_finish_page("enotfound"); | |
| 1283 | + style_finish_page(); | |
| 1252 | 1284 | } |
| 1253 | 1285 | |
| 1254 | 1286 | #if INTERFACE |
| 1255 | 1287 | # define webpage_assert(T) if(!(T)){webpage_assert_page(__FILE__,__LINE__,#T);} |
| 1256 | 1288 | #endif |
| 1257 | 1289 |
| --- 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 @@ | ||
| 724 | 724 | @ <li><span class="tagDsp">%h(zName)</span></li> |
| 725 | 725 | } |
| 726 | 726 | } |
| 727 | 727 | @ </ul> |
| 728 | 728 | db_finalize(&q); |
| 729 | - style_finish_page("taglist"); | |
| 729 | + style_finish_page(); | |
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | /* |
| 733 | 733 | ** WEBPAGE: /tagtimeline |
| 734 | 734 | ** |
| @@ -781,7 +781,7 @@ | ||
| 781 | 781 | if( PB("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR; |
| 782 | 782 | if( PB("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR; |
| 783 | 783 | www_print_timeline(&q, tmFlags, 0, 0, 0, 0, 0, 0); |
| 784 | 784 | db_finalize(&q); |
| 785 | 785 | @ <br /> |
| 786 | - style_finish_page("tagtimeline"); | |
| 786 | + style_finish_page(); | |
| 787 | 787 | } |
| 788 | 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("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 @@ | ||
| 785 | 785 | } |
| 786 | 786 | if( zExclude ){ |
| 787 | 787 | @ zExclude = "%h(zExclude)"<br /> |
| 788 | 788 | } |
| 789 | 789 | @ zKey = "%h(zKey)" |
| 790 | - style_finish_page("tarball"); | |
| 790 | + style_finish_page(); | |
| 791 | 791 | return; |
| 792 | 792 | } |
| 793 | 793 | if( referred_from_login() ){ |
| 794 | 794 | style_header("Tarball Download"); |
| 795 | 795 | @ <form action='%R/tarball/%h(zName).tar.gz'> |
| @@ -796,11 +796,11 @@ | ||
| 796 | 796 | cgi_query_parameters_to_hidden(); |
| 797 | 797 | @ <p>Tarball named <b>%h(zName).tar.gz</b> holding the content |
| 798 | 798 | @ of check-in <b>%h(zRid)</b>: |
| 799 | 799 | @ <input type="submit" value="Download" /> |
| 800 | 800 | @ </form> |
| 801 | - style_finish_page("tarball"); | |
| 801 | + style_finish_page(); | |
| 802 | 802 | return; |
| 803 | 803 | } |
| 804 | 804 | blob_zero(&tarball); |
| 805 | 805 | if( cache_read(&tarball, zKey)==0 ){ |
| 806 | 806 | tarball_of_checkin(rid, &tarball, zName, pInclude, pExclude); |
| 807 | 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("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 @@ | ||
| 1478 | 1478 | ){ |
| 1479 | 1479 | if( argc!=1 ){ |
| 1480 | 1480 | return Th_WrongNumArgs(interp, "styleFooter"); |
| 1481 | 1481 | } |
| 1482 | 1482 | if( Th_IsRepositoryOpen() ){ |
| 1483 | - style_finish_page("th1"); /* TODO: add optional parameter to pass along? */ | |
| 1483 | + style_finish_page(); | |
| 1484 | 1484 | Th_SetResult(interp, 0, 0); |
| 1485 | 1485 | return TH_OK; |
| 1486 | 1486 | }else{ |
| 1487 | 1487 | Th_SetResult(interp, "repository unavailable", -1); |
| 1488 | 1488 | return TH_ERROR; |
| 1489 | 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("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 @@ | ||
| 189 | 189 | const char *zBr; |
| 190 | 190 | char zNm[10]; |
| 191 | 191 | int i, cnt; |
| 192 | 192 | login_check_credentials(); |
| 193 | 193 | |
| 194 | + style_set_current_feature("test"); | |
| 194 | 195 | style_header("Hash Color Test"); |
| 195 | 196 | for(i=cnt=0; i<10; i++){ |
| 196 | 197 | sqlite3_snprintf(sizeof(zNm),zNm,"b%d",i); |
| 197 | 198 | zBr = P(zNm); |
| 198 | 199 | if( zBr && zBr[0] ){ |
| @@ -214,11 +215,11 @@ | ||
| 214 | 215 | zBr = P(zNm); |
| 215 | 216 | @ <input type="text" size="30" name='%s(zNm)' value='%h(PD(zNm,""))'><br /> |
| 216 | 217 | } |
| 217 | 218 | @ <input type="submit"> |
| 218 | 219 | @ </form> |
| 219 | - style_finish_page("test"); | |
| 220 | + style_finish_page(); | |
| 220 | 221 | } |
| 221 | 222 | |
| 222 | 223 | /* |
| 223 | 224 | ** Return a new timelineTable id. |
| 224 | 225 | */ |
| @@ -2729,11 +2730,11 @@ | ||
| 2729 | 2730 | if( zOlderButton ){ |
| 2730 | 2731 | @ %z(chref("button","%s",zOlderButton))%h(zOlderButtonLabel)\ |
| 2731 | 2732 | @ ↓</a> |
| 2732 | 2733 | } |
| 2733 | 2734 | document_emit_js(/*handles pikchrs rendered above*/); |
| 2734 | - style_finish_page("timeline"); | |
| 2735 | + style_finish_page(); | |
| 2735 | 2736 | } |
| 2736 | 2737 | |
| 2737 | 2738 | /* |
| 2738 | 2739 | ** The input query q selects various records. Print a human-readable |
| 2739 | 2740 | ** summary of those records. |
| @@ -3188,10 +3189,11 @@ | ||
| 3188 | 3189 | login_check_credentials(); |
| 3189 | 3190 | if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki && !g.perm.RdForum) ){ |
| 3190 | 3191 | login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki); |
| 3191 | 3192 | return; |
| 3192 | 3193 | } |
| 3194 | + style_set_current_feature("timeline"); | |
| 3193 | 3195 | style_header("Today In History"); |
| 3194 | 3196 | zToday = (char*)P("today"); |
| 3195 | 3197 | if( zToday ){ |
| 3196 | 3198 | zToday = timeline_expand_datetime(zToday); |
| 3197 | 3199 | if( !fossil_isdate(zToday) ) zToday = 0; |
| @@ -3235,11 +3237,11 @@ | ||
| 3235 | 3237 | @ <small>%z(href("%R/timeline?c=%t",zId))(more context)</a>\ |
| 3236 | 3238 | @ </small></h2> |
| 3237 | 3239 | www_print_timeline(&q, TIMELINE_GRAPH, 0, 0, 0, 0, 0, 0); |
| 3238 | 3240 | } |
| 3239 | 3241 | db_finalize(&q); |
| 3240 | - style_finish_page("timeline"); | |
| 3242 | + style_finish_page(); | |
| 3241 | 3243 | } |
| 3242 | 3244 | |
| 3243 | 3245 | |
| 3244 | 3246 | /* |
| 3245 | 3247 | ** COMMAND: test-timewarp-list |
| @@ -3341,7 +3343,7 @@ | ||
| 3341 | 3343 | if( cnt==0 ){ |
| 3342 | 3344 | @ <p>No timewarps in this repository</p> |
| 3343 | 3345 | }else{ |
| 3344 | 3346 | @ </tbody></table></div> |
| 3345 | 3347 | } |
| 3346 | - style_finish_page("timewarps"); | |
| 3348 | + style_finish_page(); | |
| 3347 | 3349 | } |
| 3348 | 3350 |
| --- 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 | @ ↓</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 | @ ↓</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 @@ | ||
| 585 | 585 | if( P("plaintext") ){ |
| 586 | 586 | style_submenu_element("Formatted", "%R/tktview/%s", zUuid); |
| 587 | 587 | }else{ |
| 588 | 588 | style_submenu_element("Plaintext", "%R/tktview/%s?plaintext", zUuid); |
| 589 | 589 | } |
| 590 | + style_set_current_feature("tkt"); | |
| 590 | 591 | style_header("View Ticket"); |
| 591 | 592 | if( showTimeline ){ |
| 592 | 593 | int tagid = db_int(0,"SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'", |
| 593 | 594 | zUuid); |
| 594 | 595 | if( tagid ){ |
| @@ -618,11 +619,11 @@ | ||
| 618 | 619 | " WHERE tkt_uuid GLOB '%q*'", zUuid); |
| 619 | 620 | if( zFullName ){ |
| 620 | 621 | attachment_list(zFullName, "<hr /><h2>Attachments:</h2><ul>"); |
| 621 | 622 | } |
| 622 | 623 | |
| 623 | - style_finish_page("tkt"); | |
| 624 | + style_finish_page(); | |
| 624 | 625 | } |
| 625 | 626 | |
| 626 | 627 | /* |
| 627 | 628 | ** TH1 command: append_field FIELD STRING |
| 628 | 629 | ** |
| @@ -815,10 +816,11 @@ | ||
| 815 | 816 | login_check_credentials(); |
| 816 | 817 | if( !g.perm.NewTkt ){ login_needed(g.anon.NewTkt); return; } |
| 817 | 818 | if( P("cancel") ){ |
| 818 | 819 | cgi_redirect("home"); |
| 819 | 820 | } |
| 821 | + style_set_current_feature("tkt"); | |
| 820 | 822 | style_header("New Ticket"); |
| 821 | 823 | ticket_standard_submenu(T_ALL_BUT(T_NEW)); |
| 822 | 824 | if( g.thTrace ) Th_Trace("BEGIN_TKTNEW<br />\n", -1); |
| 823 | 825 | ticket_init(); |
| 824 | 826 | initializeVariablesFromCGI(); |
| @@ -841,11 +843,11 @@ | ||
| 841 | 843 | return; |
| 842 | 844 | } |
| 843 | 845 | captcha_generate(0); |
| 844 | 846 | @ </form> |
| 845 | 847 | if( g.thTrace ) Th_Trace("END_TKTVIEW<br />\n", -1); |
| 846 | - style_finish_page("tkt"); | |
| 848 | + style_finish_page(); | |
| 847 | 849 | } |
| 848 | 850 | |
| 849 | 851 | /* |
| 850 | 852 | ** WEBPAGE: tktedit |
| 851 | 853 | ** WEBPAGE: debug_tktedit |
| @@ -870,28 +872,29 @@ | ||
| 870 | 872 | } |
| 871 | 873 | zName = P("name"); |
| 872 | 874 | if( P("cancel") ){ |
| 873 | 875 | cgi_redirectf("tktview?name=%T", zName); |
| 874 | 876 | } |
| 877 | + style_set_current_feature("tkt"); | |
| 875 | 878 | style_header("Edit Ticket"); |
| 876 | 879 | if( zName==0 || (nName = strlen(zName))<4 || nName>HNAME_LEN_SHA1 |
| 877 | 880 | || !validate16(zName,nName) ){ |
| 878 | 881 | @ <span class="tktError">Not a valid ticket id: "%h(zName)"</span> |
| 879 | - style_finish_page("tkt"); | |
| 882 | + style_finish_page(); | |
| 880 | 883 | return; |
| 881 | 884 | } |
| 882 | 885 | nRec = db_int(0, "SELECT count(*) FROM ticket WHERE tkt_uuid GLOB '%q*'", |
| 883 | 886 | zName); |
| 884 | 887 | if( nRec==0 ){ |
| 885 | 888 | @ <span class="tktError">No such ticket: "%h(zName)"</span> |
| 886 | - style_finish_page("tkt"); | |
| 889 | + style_finish_page(); | |
| 887 | 890 | return; |
| 888 | 891 | } |
| 889 | 892 | if( nRec>1 ){ |
| 890 | 893 | @ <span class="tktError">%d(nRec) tickets begin with: |
| 891 | 894 | @ "%h(zName)"</span> |
| 892 | - style_finish_page("tkt"); | |
| 895 | + style_finish_page(); | |
| 893 | 896 | return; |
| 894 | 897 | } |
| 895 | 898 | if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1); |
| 896 | 899 | ticket_init(); |
| 897 | 900 | getAllTicketFields(); |
| @@ -912,11 +915,11 @@ | ||
| 912 | 915 | return; |
| 913 | 916 | } |
| 914 | 917 | captcha_generate(0); |
| 915 | 918 | @ </form> |
| 916 | 919 | if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1); |
| 917 | - style_finish_page("tkt"); | |
| 920 | + style_finish_page(); | |
| 918 | 921 | } |
| 919 | 922 | |
| 920 | 923 | /* |
| 921 | 924 | ** Check the ticket table schema in zSchema to see if it appears to |
| 922 | 925 | ** be well-formed. If everything is OK, return NULL. If something is |
| @@ -1035,22 +1038,23 @@ | ||
| 1035 | 1038 | if( zType[0]=='c' ){ |
| 1036 | 1039 | zTitle = mprintf("Check-ins Associated With Ticket %h", zUuid); |
| 1037 | 1040 | }else{ |
| 1038 | 1041 | zTitle = mprintf("Timeline Of Ticket %h", zUuid); |
| 1039 | 1042 | } |
| 1043 | + style_set_current_feature("tkt"); | |
| 1040 | 1044 | style_header("%z", zTitle); |
| 1041 | 1045 | |
| 1042 | 1046 | sqlite3_snprintf(6, zGlobPattern, "%s", zUuid); |
| 1043 | 1047 | canonical16(zGlobPattern, strlen(zGlobPattern)); |
| 1044 | 1048 | tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid); |
| 1045 | 1049 | if( tagid==0 ){ |
| 1046 | 1050 | @ No such ticket: %h(zUuid) |
| 1047 | - style_finish_page("tkt"); | |
| 1051 | + style_finish_page(); | |
| 1048 | 1052 | return; |
| 1049 | 1053 | } |
| 1050 | 1054 | tkt_draw_timeline(tagid, zType); |
| 1051 | - style_finish_page("tkt"); | |
| 1055 | + style_finish_page(); | |
| 1052 | 1056 | } |
| 1053 | 1057 | |
| 1054 | 1058 | /* |
| 1055 | 1059 | ** WEBPAGE: tkthistory |
| 1056 | 1060 | ** URL: /tkthistory?name=TICKETUUID |
| @@ -1084,16 +1088,17 @@ | ||
| 1084 | 1088 | if( P("raw")!=0 ){ |
| 1085 | 1089 | style_submenu_element("Decoded", "%R/tkthistory/%s", zUuid); |
| 1086 | 1090 | }else if( g.perm.Admin ){ |
| 1087 | 1091 | style_submenu_element("Raw", "%R/tkthistory/%s?raw", zUuid); |
| 1088 | 1092 | } |
| 1093 | + style_set_current_feature("tkt"); | |
| 1089 | 1094 | style_header("%z", zTitle); |
| 1090 | 1095 | |
| 1091 | 1096 | tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname GLOB 'tkt-%q*'",zUuid); |
| 1092 | 1097 | if( tagid==0 ){ |
| 1093 | 1098 | @ No such ticket: %h(zUuid) |
| 1094 | - style_finish_page("tkt"); | |
| 1099 | + style_finish_page(); | |
| 1095 | 1100 | return; |
| 1096 | 1101 | } |
| 1097 | 1102 | if( P("raw")!=0 ){ |
| 1098 | 1103 | @ <h2>Raw Artifacts Associated With Ticket %h(zUuid)</h2> |
| 1099 | 1104 | }else{ |
| @@ -1162,11 +1167,11 @@ | ||
| 1162 | 1167 | } |
| 1163 | 1168 | db_finalize(&q); |
| 1164 | 1169 | if( nChng ){ |
| 1165 | 1170 | @ </ol> |
| 1166 | 1171 | } |
| 1167 | - style_finish_page("tkt"); | |
| 1172 | + style_finish_page(); | |
| 1168 | 1173 | } |
| 1169 | 1174 | |
| 1170 | 1175 | /* |
| 1171 | 1176 | ** Return TRUE if the given BLOB contains a newline character. |
| 1172 | 1177 | */ |
| @@ -1611,10 +1616,11 @@ | ||
| 1611 | 1616 | ** |
| 1612 | 1617 | ** Full-text search of all current tickets |
| 1613 | 1618 | */ |
| 1614 | 1619 | void tkt_srchpage(void){ |
| 1615 | 1620 | login_check_credentials(); |
| 1621 | + style_set_current_feature("tkt"); | |
| 1616 | 1622 | style_header("Ticket Search"); |
| 1617 | 1623 | ticket_standard_submenu(T_ALL_BUT(T_SRCH)); |
| 1618 | 1624 | search_screen(SRCH_TKT, 0); |
| 1619 | - style_finish_page("tkt"); | |
| 1625 | + style_finish_page(); | |
| 1620 | 1626 | } |
| 1621 | 1627 |
| --- 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 @@ | ||
| 54 | 54 | setup_menu_entry("Report Template", "tktsetup_rpttplt", |
| 55 | 55 | "The default ticket report format."); |
| 56 | 56 | setup_menu_entry("Key Template", "tktsetup_keytplt", |
| 57 | 57 | "The default color key for reports."); |
| 58 | 58 | @ </table> |
| 59 | - style_finish_page("tktsetup"); | |
| 59 | + style_finish_page(); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /* |
| 63 | 63 | ** NOTE: When changing the table definition below, also change the |
| 64 | 64 | ** equivalent definition found in schema.c. |
| @@ -123,18 +123,20 @@ | ||
| 123 | 123 | login_check_credentials(); |
| 124 | 124 | if( !g.perm.Setup ){ |
| 125 | 125 | login_needed(0); |
| 126 | 126 | return; |
| 127 | 127 | } |
| 128 | + style_set_current_feature("tktsetup"); | |
| 128 | 129 | if( PB("setup") ){ |
| 129 | 130 | cgi_redirect("tktsetup"); |
| 130 | 131 | } |
| 131 | 132 | isSubmit = P("submit")!=0; |
| 132 | 133 | z = P("x"); |
| 133 | 134 | if( z==0 ){ |
| 134 | 135 | z = db_get(zDbField, zDfltValue); |
| 135 | 136 | } |
| 137 | + style_set_current_feature("tktsetup"); | |
| 136 | 138 | style_header("Edit %s", zTitle); |
| 137 | 139 | if( P("clear")!=0 ){ |
| 138 | 140 | login_verify_csrf_secret(); |
| 139 | 141 | db_unset(zDbField, 0); |
| 140 | 142 | if( xRebuild ) xRebuild(); |
| @@ -163,11 +165,11 @@ | ||
| 163 | 165 | @ <hr /> |
| 164 | 166 | @ <h2>Default %s(zTitle)</h2> |
| 165 | 167 | @ <blockquote><pre> |
| 166 | 168 | @ %h(zDfltValue) |
| 167 | 169 | @ </pre></blockquote> |
| 168 | - style_finish_page("tktsetup"); | |
| 170 | + style_finish_page(); | |
| 169 | 171 | } |
| 170 | 172 | |
| 171 | 173 | /* |
| 172 | 174 | ** WEBPAGE: tktsetup_tab |
| 173 | 175 | ** Administrative page for defining the "ticket" table used |
| @@ -901,10 +903,11 @@ | ||
| 901 | 903 | } |
| 902 | 904 | |
| 903 | 905 | if( P("setup") ){ |
| 904 | 906 | cgi_redirect("tktsetup"); |
| 905 | 907 | } |
| 908 | + style_set_current_feature("tktsetup"); | |
| 906 | 909 | style_header("Ticket Display On Timelines"); |
| 907 | 910 | db_begin_transaction(); |
| 908 | 911 | @ <form action="%R/tktsetup_timeline" method="post"><div> |
| 909 | 912 | login_insert_csrf_secret(); |
| 910 | 913 | |
| @@ -934,8 +937,8 @@ | ||
| 934 | 937 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 935 | 938 | @ <input type="submit" name="setup" value="Cancel" /> |
| 936 | 939 | @ </p> |
| 937 | 940 | @ </div></form> |
| 938 | 941 | db_end_transaction(0); |
| 939 | - style_finish_page("tktsetup"); | |
| 942 | + style_finish_page(); | |
| 940 | 943 | |
| 941 | 944 | } |
| 942 | 945 |
| --- 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 |
+2
-2
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -546,11 +546,11 @@ | ||
| 546 | 546 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 547 | 547 | etag_check(ETAG_DATA,0); |
| 548 | 548 | style_header("Unversioned Files"); |
| 549 | 549 | if( !db_table_exists("repository","unversioned") ){ |
| 550 | 550 | @ No unversioned files on this server |
| 551 | - style_finish_page("uvlist"); | |
| 551 | + style_finish_page(); | |
| 552 | 552 | return; |
| 553 | 553 | } |
| 554 | 554 | if( PB("byage") ) zOrderBy = "mtime DESC"; |
| 555 | 555 | if( PB("showdel") ) showDel = 1; |
| 556 | 556 | db_prepare(&q, |
| @@ -632,11 +632,11 @@ | ||
| 632 | 632 | @ </tfoot> |
| 633 | 633 | @ </table></div> |
| 634 | 634 | }else{ |
| 635 | 635 | @ No unversioned files on this server. |
| 636 | 636 | } |
| 637 | - style_finish_page("uvlist"); | |
| 637 | + style_finish_page(); | |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | /* |
| 641 | 641 | ** WEBPAGE: juvlist |
| 642 | 642 | ** |
| 643 | 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("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 @@ | ||
| 772 | 772 | @ <label><input type="checkbox" name="delall"> |
| 773 | 773 | @ Delete all entries</input></label> |
| 774 | 774 | @ <input type="submit" name="delallbtn" value="Delete"></input> |
| 775 | 775 | @ </form> |
| 776 | 776 | style_table_sorter(); |
| 777 | - style_finish_page("access_log"); | |
| 777 | + style_finish_page(); | |
| 778 | 778 | } |
| 779 | 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("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 @@ | ||
| 407 | 407 | emailid |
| 408 | 408 | ); |
| 409 | 409 | if( zUser ) blob_append_sql(&sql, " AND euser=%Q", zUser); |
| 410 | 410 | db_prepare_blob(&q, &sql); |
| 411 | 411 | blob_reset(&sql); |
| 412 | + style_set_current_feature("webmail"); | |
| 412 | 413 | style_header("Message %d",emailid); |
| 413 | 414 | if( db_step(&q)==SQLITE_ROW ){ |
| 414 | 415 | Blob msg = db_column_text_as_blob(&q, 0); |
| 415 | 416 | int eFormat = atoi(PD("f","0")); |
| 416 | 417 | eState = db_column_int(&q, 1); |
| @@ -513,11 +514,11 @@ | ||
| 513 | 514 | style_submenu_element("Delete", "%s", |
| 514 | 515 | url_render(pUrl,"trash","1",zENum,"1")); |
| 515 | 516 | } |
| 516 | 517 | |
| 517 | 518 | db_end_transaction(0); |
| 518 | - style_finish_page("webmail"); | |
| 519 | + style_finish_page(); | |
| 519 | 520 | return; |
| 520 | 521 | } |
| 521 | 522 | |
| 522 | 523 | /* |
| 523 | 524 | ** Scan the query parameters looking for parameters with name of the |
| @@ -610,14 +611,15 @@ | ||
| 610 | 611 | login_check_credentials(); |
| 611 | 612 | if( !login_is_individual() ){ |
| 612 | 613 | login_needed(0); |
| 613 | 614 | return; |
| 614 | 615 | } |
| 616 | + style_set_current_feature("webmail"); | |
| 615 | 617 | if( !db_table_exists("repository","emailbox") ){ |
| 616 | 618 | style_header("Webmail Not Available"); |
| 617 | 619 | @ <p>This repository is not configured to provide webmail</p> |
| 618 | - style_finish_page("webmail"); | |
| 620 | + style_finish_page(); | |
| 619 | 621 | return; |
| 620 | 622 | } |
| 621 | 623 | add_content_sql_commands(g.db); |
| 622 | 624 | emailid = atoi(PD("id","0")); |
| 623 | 625 | url_initialize(&url, "webmail"); |
| @@ -757,11 +759,11 @@ | ||
| 757 | 759 | @ for(i=0; i<x.length; i++){ |
| 758 | 760 | @ x[i].checked = true; |
| 759 | 761 | @ } |
| 760 | 762 | @ } |
| 761 | 763 | @ </script> |
| 762 | - style_finish_page("webmail"); | |
| 764 | + style_finish_page(); | |
| 763 | 765 | db_end_transaction(0); |
| 764 | 766 | } |
| 765 | 767 | |
| 766 | 768 | /* |
| 767 | 769 | ** WEBPAGE: emailblob |
| @@ -780,10 +782,11 @@ | ||
| 780 | 782 | if( !g.perm.Setup ){ |
| 781 | 783 | login_needed(0); |
| 782 | 784 | return; |
| 783 | 785 | } |
| 784 | 786 | add_content_sql_commands(g.db); |
| 787 | + style_set_current_feature("webmail"); | |
| 785 | 788 | style_header("emailblob table"); |
| 786 | 789 | if( id>0 ){ |
| 787 | 790 | style_submenu_element("Index", "%R/emailblob"); |
| 788 | 791 | @ <ul> |
| 789 | 792 | db_prepare(&q, "SELECT emailid FROM emailblob WHERE ets=%d", id); |
| @@ -854,11 +857,11 @@ | ||
| 854 | 857 | } |
| 855 | 858 | @ </tbody></table> |
| 856 | 859 | db_finalize(&q); |
| 857 | 860 | style_table_sorter(); |
| 858 | 861 | } |
| 859 | - style_finish_page("webmail"); | |
| 862 | + style_finish_page(); | |
| 860 | 863 | } |
| 861 | 864 | |
| 862 | 865 | /* |
| 863 | 866 | ** WEBPAGE: emailoutq |
| 864 | 867 | ** |
| @@ -872,10 +875,11 @@ | ||
| 872 | 875 | if( !g.perm.Setup ){ |
| 873 | 876 | login_needed(0); |
| 874 | 877 | return; |
| 875 | 878 | } |
| 876 | 879 | add_content_sql_commands(g.db); |
| 880 | + style_set_current_feature("webmail"); | |
| 877 | 881 | style_header("emailoutq table"); |
| 878 | 882 | style_submenu_element("emailblob table","%R/emailblob"); |
| 879 | 883 | db_prepare(&q, |
| 880 | 884 | "SELECT edomain, efrom, eto, emsgid, " |
| 881 | 885 | " datetime(ectime,'unixepoch')," |
| @@ -911,7 +915,7 @@ | ||
| 911 | 915 | } |
| 912 | 916 | } |
| 913 | 917 | @ </tbody></table> |
| 914 | 918 | db_finalize(&q); |
| 915 | 919 | style_table_sorter(); |
| 916 | - style_finish_page("webmail"); | |
| 920 | + style_finish_page(); | |
| 917 | 921 | } |
| 918 | 922 |
| --- 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 @@ | ||
| 62 | 62 | ** Check a wiki name. If it is not well-formed, then issue an error |
| 63 | 63 | ** and return true. If it is well-formed, return false. |
| 64 | 64 | */ |
| 65 | 65 | static int check_name(const char *z){ |
| 66 | 66 | if( !wiki_name_is_wellformed((const unsigned char *)z) ){ |
| 67 | + style_set_current_feature("wiki"); | |
| 67 | 68 | style_header("Wiki Page Name Error"); |
| 68 | 69 | @ The wiki name "<span class="wikiError">%h(z)</span>" is not well-formed. |
| 69 | 70 | @ Rules for wiki page names: |
| 70 | 71 | well_formed_wiki_name_rules(); |
| 71 | - style_finish_page("wiki"); | |
| 72 | + style_finish_page(); | |
| 72 | 73 | return 1; |
| 73 | 74 | } |
| 74 | 75 | return 0; |
| 75 | 76 | } |
| 76 | 77 | |
| @@ -134,18 +135,19 @@ | ||
| 134 | 135 | cgi_set_parameter_nocopy("name", g.zExtra, 1); |
| 135 | 136 | g.isHome = 1; |
| 136 | 137 | wiki_page(); |
| 137 | 138 | return; |
| 138 | 139 | } |
| 140 | + style_set_current_feature("wiki"); | |
| 139 | 141 | style_header("Home"); |
| 140 | 142 | @ <p>This is a stub home-page for the project. |
| 141 | 143 | @ To fill in this page, first go to |
| 142 | 144 | @ %z(href("%R/setup_config"))setup/config</a> |
| 143 | 145 | @ and establish a "Project Name". Then create a |
| 144 | 146 | @ wiki page with that name. The content of that wiki page |
| 145 | 147 | @ will be displayed in place of this message.</p> |
| 146 | - style_finish_page("wiki"); | |
| 148 | + style_finish_page(); | |
| 147 | 149 | } |
| 148 | 150 | |
| 149 | 151 | /* |
| 150 | 152 | ** Return true if the given pagename is the name of the sandbox |
| 151 | 153 | */ |
| @@ -229,10 +231,11 @@ | ||
| 229 | 231 | ** Show a summary of the Markdown wiki formatting rules. |
| 230 | 232 | */ |
| 231 | 233 | void markdown_rules_page(void){ |
| 232 | 234 | Blob x; |
| 233 | 235 | int fTxt = P("txt")!=0; |
| 236 | + style_set_current_feature("wiki"); | |
| 234 | 237 | style_header("Markdown Formatting Rules"); |
| 235 | 238 | if( fTxt ){ |
| 236 | 239 | style_submenu_element("Formatted", "%R/md_rules"); |
| 237 | 240 | }else{ |
| 238 | 241 | style_submenu_element("Plain-Text", "%R/md_rules?txt=1"); |
| @@ -242,11 +245,11 @@ | ||
| 242 | 245 | blob_materialize(&x); |
| 243 | 246 | interwiki_append_map_table(&x); |
| 244 | 247 | safe_html_context(DOCSRC_TRUSTED); |
| 245 | 248 | wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-markdown"); |
| 246 | 249 | blob_reset(&x); |
| 247 | - style_finish_page("wiki"); | |
| 250 | + style_finish_page(); | |
| 248 | 251 | } |
| 249 | 252 | |
| 250 | 253 | /* |
| 251 | 254 | ** WEBPAGE: wiki_rules |
| 252 | 255 | ** |
| @@ -253,10 +256,11 @@ | ||
| 253 | 256 | ** Show a summary of the wiki formatting rules. |
| 254 | 257 | */ |
| 255 | 258 | void wiki_rules_page(void){ |
| 256 | 259 | Blob x; |
| 257 | 260 | int fTxt = P("txt")!=0; |
| 261 | + style_set_current_feature("wiki"); | |
| 258 | 262 | style_header("Wiki Formatting Rules"); |
| 259 | 263 | if( fTxt ){ |
| 260 | 264 | style_submenu_element("Formatted", "%R/wiki_rules"); |
| 261 | 265 | }else{ |
| 262 | 266 | style_submenu_element("Plain-Text", "%R/wiki_rules?txt=1"); |
| @@ -266,25 +270,26 @@ | ||
| 266 | 270 | blob_materialize(&x); |
| 267 | 271 | interwiki_append_map_table(&x); |
| 268 | 272 | safe_html_context(DOCSRC_TRUSTED); |
| 269 | 273 | wiki_render_by_mimetype(&x, fTxt ? "text/plain" : "text/x-fossil-wiki"); |
| 270 | 274 | blob_reset(&x); |
| 271 | - style_finish_page("wiki"); | |
| 275 | + style_finish_page(); | |
| 272 | 276 | } |
| 273 | 277 | |
| 274 | 278 | /* |
| 275 | 279 | ** WEBPAGE: markup_help |
| 276 | 280 | ** |
| 277 | 281 | ** Show links to the md_rules and wiki_rules pages. |
| 278 | 282 | */ |
| 279 | 283 | void markup_help_page(void){ |
| 284 | + style_set_current_feature("wiki"); | |
| 280 | 285 | style_header("Fossil Markup Styles"); |
| 281 | 286 | @ <ul> |
| 282 | 287 | @ <li><p>%z(href("%R/wiki_rules"))Fossil Wiki Formatting Rules</a></p></li> |
| 283 | 288 | @ <li><p>%z(href("%R/md_rules"))Markdown Formatting Rules</a></p></li> |
| 284 | 289 | @ </ul> |
| 285 | - style_finish_page("wiki"); | |
| 290 | + style_finish_page(); | |
| 286 | 291 | } |
| 287 | 292 | |
| 288 | 293 | /* |
| 289 | 294 | ** Returns non-zero if moderation is required for wiki changes and wiki |
| 290 | 295 | ** attachments. |
| @@ -344,10 +349,11 @@ | ||
| 344 | 349 | ** A generic landing page for wiki. |
| 345 | 350 | */ |
| 346 | 351 | void wiki_helppage(void){ |
| 347 | 352 | login_check_credentials(); |
| 348 | 353 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 354 | + style_set_current_feature("wiki"); | |
| 349 | 355 | style_header("Wiki Help"); |
| 350 | 356 | wiki_standard_submenu(W_ALL_BUT(W_HELP)); |
| 351 | 357 | @ <h2>Wiki Links</h2> |
| 352 | 358 | @ <ul> |
| 353 | 359 | @ <li> %z(href("%R/timeline?y=w"))Recent changes</a> to wiki pages.</li> |
| @@ -369,11 +375,11 @@ | ||
| 369 | 375 | if( search_restrict(SRCH_WIKI)!=0 ){ |
| 370 | 376 | @ <li> %z(href("%R/wikisrch"))Search</a> for wiki pages containing key |
| 371 | 377 | @ words</li> |
| 372 | 378 | } |
| 373 | 379 | @ </ul> |
| 374 | - style_finish_page("wiki"); | |
| 380 | + style_finish_page(); | |
| 375 | 381 | return; |
| 376 | 382 | } |
| 377 | 383 | |
| 378 | 384 | /* |
| 379 | 385 | ** WEBPAGE: wikisrch |
| @@ -381,14 +387,15 @@ | ||
| 381 | 387 | ** |
| 382 | 388 | ** Full-text search of all current wiki text |
| 383 | 389 | */ |
| 384 | 390 | void wiki_srchpage(void){ |
| 385 | 391 | login_check_credentials(); |
| 392 | + style_set_current_feature("wiki"); | |
| 386 | 393 | style_header("Wiki Search"); |
| 387 | 394 | wiki_standard_submenu(W_HELP|W_LIST|W_SANDBOX); |
| 388 | 395 | search_screen(SRCH_WIKI, 0); |
| 389 | - style_finish_page("wiki"); | |
| 396 | + style_finish_page(); | |
| 390 | 397 | } |
| 391 | 398 | |
| 392 | 399 | /* Return values from wiki_page_type() */ |
| 393 | 400 | #if INTERFACE |
| 394 | 401 | # define WIKITYPE_UNKNOWN (-1) |
| @@ -446,10 +453,11 @@ | ||
| 446 | 453 | static int wiki_page_header( |
| 447 | 454 | int eType, /* Page type. Might be WIKITYPE_UNKNOWN */ |
| 448 | 455 | const char *zPageName, /* Name of the page */ |
| 449 | 456 | const char *zExtra /* Extra prefix text on the page header */ |
| 450 | 457 | ){ |
| 458 | + style_set_current_feature("wiki"); | |
| 451 | 459 | if( eType==WIKITYPE_UNKNOWN ) eType = wiki_page_type(zPageName); |
| 452 | 460 | switch( eType ){ |
| 453 | 461 | case WIKITYPE_NORMAL: { |
| 454 | 462 | style_header("%s%s", zExtra, zPageName); |
| 455 | 463 | break; |
| @@ -597,11 +605,11 @@ | ||
| 597 | 605 | blob_reset(&wiki); |
| 598 | 606 | } |
| 599 | 607 | attachment_list(zPageName, "<hr /><h2>Attachments:</h2><ul>"); |
| 600 | 608 | manifest_destroy(pWiki); |
| 601 | 609 | document_emit_js(/*for optional pikchr support*/); |
| 602 | - style_finish_page("wiki"); | |
| 610 | + style_finish_page(); | |
| 603 | 611 | } |
| 604 | 612 | |
| 605 | 613 | /* |
| 606 | 614 | ** Write a wiki artifact into the repository |
| 607 | 615 | */ |
| @@ -1138,10 +1146,11 @@ | ||
| 1138 | 1146 | if( !g.perm.RdWiki ){ |
| 1139 | 1147 | login_needed(g.anon.RdWiki); |
| 1140 | 1148 | return; |
| 1141 | 1149 | } |
| 1142 | 1150 | } |
| 1151 | + style_set_current_feature("wiki"); | |
| 1143 | 1152 | style_header("Wiki Editor"); |
| 1144 | 1153 | style_emit_noscript_for_js_page(); |
| 1145 | 1154 | |
| 1146 | 1155 | /* Status bar */ |
| 1147 | 1156 | CX("<div id='fossil-status-bar' " |
| @@ -1344,11 +1353,11 @@ | ||
| 1344 | 1353 | CX("}catch(e){" |
| 1345 | 1354 | "fossil.error(e); console.error('Exception:',e);" |
| 1346 | 1355 | "}\n"); |
| 1347 | 1356 | CX("});\n"/*fossil.onPageLoad()*/); |
| 1348 | 1357 | style_script_end(); |
| 1349 | - style_finish_page("wiki"); | |
| 1358 | + style_finish_page(); | |
| 1350 | 1359 | } |
| 1351 | 1360 | |
| 1352 | 1361 | /* |
| 1353 | 1362 | ** WEBPAGE: wikinew |
| 1354 | 1363 | ** URL /wikinew |
| @@ -1367,10 +1376,11 @@ | ||
| 1367 | 1376 | zName = PD("name",""); |
| 1368 | 1377 | zMimetype = wiki_filter_mimetypes(P("mimetype")); |
| 1369 | 1378 | if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){ |
| 1370 | 1379 | cgi_redirectf("wikiedit?name=%T&mimetype=%s", zName, zMimetype); |
| 1371 | 1380 | } |
| 1381 | + style_set_current_feature("wiki"); | |
| 1372 | 1382 | style_header("Create A New Wiki Page"); |
| 1373 | 1383 | wiki_standard_submenu(W_ALL_BUT(W_NEW)); |
| 1374 | 1384 | @ <p>Rules for wiki page names:</p> |
| 1375 | 1385 | well_formed_wiki_name_rules(); |
| 1376 | 1386 | form_begin(0, "%R/wikinew"); |
| @@ -1382,11 +1392,11 @@ | ||
| 1382 | 1392 | @ </p></form> |
| 1383 | 1393 | if( zName[0] ){ |
| 1384 | 1394 | @ <p><span class="wikiError"> |
| 1385 | 1395 | @ "%h(zName)" is not a valid wiki page name!</span></p> |
| 1386 | 1396 | } |
| 1387 | - style_finish_page("wiki"); | |
| 1397 | + style_finish_page(); | |
| 1388 | 1398 | } |
| 1389 | 1399 | |
| 1390 | 1400 | |
| 1391 | 1401 | /* |
| 1392 | 1402 | ** Append the wiki text for an remark to the end of the given BLOB. |
| @@ -1513,10 +1523,11 @@ | ||
| 1513 | 1523 | if( P("cancel")!=0 ){ |
| 1514 | 1524 | cgi_redirectf("wiki?name=%T", zPageName); |
| 1515 | 1525 | return; |
| 1516 | 1526 | } |
| 1517 | 1527 | style_set_current_page("%T?name=%T", g.zPath, zPageName); |
| 1528 | + style_set_current_feature("wiki"); | |
| 1518 | 1529 | style_header("Append Comment To: %s", zPageName); |
| 1519 | 1530 | if( !goodCaptcha ){ |
| 1520 | 1531 | @ <p class="generalError">Error: Incorrect security code.</p> |
| 1521 | 1532 | } |
| 1522 | 1533 | if( P("preview")!=0 ){ |
| @@ -1544,11 +1555,11 @@ | ||
| 1544 | 1555 | @ <input type="submit" name="preview" value="Preview Your Comment" /> |
| 1545 | 1556 | @ <input type="submit" name="submit" value="Append Your Changes" /> |
| 1546 | 1557 | @ <input type="submit" name="cancel" value="Cancel" /> |
| 1547 | 1558 | captcha_generate(0); |
| 1548 | 1559 | @ </form> |
| 1549 | - style_finish_page("wiki"); | |
| 1560 | + style_finish_page(); | |
| 1550 | 1561 | } |
| 1551 | 1562 | |
| 1552 | 1563 | /* |
| 1553 | 1564 | ** WEBPAGE: whistory |
| 1554 | 1565 | ** URL: /whistory?name=PAGENAME |
| @@ -1564,10 +1575,11 @@ | ||
| 1564 | 1575 | Blob sql; |
| 1565 | 1576 | Stmt q; |
| 1566 | 1577 | login_check_credentials(); |
| 1567 | 1578 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 1568 | 1579 | zPageName = PD("name",""); |
| 1580 | + style_set_current_feature("wiki"); | |
| 1569 | 1581 | style_header("History Of %s", zPageName); |
| 1570 | 1582 | blob_init(&sql, 0, 0); |
| 1571 | 1583 | blob_append(&sql, timeline_query_for_www(), -1); |
| 1572 | 1584 | blob_append_sql(&sql, |
| 1573 | 1585 | "AND event.objid IN (" |
| @@ -1582,11 +1594,11 @@ | ||
| 1582 | 1594 | www_print_timeline(&q, |
| 1583 | 1595 | TIMELINE_DISJOINT|TIMELINE_GRAPH|TIMELINE_REFS, |
| 1584 | 1596 | 0, 0, 0, 0, 0, 0); |
| 1585 | 1597 | db_finalize(&q); |
| 1586 | 1598 | blob_reset(&sql); |
| 1587 | - style_finish_page("wiki"); | |
| 1599 | + style_finish_page(); | |
| 1588 | 1600 | } |
| 1589 | 1601 | |
| 1590 | 1602 | /* |
| 1591 | 1603 | ** WEBPAGE: wdiff |
| 1592 | 1604 | ** |
| @@ -1645,20 +1657,21 @@ | ||
| 1645 | 1657 | } |
| 1646 | 1658 | nextRid = wiki_next(wiki_tagid(pW1->zWikiTitle),pW1->rDate); |
| 1647 | 1659 | if( nextRid ){ |
| 1648 | 1660 | style_submenu_element("Next", "%R/wdiff?rid=%d", nextRid); |
| 1649 | 1661 | } |
| 1662 | + style_set_current_feature("wiki"); | |
| 1650 | 1663 | style_header("Changes To %s", pW1->zWikiTitle); |
| 1651 | 1664 | blob_zero(&d); |
| 1652 | 1665 | diffFlags = construct_diff_flags(1); |
| 1653 | 1666 | text_diff(&w2, &w1, &d, 0, diffFlags | DIFF_HTML | DIFF_LINENO); |
| 1654 | 1667 | @ <pre class="udiff"> |
| 1655 | 1668 | @ %s(blob_str(&d)) |
| 1656 | 1669 | @ <pre> |
| 1657 | 1670 | manifest_destroy(pW1); |
| 1658 | 1671 | manifest_destroy(pW2); |
| 1659 | - style_finish_page("wiki"); | |
| 1672 | + style_finish_page(); | |
| 1660 | 1673 | } |
| 1661 | 1674 | |
| 1662 | 1675 | /* |
| 1663 | 1676 | ** A query that returns information about all wiki pages. |
| 1664 | 1677 | ** |
| @@ -1701,10 +1714,11 @@ | ||
| 1701 | 1714 | int showAll = P("all")!=0; |
| 1702 | 1715 | int showRid = P("showid")!=0; |
| 1703 | 1716 | |
| 1704 | 1717 | login_check_credentials(); |
| 1705 | 1718 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 1719 | + style_set_current_feature("wiki"); | |
| 1706 | 1720 | style_header("Available Wiki Pages"); |
| 1707 | 1721 | if( showAll ){ |
| 1708 | 1722 | style_submenu_element("Active", "%R/wcontent"); |
| 1709 | 1723 | }else{ |
| 1710 | 1724 | style_submenu_element("All", "%R/wcontent?all=1"); |
| @@ -1756,11 +1770,11 @@ | ||
| 1756 | 1770 | fossil_free(zWDisplayName); |
| 1757 | 1771 | } |
| 1758 | 1772 | @ </tbody></table></div> |
| 1759 | 1773 | db_finalize(&q); |
| 1760 | 1774 | style_table_sorter(); |
| 1761 | - style_finish_page("wiki"); | |
| 1775 | + style_finish_page(); | |
| 1762 | 1776 | } |
| 1763 | 1777 | |
| 1764 | 1778 | /* |
| 1765 | 1779 | ** WEBPAGE: wfind |
| 1766 | 1780 | ** |
| @@ -1771,10 +1785,11 @@ | ||
| 1771 | 1785 | Stmt q; |
| 1772 | 1786 | const char *zTitle; |
| 1773 | 1787 | login_check_credentials(); |
| 1774 | 1788 | if( !g.perm.RdWiki ){ login_needed(g.anon.RdWiki); return; } |
| 1775 | 1789 | zTitle = PD("title","*"); |
| 1790 | + style_set_current_feature("wiki"); | |
| 1776 | 1791 | style_header("Wiki Pages Found"); |
| 1777 | 1792 | @ <ul> |
| 1778 | 1793 | db_prepare(&q, |
| 1779 | 1794 | "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'" |
| 1780 | 1795 | " ORDER BY lower(tagname) /*sort*/" , |
| @@ -1783,11 +1798,11 @@ | ||
| 1783 | 1798 | const char *zName = db_column_text(&q, 0); |
| 1784 | 1799 | @ <li>%z(href("%R/wiki?name=%T",zName))%h(zName)</a></li> |
| 1785 | 1800 | } |
| 1786 | 1801 | db_finalize(&q); |
| 1787 | 1802 | @ </ul> |
| 1788 | - style_finish_page("wiki"); | |
| 1803 | + style_finish_page(); | |
| 1789 | 1804 | } |
| 1790 | 1805 | |
| 1791 | 1806 | /* |
| 1792 | 1807 | ** Add a new wiki page to the repository. The page name is |
| 1793 | 1808 | ** given by the zPageName parameter. rid must be zero to create |
| 1794 | 1809 |
| --- 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 @@ | ||
| 85 | 85 | client_sync(syncFlags, 0, 0, 0); |
| 86 | 86 | @ </pre> |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - style_finish_page("xfersetup"); | |
| 90 | + style_finish_page(); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /* |
| 94 | 94 | ** Common implementation for the transfer setup editor pages. |
| 95 | 95 | */ |
| @@ -116,10 +116,11 @@ | ||
| 116 | 116 | isSubmit = P("submit")!=0; |
| 117 | 117 | z = P("x"); |
| 118 | 118 | if( z==0 ){ |
| 119 | 119 | z = db_get(zDbField, zDfltValue); |
| 120 | 120 | } |
| 121 | + style_set_current_feature("xfersetup"); | |
| 121 | 122 | style_header("Edit %s", zTitle); |
| 122 | 123 | if( P("clear")!=0 ){ |
| 123 | 124 | login_verify_csrf_secret(); |
| 124 | 125 | db_unset(zDbField, 0); |
| 125 | 126 | if( xRebuild ) xRebuild(); |
| @@ -150,11 +151,11 @@ | ||
| 150 | 151 | @ <h2>Default %s(zTitle)</h2> |
| 151 | 152 | @ <blockquote><pre> |
| 152 | 153 | @ %h(zDfltValue) |
| 153 | 154 | @ </pre></blockquote> |
| 154 | 155 | } |
| 155 | - style_finish_page("xfersetup"); | |
| 156 | + style_finish_page(); | |
| 156 | 157 | } |
| 157 | 158 | |
| 158 | 159 | static const char *zDefaultXferCommon = 0; |
| 159 | 160 | |
| 160 | 161 | /* |
| 161 | 162 |
| --- 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 @@ | ||
| 944 | 944 | if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude); |
| 945 | 945 | if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude); |
| 946 | 946 | zKey = blob_str(&cacheKey); |
| 947 | 947 | etag_check(ETAG_HASH, zKey); |
| 948 | 948 | |
| 949 | + style_set_current_feature("zip"); | |
| 949 | 950 | if( P("debug")!=0 ){ |
| 950 | 951 | style_header("%s Archive Generator Debug Screen", zType); |
| 951 | 952 | @ zName = "%h(zName)"<br /> |
| 952 | 953 | @ rid = %d(rid)<br /> |
| 953 | 954 | if( zInclude ){ |
| @@ -955,11 +956,11 @@ | ||
| 955 | 956 | } |
| 956 | 957 | if( zExclude ){ |
| 957 | 958 | @ zExclude = "%h(zExclude)"<br /> |
| 958 | 959 | } |
| 959 | 960 | @ zKey = "%h(zKey)" |
| 960 | - style_finish_page("zip"); | |
| 961 | + style_finish_page(); | |
| 961 | 962 | return; |
| 962 | 963 | } |
| 963 | 964 | if( referred_from_login() ){ |
| 964 | 965 | style_header("%s Archive Download", zType); |
| 965 | 966 | @ <form action='%R/%s(g.zPath)/%h(zName).%s(g.zPath)'> |
| @@ -966,11 +967,11 @@ | ||
| 966 | 967 | cgi_query_parameters_to_hidden(); |
| 967 | 968 | @ <p>%s(zType) Archive named <b>%h(zName).%s(g.zPath)</b> |
| 968 | 969 | @ holding the content of check-in <b>%h(zRid)</b>: |
| 969 | 970 | @ <input type="submit" value="Download" /> |
| 970 | 971 | @ </form> |
| 971 | - style_finish_page("zip"); | |
| 972 | + style_finish_page(); | |
| 972 | 973 | return; |
| 973 | 974 | } |
| 974 | 975 | blob_zero(&zip); |
| 975 | 976 | if( cache_read(&zip, zKey)==0 ){ |
| 976 | 977 | zip_of_checkin(eType, rid, &zip, zName, pInclude, pExclude); |
| 977 | 978 |
| --- 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 |
+71
-30
| --- www/contribute.wiki | ||
| +++ www/contribute.wiki | ||
| @@ -1,83 +1,124 @@ | ||
| 1 | 1 | <title>Contributing To Fossil</title> |
| 2 | 2 | |
| 3 | -Users are encouraged to contributed enhancements back to the Fossil | |
| 3 | +Fossil users are encouraged to contributed enhancements back to the | |
| 4 | 4 | project. This note outlines some of the procedures for making |
| 5 | 5 | useful contributions. |
| 6 | 6 | |
| 7 | 7 | <h2>1.0 Contributor Agreement</h2> |
| 8 | 8 | |
| 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 | |
| 10 | 10 | [./copyright-release.pdf | Contributor Agreement (PDF)] |
| 11 | 11 | (or [./copyright-release.html | as HTML]) on file for you. We require |
| 12 | 12 | this in order to maintain clear title to the Fossil code and prevent |
| 13 | 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 | |
| 14 | +that might cause legal problems for Fossil users. Many | |
| 15 | +lawyer-rich organizations require this as a precondition to using | |
| 16 | 16 | Fossil. |
| 17 | 17 | |
| 18 | 18 | If you do not wish to submit a Contributor Agreement, we would still |
| 19 | 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 | |
| 20 | +directly: we will be forced to re-implement your changes from scratch, which | |
| 21 | 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. | |
| 22 | 25 | |
| 23 | 26 | <h2>2.0 Submitting Patches</h2> |
| 24 | 27 | |
| 25 | 28 | 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 | |
| 27 | 35 | <a href="mailto:[email protected]">[email protected]</a>. Be sure to |
| 28 | 36 | 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 | |
| 37 | 54 | 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 | |
| 39 | 56 | 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 | |
| 41 | 58 | implementation of the same feature being prepared separately. |
| 42 | 59 | |
| 43 | 60 | <h2>3.0 Check-in Privileges</h2> |
| 44 | 61 | |
| 45 | 62 | Check-in privileges are granted on a case-by-case basis. Your chances |
| 46 | 63 | 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 | |
| 50 | 67 | privileges.</p> |
| 51 | 68 | |
| 52 | 69 | Contributors are asked to make all non-trivial changes on a branch. The |
| 53 | 70 | Fossil Architect (Richard Hipp) will merge changes onto the trunk.</p> |
| 54 | 71 | |
| 55 | -Contributors are required to following the | |
| 72 | +Contributors are required to follow the | |
| 56 | 73 | [./checkin.wiki | pre-checkin checklist] prior to every check-in to |
| 57 | 74 | the Fossil self-hosting repository. This checklist is short and succinct |
| 58 | 75 | and should only require a few seconds to follow. Contributors |
| 59 | 76 | 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. | |
| 61 | 78 | |
| 62 | 79 | Contributors should review the |
| 63 | 80 | [./style.wiki | Coding Style Guidelines] and mimic the coding style |
| 64 | 81 | used through the rest of the Fossil source code. Your code should |
| 65 | 82 | blend in. A third-party reader should be unable to distinguish your |
| 66 | 83 | code from any other code in the source corpus. |
| 67 | 84 | |
| 68 | 85 | <h2>4.0 Testing</h2> |
| 69 | 86 | |
| 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> | |
| 79 | 120 | |
| 80 | 121 | * [./build.wiki | How To Compile And Install Fossil] |
| 81 | 122 | * [./makefile.wiki | The Fossil Build Process] |
| 82 | 123 | * [./tech_overview.wiki | A Technical Overview of Fossil] |
| 83 | 124 | * [./adding_code.wiki | Adding Features To Fossil] |
| 84 | 125 |
| --- 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 |
+13
-1
| --- www/customskin.md | ||
| +++ www/customskin.md | ||
| @@ -84,11 +84,23 @@ | ||
| 84 | 84 | <meta http-equiv="Content-Security-Policy" content="...." /> |
| 85 | 85 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 86 | 86 | <title>....</title> |
| 87 | 87 | <link rel="stylesheet" href="..." type="text/css" /> |
| 88 | 88 | </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. | |
| 90 | 102 | |
| 91 | 103 | In most cases, it is best to leave the Fossil-generated HTML Header |
| 92 | 104 | alone. (One exception is when the administrator needs to include links |
| 93 | 105 | to additional CSS files.) The configurable part of the skin begins |
| 94 | 106 | with the Content Header section which should follow this template: |
| 95 | 107 |
| --- 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 |
+28
-56
| --- www/json-api/intro.md | ||
| +++ www/json-api/intro.md | ||
| @@ -140,61 +140,33 @@ | ||
| 140 | 140 | # Technical Problems and Considerations |
| 141 | 141 | |
| 142 | 142 | A random list of considerations which need to be made and potential |
| 143 | 143 | problem areas... |
| 144 | 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). | |
| 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.) | |
| 201 | 173 |
| --- 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 |