From 49de218e5d5c2f7b91d8c99b9ae7e6378d47c648 Mon Sep 17 00:00:00 2001 From: yomguy Date: Wed, 11 May 2011 16:03:46 +0200 Subject: [PATCH] change add icon, adapt add_item for a given collection, add the button --- telemeta/htdocs/css/telemeta.css | 3 ++ telemeta/htdocs/images/add.png | Bin 579 -> 612 bytes telemeta/locale/de/LC_MESSAGES/django.mo | Bin 420 -> 420 bytes telemeta/locale/de/LC_MESSAGES/django.po | 34 ++++++++++-------- telemeta/locale/fr/LC_MESSAGES/django.mo | Bin 12062 -> 12100 bytes telemeta/locale/fr/LC_MESSAGES/django.po | 34 ++++++++++-------- telemeta/models/system.py | 2 +- .../telemeta_default/collection_detail.html | 7 ++-- .../telemeta_default/mediaitem_detail.html | 2 +- telemeta/urls.py | 2 ++ telemeta/web/base.py | 8 +++-- 11 files changed, 56 insertions(+), 36 deletions(-) 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 8431237bd374e68931a13df798bc0996452f705f..fe07994c2c79feceb44bb6b69889bf6b09bf4d8b 100644 GIT binary patch delta 537 zcmV+!0_Oe01mpyeG?7UqfA&d4K~y-6jgmc2R6!JmpEG;8iyK(8>>8p5&?R(!L_?yz z8WS2DV@Rk;^p9v~V_{Q$IzBNnaW^o5$;eR2wD!4n|M~U#2Ya=_J~wdffB4mj@qzKvRxR7n zup2jl!vUOk+H?^+0I_)QvQF9q06vS-Cib6j&h4-DAb?MuMrridF8=|HKDqFC^33Fo zG;`XHR4{(NK|$X3$D)7P*KWfVU*xQcvs5|C;Az;{^?AVDiHD zD;lAlJ0bY~do_(*li0|76_Sl~YT?e(twZ&J@$EWG`4WT0Q}h@5`RRV-JN7}RO@PpZ4D=3C zEmj%q9fD0d0?a{xQg?~Ukz<_bIZ5^CFnxu-uEXCTW!BaG=%#FRuexucX_>CqUtdjk blKug3iw=QF52S(R00000NkvXXu0mjfWC#N} delta 501 zcmV zf*Xy-o)JNRYi+BPO7z*s9d>{0vUq8c&G}94mG91_zoj3m9VHsT2!GA?={D6)mHkfz z06td>m_bcrSPcMDDeJM*+y>fjK<#^t=uU*oi<@Nt)FU+;02V?7_3H~3cIR1VuFMcT zS6l_&FA2GV;y{3lgxXDZuxrZSS;?#*=QUvpn-9Q$vB5CKL%#udf&YqaZY~EJw!UtW zewii;_`(Evxg}2(u+VHa_q@Q@ZRbvxAP8=V$Xj~{P<{hf4<^oJya3#~ZnA^^Pe2lO zU_xMwv2C{_0b(y01IFP>r9v2nOiWJl>h+sUm`kBD=dc6^x5R6itOCvfSwQjo#K4h=#4w(pugL~cRGrh500000NkvXXu0mjfFfZ@1 diff --git a/telemeta/locale/de/LC_MESSAGES/django.mo b/telemeta/locale/de/LC_MESSAGES/django.mo index 02f452c82dcc8058b710314afd286011bda9bb74..d72dc777c25c00fdc4b2f6b7929e769c8a46b96d 100644 GIT binary patch delta 15 WcmZ3&yo7neWEL|k1H+Bec^LsHUId*0 delta 15 WcmZ3&yo7neWEK-E1Cx!@c^LsHT?C#0 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 0355b2cab5809f5b126106bf135211502e6052fe..7cf0674d2e15e9751d5bf48e70b5ba1de89ef78b 100644 GIT binary patch delta 4750 zcmYk<51h~S0mt#rah(5m98R@ya^x--SDT9EPboxEq}VzvGNdvl^5>@-nQ7EzG$V0K z{%mzvM1-l4)2K*EQ(BKl*48F$T0QLb`h7q5c=$f<{d<1C-{1H1_xt(&JS;2SU7Gr+ zQRc$Hag=x>X8>w7hXVU0p4!r|B)=V1Y^#f$I&@)u6>k%iwPO@tb`AymhD zSQ~S&7G8|m*b2En6|SOCgA1Lp0d|i!^p6fh8+s6JU?O_|boBnm;`vipjq}Cv`Vw>? zYcLZlunxYAb#W(NNB?1eyrFL6WCl6dkQC_(;0XFeQAfAssoXa~d4fsMp= zI2P?_G1kL!bmkT4Kz3p+`VW;9n&KhkFMPp=tDn&%InPFyya4T}H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@ 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(): -- 2.39.5