]> git.parisson.com Git - telemeta.git/commitdiff
do not pre-analyze media when adding or editing an item, add CREM's novel / published...
authoryomguy <yomguy@parisson.com>
Tue, 5 Apr 2011 09:30:57 +0000 (11:30 +0200)
committeryomguy <yomguy@parisson.com>
Tue, 5 Apr 2011 09:30:57 +0000 (11:30 +0200)
telemeta/locale/fr/LC_MESSAGES/django.mo
telemeta/locale/fr/LC_MESSAGES/django.po
telemeta/templates/telemeta_default/collection_list.html
telemeta/urls.py
telemeta/web/base.py

index 128887082d162df60826fe2e778ed2a992a64ddd..1a893c003c52d8e3da2e965cd53f2c450e3cf460 100644 (file)
Binary files a/telemeta/locale/fr/LC_MESSAGES/django.mo and b/telemeta/locale/fr/LC_MESSAGES/django.mo differ
index 6e5b553b3bd5d552411792bedeb39eff3afa9b72..6f6740c1c92bffab6a78aaeacfb312307536fd9c 100644 (file)
@@ -888,3 +888,15 @@ msgstr "Dernière connexion"
 #: templates/telemeta_default/login.html:21
 msgid "Password forgotten"
 msgstr "Mot de passe oublié"
+
+#: templates/telemeta_default/collection_list.html:9
+msgid "All"
+msgstr "Toutes"
+
+#: templates/telemeta_default/collection_list.html:10
+msgid "Novel"
+msgstr "Inédites"
+
+#: templates/telemeta_default/collection_list.html:1&
+msgid "Published"
+msgstr "Éditées"
index 8fd8ae220d000d5a2a97ef1bbf7c4ea5187d010d..3168c6d11ff1d0cce81d7f8dd8497d7e5ce6cdfd 100644 (file)
@@ -6,6 +6,9 @@
 
 {% block submenu %}
     <div class="buttons">  
+     <a href="{% url telemeta-collections %}" class="component_icon button icon_search">{% trans "All" %}</a>
+     <a href="{% url telemeta-collections-novel %}" class="component_icon button icon_search">{% trans "Novel" %}</a>
+     <a href="{% url telemeta-collections-published %}" class="component_icon button icon_search">{% trans "Published" %}</a>
     {% if user.is_authenticated and perms.telemeta.add_mediacollection %}
       <a href="{% url telemeta-collection-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
     {% endif %}
index 500aa2782d91e97f871f14a6d95d7656c5230916..93dc42be7f2fadef72bb575c296097567c2be0d7 100644 (file)
@@ -50,6 +50,10 @@ web_view = WebView()
 all_items = { 'queryset': MediaItem.objects.enriched(), }
 all_collections = { 'queryset': MediaCollection.objects.enriched(), }
 
+# CREM collections
+all_collections_novel = { 'queryset': MediaCollection.objects.filter(code__contains='_I_'), }
+all_collections_published = { 'queryset': MediaCollection.objects.filter(code__contains='_E_'), }
+
 # ID's regular expressions
 export_extensions = "|".join(web_view.list_export_extensions())
 
@@ -97,9 +101,11 @@ urlpatterns = patterns('',
         
     # collections
     url(r'^collections/$', 'django.views.generic.list_detail.object_list',
-        dict(all_collections, paginate_by=20, 
-            template_name="telemeta/collection_list.html"),
-        name="telemeta-collections"),
+        dict(all_collections, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections"),
+    url(r'^collections_novel/$', 'django.views.generic.list_detail.object_list',
+        dict(all_collections_novel, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-novel"),
+    url(r'^collections_published/$', 'django.views.generic.list_detail.object_list',
+        dict(all_collections_published, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-published"),
     url(r'^collections/?page=(?P<page>[0-9]+)$', 
         'django.views.generic.list_detail.object_list',
         dict(all_collections, paginate_by=20)),
index 86708d4f5758bb747c44606638f3b3c9eea613e9..e488e9f5af26d8fc25b69d0fe62f8dcd185d5238 100644 (file)
@@ -324,7 +324,7 @@ class WebView(object):
                 form.save()
                 if form.files:
                     self.cache_data.delete_item_data(code)
-                    self.item_analyze(item)
+#                    self.item_analyze(item)
                 item.set_revision(request.user)
                 return HttpResponseRedirect('/items/'+code)
         else:
@@ -405,18 +405,18 @@ class WebView(object):
                     subpipe = analyzer()
                     analyzers_sub.append(subpipe)
                     pipe = pipe | subpipe
-                if not self.cache_data.exists(image_file):
-                    path = self.cache_data.dir + os.sep + image_file
-                    for grapher in self.graphers:
-                        if grapher.id() == grapher_id:
-                            break
-                    graph = grapher(width = int(width), height = int(height))
-                    pipe = pipe | graph
+#                if not self.cache_data.exists(image_file):
+#                    path = self.cache_data.dir + os.sep + image_file
+#                    for grapher in self.graphers:
+#                        if grapher.id() == grapher_id:
+#                            break
+#                    graph = grapher(width = int(width), height = int(height))
+#                    pipe = pipe | graph
                 pipe.run()
-                if not self.cache_data.exists(image_file):
-                    f = open(path, 'w')
-                    graph.render(path)
-                    f.close()
+#                if not self.cache_data.exists(image_file):
+#                    f = open(path, 'w')
+#                    graph.render(path)
+#                    f.close()
                 mime_type = decoder.format()
                 analyzers.append({'name': 'Mime type', 'id': 'mime_type', 'unit': '', 'value': mime_type})
                 analyzers.append({'name': 'Channels', 'id': 'channels', 'unit': '', 'value': decoder.channels()})