From: yomguy Date: Wed, 11 May 2011 14:03:46 +0000 (+0200) Subject: change add icon, adapt add_item for a given collection, add the button X-Git-Tag: 1.1~210 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=49de218e5d5c2f7b91d8c99b9ae7e6378d47c648;p=telemeta.git change add icon, adapt add_item for a given collection, add the button --- diff --git a/telemeta/htdocs/css/telemeta.css b/telemeta/htdocs/css/telemeta.css index 9c563527..5e565eeb 100644 --- a/telemeta/htdocs/css/telemeta.css +++ b/telemeta/htdocs/css/telemeta.css @@ -1099,6 +1099,9 @@ a.image-link { .icon_add{ background-image: url('/images/add.png'); } +.icon_add_to_playlist{ + background-image: url('/images/add_to_playlist.png'); +} .icon_login{ background-image: url('/images/password.png'); } diff --git a/telemeta/htdocs/images/add.png b/telemeta/htdocs/images/add.png index 8431237b..fe07994c 100644 Binary files a/telemeta/htdocs/images/add.png and b/telemeta/htdocs/images/add.png differ diff --git a/telemeta/locale/de/LC_MESSAGES/django.mo b/telemeta/locale/de/LC_MESSAGES/django.mo index 02f452c8..d72dc777 100644 Binary files a/telemeta/locale/de/LC_MESSAGES/django.mo and b/telemeta/locale/de/LC_MESSAGES/django.mo differ diff --git a/telemeta/locale/de/LC_MESSAGES/django.po b/telemeta/locale/de/LC_MESSAGES/django.po index 03dc755b..78dcc537 100644 --- a/telemeta/locale/de/LC_MESSAGES/django.po +++ b/telemeta/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-11 14:04+0200\n" +"POT-Creation-Date: 2011-05-11 16:01+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -605,7 +605,7 @@ msgid "" msgstr "" #: templates/telemeta_default/base.html:118 -#: templates/telemeta_default/collection_detail.html:111 +#: templates/telemeta_default/collection_detail.html:114 #: templates/telemeta_default/collection_detail_new.html:116 msgid "Legal notices" msgstr "" @@ -661,28 +661,32 @@ msgstr "" msgid "Copy" msgstr "" -#: templates/telemeta_default/collection_detail.html:47 +#: templates/telemeta_default/collection_detail.html:45 +msgid "Add item" +msgstr "" + +#: templates/telemeta_default/collection_detail.html:48 #: templates/telemeta_default/collection_detail_new.html:47 #: templates/telemeta_default/mediaitem_detail.html:101 msgid "Add to playlist" msgstr "" -#: templates/telemeta_default/collection_detail.html:57 +#: templates/telemeta_default/collection_detail.html:60 msgid "Listen to this collection" msgstr "" -#: templates/telemeta_default/collection_detail.html:89 +#: templates/telemeta_default/collection_detail.html:92 #: templates/telemeta_default/collection_detail_new.html:93 msgid "Recording year" msgstr "" -#: templates/telemeta_default/collection_detail.html:98 +#: templates/telemeta_default/collection_detail.html:101 #: templates/telemeta_default/collection_detail_new.html:103 #: templates/telemeta_default/mediaitem_detail.html:228 msgid "Geographic and cultural informations" msgstr "" -#: templates/telemeta_default/collection_detail.html:116 +#: templates/telemeta_default/collection_detail.html:119 #: templates/telemeta_default/collection_detail_new.html:121 #: templates/telemeta_default/home.html:52 #: templates/telemeta_default/inc/collection_list.html:16 @@ -690,31 +694,31 @@ msgstr "" msgid "Recordist" msgstr "" -#: templates/telemeta_default/collection_detail.html:137 +#: templates/telemeta_default/collection_detail.html:140 #: templates/telemeta_default/collection_detail_new.html:142 #: templates/telemeta_default/mediaitem_detail.html:294 msgid "Archiving data" msgstr "" -#: templates/telemeta_default/collection_detail.html:160 +#: templates/telemeta_default/collection_detail.html:163 #: templates/telemeta_default/collection_detail_new.html:165 #: templates/telemeta_default/mediaitem_detail.html:309 msgid "Technical data" msgstr "" -#: templates/telemeta_default/collection_detail.html:165 +#: templates/telemeta_default/collection_detail.html:168 #: templates/telemeta_default/collection_detail_new.html:170 #: templates/telemeta_default/mediaitem_detail.html:312 msgid "Media type" msgstr "" -#: templates/telemeta_default/collection_detail.html:165 +#: templates/telemeta_default/collection_detail.html:168 #: templates/telemeta_default/collection_detail_new.html:170 #: templates/telemeta_default/mediaitem_detail.html:312 msgid "Audio" msgstr "" -#: templates/telemeta_default/collection_detail.html:170 +#: templates/telemeta_default/collection_detail.html:173 #: templates/telemeta_default/collection_detail_new.html:175 #: templates/telemeta_default/geo_countries.html:17 msgid "Number of items" @@ -1086,7 +1090,7 @@ msgstr "" msgid "No item" msgstr "" -#: templates/telemeta_default/inc/module_revisions.html:7 web/base.py:1079 +#: templates/telemeta_default/inc/module_revisions.html:7 web/base.py:1083 msgid "Last changes" msgstr "" @@ -1260,11 +1264,11 @@ msgid_plural "%(count)d collections" msgstr[0] "" msgstr[1] "" -#: web/base.py:1090 +#: web/base.py:1094 msgid "Access not allowed" msgstr "" -#: web/base.py:1092 +#: web/base.py:1096 msgid "" "Please login or contact the website administator to get admin or private " "access." diff --git a/telemeta/locale/fr/LC_MESSAGES/django.mo b/telemeta/locale/fr/LC_MESSAGES/django.mo index 0355b2ca..7cf0674d 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 11389471..1ec84952 100644 --- a/telemeta/locale/fr/LC_MESSAGES/django.po +++ b/telemeta/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-05-11 14:04+0200\n" +"POT-Creation-Date: 2011-05-11 16:01+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Olivier Guilyardi \n" "Language-Team: LANGUAGE \n" @@ -611,7 +611,7 @@ msgstr "" "communautés d'origine." #: templates/telemeta_default/base.html:118 -#: templates/telemeta_default/collection_detail.html:111 +#: templates/telemeta_default/collection_detail.html:114 #: templates/telemeta_default/collection_detail_new.html:116 msgid "Legal notices" msgstr "Mentions légales" @@ -667,28 +667,32 @@ msgstr "Editer" msgid "Copy" msgstr "Copier" -#: templates/telemeta_default/collection_detail.html:47 +#: templates/telemeta_default/collection_detail.html:45 +msgid "Add item" +msgstr "Ajouter item" + +#: templates/telemeta_default/collection_detail.html:48 #: templates/telemeta_default/collection_detail_new.html:47 #: templates/telemeta_default/mediaitem_detail.html:101 msgid "Add to playlist" msgstr "Ajouter à la liste" -#: templates/telemeta_default/collection_detail.html:57 +#: templates/telemeta_default/collection_detail.html:60 msgid "Listen to this collection" msgstr "Écouter la collection" -#: templates/telemeta_default/collection_detail.html:89 +#: templates/telemeta_default/collection_detail.html:92 #: templates/telemeta_default/collection_detail_new.html:93 msgid "Recording year" msgstr "Année d'enregistrement" -#: templates/telemeta_default/collection_detail.html:98 +#: templates/telemeta_default/collection_detail.html:101 #: templates/telemeta_default/collection_detail_new.html:103 #: templates/telemeta_default/mediaitem_detail.html:228 msgid "Geographic and cultural informations" msgstr "Indications géographiques et culturelles" -#: templates/telemeta_default/collection_detail.html:116 +#: templates/telemeta_default/collection_detail.html:119 #: templates/telemeta_default/collection_detail_new.html:121 #: templates/telemeta_default/home.html:52 #: templates/telemeta_default/inc/collection_list.html:16 @@ -696,31 +700,31 @@ msgstr "Indications géographiques et culturelles" msgid "Recordist" msgstr "Collecteur" -#: templates/telemeta_default/collection_detail.html:137 +#: templates/telemeta_default/collection_detail.html:140 #: templates/telemeta_default/collection_detail_new.html:142 #: templates/telemeta_default/mediaitem_detail.html:294 msgid "Archiving data" msgstr "Données d'archivage" -#: templates/telemeta_default/collection_detail.html:160 +#: templates/telemeta_default/collection_detail.html:163 #: templates/telemeta_default/collection_detail_new.html:165 #: templates/telemeta_default/mediaitem_detail.html:309 msgid "Technical data" msgstr "Données techniques" -#: templates/telemeta_default/collection_detail.html:165 +#: templates/telemeta_default/collection_detail.html:168 #: templates/telemeta_default/collection_detail_new.html:170 #: templates/telemeta_default/mediaitem_detail.html:312 msgid "Media type" msgstr "Type de media" -#: templates/telemeta_default/collection_detail.html:165 +#: templates/telemeta_default/collection_detail.html:168 #: templates/telemeta_default/collection_detail_new.html:170 #: templates/telemeta_default/mediaitem_detail.html:312 msgid "Audio" msgstr "Audio" -#: templates/telemeta_default/collection_detail.html:170 +#: templates/telemeta_default/collection_detail.html:173 #: templates/telemeta_default/collection_detail_new.html:175 #: templates/telemeta_default/geo_countries.html:17 msgid "Number of items" @@ -1093,7 +1097,7 @@ msgstr "Etat/Continent" msgid "No item" msgstr "Aucun item" -#: templates/telemeta_default/inc/module_revisions.html:7 web/base.py:1079 +#: templates/telemeta_default/inc/module_revisions.html:7 web/base.py:1083 msgid "Last changes" msgstr "Dernières modifications" @@ -1273,11 +1277,11 @@ msgid_plural "%(count)d collections" msgstr[0] "%(count)d collection" msgstr[1] "%(count)d collections" -#: web/base.py:1090 +#: web/base.py:1094 msgid "Access not allowed" msgstr "Accès non autorisé" -#: web/base.py:1092 +#: web/base.py:1096 msgid "" "Please login or contact the website administator to get admin or private " "access." diff --git a/telemeta/models/system.py b/telemeta/models/system.py index afdc68a8..40d17235 100644 --- a/telemeta/models/system.py +++ b/telemeta/models/system.py @@ -75,7 +75,7 @@ class Revision(ModelCore): class UserProfile(django.db.models.Model): "User profile extension" - user = ForeignKey(User, unique=True) + user = ForeignKey(User, unique=True, required=True) institution = CharField(_('Institution')) function = CharField(_('Function')) address = TextField(_('Address')) diff --git a/telemeta/templates/telemeta_default/collection_detail.html b/telemeta/templates/telemeta_default/collection_detail.html index 13400322..069a7ed2 100644 --- a/telemeta/templates/telemeta_default/collection_detail.html +++ b/telemeta/templates/telemeta_default/collection_detail.html @@ -38,14 +38,17 @@ {% endblock %} {% block title_buttons %} - Dublin Core +
{% if user.is_authenticated and perms.telemeta.change_mediacollection %} {% trans "Edit" %} {% trans "Copy" %} + {% trans "Add item" %} {% endif %} {% if user.is_authenticated %} - {% trans "Add to playlist" %} + {% trans "Add to playlist" %} {% endif %} + Dublin Core +
{% endblock %} {% block content %} diff --git a/telemeta/templates/telemeta_default/mediaitem_detail.html b/telemeta/templates/telemeta_default/mediaitem_detail.html index 933217c3..408cf1b3 100644 --- a/telemeta/templates/telemeta_default/mediaitem_detail.html +++ b/telemeta/templates/telemeta_default/mediaitem_detail.html @@ -98,7 +98,7 @@ {% trans "Copy" %} {% endif %} {% if user.is_authenticated %} - {% trans "Add to playlist" %} + {% trans "Add to playlist" %} {% endif %} {% trans "Previous" %} {% trans "Next" %} diff --git a/telemeta/urls.py b/telemeta/urls.py index ca70ed14..8cd990da 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -131,6 +131,8 @@ urlpatterns = patterns('', dict(template='telemeta/collection_edit.html'), name="telemeta-collection-copy"), url(r'^collection/add/$', web_view.collection_add, dict(template='telemeta/collection_add.html'), name="telemeta-collection-add"), + url(r'^collection/(?P[A-Za-z0-9._-]+)/add_item/$', web_view.item_add, + dict(template='telemeta/mediaitem_add.html'), name="telemeta-collection-additem"), # search url(r'^search/$', web_view.search, name="telemeta-search"), diff --git a/telemeta/web/base.py b/telemeta/web/base.py index ae27cbff..434c4be8 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -352,9 +352,13 @@ class WebView(object): }) @method_decorator(permission_required('telemeta.add_mediaitem')) - def item_add(self, request, template='telemeta/mediaitem_add.html'): + def item_add(self, request, public_id=None, template='telemeta/mediaitem_add.html'): """Show the details of a given item""" - item = MediaItem() + if public_id: + collection = MediaCollection.objects.get(public_id=public_id) + item = MediaItem(collection=collection) + else: + item = MediaItem() if request.method == 'POST': form = MediaItemForm(data=request.POST, files=request.FILES, instance=item) if form.is_valid():