--- a/server/serverctl.py Fri Aug 14 15:35:09 2009 +0200
+++ b/server/serverctl.py Fri Aug 14 15:35:41 2009 +0200
@@ -529,21 +529,20 @@
status = instance_status(config, eversion, dbversions)
# * database version > installed software
if status == 'needsoftupgrade':
- print "database is using some earlier version than installed software!"
- print "please upgrade your software and then upgrade the instance"
- print "using command 'cubicweb-ctl upgrade %s'" % config.appid
+ print "** The database of %s is more recent than the installed software!" % config.appid
+ print "** Upgrade your software, then migrate the database by running the command"
+ print "** 'cubicweb-ctl upgrade %s'" % config.appid
return
# * database version < installed software, an upgrade will be necessary
# anyway, just rewrite vc.conf and warn user he has to upgrade
- if status == 'needapplupgrade':
- print "database is using some older version than installed software."
- print "You'll have to upgrade the instance using command"
- print "'cubicweb-ctl upgrade %s'" % config.appid
+ elif status == 'needapplupgrade':
+ print "** The database of %s is older than the installed software." % config.appid
+ print "** Migrate the database by running the command"
+ print "** 'cubicweb-ctl upgrade %s'" % config.appid
return
# * database version = installed software, database version = instance fs version
# ok!
-
def instance_status(config, cubicwebapplversion, vcconf):
cubicwebversion = config.cubicweb_version()
if cubicwebapplversion > cubicwebversion:
--- a/web/data/cubicweb.edition.js Fri Aug 14 15:35:09 2009 +0200
+++ b/web/data/cubicweb.edition.js Fri Aug 14 15:35:41 2009 +0200
@@ -248,6 +248,7 @@
d.addCallback(function (response) {
var linknode = getNode('add' + rtype + ':' + peid + 'link');
var dom = getDomFromResponse(response);
+ preprocessAjaxLoad(null, dom);
var form = jQuery(dom);
form.css('display', 'none');
form.insertBefore(linknode.parentNode).slideDown('fast');
--- a/web/views/basecontrollers.py Fri Aug 14 15:35:09 2009 +0200
+++ b/web/views/basecontrollers.py Fri Aug 14 15:35:41 2009 +0200
@@ -298,6 +298,31 @@
return None
return None
+ def _call_view(self, view, **kwargs):
+ req = self.req
+ divid = req.form.get('divid', 'pageContent')
+ # we need to call pagination before with the stream set
+ stream = view.set_stream()
+ if req.form.get('paginate'):
+ if divid == 'pageContent':
+ # mimick main template behaviour
+ stream.write(u'<div id="pageContent">')
+ vtitle = self.req.form.get('vtitle')
+ if vtitle:
+ stream.write(u'<h1 class="vtitle">%s</h1>\n' % vtitle)
+ view.pagination(req, rset, view.w, not view.need_navigation)
+ if divid == 'pageContent':
+ stream.write(u'<div id="contentmain">')
+ view.render(**kwargs)
+ extresources = req.html_headers.getvalue(skiphead=True)
+ if extresources:
+ stream.write(u'<div class="ajaxHtmlHead">\n') # XXX use a widget ?
+ stream.write(extresources)
+ stream.write(u'</div>\n')
+ if req.form.get('paginate') and divid == 'pageContent':
+ stream.write(u'</div></div>')
+ return stream.getvalue()
+
@xhtmlize
def js_view(self):
# XXX try to use the page-content template
@@ -313,28 +338,7 @@
except NoSelectableObject:
vid = req.form.get('fallbackvid', 'noresult')
view = self.vreg['views'].select(vid, req, rset=rset)
- divid = req.form.get('divid', 'pageContent')
- # we need to call pagination before with the stream set
- stream = view.set_stream()
- if req.form.get('paginate'):
- if divid == 'pageContent':
- # mimick main template behaviour
- stream.write(u'<div id="pageContent">')
- vtitle = self.req.form.get('vtitle')
- if vtitle:
- stream.write(u'<h1 class="vtitle">%s</h1>\n' % vtitle)
- view.pagination(req, rset, view.w, not view.need_navigation)
- if divid == 'pageContent':
- stream.write(u'<div id="contentmain">')
- view.render()
- extresources = req.html_headers.getvalue(skiphead=True)
- if extresources:
- stream.write(u'<div class="ajaxHtmlHead">\n') # XXX use a widget ?
- stream.write(extresources)
- stream.write(u'</div>\n')
- if req.form.get('paginate') and divid == 'pageContent':
- stream.write(u'</div></div>')
- return stream.getvalue()
+ return self._call_view(view)
@xhtmlize
def js_prop_widget(self, propkey, varname, tabindex=None):
@@ -370,7 +374,8 @@
view = self.vreg['views'].select('inline-creation', self.req,
etype=ttype, peid=peid, rtype=rtype,
role=role)
- return view.render(etype=ttype, peid=peid, rtype=rtype, role=role)
+ return self._call_view(view, etype=ttype, peid=peid,
+ rtype=rtype, role=role)
@jsonize
def js_validate_form(self, action, names, values):