diff options
| author | Andrew Donnellan <ajd@linux.ibm.com> | 2019-08-22 17:12:57 +1000 |
|---|---|---|
| committer | Daniel Axtens <dja@axtens.net> | 2019-08-22 21:14:08 +1000 |
| commit | 64f39cbc2d09889bd238a93d01ab95092e538300 (patch) | |
| tree | 2d65b7758e56516436e2b5b916a3fc50a583c72d | |
| parent | 0fab75276b1ba2e065e1a6e0c2ed6dc1e19444f3 (diff) | |
| download | patchwork-64f39cbc2d09889bd238a93d01ab95092e538300.tar patchwork-64f39cbc2d09889bd238a93d01ab95092e538300.tar.gz | |
models, templates: Add project list archive URL field
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>
| -rw-r--r-- | patchwork/fixtures/default_projects.xml | 1 | ||||
| -rw-r--r-- | patchwork/migrations/0034_project_list_archive_url.py | 20 | ||||
| -rw-r--r-- | patchwork/models.py | 1 | ||||
| -rw-r--r-- | patchwork/templates/patchwork/project.html | 6 |
4 files changed, 28 insertions, 0 deletions
diff --git a/patchwork/fixtures/default_projects.xml b/patchwork/fixtures/default_projects.xml index 30d3461..39d2698 100644 --- a/patchwork/fixtures/default_projects.xml +++ b/patchwork/fixtures/default_projects.xml @@ -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 index 0000000..70d1b2b --- /dev/null +++ b/patchwork/migrations/0034_project_list_archive_url.py @@ -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), + ), + ] diff --git a/patchwork/models.py b/patchwork/models.py index a7eee4d..e43b062 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -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 diff --git a/patchwork/templates/patchwork/project.html b/patchwork/templates/patchwork/project.html index 99e36ff..bd9d20e 100644 --- a/patchwork/templates/patchwork/project.html +++ b/patchwork/templates/patchwork/project.html @@ -15,6 +15,12 @@ <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> |