# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1236183148 -3600 # Node ID 92a0601b252353fca416544c14abd1c081d26886 # Parent 09ba3cb2a440b29ad50c25a22ab28dfc47e345cf# Parent 625e597731198ae94151195336df20daca20fa86 backport default branch diff -r 09ba3cb2a440 -r 92a0601b2523 devtools/testlib.py --- a/devtools/testlib.py Wed Mar 04 17:09:10 2009 +0100 +++ b/devtools/testlib.py Wed Mar 04 17:12:28 2009 +0100 @@ -248,11 +248,11 @@ def to_test_etypes(self): return unprotected_entities(self.schema, strict=True) - def iter_automatic_rsets(self): + def iter_automatic_rsets(self, limit=10): """generates basic resultsets for each entity type""" etypes = self.to_test_etypes() for etype in etypes: - yield self.execute('Any X WHERE X is %s' % etype) + yield self.execute('Any X LIMIT %s WHERE X is %s' % (limit, etype)) etype1 = etypes.pop() etype2 = etypes.pop() @@ -347,14 +347,14 @@ ## one each def test_one_each_config(self): self.auto_populate(1) - for rset in self.iter_automatic_rsets(): + for rset in self.iter_automatic_rsets(limit=1): for testargs in self._test_everything_for(rset): yield testargs ## ten each def test_ten_each_config(self): self.auto_populate(10) - for rset in self.iter_automatic_rsets(): + for rset in self.iter_automatic_rsets(limit=10): for testargs in self._test_everything_for(rset): yield testargs diff -r 09ba3cb2a440 -r 92a0601b2523 ext/rest.py --- a/ext/rest.py Wed Mar 04 17:09:10 2009 +0100 +++ b/ext/rest.py Wed Mar 04 17:12:28 2009 +0100 @@ -1,6 +1,16 @@ """rest publishing functions -contains some functions and setup of docutils for cubicweb +contains some functions and setup of docutils for cubicweb. Provides the +following ReST directives: + +* `eid`, create link to entity in the repository by their eid + +* `card`, create link to card entity in the repository by their wikiid + (proposing to create it when the refered card doesn't exist yet) + +* `winclude`, reference to a web documentation file (in wdoc/ directories) + +* `sourcecode` (if pygments is installed), source code colorization :organization: Logilab :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. @@ -156,6 +166,36 @@ 'encoding': directives.encoding} directives.register_directive('winclude', winclude_directive) +try: + from pygments import highlight + from pygments.lexers import get_lexer_by_name, LEXERS + from pygments.formatters import HtmlFormatter +except ImportError: + pass +else: + _PYGMENTS_FORMATTER = HtmlFormatter() + + def pygments_directive(name, arguments, options, content, lineno, + content_offset, block_text, state, state_machine): + try: + lexer = get_lexer_by_name(arguments[0]) + except ValueError: + import traceback + traceback.print_exc() + print sorted(aliases for module_name, name, aliases, _, _ in LEXERS.itervalues()) + # no lexer found + lexer = get_lexer_by_name('text') + print 'LEXER', lexer + parsed = highlight(u'\n'.join(content), lexer, _PYGMENTS_FORMATTER) + context = state.document.settings.context + context.req.add_css('pygments.css') + return [nodes.raw('', parsed, format='html')] + + pygments_directive.arguments = (1, 0, 1) + pygments_directive.content = 1 + directives.register_directive('sourcecode', pygments_directive) + + class CubicWebReSTParser(Parser): """The (customized) reStructuredText parser.""" diff -r 09ba3cb2a440 -r 92a0601b2523 i18n/es.po --- a/i18n/es.po Wed Mar 04 17:09:10 2009 +0100 +++ b/i18n/es.po Wed Mar 04 17:12:28 2009 +0100 @@ -76,8 +76,8 @@ msgstr "%d semanas" #, python-format -msgid "%d years" -msgstr "%d años" +msgid "%d years" +msgstr "%d años" #, python-format msgid "%d days" @@ -104,10 +104,6 @@ msgstr "%d semanas" #, python-format -msgid "%d years" -msgstr "%d años" - -#, python-format msgid "%s error report" msgstr "%s reporte de errores" diff -r 09ba3cb2a440 -r 92a0601b2523 interfaces.py --- a/interfaces.py Wed Mar 04 17:09:10 2009 +0100 +++ b/interfaces.py Wed Mar 04 17:12:28 2009 +0100 @@ -238,7 +238,20 @@ def rss_feed_url(self): """return an url which layout sub-entities item """ -class ISIOC(Interface): - """interface for entities with sioc views""" +class ISiocItem(Interface): + """interface for entities (which are item + in sioc specification) with sioc views""" - + def isioc_content(self): + """return content entity""" + + def isioc_container(self): + """return container entity""" + +class ISiocContainer(Interface): + """interface for entities (which are container + in sioc specification) with sioc views""" + + def isioc_type(self): + """return container type (forum, weblog, mailinglist)""" + diff -r 09ba3cb2a440 -r 92a0601b2523 web/data/cubicweb.css --- a/web/data/cubicweb.css Wed Mar 04 17:09:10 2009 +0100 +++ b/web/data/cubicweb.css Wed Mar 04 17:12:28 2009 +0100 @@ -586,9 +586,13 @@ margin-bottom: 0px; } +div.primaryRight{ + float:right; + + } + div.sideRelated { margin-right: 1em; - float: right; padding: 12px 0px 12px 12px; min-width: 21em; max-width: 50em; diff -r 09ba3cb2a440 -r 92a0601b2523 web/data/cubicweb.edition.js --- a/web/data/cubicweb.edition.js Wed Mar 04 17:09:10 2009 +0100 +++ b/web/data/cubicweb.edition.js Wed Mar 04 17:12:28 2009 +0100 @@ -264,7 +264,8 @@ var d = async_rawremote_exec('inline_creation_form', peid, ptype, ttype, rtype, role); d.addCallback(function (response) { var linknode = getNode('add' + rtype + ':' + peid + 'link'); - var form = jQuery(getDomFromResponse(response)); + var dom = getDomFromResponse(response); + var form = jQuery(dom); form.css('display', 'none'); form.insertBefore(linknode.parentNode).slideDown('fast'); // setStyle(form, {display: 'none'}); @@ -273,6 +274,7 @@ // slideDown(form, {'duration':0.6}); reorderTabindex(); form.trigger('inlinedform-added'); + postAjaxLoad(dom); // MochiKit.Signal.signal(CubicWeb, 'inlinedform-added', form); }); d.addErrback(function (xxx) { diff -r 09ba3cb2a440 -r 92a0601b2523 web/views/baseviews.py --- a/web/views/baseviews.py Wed Mar 04 17:09:10 2009 +0100 +++ b/web/views/baseviews.py Wed Mar 04 17:12:28 2009 +0100 @@ -139,22 +139,19 @@ self.render_entity_metadata(entity) # entity's attributes and relations, excluding meta data # if the entity isn't meta itself - self.w(u'
')
+ self.w(u' ')
self.w(u' ')
self.render_entity_attributes(entity, siderelations)
self.w(u' ')
self.content_navigation_components('navcontenttop')
if self.main_related_section:
self.render_entity_relations(entity, siderelations)
- self.w(u' | ')
+ self.w(u'')
# side boxes
- self.w(u'')
+ self.w(u' ')
self.render_side_related(entity, siderelations)
- self.w(u' | ')
- self.w(u'
') self.w(u' | ') - self.w(u'
') self.w(u' | ') - self.w(u'
') try: box.dispatch(w=self.w, row=self.row) except NotImplementedError: # much probably a context insensitive box, which only implements # .call() and not cell_call() - box.dispatch(w=self.w) - self.w(u' |