Overview
SHA1 Hash: | 5b8774957565adc388abf0dcae6903cefc6c6726 |
---|---|
Date: | 2008-09-06 13:09:44 |
User: | eric |
Comment: | Disable tag URLs without sufficient permission, display a message when there are no tags, provide dummy Javascript functions for the tag timeline. |
Timelines: | ancestors | descendants | both | eric-tagview-rework | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-eric-tagview-rework inherited from [3984b1b2c1]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/style.c from [89fb0defc5] to [0d33291611].
@@ -180,11 +180,11 @@ @ html "<a href='$baseurl/dir'>Files</a>" @ } @ if {[hascap o]} { @ html "<a href='$baseurl/leaves'>Leaves</a>" @ html "<a href='$baseurl/timeline'>Timeline</a>" -@ # html "<a href='$baseurl/tagview'>Tags</a>" +@ html "<a href='$baseurl/tagview'>Tags</a>" @ } @ if {[hascap r]} { @ html "<a href='$baseurl/reportlist'>Bugs</a>" @ } @ if {[hascap j]} {
Modified src/tagview.c from [0c21590de1] to [6eeaea74ec].
@@ -185,10 +185,11 @@ /* ** WEBPAGE: /tagview */ void tagview_page(void){ char const *zName = 0; + int zTcount = 0; login_check_credentials(); if( !g.okRead ){ login_needed(); } login_anonymous_available(); @@ -220,19 +221,47 @@ " ORDER BY tagname", MAX_INT_TAG ); @ <ul> while( db_step(&q)==SQLITE_ROW ){ + zTcount++; const char *name = db_column_text(&q, 0); - if( strncmp(name, prefix, preflen)==0 ){ - @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name+preflen)> - @ <strong>%s(name+preflen)</strong></a></li> + if( g.okHistory ){ + if( strncmp(name, prefix, preflen)==0 ){ + @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name+preflen)> + @ %s(name+preflen)</a> + }else{ + @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name)> + @ %s(name)</a> + } }else{ - @ <li><a href=%s(g.zBaseURL)/tagview?name=%s(name)> - @ %s(name)</a></li> + if( strncmp(name, prefix, preflen)==0 ){ + @ <li><strong>%s(name+preflen)</strong> + }else{ + @ <li><strong>%s(name)</strong> + } + } + if( strncmp(name, prefix, preflen)==0 ){ + @ (symbolic label) } + @ </li> } @ </ul> + if( zTcount == 0) { + @ There are no relevant tags. + } db_finalize(&q); } + /* + * Put in dummy functions since www_print_timeline has generated calls to + * them. Some browsers don't seem to care, but better to be safe. + * Actually, it would be nice to use the functions on this page, but at + * the moment it looks to be too difficult. + */ + @ <script> + @ function xin(id){ + @ } + @ function xout(id){ + @ } + @ </script> style_footer(); }