merge stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 31 Mar 2010 14:32:19 +0200
branchstable
changeset 5114 55b8b7a5bc4a
parent 5113 f8cbdb51e6d4 (diff)
parent 5109 5cf83b9356d5 (current diff)
child 5115 2e43ef618d14
merge
--- a/__pkginfo__.py	Wed Mar 31 14:25:26 2010 +0200
+++ b/__pkginfo__.py	Wed Mar 31 14:32:19 2010 +0200
@@ -89,6 +89,8 @@
          [join(data_dir, fname) for fname in listdir(data_dir) if not isdir(join(data_dir, fname))]],
         [join('share', 'cubicweb', 'cubes', 'shared', 'data', 'timeline'),
          [join(data_dir, 'timeline', fname) for fname in listdir(join(data_dir, 'timeline'))]],
+        [join('share', 'cubicweb', 'cubes', 'shared', 'data', 'images'),
+         [join(data_dir, 'timeline', fname) for fname in listdir(join(data_dir, 'images'))]],
         [join('share', 'cubicweb', 'cubes', 'shared', 'wdoc'),
          [join(wdoc_dir, fname) for fname in listdir(wdoc_dir) if not isdir(join(wdoc_dir, fname))]],
         [join('share', 'cubicweb', 'cubes', 'shared', 'wdoc', 'images'),
--- a/web/data/cubicweb.facets.js	Wed Mar 31 14:25:26 2010 +0200
+++ b/web/data/cubicweb.facets.js	Wed Mar 31 14:32:19 2010 +0200
@@ -47,10 +47,11 @@
 	var rql = result[0];
 	var $bkLink = jQuery('#facetBkLink');
 	if ($bkLink.length) {
-	    var bkUrl = $bkLink.attr('cubicweb:target') + '&path=view?rql=' + rql;
+	    var bkPath = 'view?rql=' + escape(rql);
 	    if (vid) {
-		bkUrl += '&vid=' + vid;
+		bkPath += '&vid=' + escape(vid);
 	    }
+	    var bkUrl = $bkLink.attr('cubicweb:target') + '&path=' + escape(bkPath);
 	    $bkLink.attr('href', bkUrl);
 	}
 	var toupdate = result[1];
--- a/web/formwidgets.py	Wed Mar 31 14:25:26 2010 +0200
+++ b/web/formwidgets.py	Wed Mar 31 14:32:19 2010 +0200
@@ -783,6 +783,7 @@
             attrs['id'] = field.dom_id(form, 'fqs')
         if self.settabindex:
             attrs['tabindex'] = req.next_tabindex()
+        attrs.setdefault('cols', 60)
         attrs.setdefault('onkeyup', 'autogrow(this)')
         inputs += [tags.textarea(fqs, name=fqsqname, **attrs),
                    u'</td></tr></table>']
--- a/web/views/basecontrollers.py	Wed Mar 31 14:25:26 2010 +0200
+++ b/web/views/basecontrollers.py	Wed Mar 31 14:32:19 2010 +0200
@@ -282,8 +282,6 @@
         except RemoteCallFailed:
             raise
         except Exception, ex:
-            import traceback
-            traceback.print_exc()
             self.exception('an exception occured while calling js_%s(%s): %s',
                            fname, args, ex)
             raise RemoteCallFailed(repr(ex))
@@ -392,7 +390,18 @@
         else: # we receive unicode keys which is not supported by the **syntax
             extraargs = dict((str(key), value)
                              for key, value in extraargs.items())
-        comp = self._cw.vreg[registry].select(compid, self._cw, rset=rset, **extraargs)
+        # XXX while it sounds good, addition of the try/except below cause pb:
+        # when filtering using facets return an empty rset, the edition box
+        # isn't anymore selectable, as expected. The pb is that with the
+        # try/except below, we see a "an error occured" message in the ui, while
+        # we don't see it without it. Proper fix would probably be to deal with
+        # this by allowing facet handling code to tell to js_component that such
+        # error is expected and should'nt be reported.
+        #try:
+        comp = self._cw.vreg[registry].select(compid, self._cw, rset=rset,
+                                              **extraargs)
+        #except NoSelectableObject:
+        #    raise RemoteCallFailed('unselectable')
         extraargs = extraargs or {}
         stream = comp.set_stream()
         comp.render(**extraargs)
--- a/web/views/bookmark.py	Wed Mar 31 14:25:26 2010 +0200
+++ b/web/views/bookmark.py	Wed Mar 31 14:32:19 2010 +0200
@@ -113,7 +113,7 @@
                     # we can't edit shared bookmarks we don't own
                     bookmarksrql = 'Bookmark B WHERE B bookmarked_by U, B owned_by U, U eid %(x)s'
                     erset = req.execute(bookmarksrql, {'x': ueid}, 'x',
-                                                build_descr=False)
+                                        build_descr=False)
                     bookmarksrql %= {'x': ueid}
                 if erset:
                     url = self._cw.build_url(vid='muledit', rql=bookmarksrql)
--- a/web/views/facets.py	Wed Mar 31 14:25:26 2010 +0200
+++ b/web/views/facets.py	Wed Mar 31 14:32:19 2010 +0200
@@ -105,7 +105,10 @@
     def display_bookmark_link(self, rset):
         eschema = self._cw.vreg.schema.eschema('Bookmark')
         if eschema.has_perm(self._cw, 'add'):
-            bk_path = 'view?rql=%s' % rset.printable_rql()
+            bk_path = 'rql=%s' % self._cw.url_quote(rset.printable_rql())
+            if self._cw.form.get('vid'):
+                bk_path += '&vid=%s' % self._cw.url_quote(self._cw.form['vid'])
+            bk_path = 'view?' + bk_path
             bk_title = self._cw._('my custom search')
             linkto = 'bookmarked_by:%s:subject' % self._cw.user.eid
             bk_add_url = self._cw.build_url('add/Bookmark', path=bk_path, title=bk_title, __linkto=linkto)