Allow projects to link to external sites.
Mon Jul 31 04:54:05 UTC 2006 Alberto Bertogli <albertito@gmail.com>
* Allow projects to link to external sites.
Add a 'repoprojurl' configuration option to put a reference to an external
project site. It appears in the project summary, just like url.
It also supports multidir, both automatic detection in the third_party
directory, and static construction.
Thanks to Alexandre Rossi for the idea and preliminary patch.
{
hunk ./config.py.sample 98
+ # Each repository may show a link to some website associated with it.
+ # This is typically useful if you've got a website describing the
+ # software in your repository.
+ #repoprojurl = 'http://example.com/projects/repo1/'
+
hunk ./config.py.sample 133
+ # optional, see above
+ #repoprojurl = 'http://example.com/projects/%(name)s/'
+
hunk ./config.py.sample 155
+ # if you want the projects urls to be picked up automatically from the
+ # file named "_darcs/third_party/darcsweb/extdoc" (one line only), set
+ # this to True. It defaults to False.
+ #autoprojurl = True
+
hunk ./darcsweb.cgi 1351
+ if config.repoprojurl:
+ print ' <tr><td>project url</td>'
+ print ' <td><a href="%(url)s">%(url)s</td></tr>' % \
+ { 'url': config.repoprojurl }
hunk ./darcsweb.cgi 2202
+ if 'autoprojurl' in dir(c) and c.autoprojurl:
+ dpath = fulldir + \
+ '/_darcs/third_party/darcsweb/projurl'
+ if os.access(dpath, os.R_OK):
+ projurl = open(dpath).read()
+ elif 'repoprojurl' in dir(c):
+ projurl = c.repoprojurl % {'name': name}
+ else:
+ projurl = None
+ elif 'repoprojurl' in dir(c):
+ projurl = c.repoprojurl % { 'name': name }
+ else:
+ projurl = None
+
hunk ./darcsweb.cgi 2223
+ repoprojurl = projurl
hunk ./darcsweb.cgi 2227
+
hunk ./darcsweb.cgi 2279
+
+ config.repoprojurl = None
+ if 'repoprojurl' in dir(c):
+ config.repoprojurl = c.repoprojurl
+
}