Fossil SCM
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.
Commit
e561cfd47e026532b82cfe5bb7906c2cc916c1db
Parent
e06e65bbf2b7a28…
1 file changed
+8
-1
+8
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1441,20 +1441,27 @@ | ||
| 1441 | 1441 | vfile_scan(&base, blob_size(&base), 0, 0, 0); |
| 1442 | 1442 | db_multi_exec("DELETE FROM sfile WHERE x NOT GLOB '*.fossil'"); |
| 1443 | 1443 | n = db_int(0, "SELECT count(*) FROM sfile"); |
| 1444 | 1444 | if( n>0 ){ |
| 1445 | 1445 | Stmt q; |
| 1446 | + @ <html> | |
| 1447 | + @ <head> | |
| 1448 | + @ <title>Repository List</title> | |
| 1449 | + @ </head> | |
| 1450 | + @ <body> | |
| 1446 | 1451 | @ <h1>Available Repositories:</h1> |
| 1447 | 1452 | @ <ol> |
| 1448 | 1453 | db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'" |
| 1449 | 1454 | " FROM sfile ORDER BY x COLLATE nocase;"); |
| 1450 | 1455 | while( db_step(&q)==SQLITE_ROW ){ |
| 1451 | 1456 | const char *zName = db_column_text(&q, 0); |
| 1452 | 1457 | const char *zUrl = db_column_text(&q, 1); |
| 1453 | - @ <li><a href="%h(zUrl)">%h(zName)</a></li> | |
| 1458 | + @ <li><a href="%h(zUrl)" target="_blank">%h(zName)</a></li> | |
| 1454 | 1459 | } |
| 1455 | 1460 | @ </ol> |
| 1461 | + @ </body> | |
| 1462 | + @ </html> | |
| 1456 | 1463 | cgi_reply(); |
| 1457 | 1464 | } |
| 1458 | 1465 | sqlite3_close(g.db); |
| 1459 | 1466 | g.db = 0; |
| 1460 | 1467 | return n; |
| 1461 | 1468 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1441,20 +1441,27 @@ | |
| 1441 | vfile_scan(&base, blob_size(&base), 0, 0, 0); |
| 1442 | db_multi_exec("DELETE FROM sfile WHERE x NOT GLOB '*.fossil'"); |
| 1443 | n = db_int(0, "SELECT count(*) FROM sfile"); |
| 1444 | if( n>0 ){ |
| 1445 | Stmt q; |
| 1446 | @ <h1>Available Repositories:</h1> |
| 1447 | @ <ol> |
| 1448 | db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'" |
| 1449 | " FROM sfile ORDER BY x COLLATE nocase;"); |
| 1450 | while( db_step(&q)==SQLITE_ROW ){ |
| 1451 | const char *zName = db_column_text(&q, 0); |
| 1452 | const char *zUrl = db_column_text(&q, 1); |
| 1453 | @ <li><a href="%h(zUrl)">%h(zName)</a></li> |
| 1454 | } |
| 1455 | @ </ol> |
| 1456 | cgi_reply(); |
| 1457 | } |
| 1458 | sqlite3_close(g.db); |
| 1459 | g.db = 0; |
| 1460 | return n; |
| 1461 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1441,20 +1441,27 @@ | |
| 1441 | vfile_scan(&base, blob_size(&base), 0, 0, 0); |
| 1442 | db_multi_exec("DELETE FROM sfile WHERE x NOT GLOB '*.fossil'"); |
| 1443 | n = db_int(0, "SELECT count(*) FROM sfile"); |
| 1444 | if( n>0 ){ |
| 1445 | Stmt q; |
| 1446 | @ <html> |
| 1447 | @ <head> |
| 1448 | @ <title>Repository List</title> |
| 1449 | @ </head> |
| 1450 | @ <body> |
| 1451 | @ <h1>Available Repositories:</h1> |
| 1452 | @ <ol> |
| 1453 | db_prepare(&q, "SELECT x, substr(x,-7,-100000)||'/home'" |
| 1454 | " FROM sfile ORDER BY x COLLATE nocase;"); |
| 1455 | while( db_step(&q)==SQLITE_ROW ){ |
| 1456 | const char *zName = db_column_text(&q, 0); |
| 1457 | const char *zUrl = db_column_text(&q, 1); |
| 1458 | @ <li><a href="%h(zUrl)" target="_blank">%h(zName)</a></li> |
| 1459 | } |
| 1460 | @ </ol> |
| 1461 | @ </body> |
| 1462 | @ </html> |
| 1463 | cgi_reply(); |
| 1464 | } |
| 1465 | sqlite3_close(g.db); |
| 1466 | g.db = 0; |
| 1467 | return n; |
| 1468 |