From a79c6521434250d213d1c17afdced8bd7d7e367c Mon Sep 17 00:00:00 2001 From: yomguy Date: Wed, 6 Apr 2011 02:32:09 +0200 Subject: [PATCH] enable language detection and session set, adapt INSTALL, cleanup --- INSTALL | 35 ++++++++++++++---- telemeta/locale/fr/LC_MESSAGES/django.mo | Bin 11361 -> 11431 bytes telemeta/locale/fr/LC_MESSAGES/django.po | 8 ++++ .../templates/telemeta_default/admin.html | 1 + telemeta/templates/telemeta_default/base.html | 1 - .../telemeta_default/profile_detail.html | 33 +++++++++++++---- telemeta/urls.py | 7 +++- 7 files changed, 67 insertions(+), 18 deletions(-) diff --git a/INSTALL b/INSTALL index b6687189..88d22f68 100644 --- a/INSTALL +++ b/INSTALL @@ -127,24 +127,45 @@ Modifiy the following variables: DATABASES = your database setting dict (don't forget to create the database if needed) MEDIA_ROOT = absolute path to the media directory you just created INSTALLED_APPS = add 'telemeta' and 'jsonrpc' to the tuple + +Set the following languages: + + LANGUAGES = [ ('fr', 'French'), + ('en', 'English'), + ] + + +Set the following Middlewares: + MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.locale.LocaleMiddleware', + ) + Add the following variables: TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'django.contrib.auth.context_processors.auth',) - TELEMETA_ORGANIZATION = name of the organization which hosts this installation - TELEMETA_SUBJECTS = tuple of subject keywords (used for Dublin Core), such as "Ethnology", etc... - TELEMETA_CACHE_DIR = absolute path to the cache directory that you just created - TELEMETA_GMAP_KEY = your Google Map API key - TELEMETA_DOWNLOAD_ENABLED = True to enable audio data download - TELEMETA_PUBLIC_ACCESS_PERIOD = 51 # (in years) - + TELEMETA_ORGANIZATION = name of the organization which hosts this installation + TELEMETA_SUBJECTS = tuple of subject keywords (used for Dublin Core), such as "Ethnology", etc... + TELEMETA_CACHE_DIR = absolute path to the cache directory that you just created + TELEMETA_GMAP_KEY = your Google Map API key + TELEMETA_DOWNLOAD_ENABLED = True to enable audio data download + TELEMETA_PUBLIC_ACCESS_PERIOD = number of years above which item files are automagically published + EMAIL_HOST = your default SMTP server + DEFAULT_FROM_EMAIL = the default sending email address + Just paste the lines below:: LOGIN_URL = '/login' LOGIN_REDIRECT_URL = '/' + AUTH_PROFILE_MODULE = 'telemeta.userprofile' TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export" TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data" CACHE_BACKEND = "file://" + TELEMETA_CACHE_DIR + "/data" diff --git a/telemeta/locale/fr/LC_MESSAGES/django.mo b/telemeta/locale/fr/LC_MESSAGES/django.mo index 74d8d2f9fb46f74d9dee6bc4e3d924e3241a748c..681924701bd89e7cf364026afd0efb8961795f76 100644 GIT binary patch delta 4648 zcmYk<3wYIK0mt!|F~$HPKpdAb?$^mMMJ^FAj7umw5M(kD6KD)#=ok=~;z2GZI&TaR z5M1dJL0iBwK)|qwn|VvLdLT$LwX!5p(zM6E-*evi_<#00pZ9-zZ~ymy4!kvaOHtxf z%k;H@?Ko*q_GN^ST`z{q6aC&Gq!!B+IfJ(!96u^AphZ+HXK@I*X*3h8V3C#K^^*cd;>CYXL< z2t%UQ>x<4re@r+PLn%1IacD(T(4NmkN4fxMBdkEL-+(soG_Z@T~A0mI@6F#iBSr+r3L!krn=8Z$pk&VM_EJ8c95FN=b|yHTLHCwgd$mJRVP+L~lHUPW5>ljG1j%$v6T% zejVE2%(!2Q3@Y4-c5rR98m+Gu+u>pKk)1*QLgFl+_P7zlaH^Z39cqio#e?3Ei$2Ri zXa`23Gf;?5>CNbUCDB{a`xc=cUx|z*tV3s{CUrg$_EK+eJLpt?jt(H5ciD!Uq77!FBhEu-upc@@BheWfo5TEj!FUe%3=89l zqUcR%#WT?BO3^Qlaqj=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rqL1bv+Q4yi1wKPN zJcG@!b!pm8dvxHv(bsM;+TJ*HC8nW2MDvhe=_IV8P{fIC(Id#K98O{mwkb>hycQw9 zF<}_GnW`}t7owZIQls@rv63d0t&s- z2C~rx^U;R7q79Xzk6=J_BsQXcA#sJid@Q1JH(5$vBtNA8%;Dzx8W}-`lKo^Q*-R=3 zZDtPl#+~Fc@(VJ9>>7$I~RaE>jHQ=ICtv0Xazi zKz>Gw$vwp9dIRyeBqeN%PQW`zzgQoF{$2Prd4xgg23I#JV`y^|Ag+Y7*v9D2*pq;Xv|}Snq(( zkyl9`@rP#%DIv3nM=j};DWxCx!3$riKSa5J+)pNwE64%z7|9IjYG^|)ChdsFt)wbb z;{WrpTP({3q|-&H~l}`kI diff --git a/telemeta/locale/fr/LC_MESSAGES/django.po b/telemeta/locale/fr/LC_MESSAGES/django.po index 7a74e212..7e55d36c 100644 --- a/telemeta/locale/fr/LC_MESSAGES/django.po +++ b/telemeta/locale/fr/LC_MESSAGES/django.po @@ -888,6 +888,14 @@ msgstr "Statut super-utilisateur" msgid "Last login" msgstr "Dernière connexion" +#: templates/telemeta_default/profile_detail.html:60 +msgid "Set" +msgstr "Appliquer" + +#: templates/telemeta_default/profile_detail.html:50 +msgid "Language" +msgstr "Langue" + #: templates/telemeta_default/login.html:21 msgid "Password forgotten" msgstr "Mot de passe oublié" diff --git a/telemeta/templates/telemeta_default/admin.html b/telemeta/templates/telemeta_default/admin.html index 483b1b3f..10f9ae16 100644 --- a/telemeta/templates/telemeta_default/admin.html +++ b/telemeta/templates/telemeta_default/admin.html @@ -25,4 +25,5 @@ {% block tabcontents %} {% endblock %} + {% endblock %} diff --git a/telemeta/templates/telemeta_default/base.html b/telemeta/templates/telemeta_default/base.html index 0c008816..c42e1de0 100644 --- a/telemeta/templates/telemeta_default/base.html +++ b/telemeta/templates/telemeta_default/base.html @@ -60,7 +60,6 @@ + + {% if user.is_authenticated and user.username == usr.username or user.is_staff %} + {% trans "Edit" %} + {% endif %} + {% if user.is_authenticated and user.username == usr.username %} + + {% endif %} + + {% endblock %} diff --git a/telemeta/urls.py b/telemeta/urls.py index 54c6bfa3..f4fb66c0 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -237,9 +237,11 @@ urlpatterns = patterns('', url(r'^accounts/password_reset_complete/$', 'django.contrib.auth.views.password_reset_complete', {'template_name': 'telemeta/registration/password_reset_complete.html'}, name="telemeta-password-reset-complete"), # JSON RPC - url(r'^json/browse/', 'jsonrpc.views.browse', name="jsonrpc_browser"), # for the graphical browser/web console only, omissible url(r'^json/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'), - url(r'^json/(?P[a-zA-Z0-9.]+)$', jsonrpc_site.dispatch), # for HTTP GET only, also omissible + # for the graphical browser/web console only, omissible + url(r'^json/browse/', 'jsonrpc.views.browse', name="jsonrpc_browser"), + # for HTTP GET only, also omissible + #url(r'^json/(?P[a-zA-Z0-9.]+)$', jsonrpc_site.dispatch), # Playlists url(r'^playlists/(?P[a-zA-Z0-9]+)/(?P[a-zA-Z0-9]+)/csv/$', web_view.playlist_csv_export, name="telemeta-playlist-csv-export"), @@ -249,4 +251,5 @@ urlpatterns = patterns('', # Not allowed url(r'/*/(?P[A-Za-z0-9._-]+)/not_allowed/$', web_view.not_allowed, name="telemeta-not-allowed"), + ) -- 2.39.5