]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
models, templates: Add project list archive URL field
authorAndrew Donnellan <ajd@linux.ibm.com>
Thu, 22 Aug 2019 07:12:57 +0000 (17:12 +1000)
committerDaniel Axtens <dja@axtens.net>
Thu, 22 Aug 2019 11:14:08 +0000 (21:14 +1000)
Add a field to link to a project's mailing list archive, and display it on
the project info page.

Add the new field to the patchwork project in the supplied example fixture.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
patchwork/fixtures/default_projects.xml
patchwork/migrations/0034_project_list_archive_url.py [new file with mode: 0644]
patchwork/models.py
patchwork/templates/patchwork/project.html

index 30d346127234dbd7589d7a157ec1093d9959a1eb..39d269836394b5052e4c676cfde4546664c293de 100644 (file)
@@ -5,5 +5,6 @@
     <field type="CharField" name="name">Patchwork</field>
     <field type="CharField" name="listid">patchwork.ozlabs.org</field>
     <field type="CharField" name="listemail">patchwork@lists.ozlabs.org</field>
+    <field type="CharField" name="list_archive_url">https://lists.ozlabs.org/pipermail/patchwork/</field>
   </object>
 </django-objects>
diff --git a/patchwork/migrations/0034_project_list_archive_url.py b/patchwork/migrations/0034_project_list_archive_url.py
new file mode 100644 (file)
index 0000000..70d1b2b
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.21 on 2019-07-01 12:30
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('patchwork', '0033_remove_patch_series_model'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='project',
+            name='list_archive_url',
+            field=models.CharField(blank=True, max_length=2000),
+        ),
+    ]
index a7eee4dbad9a53afd9ce8882ff985260d2fc9fe5..e43b062b6f89a5f0281e0b007d30dc4985f4d460 100644 (file)
@@ -77,6 +77,7 @@ class Project(models.Model):
     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)
+    list_archive_url = models.CharField(max_length=2000, blank=True)
 
     # configuration options
 
index 99e36ff79d6a0b150aa0257a6feb959039607d82..bd9d20e263d8efe628fa626e5089bdc428f57fa6 100644 (file)
   <th>List address</th>
   <td>{{project.listemail}}</td>
  </tr>
+{% if project.list_archive_url %}
+ <tr>
+  <th>List archive</th>
+  <td><a href="{{ project.list_archive_url }}">{{ project.list_archive_url }}</a></td>
+ </tr>
+{% endif %}
  <tr>
   <th>Maintainer{{maintainers|length|pluralize}}</th>
   <td>