Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing "error page" if no edition exists (prevents failing) #429

Merged
merged 8 commits into from
Oct 10, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 53 additions & 6 deletions add/index.xql
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ declare option output:omit-xml-declaration "yes";
(: VARIABLE DECLARATIONS =================================================== :)

declare variable $edition := request:get-parameter("edition", "");
declare variable $editionUri := edition:findEdition($edition);
declare variable $preferences := doc(edition:getPreferencesURI($editionUri));
declare variable $editionUri := if($edition) then edition:findEdition($edition) else();
riedde marked this conversation as resolved.
Show resolved Hide resolved
declare variable $preferences := if($editionUri) then(doc(edition:getPreferencesURI($editionUri))) else();

let $eoEditionFiles := collection('/db/apps')//edirom:edition[@xml:id]
let $eoEditionFilesCount := count($eoEditionFiles)
Expand All @@ -46,10 +46,54 @@ let $comment := comment{"
"
}

let $eoEditionFileNone := <html xmlns="http://www.w3.org/1999/xhtml">
riedde marked this conversation as resolved.
Show resolved Hide resolved
<head>
<meta charset="UTF-8"/>
<title>Edirom-Online</title>
<!-- **CSS** -->
<link rel="stylesheet" type="text/css" href="resources/css/todo.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/annotation-style.css"/>

<!-- **CSS** -->
<link rel="stylesheet" href="resources/css/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/tipped/tipped.css"/>

<!-- **Raphael JS** -->
<script type="text/javascript" src="resources/js/raphael-min.js"/>

<!-- **Leaflet** -->
<link rel="stylesheet" href="resources/leaflet-0.7.3/leaflet.css"/>
<link rel="stylesheet" href="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.css"/>
<script type="text/javascript" src="resources/leaflet-0.7.3/leaflet.js"/>
<script type="text/javascript" src="resources/facsimileLayer/FacsimileLayer.js"/>
<script src="resources/Leaflet.tooltip-master/dist/leaflet.tooltip.js"/>

<!-- **Open Sea Dragon** -->
<script type="text/javascript" src="resources/js/openseadragon.min.js"/>

<!-- **JQUERY** -->
<script type="text/javascript" src="resources/jquery/jquery-2.1.3.js" charset="utf-8"/>

<!-- **ACE** -->
<script src="resources/js/ace/ace.js" type="text/javascript" charset="utf-8"/>
<script src="resources/js/ace/mode-xml.js" type="text/javascript" charset="utf-8"/>

<link rel="stylesheet" href="resources/EdiromOnline-all.css"/>

</head>
<body class="x-body">
<div class="container" style="margin: 8.75%;">
<img src="resources/pix/ViFE-logo-small-144x144-trans.png"/>
<h1 style="margin-top:5px;">Edirom Online</h1>
<h3 class="navigatorCategoryTitle">Es wurden keine Editionen gefunden.</h3>
</div>
</body>
</html>

let $eoEditionFileSingle := <html>
<head>
<meta charset="UTF-8"/>
<title>{edition:getName($editionUri)} – Edirom-Online</title>
<title>{if($editionUri) then(edition:getName($editionUri)) else()} – Edirom-Online</title>
<!-- **CSS** -->
<link rel="stylesheet" type="text/css" href="resources/css/todo.css"/>
<link rel="stylesheet" type="text/css" href="resources/css/annotation-style.css"/>
Expand Down Expand Up @@ -163,6 +207,9 @@ let $eoEditionFileMulti := <html>
</html>

return
if($eoEditionFilesCount > 1 and not($edition))
then($comment, $eoEditionFileMulti)
else($comment, $eoEditionFileSingle)
if(not($edition)) then
$eoEditionFileNone
else if($eoEditionFilesCount > 1 and not($edition)) then
($comment, $eoEditionFileMulti)
else
($comment, $eoEditionFileSingle)