From: yomguy Date: Wed, 22 Jun 2011 16:35:32 +0000 (+0200) Subject: add collection delete url and view X-Git-Tag: 1.1~78 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9b202e11bab72ef9568d0526839d33561f887951;p=telemeta.git add collection delete url and view --- diff --git a/telemeta/locale/de/LC_MESSAGES/djangojs.mo b/telemeta/locale/de/LC_MESSAGES/djangojs.mo index 4978c3eb..b4e199f3 100644 Binary files a/telemeta/locale/de/LC_MESSAGES/djangojs.mo and b/telemeta/locale/de/LC_MESSAGES/djangojs.mo differ 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 9adde569..89815fbd 100644 Binary files a/telemeta/locale/fr/LC_MESSAGES/djangojs.mo and b/telemeta/locale/fr/LC_MESSAGES/djangojs.mo differ 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"""