Fossil SCM

Improvements to /sitemap: Break out the "Test Pages" entry into a separate /sitemap-test page. Add the "Site Map" entry for popups.

drh 2020-12-02 14:14 trunk
Commit 86737df9dcf2244cc4cdf8a646769ef3b31e7360c4ea9ef64ecc1c57fb785a2e
1 file changed +53 -9
+53 -9
--- src/sitemap.c
+++ src/sitemap.c
@@ -219,22 +219,66 @@
219219
@ <li>%z(href("%R/modreq"))Pending Moderation Requests</a></li>
220220
@ <li>%z(href("%R/admin_log"))Admin log</a></li>
221221
@ <li>%z(href("%R/cachestat"))Status of the web-page cache</a></li>
222222
@ </ul></li>
223223
}
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">
226257
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>
228259
}
229260
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>
231277
}
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>
237281
if( !isPopup ){
238282
style_finish_page("sitemap");
239283
}
240284
}
241285
--- 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

Keyboard Shortcuts

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