Fossil

Check-in [e561cfd4]
Login

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

Overview
Comment:On the generated "repository list" page when running "fossil ui DIR", include a title and make all hyperlinks appear in a new window or tab.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e561cfd47e026532b82cfe5bb7906c2cc916c1db
User & Date: drh 2015-05-14 15:31:33
Context
2015-05-14
16:20
Increase the version number to 1.33. Update the change log. check-in: af872ded user: drh tags: trunk
15:31
On the generated "repository list" page when running "fossil ui DIR", include a title and make all hyperlinks appear in a new window or tab. check-in: e561cfd4 user: drh tags: trunk
2015-05-13
22:40
Change search_init() to be a file-scope symbol so that it does not conflict with a function of the same name in libel.so. check-in: e06e65bb user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

1439
1440
1441
1442
1443
1444
1445





1446
1447
1448
1449
1450
1451
1452
1453
1454
1455


1456
1457
1458
1459
1460
1461
1462
  db_multi_exec("CREATE TABLE sfile(x TEXT);");
  db_multi_exec("CREATE TABLE vfile(pathname);");
  vfile_scan(&base, blob_size(&base), 0, 0, 0);
  db_multi_exec("DELETE FROM sfile WHERE x NOT GLOB '*.fossil'");
  n = db_int(0, "SELECT count(*) FROM sfile");
  if( n>0 ){
    Stmt q;





    @ <h1>Available Repositories:</h1>
    @ <ol>
    db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'"
                   " FROM sfile ORDER BY x COLLATE nocase;");
    while( db_step(&q)==SQLITE_ROW ){
      const char *zName = db_column_text(&q, 0);
      const char *zUrl = db_column_text(&q, 1);
      @ <li><a href="%h(zUrl)">%h(zName)</a></li>
    }
    @ </ol>


    cgi_reply();
  }
  sqlite3_close(g.db);
  g.db = 0;
  return n;
}








>
>
>
>
>







|


>
>







1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
  db_multi_exec("CREATE TABLE sfile(x TEXT);");
  db_multi_exec("CREATE TABLE vfile(pathname);");
  vfile_scan(&base, blob_size(&base), 0, 0, 0);
  db_multi_exec("DELETE FROM sfile WHERE x NOT GLOB '*.fossil'");
  n = db_int(0, "SELECT count(*) FROM sfile");
  if( n>0 ){
    Stmt q;
    @ <html>
    @ <head>
    @ <title>Repository List</title>
    @ </head>
    @ <body>
    @ <h1>Available Repositories:</h1>
    @ <ol>
    db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'"
                   " FROM sfile ORDER BY x COLLATE nocase;");
    while( db_step(&q)==SQLITE_ROW ){
      const char *zName = db_column_text(&q, 0);
      const char *zUrl = db_column_text(&q, 1);
      @ <li><a href="%h(zUrl)" target="_blank">%h(zName)</a></li>
    }
    @ </ol>
    @ </body>
    @ </html>
    cgi_reply();
  }
  sqlite3_close(g.db);
  g.db = 0;
  return n;
}