Author: floguy
Date: Sat Sep 20 23:36:06 2008
New Revision: 914

Removed:
    trunk/pinax/templates/things/
Modified:
    trunk/local_apps/tribes/thing.py
    trunk/pinax/templates/tribes/tribes.html

Log:
Integrated django-things in a slightly better way.

Modified: trunk/local_apps/tribes/thing.py
==============================================================================
--- trunk/local_apps/tribes/thing.py    (original)
+++ trunk/local_apps/tribes/thing.py    Sat Sep 20 23:36:06 2008
@@ -9,4 +9,6 @@
      members = things.OrderField(verbose_name_asc='Largest',
          verbose_name_desc='Smallest', url_asc='largest',  
url_desc='smallest',
          field_url='size')
-    search = ('name', 'description')
\ No newline at end of file
+    search = ('name', 'description')
+    template_dir = 'tribes'
+    list_template_name = 'tribes.html'
\ No newline at end of file

Modified: trunk/pinax/templates/tribes/tribes.html
==============================================================================
--- trunk/pinax/templates/tribes/tribes.html    (original)
+++ trunk/pinax/templates/tribes/tribes.html    Sat Sep 20 23:36:06 2008
@@ -13,11 +13,11 @@
      <h1>{% trans "Tribes" %}</h1>

      <p>{% trans "A <b>tribe</b> is a group of people with some common  
interest." %}</p>
-
      {% if user.is_authenticated %}
          <p><a href="#" onclick="$('#tribe_form').toggle(); return  
false;">{% trans "Start your own tribe" %}</a></p>

-        <form id="tribe_form" method="POST" action="" style="display:  
none;">
+        <form id="tribe_form" method="POST" action="{% url tribes_list %}"  
style="display: none;">
+            {% get_tribe_form as tribe_form %}
              <table>
                  {{ tribe_form }}
                  <tr><td></td><td><input type="hidden" name="action"  
value="create" /><input type="submit" value="{%  
trans 'create' %}"/></td></tr>
@@ -28,50 +28,38 @@
          {% url acct_login as login_url %}
          <p>{% blocktrans %}<a href="{{ signup_url }}">Sign up</a> and <a  
href="{{ login_url }}">log in </a> to create your own tribe or join an  
existing one.{% endblocktrans %}</p>
      {% endif %}
-
-    {% if tribes %}
-
-        <p>Order by:
-            {% ifequal order_by "size" %}
-                <a href="?order_by=name">name</a>
-                or
-                <b>size</b>
-                or
-                <a href="?order_by=date">date created</a>
-
-                {% order tribes by members %}
-                {% autopaginate tribes 10 %}
-            {% else %}
-                {% ifequal order_by "date" %}
-                    <a href="?order_by=name">name</a>
-                    or
-                    <a href="?order_by=size">size</a>
-                    or
-                    <b>date created</b>
-
-                    {% order tribes by -created %}
-                    {% autopaginate tribes 10 %}
+    {% if search_enabled %}
+        <form method="GET" action="">
+            <input type="text" name="search" value="{{ terms }}" />
+            <input type="submit" value="Search" />
+        </form>
+    {% endif %}
+    <p>Order by:
+        {% for f in fields %}
+            {% ifequal f field %}
+                {% if descending %}
+                    <a href="{{ f.full_url_asc }}">{{ f.verbose_name_asc  
}}</a> or
+                    <b>{{ f.verbose_name_desc }}</b>
                  {% else %}
-                    <b>name</b>
-                    or
-                    <a href="?order_by=size">size</a>
-                    or
-                    <a href="?order_by=date">date created</a>
-
-                    {% order tribes by name %}
-                    {% autopaginate tribes 10 %}
-                {% endifequal %}
+                    <b>{{ f.verbose_name_asc }}</b> or
+                    <a href="{{ f.full_url_desc }}">{{ f.verbose_name_desc  
}}</a>
+                {% endif %}
+            {% else %}
+                <a href="{{ f.full_url_asc }}">{{ f.verbose_name_asc  
}}</a> or
+                <a href="{{ f.full_url_desc }}">{{ f.verbose_name_desc  
}}</a>
              {% endifequal %}
-        </p>
-
+            {% if not forloop.last %}, {% endif %}
+        {% endfor %}
+    </p>
+
+    {% autopaginate objects 10 %}
+    {% if objects %}
          <dl>
-        {% for tribe in tribes %}
+        {% for tribe in objects %}
              {% show_tribe tribe %}
          {% endfor %}
          </dl>
-
          {% paginate %}
-
      {% endif %}

  {% endblock %}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to