Fossil SCM
Disable tag URLs without sufficient permission, display a message when there are no tags, provide dummy Javascript functions for the tag timeline.
Commit
5b8774957565adc388abf0dcae6903cefc6c6726
Parent
5113ab5981bf88c…
2 files changed
+1
-1
+34
-5
+1
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -180,11 +180,11 @@ | ||
| 180 | 180 | @ html "<a href='$baseurl/dir'>Files</a>" |
| 181 | 181 | @ } |
| 182 | 182 | @ if {[hascap o]} { |
| 183 | 183 | @ html "<a href='$baseurl/leaves'>Leaves</a>" |
| 184 | 184 | @ html "<a href='$baseurl/timeline'>Timeline</a>" |
| 185 | -@ # html "<a href='$baseurl/tagview'>Tags</a>" | |
| 185 | +@ html "<a href='$baseurl/tagview'>Tags</a>" | |
| 186 | 186 | @ } |
| 187 | 187 | @ if {[hascap r]} { |
| 188 | 188 | @ html "<a href='$baseurl/reportlist'>Bugs</a>" |
| 189 | 189 | @ } |
| 190 | 190 | @ if {[hascap j]} { |
| 191 | 191 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -180,11 +180,11 @@ | |
| 180 | @ html "<a href='$baseurl/dir'>Files</a>" |
| 181 | @ } |
| 182 | @ if {[hascap o]} { |
| 183 | @ html "<a href='$baseurl/leaves'>Leaves</a>" |
| 184 | @ html "<a href='$baseurl/timeline'>Timeline</a>" |
| 185 | @ # html "<a href='$baseurl/tagview'>Tags</a>" |
| 186 | @ } |
| 187 | @ if {[hascap r]} { |
| 188 | @ html "<a href='$baseurl/reportlist'>Bugs</a>" |
| 189 | @ } |
| 190 | @ if {[hascap j]} { |
| 191 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -180,11 +180,11 @@ | |
| 180 | @ html "<a href='$baseurl/dir'>Files</a>" |
| 181 | @ } |
| 182 | @ if {[hascap o]} { |
| 183 | @ html "<a href='$baseurl/leaves'>Leaves</a>" |
| 184 | @ html "<a href='$baseurl/timeline'>Timeline</a>" |
| 185 | @ html "<a href='$baseurl/tagview'>Tags</a>" |
| 186 | @ } |
| 187 | @ if {[hascap r]} { |
| 188 | @ html "<a href='$baseurl/reportlist'>Bugs</a>" |
| 189 | @ } |
| 190 | @ if {[hascap j]} { |
| 191 |
+34
-5
| --- src/tagview.c | ||
| +++ src/tagview.c | ||
| @@ -185,10 +185,11 @@ | ||
| 185 | 185 | /* |
| 186 | 186 | ** WEBPAGE: /tagview |
| 187 | 187 | */ |
| 188 | 188 | void tagview_page(void){ |
| 189 | 189 | char const *zName = 0; |
| 190 | + int zTcount = 0; | |
| 190 | 191 | login_check_credentials(); |
| 191 | 192 | if( !g.okRead ){ |
| 192 | 193 | login_needed(); |
| 193 | 194 | } |
| 194 | 195 | login_anonymous_available(); |
| @@ -220,19 +221,47 @@ | ||
| 220 | 221 | " ORDER BY tagname", |
| 221 | 222 | MAX_INT_TAG |
| 222 | 223 | ); |
| 223 | 224 | @ <ul> |
| 224 | 225 | while( db_step(&q)==SQLITE_ROW ){ |
| 226 | + zTcount++; | |
| 225 | 227 | const char *name = db_column_text(&q, 0); |
| 226 | - if( strncmp(name, prefix, preflen)==0 ){ | |
| 227 | - @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name+preflen)> | |
| 228 | - @ <strong>%s(name+preflen)</strong></a></li> | |
| 228 | + if( g.okHistory ){ | |
| 229 | + if( strncmp(name, prefix, preflen)==0 ){ | |
| 230 | + @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name+preflen)> | |
| 231 | + @ %s(name+preflen)</a> | |
| 232 | + }else{ | |
| 233 | + @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name)> | |
| 234 | + @ %s(name)</a> | |
| 235 | + } | |
| 229 | 236 | }else{ |
| 230 | - @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name)> | |
| 231 | - @ %s(name)</a></li> | |
| 237 | + if( strncmp(name, prefix, preflen)==0 ){ | |
| 238 | + @ <li><strong>%s(name+preflen)</strong> | |
| 239 | + }else{ | |
| 240 | + @ <li><strong>%s(name)</strong> | |
| 241 | + } | |
| 242 | + } | |
| 243 | + if( strncmp(name, prefix, preflen)==0 ){ | |
| 244 | + @ (symbolic label) | |
| 232 | 245 | } |
| 246 | + @ </li> | |
| 233 | 247 | } |
| 234 | 248 | @ </ul> |
| 249 | + if( zTcount == 0) { | |
| 250 | + @ There are no relevant tags. | |
| 251 | + } | |
| 235 | 252 | db_finalize(&q); |
| 236 | 253 | } |
| 254 | + /* | |
| 255 | + * Put in dummy functions since www_print_timeline has generated calls to | |
| 256 | + * them. Some browsers don't seem to care, but better to be safe. | |
| 257 | + * Actually, it would be nice to use the functions on this page, but at | |
| 258 | + * the moment it looks to be too difficult. | |
| 259 | + */ | |
| 260 | + @ <script> | |
| 261 | + @ function xin(id){ | |
| 262 | + @ } | |
| 263 | + @ function xout(id){ | |
| 264 | + @ } | |
| 265 | + @ </script> | |
| 237 | 266 | style_footer(); |
| 238 | 267 | } |
| 239 | 268 |
| --- src/tagview.c | |
| +++ src/tagview.c | |
| @@ -185,10 +185,11 @@ | |
| 185 | /* |
| 186 | ** WEBPAGE: /tagview |
| 187 | */ |
| 188 | void tagview_page(void){ |
| 189 | char const *zName = 0; |
| 190 | login_check_credentials(); |
| 191 | if( !g.okRead ){ |
| 192 | login_needed(); |
| 193 | } |
| 194 | login_anonymous_available(); |
| @@ -220,19 +221,47 @@ | |
| 220 | " ORDER BY tagname", |
| 221 | MAX_INT_TAG |
| 222 | ); |
| 223 | @ <ul> |
| 224 | while( db_step(&q)==SQLITE_ROW ){ |
| 225 | const char *name = db_column_text(&q, 0); |
| 226 | if( strncmp(name, prefix, preflen)==0 ){ |
| 227 | @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name+preflen)> |
| 228 | @ <strong>%s(name+preflen)</strong></a></li> |
| 229 | }else{ |
| 230 | @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name)> |
| 231 | @ %s(name)</a></li> |
| 232 | } |
| 233 | } |
| 234 | @ </ul> |
| 235 | db_finalize(&q); |
| 236 | } |
| 237 | style_footer(); |
| 238 | } |
| 239 |
| --- src/tagview.c | |
| +++ src/tagview.c | |
| @@ -185,10 +185,11 @@ | |
| 185 | /* |
| 186 | ** WEBPAGE: /tagview |
| 187 | */ |
| 188 | void tagview_page(void){ |
| 189 | char const *zName = 0; |
| 190 | int zTcount = 0; |
| 191 | login_check_credentials(); |
| 192 | if( !g.okRead ){ |
| 193 | login_needed(); |
| 194 | } |
| 195 | login_anonymous_available(); |
| @@ -220,19 +221,47 @@ | |
| 221 | " ORDER BY tagname", |
| 222 | MAX_INT_TAG |
| 223 | ); |
| 224 | @ <ul> |
| 225 | while( db_step(&q)==SQLITE_ROW ){ |
| 226 | zTcount++; |
| 227 | const char *name = db_column_text(&q, 0); |
| 228 | if( g.okHistory ){ |
| 229 | if( strncmp(name, prefix, preflen)==0 ){ |
| 230 | @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name+preflen)> |
| 231 | @ %s(name+preflen)</a> |
| 232 | }else{ |
| 233 | @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name)> |
| 234 | @ %s(name)</a> |
| 235 | } |
| 236 | }else{ |
| 237 | if( strncmp(name, prefix, preflen)==0 ){ |
| 238 | @ <li><strong>%s(name+preflen)</strong> |
| 239 | }else{ |
| 240 | @ <li><strong>%s(name)</strong> |
| 241 | } |
| 242 | } |
| 243 | if( strncmp(name, prefix, preflen)==0 ){ |
| 244 | @ (symbolic label) |
| 245 | } |
| 246 | @ </li> |
| 247 | } |
| 248 | @ </ul> |
| 249 | if( zTcount == 0) { |
| 250 | @ There are no relevant tags. |
| 251 | } |
| 252 | db_finalize(&q); |
| 253 | } |
| 254 | /* |
| 255 | * Put in dummy functions since www_print_timeline has generated calls to |
| 256 | * them. Some browsers don't seem to care, but better to be safe. |
| 257 | * Actually, it would be nice to use the functions on this page, but at |
| 258 | * the moment it looks to be too difficult. |
| 259 | */ |
| 260 | @ <script> |
| 261 | @ function xin(id){ |
| 262 | @ } |
| 263 | @ function xout(id){ |
| 264 | @ } |
| 265 | @ </script> |
| 266 | style_footer(); |
| 267 | } |
| 268 |