summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Salgado <guilherme.salgado@linaro.org>2011-07-11 17:32:01 -0300
committerGuilherme Salgado <guilherme.salgado@linaro.org>2011-07-11 17:32:01 -0300
commit3cbaa5fac9324b08a567894e6ecfd82d62da1e94 (patch)
tree76f3fe175f0eeea29f51bc58e9dd6ca8500fe226
parentc252a4da4d6bd904f57599081aa00a038337e691 (diff)
Show the latest 10 patches submitted on the front page
Also changes the list of 10 oldest patches to include the project
-rw-r--r--apps/patchmetrics/views.py2
-rw-r--r--apps/patchwork/utils.py3
-rw-r--r--htdocs/css/patchmetrics.css4
-rw-r--r--templates/patchmetrics/frontpage.html68
4 files changed, 57 insertions, 20 deletions
diff --git a/apps/patchmetrics/views.py b/apps/patchmetrics/views.py
index eeff1f7..14ccbeb 100644
--- a/apps/patchmetrics/views.py
+++ b/apps/patchmetrics/views.py
@@ -19,6 +19,7 @@ from patchmetrics.models import (
get_submitted_patch_counts_for_month,
get_oldest_patches_waiting_for_feedback,
get_overall_patch_count,
+ LinaroPatch,
PROJECTS_TO_IGNORE_IN_STATS,
Team)
from patchwork.views import generic_list
@@ -94,6 +95,7 @@ def frontpage(request):
projects = Project.objects.exclude(
linkname__in=PROJECTS_TO_IGNORE_IN_STATS)
context['old_patches'] = get_oldest_patches_waiting_for_feedback()
+ context['latest_patches'] = LinaroPatch.objects.order_by('-date')[:10]
context['projects'] = projects.extra(
select={'lower_name': 'lower(name)'}).order_by('lower_name')
context['teams'] = Team.objects.all().order_by('display_name')
diff --git a/apps/patchwork/utils.py b/apps/patchwork/utils.py
index 90ca1d2..f9694a8 100644
--- a/apps/patchwork/utils.py
+++ b/apps/patchwork/utils.py
@@ -163,7 +163,8 @@ def ensure_source_checkout_for_project(project):
stdout=subprocess.PIPE)
else:
proc = subprocess.Popen(
- ['git', 'pull', 'origin'], cwd=root, stdout=subprocess.PIPE)
+ ['git', 'pull', 'origin', 'HEAD'], cwd=root,
+ stdout=subprocess.PIPE)
proc.communicate()
if proc.returncode != 0:
raise FailedToFetchGitRepo(
diff --git a/htdocs/css/patchmetrics.css b/htdocs/css/patchmetrics.css
index 70a2fd1..15ff713 100644
--- a/htdocs/css/patchmetrics.css
+++ b/htdocs/css/patchmetrics.css
@@ -29,6 +29,10 @@ body {
margin-bottom: 0;
}
+h2 {
+ margin: 2em 0 1em 0;
+}
+
#auth {
border-left: thin solid white;
padding-top: 0em;
diff --git a/templates/patchmetrics/frontpage.html b/templates/patchmetrics/frontpage.html
index bc49054..6375229 100644
--- a/templates/patchmetrics/frontpage.html
+++ b/templates/patchmetrics/frontpage.html
@@ -83,26 +83,56 @@ common questions.</p>
</div>
</div>
+<h2>Latest patches submitted</h2>
+<table class="patchlist">
+ <thead>
+ <tr>
+ <th>Patch</th>
+ <th>Project</th>
+ <th>Date</th>
+ <th>Author</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ {% for patch in latest_patches %}
+ <tr class="{% cycle 'odd' 'even' %}">
+ <td><a href="{% url patchmetrics.views.patch patch_id=patch.id %}"
+ >{{ patch.name|default:"[no subject]" }}</a></td>
+ <td><a href="{% url patchmetrics.views.project
+ project_id=patch.project.linkname %}"
+ >{{ patch.project.name }}</a></td>
+ <td>{{ patch.date|date:"Y-m-d" }}</td>
+ <td>{{ patch.author|personify }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+
<h2>Oldest patches not accepted yet</h2>
-<table class="patchlist" id="patchlist">
- <thead>
- <tr>
- <th>Patch</th>
- <th>Date</th>
- <th>Author</th>
- </tr>
- </thead>
-
- <tbody>
- {% for patch in old_patches %}
- <tr class="{% cycle 'odd' 'even' %}">
- <td><a href="{% url patchmetrics.views.patch patch_id=patch.id %}"
- >{{ patch.name|default:"[no subject]" }}</a></td>
- <td>{{ patch.date|date:"Y-m-d" }}</td>
- <td>{{ patch.author|personify }}</td>
- </tr>
- {% endfor %}
- </tbody>
+<table class="patchlist">
+ <thead>
+ <tr>
+ <th>Patch</th>
+ <th>Project</th>
+ <th>Date</th>
+ <th>Author</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ {% for patch in old_patches %}
+ <tr class="{% cycle 'odd' 'even' %}">
+ <td><a href="{% url patchmetrics.views.patch patch_id=patch.id %}"
+ >{{ patch.name|default:"[no subject]" }}</a></td>
+ <td><a href="{% url patchmetrics.views.project
+ project_id=patch.project.linkname %}"
+ >{{ patch.project.name }}</a></td>
+ <td>{{ patch.date|date:"Y-m-d" }}</td>
+ <td>{{ patch.author|personify }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
</table>
{% endblock %}