Due to maintenance reasons, gitlab.gwdg.de will not be available on Saturday 2021-07-24 from 10:30 to approximately 11:30 CEST.

Commit 5aba6d0d authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !70
parents 2b5f7471 a562e742
project.name=http://textgrid.de/ns/SADE-fontane-develop
project.version=5.2.0
project.version=5.2.1
project.title=[Fontane] SADE
project.abbrev=SADE-fontane-develop
project.processorversion=5.2.0
......
xquery version "3.1";
module namespace app="http://textgrid.de/ns/SADE/templates";
import module namespace templates="http://exist-db.org/xquery/templates" ;
import module namespace config="http://textgrid.de/ns/SADE/config" at "config/config.xqm";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
(:~
: returns an html snippet with the current project title from conf.xml, can be
: can be a clickable title within a navbar that triggers a sidebar
:
: @param $node the HTML node with the attribute which triggered this call
: @param $model a map containing arbitrary data - used to pass information between template calls
:)
declare function app:project-id($node as node(), $model as map(*)) {
element {$node/name()} { $node/@*[not(local-name() => starts-with("data-template")) ],
<div data-target=".sidebar-collapse" data-toggle="collapse" id="sidebar-toggle">
<span class="glyphicon glyphicon-list"> </span> {' ' || config:get('project-title')}
</div>}
};
(:~
: Collects information from <a href="https://www.uni-goettingen.de/de/publikationen/303721.html">
: Fontane-Arbeitstelle website</a>.
:
: @param $node the HTML node with the attribute which triggered this call
: @param $model a map containing arbitrary data - used to pass information between template calls
:)
declare function app:publications($node as node(), $model as map(*)) {
let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/publikationen/303721.html"
timeout="3"/>
let $response :=
try {
hc:send-request($request)[2]
} catch * {
(: inject information that we cannot read from remote. :)
<node><li class="content">Host "uni-goettingen.de" timed out after 3s.</li></node>
}
return
($response//*:li[@class="content"])[position() lt 5]
};
(:~
: Collects information from <a href="https://www.uni-goettingen.de/de/publikationen/303721.html">
: Fontane-Arbeitstelle website</a>.
:
: @param $node the HTML node with the attribute which triggered this call
: @param $model a map containing arbitrary data - used to pass information between template calls
:)
declare function app:presentations($node as node(), $model as map(*)) {
let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/vortr%C3%A4ge-und-pr%C3%A4sentationen/303717.html" timeout="3"/>
let $response :=
try {
hc:send-request($request)[2]
} catch * {
(: inject information that we cannot read from remote. :)
<node><li class="content">Host "uni-goettingen.de" timed out after 3s.</li></node>
}
for $item in ($response//*:li[@class="content"])[position() lt 5]
return
element li { for $i in $item/node() return local:nodeTest($i) }
};
declare function local:nodeTest($node){
typeswitch ($node)
case element(a) return element a {
attribute href {if(starts-with($node/@href, '/de/document')) then 'https://www.uni-goettingen.de'||$node/@href else $node/@href},
attribute target {'_blank'},
if (starts-with($node/text(), 'Power Point' )) then substring-after($node/text(), 'Power Point') else $node/text()
}
default return $node
};
......@@ -16,12 +16,6 @@ import module namespace nav="http://sade/tmpl-nav" at "tmpl-nav/tmpl-nav.xqm";
import module namespace templates="http://exist-db.org/xquery/templates" ;
import module namespace wiki="http://textgrid.de/ns/SADE/wiki" at "wiki/wiki.xqm";
(:
: The following modules provide functions which will be called by the
: templating.
:)
import module namespace app="http://textgrid.de/ns/SADE/templates" at "app.xql";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "html5";
......
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