From 9b202e11bab72ef9568d0526839d33561f887951 Mon Sep 17 00:00:00 2001 From: yomguy Date: Wed, 22 Jun 2011 18:35:32 +0200 Subject: [PATCH] add collection delete url and view --- telemeta/locale/de/LC_MESSAGES/djangojs.mo | Bin 420 -> 420 bytes telemeta/locale/de/LC_MESSAGES/djangojs.po | 8 ++++++-- telemeta/locale/fr/LC_MESSAGES/djangojs.mo | Bin 1293 -> 1373 bytes telemeta/locale/fr/LC_MESSAGES/djangojs.po | 6 +++++- telemeta/urls.py | 7 ++++--- telemeta/web/base.py | 7 +++++++ 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/telemeta/locale/de/LC_MESSAGES/djangojs.mo b/telemeta/locale/de/LC_MESSAGES/djangojs.mo index 4978c3ebc5767551381f89ddbc776f41c66bde23..b4e199f3b3aa4e8796c3c778e28dfcbaa8b05983 100644 GIT binary patch delta 15 WcmZ3&yo7neWEKl6W0Q^3c^LsHj|8Ov delta 15 WcmZ3&yo7neWEOKPQ?rfJc^LsHodl== diff --git a/telemeta/locale/de/LC_MESSAGES/djangojs.po b/telemeta/locale/de/LC_MESSAGES/djangojs.po index 99916422..2ee53a10 100644 --- a/telemeta/locale/de/LC_MESSAGES/djangojs.po +++ b/telemeta/locale/de/LC_MESSAGES/djangojs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-22 17:56+0200\n" +"POT-Creation-Date: 2011-06-22 18:34+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,5 +55,9 @@ msgid "author" msgstr "" #: htdocs/js/locale.js:11 -msgid "Paste HTML to embed in website" +msgid "Paste HTML to embed player in website" +msgstr "" + +#: htdocs/js/locale.js:12 +msgid "delete the item permanently?" msgstr "" diff --git a/telemeta/locale/fr/LC_MESSAGES/djangojs.mo b/telemeta/locale/fr/LC_MESSAGES/djangojs.mo index 9adde56940a150602890265c5a7b5990c8d9bbc3..89815fbdad254e75a894f0ccb577df14bf93b0c0 100644 GIT binary patch delta 356 zcmXxe!Ab&A6oBD#ZPFTbVNh)%CpAP@Q7x<%K0=^SYoSR7oIzp;1!3?3S`Cp8(8jep zw?b`t02k)22XODg|IXNfGvA!cIrrQ*^VbZP2gbV)8S;c2kU4Te>adi^1)kwKHZX}j ztYCn8Zj7h+g=zf5BCb%+9VTM$aF@D;zLG%N{M>M`*b%AWkr6Mr$13#$7I27V{6xLr z2laya_I!<()Fp1$3m*BfJ9;cvN0Hj9(RXAdA2;t)FfS(gAG}NU!mRqpIlk>$UHipt qdA8?w`t@+6)<*62>UuIte5>Pf)bKPLKRce|JFm7&n^g~+#&iRTN-a15 delta 298 zcmXxezYf7*6o=tcN~r`jV;~|miTK;mHMj_yrK6;)#ngzn2hqXe0*J*Tu`;u{1n+6; zB&Scm^PT?Er@gj=SH;{2RiLZ1PdoID)+!q!U39R8Q_SKVU0h%tcc>XBY~mSp|D9M& ziDWqU(P!r2L?n5;z4e_OH^E%_b)qn j(cK))XOfpvG6jA}tgvQm!@Kb{N8Vs~yriy17@3D3*S{MT diff --git a/telemeta/locale/fr/LC_MESSAGES/djangojs.po b/telemeta/locale/fr/LC_MESSAGES/djangojs.po index c30a4e20..3af8ec2f 100644 --- a/telemeta/locale/fr/LC_MESSAGES/djangojs.po +++ b/telemeta/locale/fr/LC_MESSAGES/djangojs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-06-22 17:56+0200\n" +"POT-Creation-Date: 2011-06-22 18:34+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -57,3 +57,7 @@ msgstr "auteur" #: htdocs/js/locale.js:11 msgid "Paste HTML to embed player in website" msgstr "Coller le code HTML pour inclure le lecteur dans un site" + +#: htdocs/js/locale.js:12 +msgid "delete the item permanently?" +msgstr "supprimer l'item définitivement ?" diff --git a/telemeta/urls.py b/telemeta/urls.py index fbf1a78a..e68a2581 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -141,11 +141,12 @@ urlpatterns = patterns('', dict(template='telemeta/collection_edit.html'), name="telemeta-collection-edit"), url(r'^collections/(?P[A-Za-z0-9._-]+)/copy/$', collection_view.collection_copy, dict(template='telemeta/collection_edit.html'), name="telemeta-collection-copy"), - url(r'^collection/add/$', collection_view.collection_add, + url(r'^collections/add/$', collection_view.collection_add, dict(template='telemeta/collection_add.html'), name="telemeta-collection-add"), - url(r'^collection/(?P[A-Za-z0-9._-]+)/add_item/$', item_view.item_add, + url(r'^collections/(?P[A-Za-z0-9._-]+)/add_item/$', item_view.item_add, dict(template='telemeta/mediaitem_add.html'), name="telemeta-collection-additem"), - + url(r'^collections/(?P[A-Za-z0-9._-]+)/delete/$', collection_view.item_delete, name="telemeta-collection-delete"), + # search url(r'^search/$', general_view.search, name="telemeta-search"), url(r'^search/collections/$', general_view.search, {'type': 'collections'}, diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 69162689..8dcdb77e 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -397,6 +397,13 @@ class CollectionView(object): context = RequestContext(request, {'collection': collection, 'host': request.META['HTTP_HOST']}) return HttpResponse(template.render(context), mimetype=mimetype) + @method_decorator(permission_required('telemeta.delete_mediacollection')) + def collection_delete(self, request, public_id): + """Delete a given collection""" + collection = MediaCollection.objects.get(public_id=public_id) + collection.delete() + return HttpResponseRedirect('/collections/') + class ItemView(object): """Provide Collections web UI methods""" -- 2.39.5