Skip to content

Commit

Permalink
fix #304 (don't output info into HTML) and suppress "Description:" if…
Browse files Browse the repository at this point in the history
… info not present
  • Loading branch information
bansp committed Jun 26, 2024
1 parent 029a55f commit 54affe5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions SIS/clarin/modules/centre.xql
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,17 @@ declare function cm:get-centre-info($id, $lang) {
cm:get-default-info($id)

return
cm:parseFormatRef($info)
cm:parseFormatRef($info, $id)
};

declare function cm:parseFormatRef($info) {
declare function cm:parseFormatRef($info,$id) {
if ($info)
then
(
element info {
element span {
$info/@*,
attribute {"id"} {concat("desctext",$id)},
attribute {"class"} {"desctext"},
for $node in $info/node()
return
if ($node/self::p)
Expand Down
4 changes: 2 additions & 2 deletions SIS/clarin/views/view-centre.xq
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ else
else ()
}
{
if ($centre-info)
if ($centre-info/*)
then
<div>
<span class="heading">Description: </span>
<span id="desctext{$id}" class="desctext">{$centre-info}</span>
{$centre-info}
</div>
else
()
Expand Down

0 comments on commit 54affe5

Please sign in to comment.