Commit b17820cf authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

merge

--HG--
branch : stable
......@@ -529,21 +529,20 @@ def _local_restore(appid, backupfile, drop, systemonly=True):
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:
......
......@@ -248,6 +248,7 @@ function addInlineCreationForm(peid, ttype, rtype, role) {
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');
......
......@@ -298,21 +298,8 @@ class JSonController(Controller):
return None
return None
@xhtmlize
def js_view(self):
# XXX try to use the page-content template
def _call_view(self, view, **kwargs):
req = self.req
rql = req.form.get('rql')
if rql:
rset = self._exec(rql)
else:
rset = None
vid = req.form.get('vid') or vid_from_rset(req, rset, self.schema)
try:
view = self.vreg['views'].select(vid, req, rset=rset)
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()
......@@ -326,7 +313,7 @@ class JSonController(Controller):
view.pagination(req, rset, view.w, not view.need_navigation)
if divid == 'pageContent':
stream.write(u'<div id="contentmain">')
view.render()
view.render(**kwargs)
extresources = req.html_headers.getvalue(skiphead=True)
if extresources:
stream.write(u'<div class="ajaxHtmlHead">\n') # XXX use a widget ?
......@@ -336,6 +323,23 @@ class JSonController(Controller):
stream.write(u'</div></div>')
return stream.getvalue()
@xhtmlize
def js_view(self):
# XXX try to use the page-content template
req = self.req
rql = req.form.get('rql')
if rql:
rset = self._exec(rql)
else:
rset = None
vid = req.form.get('vid') or vid_from_rset(req, rset, self.schema)
try:
view = self.vreg['views'].select(vid, req, rset=rset)
except NoSelectableObject:
vid = req.form.get('fallbackvid', 'noresult')
view = self.vreg['views'].select(vid, req, rset=rset)
return self._call_view(view)
@xhtmlize
def js_prop_widget(self, propkey, varname, tabindex=None):
"""specific method for CWProperty handling"""
......@@ -370,7 +374,8 @@ class JSonController(Controller):
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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment