--- a/web/data/cubicweb.formfilter.js Wed Jul 08 10:34:31 2009 +0200
+++ b/web/data/cubicweb.formfilter.js Wed Jul 08 10:44:37 2009 +0200
@@ -135,7 +135,7 @@
}
else{
this.setAttribute('src', UNSELECTED_IMG);
- this.setAttribute('alt', (_('not selected')));
+ this.setAttribute('alt', (_('not selected')));
}
});
var index = parseInt($this.attr('cubicweb:idx'));
@@ -149,8 +149,7 @@
if ( ! ($insertAfter.length == 1 && shift == 0) ) {
// only rearrange element if necessary
$insertAfter.after(this);
- }else{
- }
+ }
} else {
var lastSelected = facet.find('.facetValueSelected:last');
if (lastSelected.length) {
@@ -160,10 +159,8 @@
jQuery(parent).prepend(this);
}
jQuery(this).addClass('facetValueSelected');
- var img = jQuery(this).find('img');
- img.attr('src', SELECTED_IMG);
- img.attr('alt', (_('selected')));
-
+ var $img = jQuery(this).find('img');
+ $img.attr('src', SELECTED_IMG).attr('alt', (_('selected')));
}
buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs')));
facet.find('.facetBody').animate({scrollTop: 0}, '');
--- a/web/views/facets.py Wed Jul 08 10:34:31 2009 +0200
+++ b/web/views/facets.py Wed Jul 08 10:44:37 2009 +0200
@@ -41,7 +41,7 @@
needs_css = 'cubicweb.facets.css'
needs_js = ('cubicweb.ajax.js', 'cubicweb.formfilter.js')
- bkLinkBox_template = u'<div class="facetTitle">%s</div>'
+ bk_linkbox_template = u'<div class="facetTitle">%s</div>'
def facetargs(self):
"""this method returns the list of extra arguments that should
@@ -82,8 +82,8 @@
widgets.append(wdg)
if not widgets:
return
- if self.bkLinkBox_template:
- self.displayBookmarkLink(rset)
+ if self.bk_linkbox_template:
+ self.display_bookmark_link(rset)
w = self.w
w(u'<form method="post" id="%sForm" cubicweb:facetargs="%s" action="">' % (
divid, html_escape(dumps([divid, vid, paginate, self.facetargs()]))))
@@ -102,7 +102,7 @@
import cubicweb
cubicweb.info('after facets with rql: %s' % repr(rqlst))
- def displayBookmarkLink(self, rset):
+ def display_bookmark_link(self, rset):
eschema = self.schema.eschema('Bookmark')
if eschema.has_perm(self.req, 'add'):
bk_path = 'view?rql=%s' % rset.printable_rql()
@@ -114,7 +114,7 @@
html_escape(bk_base_url),
html_escape(bk_add_url),
self.req._('bookmark this search'))
- self.w(self.bkLinkBox_template % bk_link)
+ self.w(self.bk_linkbox_template % bk_link)
def get_facets(self, rset, mainvar):
return self.vreg.possible_vobjects('facets', self.req, rset,