Overview
SHA1 Hash: | a12cb216b74d859beb0e1e1b4de10e87694b4769 |
---|---|
Date: | 2009-01-22 13:08:42 |
User: | drh |
Comment: | Reenable the "Tags" menu item, but make it go to the new "taglist" page. Also add separate "tagtimeline" page and separate "brlist" into "brlist" and "brtimeline". |
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/branch.c from [4a024d4405] to [806b04e089].
@@ -214,16 +214,59 @@ "new list"); } } /* +** WEBPAGE: brlist +** +** Show a timeline of all branches +*/ +void brlist_page(void){ + Stmt q; + + login_check_credentials(); + if( !g.okRead ){ login_needed(); return; } + + style_header("Branches"); + style_submenu_element("Timeline", "Timeline", "brtimeline"); + login_anonymous_available(); + @ <h2>Branches:</h2> + @ <ul> + db_prepare(&q, + "SELECT DISTINCT value FROM tagxref" + " WHERE tagid=%d AND srcid!=0 AND value NOT NULL" + " ORDER BY value", + TAG_BRANCH + ); + while( db_step(&q)==SQLITE_ROW ){ + const char *zBr = db_column_text(&q, 0); + if( g.okHistory ){ + @ <li><a href="%s(g.zBaseURL)/timeline?t=%T(zBr)">%h(zBr)</a></li> + }else{ + @ <li><b>%h(zBr)</b></li> + } + } + db_finalize(&q); + @ </ul> + @ <br clear="both"> + @ <script> + @ function xin(id){ + @ } + @ function xout(id){ + @ } + @ </script> + style_footer(); +} + +/* ** This routine is called while for each check-in that is rendered by ** the timeline of a "brlist" page. Add some additional hyperlinks ** to the end of the line. */ -static void brlist_extra(int rid){ +static void brtimeline_extra(int rid){ Stmt q; + if( !g.okHistory ) return; db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag" " WHERE tagxref.rid=%d" " AND tagxref.tagid=tag.tagid" " AND tagxref.tagtype>0" @@ -236,64 +279,31 @@ } db_finalize(&q); } /* -** WEBPAGE: brlist +** WEBPAGE: brtimeline ** ** Show a timeline of all branches */ -void brlist_page(void){ +void brtimeline_page(void){ Stmt q; login_check_credentials(); if( !g.okRead ){ login_needed(); return; } style_header("Branches"); + style_submenu_element("List", "List", "brlist"); login_anonymous_available(); @ <h2>The initial check-in for each branch:</h2> db_prepare(&q, "%s AND blob.rid IN (SELECT rid FROM tagxref" " WHERE tagtype>0 AND tagid=%d AND srcid!=0)" " ORDER BY event.mtime DESC", timeline_query_for_www(), TAG_BRANCH ); - www_print_timeline(&q, 0, brlist_extra); - db_finalize(&q); - @ <br clear="both"> - @ <script> - @ function xin(id){ - @ } - @ function xout(id){ - @ } - @ </script> - style_footer(); -} - -/* -** WEBPAGE: symtaglist -** -** Show a timeline of all check-ins that have a primary symbolic tag. -*/ -void symtaglist_page(void){ - Stmt q; - - login_check_credentials(); - if( !g.okRead ){ login_needed(); return; } - - style_header("Tagged Check-ins"); - login_anonymous_available(); - @ <h2>Check-ins that have one or more primary symbolic tags</h2> - db_prepare(&q, - "%s AND blob.rid IN (SELECT rid FROM tagxref" - " WHERE tagtype>1 AND srcid>0" - " AND tagid IN (SELECT tagid FROM tag " - " WHERE tagname GLOB 'sym-*'))" - " ORDER BY event.mtime DESC", - timeline_query_for_www() - ); - www_print_timeline(&q, 0, 0); + www_print_timeline(&q, 0, brtimeline_extra); db_finalize(&q); @ <br clear="both"> @ <script> @ function xin(id){ @ }
Modified src/info.c from [24ba1fa9ee] to [5f178b6ba9].
@@ -1105,11 +1105,10 @@ zName = blob_str(&uuid); break; } case 2: { /* go somewhere to show the multiple UUIDs */ - tagview_page(); return; break; } default: { fossil_redirect_home();
Modified src/style.c from [2f4e685f52] to [99e13227e3].
@@ -194,10 +194,11 @@ @ } @ if {[hascap o]} { @ html "<a href='$baseurl/leaves'>Leaves</a>" @ html "<a href='$baseurl/timeline'>Timeline</a>" @ html "<a href='$baseurl/brlist'>Branches</a>" +@ html "<a href='$baseurl/taglist'>Tags</a>" @ } @ if {[hascap r]} { @ html "<a href='$baseurl/reportlist'>Bugs</a>" @ } @ if {[hascap j]} {
Modified src/tag.c from [abb9a54f9e] to [deb9d688fd].
@@ -479,6 +479,101 @@ /* Cleanup */ return; tag_cmd_usage: usage("add|cancel|find|list ..."); +} + +/* +** WEBPAGE: /taglist +*/ +void taglist_page(void){ + Stmt q; + + login_check_credentials(); + if( !g.okRead ){ + login_needed(); + } + style_header("Tags"); + style_submenu_element("Timeline", "Timeline", "tagtimeline"); + @ <h2>Tags used by one or more check-ins:</h2> + db_prepare(&q, + "SELECT substr(tagname,5)" + " FROM tag" + " WHERE EXISTS(SELECT 1 FROM tagxref" + " WHERE tagid=tag.tagid" + " AND tagtype>0)" + " AND tagname GLOB 'sym-*'" + " ORDER BY tagname" + ); + @ <ul> + while( db_step(&q)==SQLITE_ROW ){ + const char *zName = db_column_text(&q, 0); + if( g.okHistory ){ + @ <li><a href=%s(g.zBaseURL)/timeline?t=%T(zName)>%h(zName)</a></li> + }else{ + @ <li><strong>%h(zName)</strong></li> + } + } + @ </ul> + db_finalize(&q); + style_footer(); +} + +/* +** Draw the names of all tags added to check-in rid. Only tags +** that are directly applied to rid are named. Propagated tags +** are omitted. +*/ +static void tagtimeline_extra(int rid){ + Stmt q; + db_prepare(&q, + "SELECT substr(tagname,5) FROM tagxref, tag" + " WHERE tagxref.rid=%d" + " AND tagxref.tagid=tag.tagid" + " AND tagxref.tagtype>0 AND tagxref.srcid>0" + " AND tag.tagname GLOB 'sym-*'", + rid + ); + while( db_step(&q)==SQLITE_ROW ){ + const char *zTagName = db_column_text(&q, 0); + if( g.okHistory ){ + @ <a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">[%h(zTagName)]</a> + }else{ + @ <b>[%h(zTagName)]</b> + } + } + db_finalize(&q); +} + +/* +** WEBPAGE: /tagtimeline +*/ +void tagtimeline_page(void){ + Stmt q; + + login_check_credentials(); + if( !g.okRead ){ login_needed(); return; } + + style_header("Tagged Check-ins"); + style_submenu_element("List", "List", "taglist"); + login_anonymous_available(); + @ <h2>Initial check-ins for each tag:</t2> + db_prepare(&q, + "%s AND blob.rid IN (SELECT rid FROM tagxref" + " WHERE tagtype>0 AND srcid>0" + " AND tagid IN (SELECT tagid FROM tag " + " WHERE tagname GLOB 'sym-*'))" + " ORDER BY event.mtime DESC", + timeline_query_for_www() + ); + www_print_timeline(&q, 0, tagtimeline_extra); + db_finalize(&q); + @ <br clear="both"> + @ <script> + @ function xin(id){ + @ } + @ function xout(id){ + @ } + @ </script> + style_footer(); }
Modified src/tagview.c from [0e640840d1] to [c5f7f1444b].
@@ -27,10 +27,11 @@ */ #include <assert.h> #include "config.h" #include "tagview.h" +#if 0 /* DISABLED */ #if 0 # define TAGVIEW_DEFAULT_FILTER "AND t.tagname NOT GLOB 'wiki-*' " #else # define TAGVIEW_DEFAULT_FILTER @@ -188,11 +189,11 @@ www_print_timeline(&q, 0, 0); db_finalize(&q); } /* -** WEBPAGE: /tagview +** WEB PAGE: /tagview */ void tagview_page(void){ char const *zName = 0; char const *zTitle = 0; int nTag = 0; @@ -285,5 +286,7 @@ @ } @ </script> style_footer(); } + +#endif /* DISABLED */