]> git.parisson.com Git - telemeta.git/commitdiff
fix copy
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 28 Nov 2014 01:12:09 +0000 (02:12 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 28 Nov 2014 01:12:09 +0000 (02:12 +0100)
12 files changed:
telemeta/locale/de/LC_MESSAGES/django.mo
telemeta/locale/de/LC_MESSAGES/django.po
telemeta/locale/es/LC_MESSAGES/django.mo
telemeta/locale/es/LC_MESSAGES/django.po
telemeta/locale/fr/LC_MESSAGES/django.mo
telemeta/locale/fr/LC_MESSAGES/django.po
telemeta/locale/zh_CN/LC_MESSAGES/django.mo
telemeta/locale/zh_CN/LC_MESSAGES/django.po
telemeta/templates/telemeta/collection_edit.html
telemeta/templates/telemeta/collection_list.html
telemeta/urls.py
telemeta/views/item.py

index e06115a77b3fdffc81f444ec85f9e5a3141604ab..d79de83d95ed5a255a11fdc1e6726993b1d90a44 100644 (file)
Binary files a/telemeta/locale/de/LC_MESSAGES/django.mo and b/telemeta/locale/de/LC_MESSAGES/django.mo differ
index 0c7482329739b98856c1c5903dfb321d2b75e547..0a7b45478773eeef92f23f2ede12c7e64237bcca 100644 (file)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-11-28 00:20+0100\n"
+"POT-Creation-Date: 2014-11-28 01:51+0100\n"
 "PO-Revision-Date: 2012-12-22 21:24+0100\n"
 "Last-Translator: Patrik Tschudin <patsch@gmail.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1477,9 +1477,8 @@ msgid "Filters"
 msgstr ""
 
 #: templates/telemeta/collection_list.html:28
-#: templates/telemeta/mediaitem_list.html:27
-#: templates/telemeta/search_results.html:22
-#: templates/telemeta/search_results.html:26
+#, fuzzy
+msgctxt "collection list"
 msgid "All"
 msgstr "Alles"
 
@@ -1795,6 +1794,12 @@ msgstr "Schlüsselwort"
 msgid "Media Items"
 msgstr "Medienelemente"
 
+#: templates/telemeta/mediaitem_list.html:27
+#: templates/telemeta/search_results.html:22
+#: templates/telemeta/search_results.html:26
+msgid "All"
+msgstr "Alles"
+
 #: templates/telemeta/mediaitem_list.html:28
 msgid "Unpublished"
 msgstr "unveröffentlicht"
index b9c6d611e3bbc69a1d0d4e9ecda164a710e5ea7a..c89a27ad9f508b0eb899f2aadc180d5aae459a35 100644 (file)
Binary files a/telemeta/locale/es/LC_MESSAGES/django.mo and b/telemeta/locale/es/LC_MESSAGES/django.mo differ
index 573ac3e9f81acb651a8bfa41f9cdd78f8809c7b9..996032259413c254d5d78158a8d414a2a69eb85a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-11-28 00:20+0100\n"
+"POT-Creation-Date: 2014-11-28 01:51+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1435,9 +1435,7 @@ msgid "Filters"
 msgstr ""
 
 #: templates/telemeta/collection_list.html:28
-#: templates/telemeta/mediaitem_list.html:27
-#: templates/telemeta/search_results.html:22
-#: templates/telemeta/search_results.html:26
+msgctxt "collection list"
 msgid "All"
 msgstr ""
 
@@ -1741,6 +1739,12 @@ msgstr ""
 msgid "Media Items"
 msgstr ""
 
+#: templates/telemeta/mediaitem_list.html:27
+#: templates/telemeta/search_results.html:22
+#: templates/telemeta/search_results.html:26
+msgid "All"
+msgstr ""
+
 #: templates/telemeta/mediaitem_list.html:28
 msgid "Unpublished"
 msgstr ""
index 638a054ed0a7a674b34a3b789fbdfd031b3889e3..34ab773d5507a4f768189f49b83ef90ea17b3aaa 100644 (file)
Binary files a/telemeta/locale/fr/LC_MESSAGES/django.mo and b/telemeta/locale/fr/LC_MESSAGES/django.mo differ
index 40e2a2ddb425731fbd5c70b4db34b6850baa6788..3dd846fa4231999184b31530f6c27744a8ecb09a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-11-28 00:20+0100\n"
+"POT-Creation-Date: 2014-11-28 01:51+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: Guillaume Pellerin <yomguy@parisson.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -759,7 +759,7 @@ msgstr "média associés"
 
 #: models/media.py:872
 msgid "date added"
-msgstr ""
+msgstr "date d'ajout"
 
 #: models/media.py:873
 msgid "date of first attribution"
@@ -1439,11 +1439,9 @@ msgid "Filters"
 msgstr "Filtres"
 
 #: templates/telemeta/collection_list.html:28
-#: templates/telemeta/mediaitem_list.html:27
-#: templates/telemeta/search_results.html:22
-#: templates/telemeta/search_results.html:26
+msgctxt "collection list"
 msgid "All"
-msgstr "Tous"
+msgstr "Toutes"
 
 #: templates/telemeta/collection_list.html:29
 msgctxt "collection list"
@@ -1748,6 +1746,12 @@ msgstr "Mot-clé"
 msgid "Media Items"
 msgstr "Items"
 
+#: templates/telemeta/mediaitem_list.html:27
+#: templates/telemeta/search_results.html:22
+#: templates/telemeta/search_results.html:26
+msgid "All"
+msgstr "Tous"
+
 #: templates/telemeta/mediaitem_list.html:28
 msgid "Unpublished"
 msgstr "Inédits"
index 8cd941e72ed4fb3751c98499423173115046e612..75679e8ecc88e4173642863b3aa6261c1aa37f8d 100644 (file)
Binary files a/telemeta/locale/zh_CN/LC_MESSAGES/django.mo and b/telemeta/locale/zh_CN/LC_MESSAGES/django.mo differ
index e5a35327c7f1d245f5221f53714cce651c8d8c7f..187f0c52df91d9a033fbd935aa9bbccdb0dca034 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Telemeta 1.4\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-11-28 00:20+0100\n"
+"POT-Creation-Date: 2014-11-28 01:51+0100\n"
 "PO-Revision-Date: 2014-09-02 16:18+2\n"
 "Last-Translator: Zaichao XIA <xiazaichao@gmail.com>\n"
 "Language-Team: zh_CN <LL@li.org>\n"
@@ -1467,9 +1467,8 @@ msgid "Filters"
 msgstr ""
 
 #: templates/telemeta/collection_list.html:28
-#: templates/telemeta/mediaitem_list.html:27
-#: templates/telemeta/search_results.html:22
-#: templates/telemeta/search_results.html:26
+#, fuzzy
+msgctxt "collection list"
 msgid "All"
 msgstr "所有"
 
@@ -1777,6 +1776,12 @@ msgstr "关键字"
 msgid "Media Items"
 msgstr "媒体项"
 
+#: templates/telemeta/mediaitem_list.html:27
+#: templates/telemeta/search_results.html:22
+#: templates/telemeta/search_results.html:26
+msgid "All"
+msgstr "所有"
+
 #: templates/telemeta/mediaitem_list.html:28
 msgid "Unpublished"
 msgstr "未出版的"
index 1ae9b68b92714b73f5d0b5d924b0f67c717d5174..bdad1d1a3e9ef7405ead1789cb2ce99017e4b7d5 100644 (file)
@@ -4,14 +4,14 @@
 {% load bootstrap3 %}
 
 {% block title %}
-    <img src="{{ STATIC_URL }}telemeta/images/collections_red.png" style="vertical-align:middle" /> Collection : {{ object.title }}
+    <img src="{{ STATIC_URL }}telemeta/images/collections_red.png" style="vertical-align:middle" /> Collection : {{ collection.title }}
 {% endblock %}
 
 {% block title_buttons %}
 <div class="fixedWidthAsPlayer">
     <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{{ STATIC_URL }}telemeta/images/wait.gif" />
     {% block cancel %}
-    <a id="cancel" href="{% url "telemeta-collection-detail" object.public_id %}">
+    <a id="cancel" href="{% url "telemeta-collection-detail" collection.public_id %}">
       <button type="button" class="btn btn-default">
         <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
       </button>
@@ -65,7 +65,7 @@
 
     <div align="center" style="margin-top:3ex;">
     {% block cancel2 %}
-    <a id="cancel" href="{% url "telemeta-collection-detail" object.public_id %}">
+    <a id="cancel" href="{% url "telemeta-collection-detail" collection.public_id %}">
       <button type="button" class="btn btn-default">
         <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
       </button>
index 21b415a921d75d0d4e72b6fd30675ed7d935dfaa..d05d9c4eaea66052d1b7ae30c6d05b8ac04e42d3 100644 (file)
@@ -25,7 +25,7 @@
     <span class="glyphicon glyphicon-filter"></span> {% trans "Filters" %} <span class="caret"></span>
   </button>
   <ul class="dropdown-menu" role="menu">
-    <li><a href="{% url "telemeta-collections" %}" class="">{% trans "All" %}</a></li>
+    <li><a href="{% url "telemeta-collections" %}" class="">{% trans "All" context "collection list" %}</a></li>
     <li><a href="{% url "telemeta-collections-unpublished" %}">{% trans "Unpublished" context "collection list" %}</a></li>
     <li><a href="{% url "telemeta-collections-published" %}">{% trans "Published" context "collection list" %}</a></li>
     <li><a href="{% url "telemeta-collections-sound" %}">{% trans "Digitized" context "collection list" %}</a></li>
index 79eaac3becf9bb026dabd245d3ab97559217d75d..7f356af8f23c230034d03a63a206ef345da0f05e 100644 (file)
@@ -82,7 +82,7 @@ urlpatterns = patterns('',
     url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/analyze/xml/$', item_view.item_analyze_xml, name="telemeta-item-analyze-xml"),
     url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/item_xspf.xml$', item_view.item_playlist, dict(template="telemeta/mediaitem_xspf.xml", mimetype="application/xspf+xml"), name="telemeta-item-xspf"),
     url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/edit/$', ItemEditView.as_view(), name="telemeta-item-edit"),
-    url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/copy/$', ItemEditView.as_view(), name="telemeta-item-copy"),
+    url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/copy/$', ItemCopyView.as_view(), name="telemeta-item-copy"),
     url(r'^archives/items_add/$', ItemAddView.as_view(), name="telemeta-item-add"),
     url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/player/(?P<width>[0-9]+)x(?P<height>[0-9]+)/$', item_view.item_detail, dict(template='telemeta/mediaitem_player.html'), name="telemeta-item-player"),
     url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/player/(?P<width>[0-9]+)x(?P<height>[0-9]+)/simple/$', item_view.item_detail, dict(template='telemeta/mediaitem_player_simple.html'), name="telemeta-item-player-simple"),
index 21608176b578bc725951e99c632e913586f3f20b..29ef4eb23efeae6b9c10ae040a31e39989eeb3c0 100644 (file)
@@ -778,47 +778,22 @@ class ItemCopyView(ItemAddView):
     def get_initial(self):
         return model_to_dict(self.get_object())
 
-    def form_valid(self, form):
-        item = MediaItem()
-        if self.request.FILES:
-            item_form = MediaItemForm(data=self.request.POST, files=self.request.FILES, instance=item, prefix='item')
-        else:
-            item_form = MediaItemForm(data=self.request.POST, instance=item, prefix='item')
-
-        if item_form.is_valid():
-            item_form.save()
-            if not self.request.FILES:
-                item.file = source_item.file
-                item.save()
-
-            code = item_form.cleaned_data['code']
-            if not code:
-                code = str(item.id)
-            if format_form.is_valid():
-                format.item = item
-                format_form.save()
-
-            performances = MediaItemPerformance.objects.filter(media_item=source_item)
-            for performance in performances:
-                performance.pk = None
-                performance.id = None
-                performance.media_item = item
-                performance.save()
-
-            keywords = MediaItemKeyword.objects.filter(item=source_item)
-            for keyword in keywords:
-                keyword.pk = None
-                keyword.id = None
-                keyword.item = item
-                keyword.save()
-
-            item.set_revision(self.request.user)
-
-        self.code = form.cleaned_data['code']
-        return super(ItemCopyView, self).form_valid(form)
-
     def get_success_url(self):
-        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.code})
+        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.object.code})
+
+    def get_context_data(self, **kwargs):
+        context = super(ItemCopyView, self).get_context_data(**kwargs)
+        item = self.get_object()
+        context['item'] = item
+        context['access'] = get_item_access(item, self.request.user)
+        context['previous'], context['next'] = self.item_previous_next(item)
+        #FIXME
+        context['mime_type'] = 'audio/mp3'
+        context['export_formats'] = self.get_export_formats()
+        context['visualizers'] = self.get_graphers()
+        context['audio_export_enabled'] = self.export_enabled
+        context['auto_zoom'] = True
+        return context
 
 
 class ItemDetailView(ItemViewMixin, DetailView):