Fossil SCM
Add the unpub query parameter to the /bloblist webpage.
Commit
c8b1e81f1138e52fa8704d65ff0c9b2d5989ef9d
Parent
d10e2cb6392ddf9…
1 file changed
+10
-3
+10
-3
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -979,23 +979,25 @@ | ||
| 979 | 979 | ** |
| 980 | 980 | ** Return a page showing all artifacts in the repository. Query parameters: |
| 981 | 981 | ** |
| 982 | 982 | ** n=N Show N artifacts |
| 983 | 983 | ** s=S Start with artifact number S |
| 984 | +** unpub Show only unpublished artifacts | |
| 984 | 985 | */ |
| 985 | 986 | void bloblist_page(void){ |
| 986 | 987 | Stmt q; |
| 987 | 988 | int s = atoi(PD("s","0")); |
| 988 | 989 | int n = atoi(PD("n","5000")); |
| 989 | 990 | int mx = db_int(0, "SELECT max(rid) FROM blob"); |
| 991 | + int unpubOnly = PB("unpub"); | |
| 990 | 992 | char *zRange; |
| 991 | 993 | |
| 992 | 994 | login_check_credentials(); |
| 993 | 995 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 994 | 996 | style_header("List Of Artifacts"); |
| 995 | 997 | style_submenu_element("250 Largest", 0, "bigbloblist"); |
| 996 | - if( mx>n && P("s")==0 ){ | |
| 998 | + if( !unpubOnly && mx>n && P("s")==0 ){ | |
| 997 | 999 | int i; |
| 998 | 1000 | @ <p>Select a range of artifacts to view:</p> |
| 999 | 1001 | @ <ul> |
| 1000 | 1002 | for(i=1; i<=mx; i+=n){ |
| 1001 | 1003 | @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n)) |
| @@ -1003,15 +1005,20 @@ | ||
| 1003 | 1005 | } |
| 1004 | 1006 | @ </ul> |
| 1005 | 1007 | style_footer(); |
| 1006 | 1008 | return; |
| 1007 | 1009 | } |
| 1008 | - if( mx>n ){ | |
| 1010 | + if( !unpubOnly && mx>n ){ | |
| 1009 | 1011 | style_submenu_element("Index", "Index", "bloblist"); |
| 1010 | 1012 | } |
| 1011 | - zRange = mprintf("BETWEEN %d AND %d", s, s+n-1); | |
| 1013 | + if( unpubOnly ){ | |
| 1014 | + zRange = mprintf("IN private"); | |
| 1015 | + }else{ | |
| 1016 | + zRange = mprintf("BETWEEN %d AND %d", s, s+n-1); | |
| 1017 | + } | |
| 1012 | 1018 | describe_artifacts(zRange); |
| 1019 | + fossil_free(zRange); | |
| 1013 | 1020 | db_prepare(&q, |
| 1014 | 1021 | "SELECT rid, uuid, summary, isPrivate FROM description ORDER BY rid" |
| 1015 | 1022 | ); |
| 1016 | 1023 | @ <table cellpadding="0" cellspacing="0"> |
| 1017 | 1024 | while( db_step(&q)==SQLITE_ROW ){ |
| 1018 | 1025 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -979,23 +979,25 @@ | |
| 979 | ** |
| 980 | ** Return a page showing all artifacts in the repository. Query parameters: |
| 981 | ** |
| 982 | ** n=N Show N artifacts |
| 983 | ** s=S Start with artifact number S |
| 984 | */ |
| 985 | void bloblist_page(void){ |
| 986 | Stmt q; |
| 987 | int s = atoi(PD("s","0")); |
| 988 | int n = atoi(PD("n","5000")); |
| 989 | int mx = db_int(0, "SELECT max(rid) FROM blob"); |
| 990 | char *zRange; |
| 991 | |
| 992 | login_check_credentials(); |
| 993 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 994 | style_header("List Of Artifacts"); |
| 995 | style_submenu_element("250 Largest", 0, "bigbloblist"); |
| 996 | if( mx>n && P("s")==0 ){ |
| 997 | int i; |
| 998 | @ <p>Select a range of artifacts to view:</p> |
| 999 | @ <ul> |
| 1000 | for(i=1; i<=mx; i+=n){ |
| 1001 | @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n)) |
| @@ -1003,15 +1005,20 @@ | |
| 1003 | } |
| 1004 | @ </ul> |
| 1005 | style_footer(); |
| 1006 | return; |
| 1007 | } |
| 1008 | if( mx>n ){ |
| 1009 | style_submenu_element("Index", "Index", "bloblist"); |
| 1010 | } |
| 1011 | zRange = mprintf("BETWEEN %d AND %d", s, s+n-1); |
| 1012 | describe_artifacts(zRange); |
| 1013 | db_prepare(&q, |
| 1014 | "SELECT rid, uuid, summary, isPrivate FROM description ORDER BY rid" |
| 1015 | ); |
| 1016 | @ <table cellpadding="0" cellspacing="0"> |
| 1017 | while( db_step(&q)==SQLITE_ROW ){ |
| 1018 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -979,23 +979,25 @@ | |
| 979 | ** |
| 980 | ** Return a page showing all artifacts in the repository. Query parameters: |
| 981 | ** |
| 982 | ** n=N Show N artifacts |
| 983 | ** s=S Start with artifact number S |
| 984 | ** unpub Show only unpublished artifacts |
| 985 | */ |
| 986 | void bloblist_page(void){ |
| 987 | Stmt q; |
| 988 | int s = atoi(PD("s","0")); |
| 989 | int n = atoi(PD("n","5000")); |
| 990 | int mx = db_int(0, "SELECT max(rid) FROM blob"); |
| 991 | int unpubOnly = PB("unpub"); |
| 992 | char *zRange; |
| 993 | |
| 994 | login_check_credentials(); |
| 995 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 996 | style_header("List Of Artifacts"); |
| 997 | style_submenu_element("250 Largest", 0, "bigbloblist"); |
| 998 | if( !unpubOnly && mx>n && P("s")==0 ){ |
| 999 | int i; |
| 1000 | @ <p>Select a range of artifacts to view:</p> |
| 1001 | @ <ul> |
| 1002 | for(i=1; i<=mx; i+=n){ |
| 1003 | @ <li> %z(href("%R/bloblist?s=%d&n=%d",i,n)) |
| @@ -1003,15 +1005,20 @@ | |
| 1005 | } |
| 1006 | @ </ul> |
| 1007 | style_footer(); |
| 1008 | return; |
| 1009 | } |
| 1010 | if( !unpubOnly && mx>n ){ |
| 1011 | style_submenu_element("Index", "Index", "bloblist"); |
| 1012 | } |
| 1013 | if( unpubOnly ){ |
| 1014 | zRange = mprintf("IN private"); |
| 1015 | }else{ |
| 1016 | zRange = mprintf("BETWEEN %d AND %d", s, s+n-1); |
| 1017 | } |
| 1018 | describe_artifacts(zRange); |
| 1019 | fossil_free(zRange); |
| 1020 | db_prepare(&q, |
| 1021 | "SELECT rid, uuid, summary, isPrivate FROM description ORDER BY rid" |
| 1022 | ); |
| 1023 | @ <table cellpadding="0" cellspacing="0"> |
| 1024 | while( db_step(&q)==SQLITE_ROW ){ |
| 1025 |