]> git.openstreetmap.org Git - osqa.git/commitdiff
removing score sort option from the bulk management tool in the administration, it...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 10 Jun 2011 15:04:48 +0000 (15:04 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 10 Jun 2011 15:04:48 +0000 (15:04 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1061 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/page.py
forum/skins/default/templates/osqaadmin/nodeman.html

index 665a1be837ac395d2c1323f1487d0986b14e2b45..dcb9dfd417143c2722469b5d52587f41e5a7e433 100644 (file)
@@ -1,6 +1,25 @@
 from base import *
 from django.utils.translation import ugettext as _
 
+def silent_permalink(func):
+    """
+    Decorator that calls urlresolvers.reverse() to return a URL using
+    parameters returned by the decorated function "func".
+
+    "func" should be a function that returns a tuple in one of the
+    following formats:
+        (viewname, viewargs)
+        (viewname, viewargs, viewkwargs)
+    """
+    from django.core.urlresolvers import reverse
+    def inner(*args, **kwargs):
+        bits = func(*args, **kwargs)
+        try:
+            return reverse(bits[0], None, *bits[1:3])
+        except:
+            return "javascript:alert('Configure this page URL in the urls.py file');"
+    return inner
+
 class Page(Node):
     friendly_name = _("page")
 
@@ -34,7 +53,7 @@ class Page(Node):
         else:
             return _("[Unpublished] %s") % self.title
 
-    @models.permalink
+    @silent_permalink
     def get_absolute_url(self):
         return ('static_page', (), {'path': self.extra['path']})
         
index ea97d1207d1b9f459ddf883a1bb2edbe79dc7e05..ca86af5b5604ea9b8368606f5b9c0e0ae9cdf0b3 100644 (file)
 
                             added_at_link = current_sort == "added_at" and nodes.paginator.added_at_asc_sort_link or nodes.paginator.added_at_sort_link
                             author_link = current_sort == "author_asc" and nodes.paginator.author_sort_link or nodes.paginator.author_asc_sort_link
-                            score_link = current_sort == "score" and nodes.paginator.score_asc_sort_link or nodes.paginator.score_sort_link
                             act_at_link = current_sort == "act_at" and nodes.paginator.act_at_asc_sort_link or nodes.paginator.act_at_sort_link
                             act_by_link = current_sort == "act_by_asc" and nodes.paginator.act_by_sort_link or nodes.paginator.act_by_asc_sort_link
                         {% enddeclare %}
                         <th class="sorted {{ added_at }}">
                             <a href="{{ added_at_link }}">{% trans "Added at" %}</a>
                         </th>
-                        <!--<th class="sorted {{ score }}">
+                        {% comment %}
+                        <th class="sorted {{ score }}">
                             <a href="{{ score_link }}">{% trans "Score" %}</a>
-                        </th>-->
+                        </th>
+                        {% endcomment %}
                         <th class="sorted {{ act_by }}">
                             <a href="{{ act_by_link }}">{% trans "Last activity by" %}</a>
                         </th>