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 96cda0b4 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

feat: remove unused module

parent 5e632069
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
};
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