Fossil SCM
Paint backgrounds with the hash_color for the login name when the "ubg" query parameter is given on the /setup_ulist page.
Commit
eb1415d8c5ba4a3100e809a99a669f6c1cc398b06200cca6febbf5bbc9571306
Parent
8a3dc1a9754e5fe…
1 file changed
+7
-1
+7
-1
| --- src/setupuser.c | ||
| +++ src/setupuser.c | ||
| @@ -33,16 +33,18 @@ | ||
| 33 | 33 | ** screen for that user. Requires Admin privileges. |
| 34 | 34 | ** |
| 35 | 35 | ** Query parameters: |
| 36 | 36 | ** |
| 37 | 37 | ** with=CAP Only show users that have one or more capabilities in CAP. |
| 38 | +** ubg Color backgrounds by username hash | |
| 38 | 39 | */ |
| 39 | 40 | void setup_ulist(void){ |
| 40 | 41 | Stmt s; |
| 41 | 42 | double rNow; |
| 42 | 43 | const char *zWith = P("with"); |
| 43 | 44 | int bUnusedOnly = P("unused")!=0; |
| 45 | + int bUbg = P("ubg")!=0; | |
| 44 | 46 | |
| 45 | 47 | login_check_credentials(); |
| 46 | 48 | if( !g.perm.Admin ){ |
| 47 | 49 | login_needed(0); |
| 48 | 50 | return; |
| @@ -181,11 +183,15 @@ | ||
| 181 | 183 | const char *zSub; |
| 182 | 184 | int sid = db_column_int(&s,9); |
| 183 | 185 | if( rATime>0.0 ){ |
| 184 | 186 | zAge = human_readable_age(rNow - rATime); |
| 185 | 187 | } |
| 186 | - @ <tr> | |
| 188 | + if( bUbg ){ | |
| 189 | + @ <tr style='background-color: %h(hash_color(zLogin));'> | |
| 190 | + }else{ | |
| 191 | + @ <tr> | |
| 192 | + } | |
| 187 | 193 | @ <td data-sortkey='%h(zSortKey)'>\ |
| 188 | 194 | @ <a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> |
| 189 | 195 | @ <td>%h(zCap) |
| 190 | 196 | @ <td>%h(zInfo) |
| 191 | 197 | @ <td>%h(zDate?zDate:"") |
| 192 | 198 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -33,16 +33,18 @@ | |
| 33 | ** screen for that user. Requires Admin privileges. |
| 34 | ** |
| 35 | ** Query parameters: |
| 36 | ** |
| 37 | ** with=CAP Only show users that have one or more capabilities in CAP. |
| 38 | */ |
| 39 | void setup_ulist(void){ |
| 40 | Stmt s; |
| 41 | double rNow; |
| 42 | const char *zWith = P("with"); |
| 43 | int bUnusedOnly = P("unused")!=0; |
| 44 | |
| 45 | login_check_credentials(); |
| 46 | if( !g.perm.Admin ){ |
| 47 | login_needed(0); |
| 48 | return; |
| @@ -181,11 +183,15 @@ | |
| 181 | const char *zSub; |
| 182 | int sid = db_column_int(&s,9); |
| 183 | if( rATime>0.0 ){ |
| 184 | zAge = human_readable_age(rNow - rATime); |
| 185 | } |
| 186 | @ <tr> |
| 187 | @ <td data-sortkey='%h(zSortKey)'>\ |
| 188 | @ <a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> |
| 189 | @ <td>%h(zCap) |
| 190 | @ <td>%h(zInfo) |
| 191 | @ <td>%h(zDate?zDate:"") |
| 192 |
| --- src/setupuser.c | |
| +++ src/setupuser.c | |
| @@ -33,16 +33,18 @@ | |
| 33 | ** screen for that user. Requires Admin privileges. |
| 34 | ** |
| 35 | ** Query parameters: |
| 36 | ** |
| 37 | ** with=CAP Only show users that have one or more capabilities in CAP. |
| 38 | ** ubg Color backgrounds by username hash |
| 39 | */ |
| 40 | void setup_ulist(void){ |
| 41 | Stmt s; |
| 42 | double rNow; |
| 43 | const char *zWith = P("with"); |
| 44 | int bUnusedOnly = P("unused")!=0; |
| 45 | int bUbg = P("ubg")!=0; |
| 46 | |
| 47 | login_check_credentials(); |
| 48 | if( !g.perm.Admin ){ |
| 49 | login_needed(0); |
| 50 | return; |
| @@ -181,11 +183,15 @@ | |
| 183 | const char *zSub; |
| 184 | int sid = db_column_int(&s,9); |
| 185 | if( rATime>0.0 ){ |
| 186 | zAge = human_readable_age(rNow - rATime); |
| 187 | } |
| 188 | if( bUbg ){ |
| 189 | @ <tr style='background-color: %h(hash_color(zLogin));'> |
| 190 | }else{ |
| 191 | @ <tr> |
| 192 | } |
| 193 | @ <td data-sortkey='%h(zSortKey)'>\ |
| 194 | @ <a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> |
| 195 | @ <td>%h(zCap) |
| 196 | @ <td>%h(zInfo) |
| 197 | @ <td>%h(zDate?zDate:"") |
| 198 |