Fossil SCM
Improvements to /sitemap: Break out the "Test Pages" entry into a separate /sitemap-test page. Add the "Site Map" entry for popups.
Commit
86737df9dcf2244cc4cdf8a646769ef3b31e7360c4ea9ef64ecc1c57fb785a2e
Parent
bbfd6123506e10e…
1 file changed
+53
-9
+53
-9
| --- src/sitemap.c | ||
| +++ src/sitemap.c | ||
| @@ -219,22 +219,66 @@ | ||
| 219 | 219 | @ <li>%z(href("%R/modreq"))Pending Moderation Requests</a></li> |
| 220 | 220 | @ <li>%z(href("%R/admin_log"))Admin log</a></li> |
| 221 | 221 | @ <li>%z(href("%R/cachestat"))Status of the web-page cache</a></li> |
| 222 | 222 | @ </ul></li> |
| 223 | 223 | } |
| 224 | - @ <li>Test Pages | |
| 225 | - @ <ul> | |
| 224 | + @ <li>%z(href("%R/sitemap-test"))Test Pages</a></li> | |
| 225 | + if( isPopup ){ | |
| 226 | + @ <li>%z(href("%R/sitemap"))Site Map</a></li> | |
| 227 | + } | |
| 228 | + @ </ul> | |
| 229 | + if( !isPopup ){ | |
| 230 | + style_finish_page("sitemap"); | |
| 231 | + } | |
| 232 | +} | |
| 233 | + | |
| 234 | +/* | |
| 235 | +** WEBPAGE: sitemap-test | |
| 236 | +** | |
| 237 | +** List some of the web pages offered by the Fossil web engine for testing | |
| 238 | +** purposes. This is similar to /sitemap, but is focused only on showing | |
| 239 | +** pages associated with testing. | |
| 240 | +*/ | |
| 241 | +void sitemap_test_page(void){ | |
| 242 | + int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */ | |
| 243 | + | |
| 244 | + login_check_credentials(); | |
| 245 | + if( P("popup")!=0 && cgi_csrf_safe(0) ){ | |
| 246 | + /* If this is a POST from the same origin with the popup=1 parameter, | |
| 247 | + ** then disable anti-robot defenses */ | |
| 248 | + isPopup = 1; | |
| 249 | + g.perm.Hyperlink = 1; | |
| 250 | + g.javascriptHyperlink = 0; | |
| 251 | + } | |
| 252 | + if( !isPopup ){ | |
| 253 | + style_header("Test Page Map"); | |
| 254 | + style_adunit_config(ADUNIT_RIGHT_OK); | |
| 255 | + } | |
| 256 | + @ <ul id="sitemap" class="columns" style="column-width:20em"> | |
| 226 | 257 | if( g.perm.Admin || db_get_boolean("test_env_enable",0) ){ |
| 227 | - @ <li>%z(href("%R/test_env"))CGI Environment Test</a></li> | |
| 258 | + @ <li>%z(href("%R/test_env"))CGI Environment Test</a></li> | |
| 228 | 259 | } |
| 229 | 260 | if( g.perm.Read ){ |
| 230 | - @ <li>%z(href("%R/test-rename-list"))List of file renames</a></li> | |
| 261 | + @ <li>%z(href("%R/test-rename-list"))List of file renames</a></li> | |
| 262 | + } | |
| 263 | + @ <li>%z(href("%R/test-builtin-files"))List of built-in files</a></li> | |
| 264 | + @ <li>%z(href("%R/mimetype_list"))List of MIME types</a></li> | |
| 265 | + @ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic | |
| 266 | + @ colors assigned to branch names</a> | |
| 267 | + if( g.perm.Admin ){ | |
| 268 | + @ <li>%z(href("%R/test-backlinks"))List of backlinks</a></li> | |
| 269 | + @ <li>%z(href("%R/test-backlink-timeline"))Backlink timeline</a></li> | |
| 270 | + @ <li>%z(href("%R/phantoms"))List of phantom artifacts</a></li> | |
| 271 | + @ <li>%z(href("%R/test-warning"))Error Log test page</a></li> | |
| 272 | + @ <li>%z(href("%R/repo_stat1"))Repository <tt>sqlite_stat1</tt> table</a> | |
| 273 | + @ <li>%z(href("%R/repo_schema"))Repository schema</a></li> | |
| 274 | + } | |
| 275 | + if( g.perm.Read && g.perm.Hyperlink ){ | |
| 276 | + @ <li>%z(href("%R/timewarps"))Timeline of timewarps</a></li> | |
| 231 | 277 | } |
| 232 | - @ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic | |
| 233 | - @ colors assigned to branch names</a> | |
| 234 | - @ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li> | |
| 235 | - @ </ul></li> | |
| 236 | - @ </ul> | |
| 278 | + @ <li>%z(href("%R/cookies"))Content of display preference cookie</a></li> | |
| 279 | + @ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li> | |
| 280 | + @ <li>%z(href("%R/test-piechart"))Pie-Chart generator test</a></li> | |
| 237 | 281 | if( !isPopup ){ |
| 238 | 282 | style_finish_page("sitemap"); |
| 239 | 283 | } |
| 240 | 284 | } |
| 241 | 285 |
| --- src/sitemap.c | |
| +++ src/sitemap.c | |
| @@ -219,22 +219,66 @@ | |
| 219 | @ <li>%z(href("%R/modreq"))Pending Moderation Requests</a></li> |
| 220 | @ <li>%z(href("%R/admin_log"))Admin log</a></li> |
| 221 | @ <li>%z(href("%R/cachestat"))Status of the web-page cache</a></li> |
| 222 | @ </ul></li> |
| 223 | } |
| 224 | @ <li>Test Pages |
| 225 | @ <ul> |
| 226 | if( g.perm.Admin || db_get_boolean("test_env_enable",0) ){ |
| 227 | @ <li>%z(href("%R/test_env"))CGI Environment Test</a></li> |
| 228 | } |
| 229 | if( g.perm.Read ){ |
| 230 | @ <li>%z(href("%R/test-rename-list"))List of file renames</a></li> |
| 231 | } |
| 232 | @ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic |
| 233 | @ colors assigned to branch names</a> |
| 234 | @ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li> |
| 235 | @ </ul></li> |
| 236 | @ </ul> |
| 237 | if( !isPopup ){ |
| 238 | style_finish_page("sitemap"); |
| 239 | } |
| 240 | } |
| 241 |
| --- src/sitemap.c | |
| +++ src/sitemap.c | |
| @@ -219,22 +219,66 @@ | |
| 219 | @ <li>%z(href("%R/modreq"))Pending Moderation Requests</a></li> |
| 220 | @ <li>%z(href("%R/admin_log"))Admin log</a></li> |
| 221 | @ <li>%z(href("%R/cachestat"))Status of the web-page cache</a></li> |
| 222 | @ </ul></li> |
| 223 | } |
| 224 | @ <li>%z(href("%R/sitemap-test"))Test Pages</a></li> |
| 225 | if( isPopup ){ |
| 226 | @ <li>%z(href("%R/sitemap"))Site Map</a></li> |
| 227 | } |
| 228 | @ </ul> |
| 229 | if( !isPopup ){ |
| 230 | style_finish_page("sitemap"); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | /* |
| 235 | ** WEBPAGE: sitemap-test |
| 236 | ** |
| 237 | ** List some of the web pages offered by the Fossil web engine for testing |
| 238 | ** purposes. This is similar to /sitemap, but is focused only on showing |
| 239 | ** pages associated with testing. |
| 240 | */ |
| 241 | void sitemap_test_page(void){ |
| 242 | int isPopup = 0; /* This is an XMLHttpRequest() for /sitemap */ |
| 243 | |
| 244 | login_check_credentials(); |
| 245 | if( P("popup")!=0 && cgi_csrf_safe(0) ){ |
| 246 | /* If this is a POST from the same origin with the popup=1 parameter, |
| 247 | ** then disable anti-robot defenses */ |
| 248 | isPopup = 1; |
| 249 | g.perm.Hyperlink = 1; |
| 250 | g.javascriptHyperlink = 0; |
| 251 | } |
| 252 | if( !isPopup ){ |
| 253 | style_header("Test Page Map"); |
| 254 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 255 | } |
| 256 | @ <ul id="sitemap" class="columns" style="column-width:20em"> |
| 257 | if( g.perm.Admin || db_get_boolean("test_env_enable",0) ){ |
| 258 | @ <li>%z(href("%R/test_env"))CGI Environment Test</a></li> |
| 259 | } |
| 260 | if( g.perm.Read ){ |
| 261 | @ <li>%z(href("%R/test-rename-list"))List of file renames</a></li> |
| 262 | } |
| 263 | @ <li>%z(href("%R/test-builtin-files"))List of built-in files</a></li> |
| 264 | @ <li>%z(href("%R/mimetype_list"))List of MIME types</a></li> |
| 265 | @ <li>%z(href("%R/hash-color-test"))Page to experiment with the automatic |
| 266 | @ colors assigned to branch names</a> |
| 267 | if( g.perm.Admin ){ |
| 268 | @ <li>%z(href("%R/test-backlinks"))List of backlinks</a></li> |
| 269 | @ <li>%z(href("%R/test-backlink-timeline"))Backlink timeline</a></li> |
| 270 | @ <li>%z(href("%R/phantoms"))List of phantom artifacts</a></li> |
| 271 | @ <li>%z(href("%R/test-warning"))Error Log test page</a></li> |
| 272 | @ <li>%z(href("%R/repo_stat1"))Repository <tt>sqlite_stat1</tt> table</a> |
| 273 | @ <li>%z(href("%R/repo_schema"))Repository schema</a></li> |
| 274 | } |
| 275 | if( g.perm.Read && g.perm.Hyperlink ){ |
| 276 | @ <li>%z(href("%R/timewarps"))Timeline of timewarps</a></li> |
| 277 | } |
| 278 | @ <li>%z(href("%R/cookies"))Content of display preference cookie</a></li> |
| 279 | @ <li>%z(href("%R/test-captcha"))Random ASCII-art Captcha image</a></li> |
| 280 | @ <li>%z(href("%R/test-piechart"))Pie-Chart generator test</a></li> |
| 281 | if( !isPopup ){ |
| 282 | style_finish_page("sitemap"); |
| 283 | } |
| 284 | } |
| 285 |