Overview
SHA1 Hash: | 8d529a7ae9b00d3cb39d4e7b56bfa1e089a18795 |
---|---|
Date: | 2008-11-26 21:59:42 |
User: | eric |
Comment: | Tidy up the raw tags web page, and provide a way to get there, for admins only |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/db.c from [63d9c57b09] to [9592bb6541].
@@ -1395,11 +1395,11 @@ const char *zUuid; /* The UUID to render */ char *z; /* Rendered HTML text */ zUuid = (const char*)sqlite3_value_text(argv[0]); if( g.okHistory && zUuid && strlen(zUuid)>=10 ){ - z = mprintf("<tt><a href='%s/vinfo/%t'><span style='font-size:1.5em'>" + z = mprintf("<tt><a href='%s/info/%t'><span style='font-size:1.5em'>" "%#h</span>%h</a></tt>", g.zBaseURL, zUuid, 10, zUuid, &zUuid[10]); sqlite3_result_text(pCxt, z, -1, free); }else{ sqlite3_result_text(pCxt, zUuid, -1, SQLITE_TRANSIENT); @@ -1440,11 +1440,11 @@ const char *zTag; /* The tag to render */ char *z; /* rendered html text */ zTag = (const char*)sqlite3_value_text(argv[0]); if( g.okHistory ){ - z = mprintf("<a href='%s/tagview?name=%T'>%h</a>", + z = mprintf("<a href='%s/tagview?name=%T&raw=y'>%h</a>", g.zBaseURL, zTag, zTag); }else{ z = mprintf("%h", zTag); } sqlite3_result_text(pCxt, z, -1, free);
Modified src/style.c from [f8159149de] to [ce8ef4ed6f].
@@ -367,10 +367,15 @@ @ a 'border' attribute set is arguable. */ @ .achtung { @ color: #ff0000; @ background: #ffff00; @ border: 1px solid #ff0000; +@ } +@ +@ div.miniform { +@ font-size: smaller; +@ margin: 8px; @ } @ @ table.fossil_db_generic_query_view { @ border-spacing: 0px; @ border: 1px solid black;
Modified src/tagview.c from [ea26ba8f0d] to [cf215193b7].
@@ -77,11 +77,11 @@ /* ** 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'/> @ <input type='hidden' name='raw' value='y'/> @@ -124,17 +124,19 @@ char *zSql; @ <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); } /* @@ -145,11 +147,11 @@ login_check_credentials(); /* 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")) ){ tagview_page_tag_by_id( atoi(check) ); @@ -187,10 +189,11 @@ /* ** 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(); } @@ -199,11 +202,15 @@ return; } 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){ tagview_print_timeline(zName, ""); @@ -212,11 +219,15 @@ } }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" " WHERE tagid=tag.tagid" @@ -255,10 +266,11 @@ if( nTag == 0) { @ 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 * the moment it looks to be too difficult. @@ -267,7 +279,8 @@ @ function xin(id){ @ } @ function xout(id){ @ } @ </script> + style_footer(); }