]> git.parisson.com Git - telemeta.git/commitdiff
* add /archives
authoryomguy <yomguy@parisson.com>
Fri, 10 Feb 2012 09:59:13 +0000 (10:59 +0100)
committeryomguy <yomguy@parisson.com>
Fri, 10 Feb 2012 09:59:13 +0000 (10:59 +0100)
* fix filters

telemeta/templates/telemeta/search_results.html
telemeta/urls.py
telemeta/views/base.py

index fc11eba38af7eacefc3880c58b7e61e2400f2fc5..b08d5c83eb8d47ce212b84db2afa19eb465e5d9e 100644 (file)
@@ -12,7 +12,8 @@
     {% ifequal type 'items' %}
      <a href="{% url telemeta-search-items %}?{{criteria|with_no_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "All" %}</a>
      <a href="{% url telemeta-search-items %}?{{criteria|with_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
-    {% else %}
+    {% endifequal %}
+    {% ifequal type 'collections' %}
      <a href="{% url telemeta-search-collections %}?{{criteria|with_no_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "All" %}</a>
      <a href="{% url telemeta-search-collections %}?{{criteria|with_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
     {% endifequal %}
index 2d3666c4dbc65cbb2d12ad250bf79e868f7c5ca0..1ffa760acbe7e898d8629783aeff3b07f9b2a2c4 100644 (file)
@@ -189,6 +189,7 @@ urlpatterns = patterns('',
     url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/dc/xml/$', resource_view.detail,
         {'format': 'dublin_core_xml'},
         name="telemeta-resource-dublincore-xml"),
+    url(r'^archives/$', general_view.search, name="telemeta-archives"),
 
     # search
     url(r'^search/$', general_view.search, name="telemeta-search"),
index be8d296da65043bcc6f75a416d70a9c58de10c56..9d2ef3613ce3a4e16b9a6147e561ed546d60f5bd 100644 (file)
@@ -382,10 +382,10 @@ class GeneralView(object):
                 criteria[key] = value
 
         if type is None:
-            if collections.count():
-                type = 'collections'
-            else:
+            if items.count():
                 type = 'items'
+            else:
+                type = 'collections'
 
         if type == 'items':
             objects = items