diff options
author | Simo Sorce <idra@samba.org> | 2012-10-26 12:51:42 +0000 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2012-11-15 14:35:59 +0800 |
commit | c30c03312041c24c39b6a986882aae6189096c2f (patch) | |
tree | a8259779a17e29bd3e132fb2f3b51aaa7dbcefc0 | |
parent | 2894c4aeec566cb678a331f44f3d981c09c7d90c (diff) | |
download | patchwork-c30c03312041c24c39b6a986882aae6189096c2f.tar patchwork-c30c03312041c24c39b6a986882aae6189096c2f.tar.gz |
Add URL and SCM data to projects
This allows us to display friendly links to the project website,
web SCM UI and SCM URL.
For example for the patchwork project these could be set to:
web_url: http://jk.ozlabs.org/projects/patchwork/
scm_url: git://ozlabs.org/home/jk/git/patchwork
webscm_url: http://git.ozlabs.org/?p=patchwork;a=tree
Requires a DB schema upgrade
Signed-off-by: Simo Sorce <idra@samba.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | apps/patchwork/models.py | 3 | ||||
-rw-r--r-- | lib/sql/migration/012-project-add-columns.sql | 5 | ||||
-rw-r--r-- | templates/patchwork/project.html | 18 |
3 files changed, 26 insertions, 0 deletions
diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py index bbfe827..86a5266 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -64,6 +64,9 @@ class Project(models.Model): name = models.CharField(max_length=255, unique=True) listid = models.CharField(max_length=255, unique=True) listemail = models.CharField(max_length=200) + web_url = models.CharField(max_length=2000, blank=True) + scm_url = models.CharField(max_length=2000, blank=True) + webscm_url = models.CharField(max_length=2000, blank=True) send_notifications = models.BooleanField() def __unicode__(self): diff --git a/lib/sql/migration/012-project-add-columns.sql b/lib/sql/migration/012-project-add-columns.sql new file mode 100644 index 0000000..d984ad2 --- /dev/null +++ b/lib/sql/migration/012-project-add-columns.sql @@ -0,0 +1,5 @@ +BEGIN; +ALTER TABLE "patchwork_project" ADD COLUMN "web_url" varchar(2000); +ALTER TABLE "patchwork_project" ADD COLUMN "scm_url" varchar(2000); +ALTER TABLE "patchwork_project" ADD COLUMN "webscm_url" varchar(2000); +COMMIT; diff --git a/templates/patchwork/project.html b/templates/patchwork/project.html index 2d63d1d..5b2cc13 100644 --- a/templates/patchwork/project.html +++ b/templates/patchwork/project.html @@ -28,6 +28,24 @@ <th>Patch count</th> <td>{{n_patches}} (+ {{n_archived_patches}} archived)</td> </tr> +{% if project.web_url %} + <tr> + <th>Website</th> + <td><a href="{{project.web_url}}">{{project.web_url}}</a></td> + </tr> +{% endif %} +{% if project.webscm_url %} + <tr> + <th>Source Code Web Interface</th> + <td><a href="{{project.webscm_url}}">{{project.webscm_url}}</a></td> + </tr> +{% endif %} +{% if project.scm_url %} + <tr> + <th>Source Code Manager URL</th> + <td><a href="{{project.scm_url}}">{{project.scm_url}}</a></td> + </tr> +{% endif %} </table> {% if settings.ENABLE_XMLRPC %} |