Fossil SCM

Add the colortest query parameter to the brlist webpage.

drh 2011-08-26 14:49 trunk
Commit d0daac20dae97980a27b80f6c79618ad5a5153e7
1 file changed +21 -3
+21 -3
--- src/branch.c
+++ src/branch.c
@@ -281,13 +281,18 @@
281281
void brlist_page(void){
282282
Stmt q;
283283
int cnt;
284284
int showClosed = P("closed")!=0;
285285
int showAll = P("all")!=0;
286
+ int colorTest = P("colortest")!=0;
286287
287288
login_check_credentials();
288289
if( !g.okRead ){ login_needed(); return; }
290
+ if( colorTest ){
291
+ showClosed = 0;
292
+ showAll = 1;
293
+ }
289294
290295
style_header(showClosed ? "Closed Branches" :
291296
showAll ? "All Branches" : "Open Branches");
292297
style_submenu_element("Timeline", "Timeline", "brtimeline");
293298
if( showClosed ){
@@ -298,10 +303,15 @@
298303
style_submenu_element("Open","Open","brlist");
299304
}else{
300305
style_submenu_element("All", "All", "brlist?all");
301306
style_submenu_element("Closed","Closed","brlist?closed");
302307
}
308
+ if( !colorTest ){
309
+ style_submenu_element("Color-Test", "Color-Test", "brlist?colortest");
310
+ }else{
311
+ style_submenu_element("All", "All", "brlist?all");
312
+ }
303313
login_anonymous_available();
304314
style_sidebox_begin("Nomenclature:", "33%");
305315
@ <ol>
306316
@ <li> An <div class="sideboxDescribed"><a href="brlist">
307317
@ open branch</a></div> is a branch that has one or
@@ -320,20 +330,28 @@
320330
prepareBranchQuery(&q, showAll, showClosed);
321331
cnt = 0;
322332
while( db_step(&q)==SQLITE_ROW ){
323333
const char *zBr = db_column_text(&q, 0);
324334
if( cnt==0 ){
325
- if( showClosed ){
335
+ if( colorTest ){
336
+ @ <h2>Default background colors for all branches:</h2>
337
+ }else if( showAll ){
338
+ @ <h2>All Branches:</h2>
339
+ }else if( showClosed ){
326340
@ <h2>Closed Branches:</h2>
327341
}else{
328342
@ <h2>Open Branches:</h2>
329343
}
330344
@ <ul>
331345
cnt++;
332346
}
333
- if( g.okHistory ){
334
- @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)">%h(zBr)</a></li>
347
+ if( colorTest ){
348
+ const char *zColor = hash_color(zBr);
349
+ @ <li><span style="background-color: %s(zColor)">
350
+ @ %h(zBr) &rarr; %s(zColor)</span></li>
351
+ }else if( g.okHistory ){
352
+ @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)")>%h(zBr)</a></li>
335353
}else{
336354
@ <li><b>%h(zBr)</b></li>
337355
}
338356
}
339357
if( cnt ){
340358
--- src/branch.c
+++ src/branch.c
@@ -281,13 +281,18 @@
281 void brlist_page(void){
282 Stmt q;
283 int cnt;
284 int showClosed = P("closed")!=0;
285 int showAll = P("all")!=0;
 
286
287 login_check_credentials();
288 if( !g.okRead ){ login_needed(); return; }
 
 
 
 
289
290 style_header(showClosed ? "Closed Branches" :
291 showAll ? "All Branches" : "Open Branches");
292 style_submenu_element("Timeline", "Timeline", "brtimeline");
293 if( showClosed ){
@@ -298,10 +303,15 @@
298 style_submenu_element("Open","Open","brlist");
299 }else{
300 style_submenu_element("All", "All", "brlist?all");
301 style_submenu_element("Closed","Closed","brlist?closed");
302 }
 
 
 
 
 
303 login_anonymous_available();
304 style_sidebox_begin("Nomenclature:", "33%");
305 @ <ol>
306 @ <li> An <div class="sideboxDescribed"><a href="brlist">
307 @ open branch</a></div> is a branch that has one or
@@ -320,20 +330,28 @@
320 prepareBranchQuery(&q, showAll, showClosed);
321 cnt = 0;
322 while( db_step(&q)==SQLITE_ROW ){
323 const char *zBr = db_column_text(&q, 0);
324 if( cnt==0 ){
325 if( showClosed ){
 
 
 
 
326 @ <h2>Closed Branches:</h2>
327 }else{
328 @ <h2>Open Branches:</h2>
329 }
330 @ <ul>
331 cnt++;
332 }
333 if( g.okHistory ){
334 @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)">%h(zBr)</a></li>
 
 
 
 
335 }else{
336 @ <li><b>%h(zBr)</b></li>
337 }
338 }
339 if( cnt ){
340
--- src/branch.c
+++ src/branch.c
@@ -281,13 +281,18 @@
281 void brlist_page(void){
282 Stmt q;
283 int cnt;
284 int showClosed = P("closed")!=0;
285 int showAll = P("all")!=0;
286 int colorTest = P("colortest")!=0;
287
288 login_check_credentials();
289 if( !g.okRead ){ login_needed(); return; }
290 if( colorTest ){
291 showClosed = 0;
292 showAll = 1;
293 }
294
295 style_header(showClosed ? "Closed Branches" :
296 showAll ? "All Branches" : "Open Branches");
297 style_submenu_element("Timeline", "Timeline", "brtimeline");
298 if( showClosed ){
@@ -298,10 +303,15 @@
303 style_submenu_element("Open","Open","brlist");
304 }else{
305 style_submenu_element("All", "All", "brlist?all");
306 style_submenu_element("Closed","Closed","brlist?closed");
307 }
308 if( !colorTest ){
309 style_submenu_element("Color-Test", "Color-Test", "brlist?colortest");
310 }else{
311 style_submenu_element("All", "All", "brlist?all");
312 }
313 login_anonymous_available();
314 style_sidebox_begin("Nomenclature:", "33%");
315 @ <ol>
316 @ <li> An <div class="sideboxDescribed"><a href="brlist">
317 @ open branch</a></div> is a branch that has one or
@@ -320,20 +330,28 @@
330 prepareBranchQuery(&q, showAll, showClosed);
331 cnt = 0;
332 while( db_step(&q)==SQLITE_ROW ){
333 const char *zBr = db_column_text(&q, 0);
334 if( cnt==0 ){
335 if( colorTest ){
336 @ <h2>Default background colors for all branches:</h2>
337 }else if( showAll ){
338 @ <h2>All Branches:</h2>
339 }else if( showClosed ){
340 @ <h2>Closed Branches:</h2>
341 }else{
342 @ <h2>Open Branches:</h2>
343 }
344 @ <ul>
345 cnt++;
346 }
347 if( colorTest ){
348 const char *zColor = hash_color(zBr);
349 @ <li><span style="background-color: %s(zColor)">
350 @ %h(zBr) &rarr; %s(zColor)</span></li>
351 }else if( g.okHistory ){
352 @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)")>%h(zBr)</a></li>
353 }else{
354 @ <li><b>%h(zBr)</b></li>
355 }
356 }
357 if( cnt ){
358

Keyboard Shortcuts

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