summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Copeland <ben.copeland@linaro.org>2018-11-26 22:09:45 +0000
committerBenjamin Copeland <ben.copeland@linaro.org>2018-11-27 10:07:13 +0000
commit3b4f36be69933e3fadee3b99dbb99bbee8e6467d (patch)
tree632bc9991e4fe20738f3b32bcc3600a3f2b1cd71
parent7702d6e540d4d6a8ec97db684e792947e61de0df (diff)
downloadpatchwork-tools-3b4f36be69933e3fadee3b99dbb99bbee8e6467d.tar.gz
Projects: Add a project view
We lacked a project view ( https://patches.linaro.org/projects/ ) to just list all projects. We have one for teams https://patches.linaro.org/team/ so lets add one for projects too. Change-Id: Ibb84bf9e58d10c4fec001ca0a08e03e44e01e133
-rw-r--r--linaro_metrics/templates/linaro_metrics/projects.html16
-rw-r--r--linaro_metrics/urls.py1
-rw-r--r--linaro_metrics/views.py5
3 files changed, 22 insertions, 0 deletions
diff --git a/linaro_metrics/templates/linaro_metrics/projects.html b/linaro_metrics/templates/linaro_metrics/projects.html
new file mode 100644
index 0000000..85d7a9b
--- /dev/null
+++ b/linaro_metrics/templates/linaro_metrics/projects.html
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+
+{% block title %}Projects{% endblock %}
+{% block heading %}Projects{% endblock %}
+
+{% block body %}
+
+<ul>
+ {% for p in projects %}
+ <li>
+ <a href="{% url 'patchwork.views.patch.patch_list' project_id=p.linkname %}">{{p.name}}</a>
+ </li>
+ {% endfor %}
+</ul>
+
+{% endblock %}
diff --git a/linaro_metrics/urls.py b/linaro_metrics/urls.py
index 0b3fe4d..9444607 100644
--- a/linaro_metrics/urls.py
+++ b/linaro_metrics/urls.py
@@ -21,6 +21,7 @@ urlpatterns = patterns(
# Now provide our own urls.
(r'^faq$', 'linaro_metrics.views.faq_view'),
(r'^team/$', 'linaro_metrics.views.team_overview'),
+ (r'^projects/$', 'linaro_metrics.views.project_overview'),
(r'^team/(?P<team>[^/]+)/$', 'linaro_metrics.views.team_view'),
(r'^patches/(?P<user>[^/]+)/$', 'linaro_metrics.views.user_view'),
(r'^reports/project_activity$',
diff --git a/linaro_metrics/views.py b/linaro_metrics/views.py
index 1b86d17..8a0b1b2 100644
--- a/linaro_metrics/views.py
+++ b/linaro_metrics/views.py
@@ -72,6 +72,11 @@ def team_overview(request):
return render(request, 'linaro_metrics/teams.html', context)
+def project_overview(request):
+ context = {'projects': Project.objects.all()}
+ return render(request, 'linaro_metrics/projects.html', context)
+
+
# The patchwork version of the "personify" filter requires a project. We don't
# have a project for "team". Although personify is a simple function, we can't
# directly monkey-patch it due to the way django templates load filters. This