]> git.parisson.com Git - telemeta.git/commitdiff
enable language detection and session set, adapt INSTALL, cleanup
authoryomguy <yomguy@parisson.com>
Wed, 6 Apr 2011 00:32:09 +0000 (02:32 +0200)
committeryomguy <yomguy@parisson.com>
Wed, 6 Apr 2011 00:32:09 +0000 (02:32 +0200)
INSTALL
telemeta/locale/fr/LC_MESSAGES/django.mo
telemeta/locale/fr/LC_MESSAGES/django.po
telemeta/templates/telemeta_default/admin.html
telemeta/templates/telemeta_default/base.html
telemeta/templates/telemeta_default/profile_detail.html
telemeta/urls.py

diff --git a/INSTALL b/INSTALL
index b66871896f52ff47b0e97687e511eaacf5e5f127..88d22f6863791872051c8e80b296a9f7e7656b42 100644 (file)
--- 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"
index 74d8d2f9fb46f74d9dee6bc4e3d924e3241a748c..681924701bd89e7cf364026afd0efb8961795f76 100644 (file)
Binary files a/telemeta/locale/fr/LC_MESSAGES/django.mo and b/telemeta/locale/fr/LC_MESSAGES/django.mo differ
index 7a74e212919ee6ebf82c6d8a3c4de0d0d1e8c53a..7e55d36c89a9caf0d20f63ba06bc39d87822cefb 100644 (file)
@@ -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é"
index 483b1b3f5e318d3e52e775ee0287e27c2912c625..10f9ae163787af21214c134a74eb41b5d56b3018 100644 (file)
@@ -25,4 +25,5 @@
     {% block tabcontents %}
     {% endblock %}
 </div>
+
 {% endblock %}
index 0c008816ab8bf52af19df05d136e5fadb5fa7d24..c42e1de04a83f7ffd16a0f9fdc247353c5e8f091 100644 (file)
@@ -60,7 +60,6 @@
 <div id="quick_search">
 <form action="{% url telemeta-search %}" id="_quickSearchForm" method="GET">
 <input type="text" id="quick_search_pattern" name="pattern" />
-<!--<input type="submit" value="{% trans 'Search' %}" />-->
 <a href="#" class="component button"
                 onclick="document.getElementById('_quickSearchForm').submit(); return false;">{% trans "Search" %}</a>
 </form>
index 437981a1fa7ed9fbfce6401cc6523c91dd39a10d..8f88c5602dcb7551b71457edcd9631217663dfb1 100644 (file)
@@ -1,11 +1,9 @@
 {% extends "telemeta/base.html" %}
 {% load i18n %}
 {% load telemeta_utils %}
-
+        
 {% block head_title %}{% trans "User Profile" %} : {{ usr.username }}{% endblock %}
 
-
-
 {% block content %}
   <div class="module-set" style="width: 33%">
   {% block modules %}
@@ -26,9 +24,6 @@
   </div>
 
   <h3>{% trans "User profile" %} : {{ usr.username }}</h3>
-{% if user.is_authenticated %}
-      <a href="{% url telemeta-profile-edit usr.username %}" class="component_icon button icon_edit" style="float:right">{% trans "Edit" %}</a>
-     {% endif %}
     <div class="infos" style="padding-top: 1em;">
      <dl class="listing">
       <dt>{% trans "First Name" %}</dt><dd>{{ usr.first_name }}</dd>
       <dt>{% trans "Is staff" %}</dt><dd>{{ usr.is_staff }}</dd>
       <dt>{% trans "Is superuser" %}</dt><dd>{{ usr.is_superuser }}</dd>
       <dt>{% trans "Last login" %}</dt><dd>{{ usr.last_login }}</dd>
+      {% if user.is_authenticated and user.username == usr.username %}
+        {% get_current_language as LANGUAGE_CODE %}
+        {% get_available_languages as LANGUAGES %}
+      <dt>{% trans "Language" %}</dt><dd><form id="setlang" action="/i18n/setlang/" method="post">{% csrf_token %}
+        <input name="next" type="hidden" value="" />
+          <select name="language">
+            {% for lang in LANGUAGES %}
+             <option {% if lang.0 == LANGUAGE_CODE %}selected{% endif %} value="{{ lang.0 }}">{{ lang.1 }}</option>
+            {% endfor %}
+          </select>
+          <a href="#" class="component_icon button icon_save" 
+            onclick="document.getElementById('setlang').submit(); return false;">{% trans "Set" %}</a>
+         </form>
+        </dd>
+      {%  endif %}
      </dl>
     </div>
-    <a href="{% url telemeta-password-change %}" class="component_icon button icon_login" style="float:left">{% trans "Change password" %}</a>
-   </div>
+        
+    {% if user.is_authenticated and user.username == usr.username or user.is_staff %}
+    <a href="{% url telemeta-profile-edit usr.username %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
+    {%  endif %}
+    {% if user.is_authenticated and user.username == usr.username %}
+    <a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Change password" %}</a>
+    {%  endif %}
+  </div>
 {% endblock %}
 
index 54c6bfa3513ef158742901443b7f35efde2ac089..f4fb66c0a7c22df159f2921c677c54380865c727 100644 (file)
@@ -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<method>[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<method>[a-zA-Z0-9.]+)$', jsonrpc_site.dispatch),  
     
     # Playlists
     url(r'^playlists/(?P<public_id>[a-zA-Z0-9]+)/(?P<resource_type>[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<public_id>[A-Za-z0-9._-]+)/not_allowed/$', web_view.not_allowed, name="telemeta-not-allowed"),
+    
 )