Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
5aba6d0d
Commit
5aba6d0d
authored
Feb 19, 2021
by
Mathias Goebel
🎠
Browse files
Merge branch 'develop' into 'master'
Develop See merge request
!70
parents
2b5f7471
a562e742
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
build.properties
View file @
5aba6d0d
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
...
...
modules/app.xql
deleted
100644 → 0
View file @
2b5f7471
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
};
modules/view.xql
View file @
5aba6d0d
...
...
@@ -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";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment