Fossil SCM
Use "Reports" for the /reportlist element, as per [1a1c0ebe3cf9]. Also be more pedantic when composing user-visible labels for the parameter-induced hyperlinks.
Commit
8861a68e2c3a232a3a80df6a274706a6d4ea1f0bc39cb5a17732a081562ee011
Parent
290671078c3270c…
2 files changed
+2
-9
+16
-6
+2
-9
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -1037,23 +1037,16 @@ | ||
| 1037 | 1037 | struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1038 | 1038 | const char *zQS = PD("QUERY_STRING",""); |
| 1039 | 1039 | |
| 1040 | 1040 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1041 | 1041 | style_set_current_feature("report"); |
| 1042 | - /* | |
| 1043 | - ** Lets use a funcy button for /reportlist since that page may be | |
| 1044 | - ** heavily customized by the user. Some variants: ⊚ ⦾ ❊ ⊛ ⚛ ⸎ 💠 | |
| 1045 | - ** Enclosing it inside of square brackets makes its position | |
| 1046 | - ** determenistic and clearly distincts regular submenu links from | |
| 1047 | - ** those that are induced by the query string parameters. | |
| 1048 | - */ | |
| 1049 | 1042 | if( zQS[0] ){ |
| 1050 | 1043 | style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); |
| 1051 | - style_submenu_element("[⊚]","%R/reportlist?%s",zQS); | |
| 1044 | + style_submenu_element("Reports","%R/reportlist?%s",zQS); | |
| 1052 | 1045 | } else { |
| 1053 | 1046 | style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); |
| 1054 | - style_submenu_element("[⊚]","%R/reportlist"); | |
| 1047 | + style_submenu_element("Reports","%R/reportlist"); | |
| 1055 | 1048 | } |
| 1056 | 1049 | style_submenu_parametric("rptview_",5); |
| 1057 | 1050 | style_submenu_parametric("rv",5); |
| 1058 | 1051 | |
| 1059 | 1052 | if( g.perm.Admin |
| 1060 | 1053 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -1037,23 +1037,16 @@ | |
| 1037 | struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1038 | const char *zQS = PD("QUERY_STRING",""); |
| 1039 | |
| 1040 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1041 | style_set_current_feature("report"); |
| 1042 | /* |
| 1043 | ** Lets use a funcy button for /reportlist since that page may be |
| 1044 | ** heavily customized by the user. Some variants: ⊚ ⦾ ❊ ⊛ ⚛ ⸎ 💠 |
| 1045 | ** Enclosing it inside of square brackets makes its position |
| 1046 | ** determenistic and clearly distincts regular submenu links from |
| 1047 | ** those that are induced by the query string parameters. |
| 1048 | */ |
| 1049 | if( zQS[0] ){ |
| 1050 | style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); |
| 1051 | style_submenu_element("[⊚]","%R/reportlist?%s",zQS); |
| 1052 | } else { |
| 1053 | style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); |
| 1054 | style_submenu_element("[⊚]","%R/reportlist"); |
| 1055 | } |
| 1056 | style_submenu_parametric("rptview_",5); |
| 1057 | style_submenu_parametric("rv",5); |
| 1058 | |
| 1059 | if( g.perm.Admin |
| 1060 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -1037,23 +1037,16 @@ | |
| 1037 | struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
| 1038 | const char *zQS = PD("QUERY_STRING",""); |
| 1039 | |
| 1040 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1041 | style_set_current_feature("report"); |
| 1042 | if( zQS[0] ){ |
| 1043 | style_submenu_element("Raw","%R/%s?tablist=1&%s",g.zPath,zQS); |
| 1044 | style_submenu_element("Reports","%R/reportlist?%s",zQS); |
| 1045 | } else { |
| 1046 | style_submenu_element("Raw","%R/%s?tablist=1",g.zPath); |
| 1047 | style_submenu_element("Reports","%R/reportlist"); |
| 1048 | } |
| 1049 | style_submenu_parametric("rptview_",5); |
| 1050 | style_submenu_parametric("rv",5); |
| 1051 | |
| 1052 | if( g.perm.Admin |
| 1053 |
+16
-6
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -346,14 +346,14 @@ | ||
| 346 | 346 | */ |
| 347 | 347 | void style_submenu_parametric( |
| 348 | 348 | const char *zPrefix, /* common prefix of the query parameters names */ |
| 349 | 349 | const int nMaxDigit /* maximal digit on the end of param names */ |
| 350 | 350 | ){ |
| 351 | - const char *zQS; /* QUERY_STRING */ | |
| 352 | - const char *suffix = "smpl"; /* common suffix for all parameters */ | |
| 353 | - const short sfxlen = 4; /* length of the above suffix */ | |
| 354 | - char zN[32]; /* short names => no dynamic allocations */ | |
| 351 | + static const char *suffix = "smpl"; /* common suffix for param names */ | |
| 352 | + static const short sfxlen = 4; /* length of the above suffix */ | |
| 353 | + const char *zQS; /* QUERY_STRING */ | |
| 354 | + char zN[32]; /* buffer for parameter names to probe */ | |
| 355 | 355 | short i,l; |
| 356 | 356 | |
| 357 | 357 | /* zPrefix must be tidy and short; also filter out ENV/CGI variables */ |
| 358 | 358 | assert( zPrefix != 0 && fossil_islower(zPrefix[0]) ); |
| 359 | 359 | l = strnlen( zPrefix, sizeof(zN) ); |
| @@ -378,14 +378,24 @@ | ||
| 378 | 378 | else break; |
| 379 | 379 | } |
| 380 | 380 | if( z[0] != 0 && z[0] != '/' ) |
| 381 | 381 | continue; |
| 382 | 382 | assert( nSubmenu < count(aSubmenu) ); |
| 383 | - if(fossil_islower(zV[0])){ | |
| 383 | + if(fossil_islower(zV[0]) && z[0]=='/'){ | |
| 384 | 384 | aSubmenu[nSubmenu].zLabel = mprintf( "%s",zV); /* memory leak? */ |
| 385 | 385 | }else{ |
| 386 | - aSubmenu[nSubmenu].zLabel = mprintf("✧%s",zV); /* maybe: ◦✧⸰⸎ ✨ */ | |
| 386 | + /* prepend a label with an unobtrusive symbol that "sorts-last"; | |
| 387 | + ** this clearly distincts it from the built-in elements */ | |
| 388 | + static const char *mark = "✧"; | |
| 389 | + char *z = mprintf("%s%s",mark,zV); | |
| 390 | + aSubmenu[nSubmenu].zLabel = z; | |
| 391 | + /* also prettify the first segment */ | |
| 392 | + z += strlen(mark); | |
| 393 | + z[0] = fossil_toupper(z[0]); | |
| 394 | + for(; z[0]!=0 && z[0]!='/'; z++ ){ | |
| 395 | + if( z[0]=='_' ) z[0] = ' '; | |
| 396 | + } | |
| 387 | 397 | } |
| 388 | 398 | if( zQS[0] ){ |
| 389 | 399 | aSubmenu[nSubmenu].zLink = mprintf("%R/%s?%s",zV,zQS); |
| 390 | 400 | }else{ |
| 391 | 401 | aSubmenu[nSubmenu].zLink = mprintf("%R/%s",zV); |
| 392 | 402 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -346,14 +346,14 @@ | |
| 346 | */ |
| 347 | void style_submenu_parametric( |
| 348 | const char *zPrefix, /* common prefix of the query parameters names */ |
| 349 | const int nMaxDigit /* maximal digit on the end of param names */ |
| 350 | ){ |
| 351 | const char *zQS; /* QUERY_STRING */ |
| 352 | const char *suffix = "smpl"; /* common suffix for all parameters */ |
| 353 | const short sfxlen = 4; /* length of the above suffix */ |
| 354 | char zN[32]; /* short names => no dynamic allocations */ |
| 355 | short i,l; |
| 356 | |
| 357 | /* zPrefix must be tidy and short; also filter out ENV/CGI variables */ |
| 358 | assert( zPrefix != 0 && fossil_islower(zPrefix[0]) ); |
| 359 | l = strnlen( zPrefix, sizeof(zN) ); |
| @@ -378,14 +378,24 @@ | |
| 378 | else break; |
| 379 | } |
| 380 | if( z[0] != 0 && z[0] != '/' ) |
| 381 | continue; |
| 382 | assert( nSubmenu < count(aSubmenu) ); |
| 383 | if(fossil_islower(zV[0])){ |
| 384 | aSubmenu[nSubmenu].zLabel = mprintf( "%s",zV); /* memory leak? */ |
| 385 | }else{ |
| 386 | aSubmenu[nSubmenu].zLabel = mprintf("✧%s",zV); /* maybe: ◦✧⸰⸎ ✨ */ |
| 387 | } |
| 388 | if( zQS[0] ){ |
| 389 | aSubmenu[nSubmenu].zLink = mprintf("%R/%s?%s",zV,zQS); |
| 390 | }else{ |
| 391 | aSubmenu[nSubmenu].zLink = mprintf("%R/%s",zV); |
| 392 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -346,14 +346,14 @@ | |
| 346 | */ |
| 347 | void style_submenu_parametric( |
| 348 | const char *zPrefix, /* common prefix of the query parameters names */ |
| 349 | const int nMaxDigit /* maximal digit on the end of param names */ |
| 350 | ){ |
| 351 | static const char *suffix = "smpl"; /* common suffix for param names */ |
| 352 | static const short sfxlen = 4; /* length of the above suffix */ |
| 353 | const char *zQS; /* QUERY_STRING */ |
| 354 | char zN[32]; /* buffer for parameter names to probe */ |
| 355 | short i,l; |
| 356 | |
| 357 | /* zPrefix must be tidy and short; also filter out ENV/CGI variables */ |
| 358 | assert( zPrefix != 0 && fossil_islower(zPrefix[0]) ); |
| 359 | l = strnlen( zPrefix, sizeof(zN) ); |
| @@ -378,14 +378,24 @@ | |
| 378 | else break; |
| 379 | } |
| 380 | if( z[0] != 0 && z[0] != '/' ) |
| 381 | continue; |
| 382 | assert( nSubmenu < count(aSubmenu) ); |
| 383 | if(fossil_islower(zV[0]) && z[0]=='/'){ |
| 384 | aSubmenu[nSubmenu].zLabel = mprintf( "%s",zV); /* memory leak? */ |
| 385 | }else{ |
| 386 | /* prepend a label with an unobtrusive symbol that "sorts-last"; |
| 387 | ** this clearly distincts it from the built-in elements */ |
| 388 | static const char *mark = "✧"; |
| 389 | char *z = mprintf("%s%s",mark,zV); |
| 390 | aSubmenu[nSubmenu].zLabel = z; |
| 391 | /* also prettify the first segment */ |
| 392 | z += strlen(mark); |
| 393 | z[0] = fossil_toupper(z[0]); |
| 394 | for(; z[0]!=0 && z[0]!='/'; z++ ){ |
| 395 | if( z[0]=='_' ) z[0] = ' '; |
| 396 | } |
| 397 | } |
| 398 | if( zQS[0] ){ |
| 399 | aSubmenu[nSubmenu].zLink = mprintf("%R/%s?%s",zV,zQS); |
| 400 | }else{ |
| 401 | aSubmenu[nSubmenu].zLink = mprintf("%R/%s",zV); |
| 402 |