From: yomguy Date: Tue, 5 Apr 2011 09:30:57 +0000 (+0200) Subject: do not pre-analyze media when adding or editing an item, add CREM's novel / published... X-Git-Tag: 1.1~299 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=fe4d1285df8e7bf40ce2636b2cbdfd533093ef5e;p=telemeta.git do not pre-analyze media when adding or editing an item, add CREM's novel / published collection filter --- diff --git a/telemeta/locale/fr/LC_MESSAGES/django.mo b/telemeta/locale/fr/LC_MESSAGES/django.mo index 12888708..1a893c00 100644 Binary files a/telemeta/locale/fr/LC_MESSAGES/django.mo and b/telemeta/locale/fr/LC_MESSAGES/django.mo differ diff --git a/telemeta/locale/fr/LC_MESSAGES/django.po b/telemeta/locale/fr/LC_MESSAGES/django.po index 6e5b553b..6f6740c1 100644 --- a/telemeta/locale/fr/LC_MESSAGES/django.po +++ b/telemeta/locale/fr/LC_MESSAGES/django.po @@ -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" diff --git a/telemeta/templates/telemeta_default/collection_list.html b/telemeta/templates/telemeta_default/collection_list.html index 8fd8ae22..3168c6d1 100644 --- a/telemeta/templates/telemeta_default/collection_list.html +++ b/telemeta/templates/telemeta_default/collection_list.html @@ -6,6 +6,9 @@ {% block submenu %}
+ {% trans "All" %} + {% trans "Novel" %} + {% trans "Published" %} {% if user.is_authenticated and perms.telemeta.add_mediacollection %} {% trans "Add" %} {% endif %} diff --git a/telemeta/urls.py b/telemeta/urls.py index 500aa278..93dc42be 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -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[0-9]+)$', 'django.views.generic.list_detail.object_list', dict(all_collections, paginate_by=20)), diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 86708d4f..e488e9f5 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -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()})