]> git.parisson.com Git - telemeta.git/commitdiff
fix help and legal_notices translated pages, add set_var template tag
authoryomguy <yomguy@parisson.com>
Fri, 29 Apr 2011 08:46:31 +0000 (10:46 +0200)
committeryomguy <yomguy@parisson.com>
Fri, 29 Apr 2011 08:46:31 +0000 (10:46 +0200)
14 files changed:
telemeta/htdocs/css/telemeta.css
telemeta/pages/default/parts/help-en.rst [new file with mode: 0644]
telemeta/pages/default/parts/help-fr.rst [new file with mode: 0644]
telemeta/pages/default/parts/help.rst [deleted file]
telemeta/pages/default/parts/home-en.rst [new file with mode: 0644]
telemeta/pages/default/parts/home-fr.rst [new file with mode: 0644]
telemeta/pages/default/parts/home.rst [deleted file]
telemeta/pages/default/parts/legal_notices-en.rst [new file with mode: 0644]
telemeta/pages/default/parts/legal_notices-fr.rst [new file with mode: 0644]
telemeta/pages/default/parts/legal_notices.rst [deleted file]
telemeta/templates/telemeta_default/base.html
telemeta/templatetags/telemeta_utils.py
telemeta/urls.py
telemeta/web/base.py

index ba0a1e068f37695f074b8d91ee1679ffe3aeeda3..8321625d4d100f3845ac41611bd2a081570de73a 100644 (file)
@@ -488,7 +488,7 @@ form.login .submit {
     font-size: 10px;
     border-top: 1px solid;
     height: 31px;
-    padding: 0.5em;
+    padding: 0.5em 0.5em 0.7em 0.5em;
     margin-top: 2.5em;
 }
 #footer :link, #footer :visited { color: #FFF; }
diff --git a/telemeta/pages/default/parts/help-en.rst b/telemeta/pages/default/parts/help-en.rst
new file mode 100644 (file)
index 0000000..10c1e68
--- /dev/null
@@ -0,0 +1,15 @@
+========================
+Help page for Telemeta
+========================
+
+Glossary :
+
+#. Introduction
+#. First time
+#. Models
+#. Interface
+#. Advanced functions
+
+For more informations, see `telemeta.org <http://telemeta.org>`_
+
+
diff --git a/telemeta/pages/default/parts/help-fr.rst b/telemeta/pages/default/parts/help-fr.rst
new file mode 100644 (file)
index 0000000..e670714
--- /dev/null
@@ -0,0 +1,15 @@
+========================
+Page d'aide Telemeta
+========================
+
+Plan :
+
+#. Introduction
+#. Prise en main
+#. Modèles
+#. Interface
+#. Fonctions avancées
+
+Pour plus d'informations, voir `telemeta.org <http://telemeta.org>`_
+
+
diff --git a/telemeta/pages/default/parts/help.rst b/telemeta/pages/default/parts/help.rst
deleted file mode 100644 (file)
index e670714..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-========================
-Page d'aide Telemeta
-========================
-
-Plan :
-
-#. Introduction
-#. Prise en main
-#. Modèles
-#. Interface
-#. Fonctions avancées
-
-Pour plus d'informations, voir `telemeta.org <http://telemeta.org>`_
-
-
diff --git a/telemeta/pages/default/parts/home-en.rst b/telemeta/pages/default/parts/home-en.rst
new file mode 100644 (file)
index 0000000..38fe140
--- /dev/null
@@ -0,0 +1,23 @@
+===================================================
+Telemeta : Web Audio Content Management System
+===================================================
+
+Telemeta is a web audio archiving program which introduces useful and secure methods to backup, index, transcode, analyse and publish any digitalized audio file with its metadata. It is dedicated to professionnals who wants to easily backup and publish documented sounds from collections of vinyls, magnetic tapes or audio CDs over a strong database, in accordance with open standards.
+
+Here are the main features of Telemeta:
+
+* Secure archiving, editing and publishing of audio files over internet.
+* User friendly web frontend including workflows and high level search methods
+* Smart dynamical and skinnable audio player (thanks to Timeside and soundmanager2)
+* "On the fly" analyzing, transcoding and metadata embedding based on an easy plugin architecture
+* Multi-format support : FLAC, OGG, MP3, WAV and more
+* GEO Navigator for audio geolocalization
+* DublinCore compatibility
+* OAI-PMH data provider
+* XML serialized backup
+* Strong SQL backend 
+
+The Telemeta data model is based on 'collections' and 'items'. A collection is described by its metadata and includes original audio items (sounds) and its own metadata. This existing model has been designed to fit the one of the French Centre of Etnomusicology (CREM) but could be easily adapted/overrided to suit other data structures.
+
+
+
diff --git a/telemeta/pages/default/parts/home-fr.rst b/telemeta/pages/default/parts/home-fr.rst
new file mode 100644 (file)
index 0000000..38fe140
--- /dev/null
@@ -0,0 +1,23 @@
+===================================================
+Telemeta : Web Audio Content Management System
+===================================================
+
+Telemeta is a web audio archiving program which introduces useful and secure methods to backup, index, transcode, analyse and publish any digitalized audio file with its metadata. It is dedicated to professionnals who wants to easily backup and publish documented sounds from collections of vinyls, magnetic tapes or audio CDs over a strong database, in accordance with open standards.
+
+Here are the main features of Telemeta:
+
+* Secure archiving, editing and publishing of audio files over internet.
+* User friendly web frontend including workflows and high level search methods
+* Smart dynamical and skinnable audio player (thanks to Timeside and soundmanager2)
+* "On the fly" analyzing, transcoding and metadata embedding based on an easy plugin architecture
+* Multi-format support : FLAC, OGG, MP3, WAV and more
+* GEO Navigator for audio geolocalization
+* DublinCore compatibility
+* OAI-PMH data provider
+* XML serialized backup
+* Strong SQL backend 
+
+The Telemeta data model is based on 'collections' and 'items'. A collection is described by its metadata and includes original audio items (sounds) and its own metadata. This existing model has been designed to fit the one of the French Centre of Etnomusicology (CREM) but could be easily adapted/overrided to suit other data structures.
+
+
+
diff --git a/telemeta/pages/default/parts/home.rst b/telemeta/pages/default/parts/home.rst
deleted file mode 100644 (file)
index 38fe140..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-===================================================
-Telemeta : Web Audio Content Management System
-===================================================
-
-Telemeta is a web audio archiving program which introduces useful and secure methods to backup, index, transcode, analyse and publish any digitalized audio file with its metadata. It is dedicated to professionnals who wants to easily backup and publish documented sounds from collections of vinyls, magnetic tapes or audio CDs over a strong database, in accordance with open standards.
-
-Here are the main features of Telemeta:
-
-* Secure archiving, editing and publishing of audio files over internet.
-* User friendly web frontend including workflows and high level search methods
-* Smart dynamical and skinnable audio player (thanks to Timeside and soundmanager2)
-* "On the fly" analyzing, transcoding and metadata embedding based on an easy plugin architecture
-* Multi-format support : FLAC, OGG, MP3, WAV and more
-* GEO Navigator for audio geolocalization
-* DublinCore compatibility
-* OAI-PMH data provider
-* XML serialized backup
-* Strong SQL backend 
-
-The Telemeta data model is based on 'collections' and 'items'. A collection is described by its metadata and includes original audio items (sounds) and its own metadata. This existing model has been designed to fit the one of the French Centre of Etnomusicology (CREM) but could be easily adapted/overrided to suit other data structures.
-
-
-
diff --git a/telemeta/pages/default/parts/legal_notices-en.rst b/telemeta/pages/default/parts/legal_notices-en.rst
new file mode 100644 (file)
index 0000000..8481e3b
--- /dev/null
@@ -0,0 +1,7 @@
+==================
+Legal notices
+==================
+
+...
+
+
diff --git a/telemeta/pages/default/parts/legal_notices-fr.rst b/telemeta/pages/default/parts/legal_notices-fr.rst
new file mode 100644 (file)
index 0000000..7bcd70a
--- /dev/null
@@ -0,0 +1,7 @@
+==================
+Mentions légales
+==================
+
+...
+
+
diff --git a/telemeta/pages/default/parts/legal_notices.rst b/telemeta/pages/default/parts/legal_notices.rst
deleted file mode 100644 (file)
index 0c2146b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-==================
-Mentions légales
-==================
-
-...
-
-==================
-Legal notices
-==================
-
-...
-
-
index c6abf552af4c32b337e29d5d3bda3a9a96565bc4..360c4835e766489a8fcb756c81a51531e78ddbc8 100644 (file)
 {{ user.username }}.
 {% endif %}
 <a href="{% url telemeta-profile-detail user.username %}">{% trans "Account" %}</a> |
-<a href="{% url telemeta-help %}">{% trans "Help" %}</a> | 
+<a href="/page/parts/help-{{ LANGUAGE_CODE }}">{% trans "Help" %}</a> | 
 <a href="{% url telemeta-logout %}">{% trans "Sign out" %}
 <img src="images/logout.png" style="vertical-align:middle" /></a>
 {% else %}
-<a href="{% url telemeta-help %}">{% trans "Help" %}</a> |
+<a href="/page/parts/help-{{ LANGUAGE_CODE }}">{% trans "Help" %}</a> |
 <a href="{% url telemeta-login %}?next={{ request.path|urlencode }}">{% trans "Sign in" %}</a>
 {% endif %}
 </div>
 
  <p class="right">
   Copyright &copy; 2011 Parisson<br />
-  <a href="{% url telemeta-flatpage 'parts/legal_notices' %}">{% trans "Legal notices" %}</a>
+  <a href="/page/parts/legal_notices-{{ LANGUAGE_CODE }}">{% trans "Legal notices" %}</a>
  </p>
 {% endblock %}
 </div>
index df83d36a3d2378b5efd00c2f7d5d52d2f22ec4ad..f5984e51a85bda1438df80a8e5d92f3da03df5e4 100644 (file)
@@ -267,3 +267,28 @@ render_flatpage.is_safe = True
 def organization():
     return settings.TELEMETA_ORGANIZATION
 
+class SetVarNode(template.Node):
+    def __init__(self, var_name, var_value):
+        self.var_name = var_name
+        self.var_value = var_value
+    def render(self, context):
+        try:
+            value = template.Variable(self.var_value).resolve(context)
+        except template.VariableDoesNotExist:
+            value = ""
+        context[self.var_name] = value
+        return u""
+
+@register.tag 
+def set_var(parser, token):
+    """
+        {% set <var_name>  = <var_value> %}
+    """
+    parts = token.split_contents()
+    if len(parts) < 4:
+        raise template.TemplateSyntaxError("'set' tag must be of the form:  {% set <var_name>  = <var_value> %}")
+    return SetVarNode(parts[1], parts[3])
+
index 5d69fbcd45dcea6f84a859d8309ed39f98a27651..00ab6e7959d89da5f7334b9d6cc5f59d4cdfdbaa 100644 (file)
@@ -61,7 +61,6 @@ htdocs = os.path.dirname(__file__) + '/htdocs'
 
 urlpatterns = patterns('',
     url(r'^$', web_view.index, name="telemeta-home"),
-    url(r'^help$', web_view.help, name="telemeta-help"),
 
     # items
     url(r'^items/$', 'django.views.generic.list_detail.object_list', 
index 8e8d0ac5f3b7ec7ab0566451f99c8b68ad06834d..53bed1d4195d76affc24d3f165c083230d9e51ff 100644 (file)
@@ -112,9 +112,8 @@ class WebView(object):
             template = loader.get_template('telemeta/index.html')
             ids = [id for id in MediaItem.objects.all().values_list('id', flat=True).order_by('?')[0:3]]
             items = MediaItem.objects.enriched().filter(pk__in=ids)
-
             context = RequestContext(request, {
-                        'page_content': pages.get_page_content(request, 'parts/home', ignore_slash_issue=True),
+                        'page_content': pages.get_page_content(request, 'parts/home-'+request.LANGUAGE_CODE, ignore_slash_issue=True),
                         'items': items})
             return HttpResponse(template.render(context))
         else:
@@ -122,13 +121,8 @@ class WebView(object):
             playlists = self.get_playlists(request)
             revisions = self.get_revisions(request)
             searches = Search.objects.filter(username=request.user)
-            translation_list = ['Title', 'Description', 'OK', 'Cancel']
-            translations = {}
-            for term in translation_list:
-                translations[term] = ugettext(term)
-                
             return render(request, template, {'playlists': playlists, 'searches': searches, 
-                                              'revisions': revisions, 'translations': translations})
+                                              'revisions': revisions,})
   
     def get_revisions(self, request):
         last_revisions = Revision.objects.all().order_by('-time')[0:15]
@@ -1032,16 +1026,6 @@ class WebView(object):
                 writer.writerow(data)
         return response
         
-    def help(self, request):
-        """Render the help page"""
-        template = loader.get_template('telemeta/index.html')
-        ids = [id for id in MediaItem.objects.all().values_list('id', flat=True).order_by('?')[0:3]]
-        items = MediaItem.objects.enriched().filter(pk__in=ids)
-        context = RequestContext(request, {
-                    'page_content': pages.get_page_content(request, 'parts/help', ignore_slash_issue=True),
-                    'items': items})
-        return HttpResponse(template.render(context))
-        
     def rss(self, request):
         "Render the RSS feed of last revisions"
         rss_item_list = []