Differences From:
File
src/tagview.c
part of check-in
[10df4ff603]
- Reinstate "Tags" on the default main menu. Allow the new tagview page to hand
over to the old (but no user interface for this yet).
by
eric on
2008-11-25 21:56:42.
[view]
To:
File
src/tagview.c
part of check-in
[8d529a7ae9]
- Tidy up the raw tags web page, and provide a way to get there, for admins only
by
eric on
2008-11-26 21:59:42.
[view]
@@ -78,9 +78,9 @@
** A small search form which forwards to ?like=SEARCH_STRING
*/
static void tagview_page_search_miniform(void){
char const * like = P("like");
- @ <div style='font-size:smaller'>
+ @ <div class='miniform'>
@ <form action='tagview' method='post'>
@ Search for tags:
@ <input type='text' name='like' value='%h((like?like:""))' size='10'/>
@ <input type='submit'/>
@@ -125,15 +125,17 @@
@ <h2>Tag '%s(tagname)':</h2>
zSql = mprintf(
"SELECT DISTINCT"
" linktagid(t.tagid) AS 'Tag ID',"
+ " linktagname(t.tagname) AS 'Name',"
" DATETIME(tx.mtime) AS 'Timestamp',"
" linkuuid(b.uuid) AS 'Version'"
" FROM tag t, tagxref tx, blob b "
- " WHERE t.tagname='%q' AND t.tagid=tx.tagid AND tx.rid=b.rid "
+ " WHERE ( t.tagname='%q' OR t.tagname='sym-%q') "
+ " AND t.tagid=tx.tagid AND tx.rid=b.rid "
TAGVIEW_DEFAULT_FILTER
" ORDER BY tx.mtime DESC",
- tagname);
+ tagname,tagname);
db_generic_query_view(zSql, 1);
free(zSql);
}
@@ -146,9 +148,9 @@
/* if( !g.okRdWiki ){ */
if( !g.okAdmin ){
login_needed();
}
- style_header("Tags");
+ style_header("Raw Tags");
login_anonymous_available();
tagview_page_search_miniform();
@ <hr/>
if( 0 != (check = P("tagid")) ){
@@ -188,8 +190,9 @@
** WEBPAGE: /tagview
*/
void tagview_page(void){
char const *zName = 0;
+ char const *zTitle = 0;
int nTag = 0;
login_check_credentials();
if( !g.okRead ){
login_needed();
@@ -200,9 +203,13 @@
}
login_anonymous_available();
if( 0 != (zName = P("name")) ){
Blob uuid;
- style_header("Tagged Artifacts");
+ if( g.okAdmin ){
+ style_submenu_element("RawTags", "Internal Ticket View",
+ "%s/tagview?name=%s&raw=y", g.zTop, zName);
+ }
+ zTitle = "Tagged Artifacts";
@ <h2>%s(zName):</h2>
if( sym_tag_to_uuid(zName, &uuid) > 0){
tagview_print_timeline(zName, "sym-");
}else if( tag_to_uuid(zName, &uuid, "") > 0){
@@ -213,9 +220,13 @@
}else{
Stmt q;
const char *prefix = "sym-";
int preflen = strlen(prefix);
- style_header("Tags");
+ if( g.okAdmin ){
+ style_submenu_element("RawTags", "Internal Ticket View",
+ "%s/tagview?raw=y", g.zTop);
+ }
+ zTitle = "Tags";
db_prepare(&q,
"SELECT tagname"
" FROM tag"
" WHERE EXISTS(SELECT 1 FROM tagxref"
@@ -256,8 +267,9 @@
@ There are no relevant tags.
}
db_finalize(&q);
}
+ style_header(zTitle);
/*
* 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
@@ -268,6 +280,7 @@
@ }
@ function xout(id){
@ }
@ </script>
+
style_footer();
}