291
292
293
294
295
296
297
|
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
** options).
*/
void clone_ssh_db_set_options(void){
if( g.zSshCmd && g.zSshCmd[0] ){
db_set("ssh-command", g.zSshCmd, 0);
}
}
/*
** WEBPAGE: download
**
** Provide a simple page that newbies to download the latest tarball or
** ZIP archive, and to provide instructions on how to clone.
*/
void download_page(void){
login_check_credentials();
style_header("Download Page");
if( !g.perm.Zip ){
@ <p>Bummer. You do not have permission to download.
if( g.zLogin==0 || g.zLogin[0]==0 ){
@ Maybe it would work better if you
@ <a href="../login">logged in</a>.
}else{
@ Contact the site administrator and ask them to give
@ you "Download Zip" privileges.
}
}else{
const char *zDLTag = db_get("download-tag","trunk");
const char *zNm = db_get("short-project-name","download");
char *zUrl = href("%R/zip/%t.zip?uuid=%t", zNm, zDLTag);
@ <p>ZIP Archive: %z(zUrl)%h(zNm).zip</a>
zUrl = href("%R/tarball/%t.tar.gz?uuid=%t", zNm, zDLTag);
@ <p>Tarball: %z(zUrl)%h(zNm).tar.gz</a>
}
if( !g.perm.Clone ){
@ <p>You are not authorized to clone this repository.
if( g.zLogin==0 || g.zLogin[0]==0 ){
@ Maybe you would be able to clone if you
@ <a href="../login">logged in</a>.
}else{
@ Contact the site administrator and ask them to give
@ you "Clone" privileges in order to clone.
}
}else{
const char *zNm = db_get("short-project-name","clone");
@ <p>Clone the repository using this command:
@ <blockquote><pre>
@ fossil clone %s(g.zBaseURL) %h(zNm).fossil
@ </pre></blockquote>
}
style_footer();
}
|