cleanups
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 Oct 2010 13:14:48 +0200
changeset 6545 5cea387a5667
parent 6544 e0d20fb46389
child 6546 31586c7b63f6
cleanups
web/data/cubicweb.compat.js
web/views/basecontrollers.py
web/views/cwproperties.py
--- a/web/data/cubicweb.compat.js	Tue Oct 19 13:13:13 2010 +0200
+++ b/web/data/cubicweb.compat.js	Tue Oct 19 13:14:48 2010 +0200
@@ -66,14 +66,14 @@
 );
 
 addElementClass = cw.utils.deprecatedFunction(
-    '[3.9] addElementClass(node, cls) is depcreated, use $(node).addClass(cls) instead',
+    '[3.9] addElementClass(node, cls) is deprecated, use $(node).addClass(cls) instead',
     function(node, klass) {
         $(node).addClass(klass);
     }
 );
 
 removeElementClass = cw.utils.deprecatedFunction(
-    '[3.9] removeElementClass(node, cls) is depcreated, use $(node).removeClass(cls) instead',
+    '[3.9] removeElementClass(node, cls) is deprecated, use $(node).removeClass(cls) instead',
     function(node, klass) {
         $(node).removeClass(klass);
     }
--- a/web/views/basecontrollers.py	Tue Oct 19 13:13:13 2010 +0200
+++ b/web/views/basecontrollers.py	Tue Oct 19 13:14:48 2010 +0200
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
--- a/web/views/cwproperties.py	Tue Oct 19 13:13:13 2010 +0200
+++ b/web/views/cwproperties.py	Tue Oct 19 13:14:48 2010 +0200
@@ -15,9 +15,8 @@
 #
 # You should have received a copy of the GNU Lesser General Public License along
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
-"""Specific views for CWProperty
+"""Specific views for CWProperty (eg site/user preferences"""
 
-"""
 __docformat__ = "restructuredtext en"
 _ = unicode
 
@@ -66,8 +65,8 @@
 
 def make_togglable_link(nodeid, label):
     """builds a HTML link that switches the visibility & remembers it"""
-    action = u"javascript: togglePrefVisibility('%s')" % nodeid
-    return u'<a href="%s">%s</a>' % (action, label)
+    return u'<a href="javascript: togglePrefVisibility(\'%s\')">%s</a>' % (
+        nodeid, label)
 
 def css_class(someclass):
     return someclass and 'class="%s"' % someclass or ''
@@ -111,7 +110,8 @@
         return status
 
     def call(self, **kwargs):
-        self._cw.add_js(('cubicweb.edition.js', 'cubicweb.preferences.js', 'cubicweb.ajax.js'))
+        self._cw.add_js(('cubicweb.preferences.js',
+                         'cubicweb.edition.js', 'cubicweb.ajax.js'))
         self._cw.add_css('cubicweb.preferences.css')
         vreg = self._cw.vreg
         values = self.defined_keys
@@ -135,7 +135,7 @@
 
         for group, objects in groupedopts.items():
             for oid, keys in objects.items():
-                groupedopts[group][oid] = self.form(group + '-' + oid, keys, True)
+                groupedopts[group][oid] = self.form(group + '_' + oid, keys, True)
 
         w = self.w
         req = self._cw