[extensions-web] auth: Add a "Waiting for author" section too
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] auth: Add a "Waiting for author" section too
- Date: Fri, 19 Oct 2012 18:03:07 +0000 (UTC)
commit 3a50b74c3d45af72544758cb269f49b3315245a7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Oct 19 13:56:45 2012 -0400
auth: Add a "Waiting for author" section too
.../auth/templates/registration/profile.html | 13 +++++++++++++
sweettooth/auth/views.py | 3 +++
sweettooth/extensions/models.py | 3 +++
3 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/sweettooth/auth/templates/registration/profile.html b/sweettooth/auth/templates/registration/profile.html
index 9c5d605..17c55e0 100644
--- a/sweettooth/auth/templates/registration/profile.html
+++ b/sweettooth/auth/templates/registration/profile.html
@@ -41,5 +41,18 @@
</li>
{% endwith %}
{% endfor %}
+
+ <h3> These reviews are waiting for you </h3>
+ {% for version in waiting %}
+ {% with version.extension as extension %}
+ <li class="extension profile">
+ <h4 class="extension-name"><a href="{% url review-version pk=version.pk %}">
+ <img src="{{ extension.icon.url }}" class="icon"> {{ extension.name }} <span class="version">(v{{ version.version }})</span>
+ </a></h4>
+
+ <p class="description">{{ extension.first_line_of_description }}</p>
+ </li>
+ {% endwith %}
+ {% endfor %}
</div>
{% endblock %}
diff --git a/sweettooth/auth/views.py b/sweettooth/auth/views.py
index ca4a37c..55700fe 100644
--- a/sweettooth/auth/views.py
+++ b/sweettooth/auth/views.py
@@ -21,8 +21,10 @@ def profile(request, user):
if is_editable:
unreviewed = ExtensionVersion.objects.unreviewed().filter(extension__creator=userobj)
+ waiting = ExtensionVersion.objects.waiting().filter(extension__creator=userobj)
else:
unreviewed = []
+ waiting = []
return render(request,
'registration/profile.html',
@@ -30,6 +32,7 @@ def profile(request, user):
display_name=display_name,
extensions=extensions,
unreviewed=unreviewed,
+ waiting=waiting,
is_editable=is_editable))
@ajax_view
diff --git a/sweettooth/extensions/models.py b/sweettooth/extensions/models.py
index 79aa355..cf7b424 100644
--- a/sweettooth/extensions/models.py
+++ b/sweettooth/extensions/models.py
@@ -258,6 +258,9 @@ class ExtensionVersionManager(models.Manager):
def unreviewed(self):
return self.filter(status=STATUS_UNREVIEWED)
+ def waiting(self):
+ return self.filter(status=STATUS_WAITING)
+
def visible(self):
return self.filter(status=STATUS_ACTIVE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]