Fossil

Check-in [59121b9c0d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the experimental test-describe-artifacts webpage.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59121b9c0d1737c1106ef9ec962ad9618b0e74d8
User & Date: drh 2014-12-10 20:53:16.361
Context
2014-12-10
21:47
Rename the "test-describe-artifacts" webpage to "bloblist". Provide an index to use for repos with more than 5000 artifacts. Improvements to the bulk artifact describer. check-in: f3663f9f69 user: drh tags: trunk
20:53
Add the experimental test-describe-artifacts webpage. check-in: 59121b9c0d user: drh tags: trunk
17:34
First cut at a "sitemap" page. check-in: 843244311a user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/name.c.
942
943
944
945
946
947
948
949






















































950
951
952
953
954
955
956
**
** Usage: %fossil test-describe-artifacts
**
** Display a one-line description of every artifact.
*/
void test_describe_artifacts_cmd(void){
  db_find_and_open_repository(0,0);
  describe_artifacts_to_stdout("IN (SELECT rid FROM blob)", 0);






















































}

/*
** COMMAND: test-unsent
**
** Usage: %fossil test-unsent
**







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
**
** Usage: %fossil test-describe-artifacts
**
** Display a one-line description of every artifact.
*/
void test_describe_artifacts_cmd(void){
  db_find_and_open_repository(0,0);
  describe_artifacts_to_stdout(">0", 0);
}

/*
** WEBPAGE: test-describe-artifacts
**
** Return a page showing all artifacts in the repository
*/
void test_describe_artifacts_page(void){
  Stmt q;
  int s = atoi(PD("s","0"));
  int n = atoi(PD("n","5000"));
  int mx = db_int(0, "SELECT max(rid) FROM blob");
  char *zRange;

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(); return; }
  style_header("List Of Artifacts");
  if( mx>n && P("s")==0 ){
    int i;
    @ <p>Select a range of artifacts to view:</p>
    @ <ul>
    for(i=1; i<=mx; i+=n){
      @ <li> %z(href("%R/test-describe-artifacts?s=%d&n=%d",i,n))
      @ %d(i)..%d(i+n-1<mx?i+n-1:mx)</a>
    }
    @ </ul>
    style_footer();
    return;
  }
  if( mx>n ){
    style_submenu_element("Index", "Index", "test-describe-artifacts");
  }
  zRange = mprintf("BETWEEN %d AND %d", s, s+n-1);
  describe_artifacts(zRange);
  db_prepare(&q,
    "SELECT rid, uuid, summary, isPrivate FROM description ORDER BY rid"
  );
  @ <table cellpadding="0" cellspacing="0">
  while( db_step(&q)==SQLITE_ROW ){
    int rid = db_column_int(&q,0);
    const char *zUuid = db_column_text(&q, 1);
    const char *zDesc = db_column_text(&q, 2);
    int isPriv = db_column_int(&q,2);
    @ <tr><td align="right">%d(rid)</td>
    @ <td>&nbsp;%z(href("%R/info/%s",zUuid))%s(zUuid)</a>&nbsp;</td>
    @ <td align="left">%h(zDesc)</td>
    if( isPriv ){
      @ <td>(unpublished)</td>
    }
    @ </tr>
  }
  @ </table>
  db_finalize(&q);
  style_footer();
}

/*
** COMMAND: test-unsent
**
** Usage: %fossil test-unsent
**
Changes to src/sitemap.c.
56
57
58
59
60
61
62

63
64
65
66
67
68
69
  @ <li>%z(href("%R/reports"))Activity Reports</a>
  @ <li>%z(href("%R/login"))Login/Logout/Change Password</a>
  @ <li>%z(href("%R/attachlist"))List of Attachments</a>
  @ <li>Repository Status
  @   <ul>
  @   <li>%z(href("%R/stat"))Status Summary</a>
  @   <li>%z(href("%R/urllist"))List of URLs used to access this repository</a>

  @   </ul>
  @ <li>On-line Documentation
  @   <ul>
  @   <li>%z(href("%R/help"))List of All Commands and Web Pages</a>
  @   <li>%z(href("%R/test-all-help"))All "help" text on a single page</a>
  @   <li>%z(href("%R/wiki_rules"))Wiki Formatting Rules</a>
  @   </ul>







>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  @ <li>%z(href("%R/reports"))Activity Reports</a>
  @ <li>%z(href("%R/login"))Login/Logout/Change Password</a>
  @ <li>%z(href("%R/attachlist"))List of Attachments</a>
  @ <li>Repository Status
  @   <ul>
  @   <li>%z(href("%R/stat"))Status Summary</a>
  @   <li>%z(href("%R/urllist"))List of URLs used to access this repository</a>
  @   <li>%z(href("%R/test-describe-artifacts"))List of Artifacts</a>
  @   </ul>
  @ <li>On-line Documentation
  @   <ul>
  @   <li>%z(href("%R/help"))List of All Commands and Web Pages</a>
  @   <li>%z(href("%R/test-all-help"))All "help" text on a single page</a>
  @   <li>%z(href("%R/wiki_rules"))Wiki Formatting Rules</a>
  @   </ul>