From: olivier <> Date: Fri, 12 Feb 2010 13:34:53 +0000 (+0000) Subject: add geo navigator and musical selection modules to homepage X-Git-Tag: 1.1~544 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4d0ab7932c7be6a872228362d32410ae836bf6ea;p=telemeta.git add geo navigator and musical selection modules to homepage --- diff --git a/telemeta/htdocs/css/telemeta.css b/telemeta/htdocs/css/telemeta.css index abd74b7a..e72738ed 100644 --- a/telemeta/htdocs/css/telemeta.css +++ b/telemeta/htdocs/css/telemeta.css @@ -622,8 +622,7 @@ table.listing tbody tr:hover { background: #f7f8fa !important } } .rst-content img { - margin: 0 1.5em 1.5em 1.5em; - float: left; + margin: 1.5em; } .rst-content img.align-left { @@ -633,3 +632,50 @@ table.listing tbody tr:hover { background: #f7f8fa !important } .rst-content img.align-right { margin-right: 0 } + +.module { + float: right; + border: 1px dotted #999; + background: #EEE; + padding: 1em; + margin: 0 0 1.5em 1.5em; + clear: right; +} + +.module h3 { + margin-top: 0; + margin-bottom: 0.8em; + font-size: 1.1em; +} + +a.image-link { + border: none; +} + +.map-thumbnail { + border: solid 1px #999; +} + +.home-content .module { + width: 338px; +} + +.home-description { + padding-right: 370px; +} + +ul.playlist { + list-style-type: none; + border-top: solid 1px #e1e1e1; + margin: 0; + padding: 0 !important; +} + +ul.playlist li { + display: block; + border: solid 1px #e1e1e1; + border-top: 0; + background: white; + margin: 0; + padding: 1em !important; +} diff --git a/telemeta/htdocs/images/map_thumbnail.png b/telemeta/htdocs/images/map_thumbnail.png new file mode 100644 index 00000000..c270e553 Binary files /dev/null and b/telemeta/htdocs/images/map_thumbnail.png differ diff --git a/telemeta/locale/fr/LC_MESSAGES/django.mo b/telemeta/locale/fr/LC_MESSAGES/django.mo index 686816c4..5ed08461 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 264a8ce6..a8eb3035 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: 2010-02-09 22:15+0100\n" +"POT-Creation-Date: 2010-02-12 14:31+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Olivier Guilyardi \n" "Language-Team: LANGUAGE \n" @@ -16,408 +16,410 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: models/core.py:130 +#: models/core.py:142 msgid "Duration" msgstr "Durée" -#: models/core.py:135 -msgid "Enter a valid duration in HH:MM[:ss[.uuuuuu]] format." -msgstr "Entrez une durée valide au format HH:MM[:ss[.uuuuuu]]" +#: models/core.py:147 +msgid "Enter a valid duration in HH:MM[:ss] format." +msgstr "Entrez une durée valide au format HH:MM[:ss]" -#: models/crem.py:137 +#: models/enum.py:41 models/enum.py:124 +msgid "value" +msgstr "valeur" + +#: models/enum.py:123 +msgid "publisher" +msgstr "éditeur" + +#: models/enum.py:134 models/enum.py:145 models/instrument.py:41 +#: models/instrument.py:51 models/location.py:50 models/location.py:142 +#: models/media.py:347 +msgid "name" +msgstr "nom" + +#: models/enum.py:144 models/media.py:225 +msgid "population / social group" +msgstr "population / groupe social" + +#: models/instrument.py:62 models/instrument.py:75 +msgid "instrument" +msgstr "instrument" + +#: models/instrument.py:64 +msgid "parent instrument" +msgstr "instrument parent" + +#: models/instrument.py:73 models/location.py:150 +msgid "alias" +msgstr "alias" + +#: models/location.py:48 +msgid "country" +msgstr "pays" + +#: models/location.py:48 +msgid "continent" +msgstr "continent" + +#: models/location.py:48 +msgid "other" +msgstr "autre" + +#: models/location.py:51 +msgid "type" +msgstr "type" + +#: models/location.py:52 +msgid "complete type" +msgstr "type complet" + +#: models/location.py:54 +msgid "current location" +msgstr "lieu actuel" + +#: models/location.py:57 models/location.py:151 +msgid "authoritative" +msgstr "officiel" + +#: models/location.py:105 models/location.py:149 models/location.py:162 +#: models/media.py:222 +msgid "location" +msgstr "lieu" + +#: models/location.py:141 +msgid "identifier" +msgstr "identifiant" + +#: models/location.py:163 +msgid "ancestor location" +msgstr "lieu ancêtre" + +#: models/media.py:50 msgid "Metadata only" msgstr "Métadonnées uniquement" -#: models/crem.py:139 +#: models/media.py:52 msgid "Sound and metadata" msgstr "Son et métadonnées" -#: models/crem.py:141 +#: models/media.py:54 msgid "Private data" msgstr "Données privées" -#: models/crem.py:143 models/crem.py:206 models/crem.py:327 +#: models/media.py:55 models/media.py:123 models/media.py:244 msgid "public access" msgstr "accès public" -#: models/crem.py:160 models/crem.py:324 +#: models/media.py:77 models/media.py:241 msgid "reference" msgstr "référence" -#: models/crem.py:162 +#: models/media.py:79 msgid "archive format" msgstr "format d'archivage" -#: models/crem.py:163 models/crem.py:300 +#: models/media.py:80 models/media.py:217 msgid "old code" msgstr "ancienne cote" -#: models/crem.py:164 models/crem.py:301 +#: models/media.py:81 models/media.py:218 msgid "code" msgstr "cote" -#: models/crem.py:165 models/crem.py:309 models/crem.py:396 +#: models/media.py:82 models/media.py:226 models/media.py:334 msgid "title" msgstr "titre" -#: models/crem.py:166 models/crem.py:310 +#: models/media.py:83 models/media.py:227 msgid "original title / translation" msgstr "titre original / traduction" -#: models/crem.py:167 +#: models/media.py:84 msgid "number of components (medium / piece)" msgstr "nb de composants (support / pièce)" -#: models/crem.py:169 +#: models/media.py:86 msgid "secondary edition" msgstr "réédition" -#: models/crem.py:170 +#: models/media.py:87 msgid "depositor / contributor" msgstr "déposant / contributeur" -#: models/crem.py:171 +#: models/media.py:88 msgid "author of published notice" msgstr "auteur de la notice éditée" -#: models/crem.py:172 +#: models/media.py:89 msgid "related documentation" msgstr "documentation associée" -#: models/crem.py:173 models/crem.py:318 +#: models/media.py:90 models/media.py:235 msgid "recordist" msgstr "enregistré par" -#: models/crem.py:174 +#: models/media.py:91 msgid "recordist identical to depositor" msgstr "collecteur identique au déposant" -#: models/crem.py:176 +#: models/media.py:93 msgid "publisher / status" msgstr "éditeur / statut" -#: models/crem.py:177 +#: models/media.py:94 msgid "published" msgstr "édité" -#: models/crem.py:178 +#: models/media.py:95 msgid "year published" msgstr "année de parution" -#: models/crem.py:180 +#: models/media.py:97 msgid "publisher collection" msgstr "collection éditeur" -#: models/crem.py:181 +#: models/media.py:98 msgid "publisher serial number" msgstr "numéro dans la série" -#: models/crem.py:182 +#: models/media.py:99 msgid "bibliographic references" msgstr "références bibliographiques" -#: models/crem.py:184 +#: models/media.py:101 msgid "mode of acquisition" msgstr "mode d'acquisition" -#: models/crem.py:185 models/crem.py:325 +#: models/media.py:102 models/media.py:242 msgid "comment" msgstr "commentaire" -#: models/crem.py:187 +#: models/media.py:104 msgid "record author" msgstr "rédacteur fiche" -#: models/crem.py:189 +#: models/media.py:106 msgid "record writer" msgstr "saisie fiche" -#: models/crem.py:191 +#: models/media.py:108 msgid "legal rights" msgstr "droit d'utilisation" -#: models/crem.py:192 +#: models/media.py:109 msgid "copies" msgstr "autres exemplaires" -#: models/crem.py:193 +#: models/media.py:110 msgid "recording year (from)" msgstr "année d'enregistrement (depuis)" -#: models/crem.py:194 +#: models/media.py:111 msgid "recording year (until)" msgstr "année d'enregistrement (jusqu'à)" -#: models/crem.py:196 +#: models/media.py:113 msgid "recording context" msgstr "context d'enregistrement" -#: models/crem.py:197 models/crem.py:302 +#: models/media.py:114 models/media.py:219 msgid "approximative duration" msgstr "durée approximative" -#: models/crem.py:198 +#: models/media.py:115 msgid "document type" msgstr "type de document" -#: models/crem.py:199 +#: models/media.py:116 msgid "archiver notes" msgstr "notes de l'archiviste" -#: models/crem.py:200 +#: models/media.py:117 msgid "status" msgstr "etat" -#: models/crem.py:201 +#: models/media.py:118 msgid "CNRS depositor" msgstr "déposant CNRS" -#: models/crem.py:202 +#: models/media.py:119 msgid "items finished" msgstr "fiches faîtes" -#: models/crem.py:203 +#: models/media.py:120 msgid "a_informer_07_03" msgstr "a_informer_07_03" -#: models/crem.py:205 +#: models/media.py:122 msgid "A/D conversion" msgstr "numérisation" -#: models/crem.py:243 +#: models/media.py:160 msgid "states / nations" msgstr "états / nations" -#: models/crem.py:256 +#: models/media.py:173 msgid "populations / social groups" msgstr "populations / groupes sociaux" -#: models/crem.py:264 models/crem.py:379 +#: models/media.py:181 models/media.py:294 msgid "computed duration" msgstr "durée calculée" -#: models/crem.py:298 +#: models/media.py:215 msgid "collection" msgstr "collection" -#: models/crem.py:299 +#: models/media.py:216 msgid "item number" msgstr "n° de l'item" -#: models/crem.py:303 +#: models/media.py:220 msgid "recording date (from)" msgstr "date d'enregistrement (depuis)" -#: models/crem.py:304 +#: models/media.py:221 msgid "recording date (until)" msgstr "date d'enregistrement (jusqu'à)" -#: models/crem.py:305 models/crem.py:674 models/crem.py:687 -msgid "location" -msgstr "lieu" - -#: models/crem.py:306 +#: models/media.py:223 msgid "location details" msgstr "précisions lieu" -#: models/crem.py:308 models/crem.py:775 -msgid "population / social group" -msgstr "population / groupe social" - -#: models/crem.py:311 +#: models/media.py:228 msgid "author" msgstr "auteur" -#: models/crem.py:313 +#: models/media.py:230 msgid "vernacular name" msgstr "nom vernaculaire" -#: models/crem.py:314 +#: models/media.py:231 msgid "comments" msgstr "commentaires" -#: models/crem.py:315 +#: models/media.py:232 msgid "published reference" msgstr "référence éditée" -#: models/crem.py:316 +#: models/media.py:233 msgid "moda_execut" msgstr "moda_execut" -#: models/crem.py:317 +#: models/media.py:234 msgid "copy of" msgstr "copie de" -#: models/crem.py:319 +#: models/media.py:236 msgid "recordist as in collection" msgstr "collecteur identique à la collection" -#: models/crem.py:320 +#: models/media.py:237 msgid "cultural area" msgstr "aire culturelle" -#: models/crem.py:322 +#: models/media.py:239 msgid "generic name" msgstr "nom générique" -#: models/crem.py:323 +#: models/media.py:240 msgid "recordist selection" msgstr "sélection collecteur" -#: models/crem.py:326 +#: models/media.py:243 msgid "file" msgstr "fichier" -#: models/crem.py:333 +#: models/media.py:250 msgid "keywords" msgstr "mots-clés" -#: models/crem.py:395 models/crem.py:521 models/crem.py:709 +#: models/media.py:309 models/media.py:319 models/media.py:333 msgid "item" msgstr "item" -#: models/crem.py:397 -msgid "start" -msgstr "début" - -#: models/crem.py:398 -msgid "end" -msgstr "fin" - -#: models/crem.py:408 models/crem.py:725 -msgid "value" -msgstr "valeur" - -#: models/crem.py:478 models/crem.py:488 models/crem.py:552 models/crem.py:578 -#: models/crem.py:667 models/crem.py:765 models/crem.py:776 -msgid "name" -msgstr "nom" - -#: models/crem.py:499 models/crem.py:512 -msgid "instrument" -msgstr "instrument" - -#: models/crem.py:501 -msgid "parent instrument" -msgstr "instrument parent" - -#: models/crem.py:510 models/crem.py:675 -msgid "alias" -msgstr "alias" +#: models/media.py:310 +msgid "keyword" +msgstr "mot-clé" -#: models/crem.py:523 +#: models/media.py:321 msgid "scientific instrument" msgstr "instrument scientifique" -#: models/crem.py:525 +#: models/media.py:323 msgid "vernacular instrument" msgstr "instrument vernaculaire" -#: models/crem.py:526 +#: models/media.py:324 msgid "number" msgstr "nombre" -#: models/crem.py:527 +#: models/media.py:325 msgid "interprets" msgstr "interprètes" -#: models/crem.py:536 +#: models/media.py:335 +msgid "start" +msgstr "début" + +#: models/media.py:336 +msgid "end" +msgstr "fin" + +#: models/media.py:359 +msgid "playlist" +msgstr "liste de lecture" + +#: models/media.py:360 +msgid "resource type" +msgstr "type de ressource" + +#: models/media.py:361 +msgid "resource" +msgstr "ressource" + +#: models/system.py:44 msgid "username" msgstr "nom d'utilisateur" -#: models/crem.py:537 +#: models/system.py:45 msgid "level" msgstr "niveau" -#: models/crem.py:538 +#: models/system.py:46 msgid "first name" msgstr "prénom" -#: models/crem.py:539 +#: models/system.py:47 msgid "last name" msgstr "nom de famille" -#: models/crem.py:540 +#: models/system.py:48 msgid "phone" msgstr "téléphone" -#: models/crem.py:541 +#: models/system.py:49 msgid "email" msgstr "e-mail" -#: models/crem.py:564 -msgid "playlist" -msgstr "liste de lecture" - -#: models/crem.py:565 -msgid "resource type" -msgstr "type de ressource" - -#: models/crem.py:566 -msgid "resource" -msgstr "ressource" - -#: models/crem.py:576 -msgid "country" -msgstr "pays" - -#: models/crem.py:576 -msgid "continent" -msgstr "continent" - -#: models/crem.py:576 -msgid "other" -msgstr "autre" - -#: models/crem.py:579 -msgid "type" -msgstr "type" - -#: models/crem.py:580 -msgid "complete type" -msgstr "type complet" - -#: models/crem.py:582 -msgid "current location" -msgstr "lieu actuel" - -#: models/crem.py:585 models/crem.py:676 -msgid "authoritative" -msgstr "officiel" - -#: models/crem.py:666 -msgid "identifier" -msgstr "identifiant" - -#: models/crem.py:688 -msgid "ancestor location" -msgstr "lieu ancêtre" - -#: models/crem.py:710 -msgid "keyword" -msgstr "mot-clé" - -#: models/crem.py:724 -msgid "publisher" -msgstr "éditeur" - -#: models/crem.py:738 +#: models/system.py:62 msgid "element type" msgstr "type d'élément" -#: models/crem.py:739 +#: models/system.py:63 msgid "element identifier" msgstr "identifiant de l'élément" -#: models/crem.py:740 +#: models/system.py:64 msgid "modification type" msgstr "type de modification" -#: models/crem.py:741 +#: models/system.py:65 msgid "time" msgstr "heure" -#: models/crem.py:742 +#: models/system.py:66 msgid "user" msgstr "utilisateur" @@ -462,7 +464,7 @@ msgid "Recording year" msgstr "Année d'enregistrement" #: templates/telemeta_default/collection_detail.html:59 -#: templates/telemeta_default/mediaitem_detail.html:143 +#: templates/telemeta_default/mediaitem_detail.html:144 msgid "Geographic and cultural informations" msgstr "Indications géographiques et culturelles" @@ -477,22 +479,22 @@ msgid "Recordist" msgstr "Enregistré par" #: templates/telemeta_default/collection_detail.html:98 -#: templates/telemeta_default/mediaitem_detail.html:208 +#: templates/telemeta_default/mediaitem_detail.html:209 msgid "Archiving data" msgstr "Données d'archivage" #: templates/telemeta_default/collection_detail.html:121 -#: templates/telemeta_default/mediaitem_detail.html:223 +#: templates/telemeta_default/mediaitem_detail.html:224 msgid "Technical data" msgstr "Données techniques" #: templates/telemeta_default/collection_detail.html:126 -#: templates/telemeta_default/mediaitem_detail.html:226 +#: templates/telemeta_default/mediaitem_detail.html:227 msgid "Media type" msgstr "Type de media" #: templates/telemeta_default/collection_detail.html:126 -#: templates/telemeta_default/mediaitem_detail.html:226 +#: templates/telemeta_default/mediaitem_detail.html:227 msgid "Audio" msgstr "Audio" @@ -526,6 +528,7 @@ msgid "List" msgstr "Liste" #: templates/telemeta_default/geo_continents.html:24 +#: templates/telemeta_default/index.html:8 msgid "Geographic Navigator" msgstr "Navigateur géographique" @@ -535,20 +538,28 @@ msgstr "Navigateur géographique" msgid "World" msgstr "Monde" -#: templates/telemeta_default/mediaitem_detail.html:134 +#: templates/telemeta_default/index.html:10 +msgid "Open the geographic navigator" +msgstr "Accéder au navigateur géographique" + +#: templates/telemeta_default/index.html:13 +msgid "Musical selection" +msgstr "Sélection musicale" + +#: templates/telemeta_default/mediaitem_detail.html:135 msgid "Recording date" msgstr "Date d'enregistrement" -#: templates/telemeta_default/mediaitem_detail.html:146 +#: templates/telemeta_default/mediaitem_detail.html:147 #: templates/telemeta_default/inc/mediaitem_list.html:17 msgid "Location" msgstr "Lieu" -#: templates/telemeta_default/mediaitem_detail.html:161 +#: templates/telemeta_default/mediaitem_detail.html:162 msgid "Musical informations" msgstr "Informations sur la musique" -#: templates/telemeta_default/mediaitem_detail.html:197 +#: templates/telemeta_default/mediaitem_detail.html:198 msgid "General informations" msgstr "Informations générales" @@ -592,17 +603,16 @@ msgstr "Pays/Continent" msgid "No item" msgstr "Aucun item" -#: templatetags/telemeta_utils.py:193 +#: templatetags/telemeta_utils.py:200 #, python-format msgid "%(count)d item" msgid_plural "%(count)d items" msgstr[0] "%(count)d item" msgstr[1] "%(count)d items" -#: templatetags/telemeta_utils.py:196 +#: templatetags/telemeta_utils.py:203 #, python-format msgid "%(count)d collection" msgid_plural "%(count)d collections" msgstr[0] "%(count)d collection" msgstr[1] "%(count)d collections" - diff --git a/telemeta/templates/telemeta_default/flatpage.html b/telemeta/templates/telemeta_default/flatpage.html index f7a06cf7..6b2b55f4 100644 --- a/telemeta/templates/telemeta_default/flatpage.html +++ b/telemeta/templates/telemeta_default/flatpage.html @@ -1,5 +1,5 @@ {% extends "telemeta/base.html" %} {% load telemeta_utils %} {% block content %} -{{ page_content|rst }} +{{ page_content|render_flatpage }} {% endblock %} diff --git a/telemeta/templates/telemeta_default/index.html b/telemeta/templates/telemeta_default/index.html index 78e725dd..89cd2b47 100644 --- a/telemeta/templates/telemeta_default/index.html +++ b/telemeta/templates/telemeta_default/index.html @@ -1,18 +1,28 @@ {% extends "telemeta/base.html" %} {% load telemeta_utils %} -{% block content %} -{{ page_content|rst }} +{% load i18n %} - {% endblock %} diff --git a/telemeta/templatetags/telemeta_utils.py b/telemeta/templatetags/telemeta_utils.py index 0eeb1b4c..15348021 100644 --- a/telemeta/templatetags/telemeta_utils.py +++ b/telemeta/templatetags/telemeta_utils.py @@ -218,7 +218,7 @@ def equals(value1, value2): return value1 == value2 @register.filter -def rst(content): +def render_flatpage(content): parsed = "" path = getattr(content, 'path', '') if isinstance(content, basestring): @@ -245,7 +245,7 @@ def rst(content): parts = publish_parts(source=smart_str(parsed), writer_name="html4css1", settings_overrides={}) return mark_safe('
\n' + force_unicode(parts["html_body"]) + '
') -rst.is_safe = True +render_flatpage.is_safe = True diff --git a/telemeta/web/base.py b/telemeta/web/base.py index d40cc8d6..bd653557 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -69,7 +69,11 @@ class WebView(Component): """Render the homepage""" template = loader.get_template('telemeta/index.html') - context = Context({'page_content': pages.get_page_content(request, 'parts/home', ignore_slash_issue=True)}) + ids = [id for id in MediaItem.objects.all().values_list('id', flat=True).order_by('?')[0:4]] + items = MediaItem.objects.enriched().filter(pk__in=ids) + + context = Context({'page_content': pages.get_page_content(request, 'parts/home', ignore_slash_issue=True), + 'items': items}) return HttpResponse(template.render(context)) def collection_detail(self, request, public_id, template=''):