]> git.ozlabs.org Git - patchwork/commitdiff
Add URL and SCM data to projects
authorSimo Sorce <idra@samba.org>
Fri, 26 Oct 2012 12:51:42 +0000 (12:51 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 15 Nov 2012 06:35:59 +0000 (14:35 +0800)
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>
apps/patchwork/models.py
lib/sql/migration/012-project-add-columns.sql [new file with mode: 0644]
templates/patchwork/project.html

index bbfe827aec551d41bdc75a8f0dde6315b74a09d5..86a5266cff2d2177f682c57e6fcea8897b616b66 100644 (file)
@@ -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 (file)
index 0000000..d984ad2
--- /dev/null
@@ -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;
index 2d63d1d86c8cdb42f49010c0230db9dce0ca7e9b..5b2cc13b9d24f911b81742972a1ae08181134415 100644 (file)
   <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 %}