Commit 7c652cc5 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

repair tmpl-nav failure on deployed

parent 3997e666
......@@ -13,11 +13,11 @@ declare
%templates:wrap
function nav:navitems($node as node(), $model as map(*)) as map(*) {
let $confLocation := config:module-get($nav:module-key, "location")
let $confLocation := "/db/sade-projects/textgrid/navigation.xml"
let $log := console:log( $confLocation )
let $navitems :=
if($confLocation != "") then
doc( config:get('project-dir') || "/" || $confLocation)//navigation/*
doc( $confLocation)//navigation/*
else
$model("config")//module[string(@key)=$nav:module-key]//navigation/*
return map { "navitems" := $navitems }
......@@ -91,13 +91,13 @@ return
<textarea class="form-control" rows="10" name="new" />
<button type="submit" class="btn btn-primary">Save</button>
</form>
<pre>{serialize(doc('/sade-projects/' || config:get("project-id") || '/navigation.xml'))}</pre>
<pre>{serialize(doc('/db/sade-projects/' || config:get("project-id") || '/navigation.xml'))}</pre>
</div>
else
let $item := xmldb:login('/sade-projects/' || config:get("project-id"), config:get("sade.user"), config:get("sade.password")),
$egal := xmldb:store('/sade-projects/' || config:get("project-id"), 'navigation.xml', $new, "text/xml")
let $item := xmldb:login('/db/sade-projects/' || config:get("project-id"), config:get("sade.user"), config:get("sade.password")),
$egal := xmldb:store('/db/sade-projects/' || config:get("project-id"), 'navigation.xml', $new, "text/xml")
return
<div><pre>{serialize(doc('/sade-projects/' || config:get("project-id") || '/navigation.xml'))}</pre></div>
<div><pre>{serialize(doc('/db/sade-projects/' || config:get("project-id") || '/navigation.xml'))}</pre></div>
};
declare function nav:textgrid($node as node(), $model as map(*)) {
......
Supports Markdown
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