Fossil SCM

Disable tag URLs without sufficient permission, display a message when there are no tags, provide dummy Javascript functions for the tag timeline.

eric 2008-09-06 13:09 eric-tagview-rework
Commit 5b8774957565adc388abf0dcae6903cefc6c6726
2 files changed +1 -1 +34 -5
+1 -1
--- src/style.c
+++ src/style.c
@@ -180,11 +180,11 @@
180180
@ html "<a href='$baseurl/dir'>Files</a>"
181181
@ }
182182
@ if {[hascap o]} {
183183
@ html "<a href='$baseurl/leaves'>Leaves</a>"
184184
@ html "<a href='$baseurl/timeline'>Timeline</a>"
185
-@ # html "<a href='$baseurl/tagview'>Tags</a>"
185
+@ html "<a href='$baseurl/tagview'>Tags</a>"
186186
@ }
187187
@ if {[hascap r]} {
188188
@ html "<a href='$baseurl/reportlist'>Bugs</a>"
189189
@ }
190190
@ if {[hascap j]} {
191191
--- 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 @@
185185
/*
186186
** WEBPAGE: /tagview
187187
*/
188188
void tagview_page(void){
189189
char const *zName = 0;
190
+ int zTcount = 0;
190191
login_check_credentials();
191192
if( !g.okRead ){
192193
login_needed();
193194
}
194195
login_anonymous_available();
@@ -220,19 +221,47 @@
220221
" ORDER BY tagname",
221222
MAX_INT_TAG
222223
);
223224
@ <ul>
224225
while( db_step(&q)==SQLITE_ROW ){
226
+ zTcount++;
225227
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
+ }
229236
}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)
232245
}
246
+ @ </li>
233247
}
234248
@ </ul>
249
+ if( zTcount == 0) {
250
+ @ There are no relevant tags.
251
+ }
235252
db_finalize(&q);
236253
}
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>
237266
style_footer();
238267
}
239268
--- 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

Keyboard Shortcuts

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