Commit 0f6179bc authored by barth23's avatar barth23
Browse files

Merge commit '3ae19ed1' into register

* commit '3ae19ed1':
  add restriction and error msg to publish functionality
  bugfix for register entry geo location
  add boostrap map file
  improve reset function for register entries
  add functionality for register entries if artist name is unknown
  add IDNO register entry functionality for register works
  Update persons.xml with content from export 29.06.2020
  add external js files to be independent
  bugfix for register entry modals
  add geogNames to register occurences
  add translation for register categories
  beautify register.js
  add sorting for register occurences
  add register occurences functionality to places and works
  add occurrences in text functionality for register persons
  add pills layout to overview and guidelines
  bugfix for transform
  add missing images of word clouds
  add download functionality to overview page of edtions
  add download functionality to edition navbar
parents 6ce9c6c1 3ae19ed1
......@@ -341,6 +341,11 @@
<lang key="en">pages</lang>
<lang key="fr">Pages</lang>
</word>
<word key="page">
<lang key="de">Seite</lang>
<lang key="en">pages</lang>
<lang key="fr">Page</lang>
</word>
<word key="legendDates">
<lang key="de">Datum</lang>
<lang key="en">dates</lang>
......@@ -442,7 +447,7 @@
<lang key="fr">dans l'index des œuvres</lang>
</word>
<word key="publicRegisterLink">
<lang key="de">öffentliches Verzeichnis: </lang>
<lang key="de">Öffentliches Verzeichnis: </lang>
<lang key="en">Public Register Link: </lang>
<lang key="fr">Référentiel: </lang>
</word>
......@@ -556,4 +561,9 @@
<lang key="en">EditorialNote</lang>
<lang key="fr">Note éditoriale</lang>
</word>
<word key="noEntriesRegister">
<lang key="de">keine Treffer</lang>
<lang key="en">no entries found</lang>
<lang key="fr">aucun résultat</lang>
</word>
</translation>
......@@ -128,5 +128,153 @@ declare
%output:media-type("application/json")
%output:method("json")
function registerapi:get-places-in-works($id as xs:string*) as element(response) {
<resp>{doc("/db/apps/sade-architrave/templates/register/works.xml")//tei:text//tei:placeName[@ref='textgrid:'||$id]}</resp>
};
\ No newline at end of file
let $doc := doc("/db/apps/sade-architrave/templates/register/works.xml")
let $places := $doc//tei:text//tei:placeName[@ref='textgrid:'||$id]
return <resp>
{for $node in $places return
element tei:placeName {
attribute ref {$node/@ref},
attribute ancestor {$node/[ancestor::tei:item/@xml:id]},
attribute ancestorNameCurrentDE {$node/[ancestor::tei:item/tei:name[@xml:lang='de']]},
attribute ancestorNameCurrentFRA {$node/[ancestor::tei:item/tei:name[@xml:lang='fra']]}
}
}
</resp>
};
(:~
: query to find occurences of places in persons by textgridID
: :)
declare
%rest:GET
%rest:path("/get-places-in-persons/{$id}")
%rest:produces("application/json")
%output:media-type("application/json")
%output:method("json")
function registerapi:get-places-in-persons($id as xs:string*) as element(response) {
let $doc := doc("/db/apps/sade-architrave/templates/register/persons.xml")
let $places := $doc//tei:text//tei:placeName[@ref='textgrid:'||$id]
return <resp>
{for $node in $places return
element tei:placeName {
attribute ref {$node/@ref},
attribute ancestor {$node/[ancestor::tei:item/@xml:id]},
attribute ancestorNameCurrentDE {$node/[ancestor::tei:item/tei:name[@xml:lang='de']]},
attribute ancestorNameCurrentFRA {$node/[ancestor::tei:item/tei:name[@xml:lang='fra']]}
}
}
</resp>
};
(:~
: query to find occurences of places in works by textgridID
: :)
declare
%rest:GET
%rest:path("/get-persons-in-text/{$text}/{$id}")
%rest:produces("application/json")
%output:media-type("application/json")
%output:method("json")
function registerapi:get-persons-in-text($text as xs:string, $id as xs:string) as element(response) {
let $doc :=
try {doc("/db/apps/sade-architrave/textgrid/data/" || $text || ".xml")}
catch * {""}
let $personsXML := doc("/db/apps/sade-architrave/templates/register/persons.xml")
let $persons := $doc//tei:persName[@ref='psn:textgrid:'||$id]
return <resp>
{for $node in $persons return
element tei:persName {
attribute ref {$node/@ref},
attribute refNameDE {
$personsXML//tei:person[@xml:id='textgrid:'||$id]/tei:persName[@xml:lang='de']
},
attribute refNameFR {
$personsXML//tei:person[@xml:id='textgrid:'||$id]/tei:persName[@xml:lang='fra']
},
attribute editionID {$text},
attribute editionPage {$node/[preceding::tei:pb[1]/@n]}
}
}
</resp>
};
(:~
: query to find occurences of places in works by textgridID
: :)
declare
%rest:GET
%rest:path("/get-places-in-text/{$text}/{$id}")
%rest:produces("application/json")
%output:media-type("application/json")
%output:method("json")
function registerapi:get-places-in-text($text as xs:string, $id as xs:string) as element(response) {
let $doc :=
try {doc("/db/apps/sade-architrave/textgrid/data/" || $text || ".xml")}
catch * {""}
let $placesXML := doc("/db/apps/sade-architrave/templates/register/places.xml")
let $places := $doc//tei:placeName[@ref='plc:textgrid:'||$id]
let $geogNames := $doc//tei:geogName[@ref='plc:textgrid:'||$id]
return <resp>
{for $node in $places return
element tei:placeName {
attribute ref {$node/@ref},
attribute refNameDE {
$placesXML//tei:place[@xml:id='textgrid:'||$id]/tei:placeName[@xml:lang='de']
},
attribute refNameFR {
$placesXML//tei:place[@xml:id='textgrid:'||$id]/tei:placeName[@xml:lang='fra']
},
attribute editionID {$text},
attribute editionPage {$node/[preceding::tei:pb[1]/@n]}
}
}
{for $node in $geogNames return
element tei:placeName {
attribute ref {$node/@ref},
attribute refNameDE {
$placesXML//tei:place[@xml:id='textgrid:'||$id]/tei:placeName[@xml:lang='de']
},
attribute refNameFR {
$placesXML//tei:place[@xml:id='textgrid:'||$id]/tei:placeName[@xml:lang='fra']
},
attribute editionID {$text},
attribute editionPage {$node/[preceding::tei:pb[1]/@n]}
}
}
</resp>
};
(:~
: query to find occurences of places in works by textgridID
: :)
declare
%rest:GET
%rest:path("/get-works-in-text/{$text}/{$id}")
%rest:produces("application/json")
%output:media-type("application/json")
%output:method("json")
function registerapi:get-works-in-text($text as xs:string, $id as xs:string) as element(response) {
let $doc :=
try {doc("/db/apps/sade-architrave/textgrid/data/" || $text || ".xml")}
catch * {""}
let $worksXML := doc("/db/apps/sade-architrave/templates/register/works.xml")
let $works := $doc//tei:rs[@ref='wrk:textgrid:'||$id]
return <resp>
{for $node in $works return
element tei:item {
attribute ref {$node/@ref},
attribute refNameDE {
$worksXML//tei:item[@xml:id='textgrid:'||$id]/tei:name[@xml:lang='de']
},
attribute refNameFR {
$worksXML//tei:item[@xml:id='textgrid:'||$id]/tei:name[@xml:lang='fra']
},
attribute editionID {$text},
attribute editionPage {$node/[preceding::tei:pb[1]/@n]}
}
}
</resp>
};
......@@ -150,6 +150,9 @@ declare function transformXML:importFromTGRep($tgURI as xs:string, $filenameOutp
let $pbNumbers as xs:string := local:countPB($counterPages)
let $fwNumbers as xs:string := local:countFW($counterPages,$input)
let $tgURIshort := substring-before($tgURI,'.')
let $storeInDB := xmldb:store('/db/apps/sade-architrave/textgrid/data/', $tgURIshort || '.xml' , $input )
for $i in 1 to $counterPages
return
if ($i < $counterPages) then (
......
......@@ -17,9 +17,11 @@ let $uri as xs:string := request:get-parameter("uri", ""),
return
if( $uri = "" ) then
error(QName("https://sade.textgrid.de/ns/error", "PUBLISH01"), "no URI provided")
else
else if (contains($uri, '34zmq') or contains($uri, '3r3nn') or contains($uri, '34zs7') or contains($uri, '3ptwg') or contains($uri, '3qr4f') or contains($uri, '34znb') or contains($uri, '3czfj') or contains($uri, '3q4rq') or contains($uri, '3r0fv') or contains($uri, '350mg') or contains($uri, '3c0m2') or contains($uri, '3czn9') ) then
<div>{
for $i in tgconnect:publish($uri,$sid,$target,$user,$password,$project,$surface,$login)
return
<ok>{ $uri } » { $i }</ok>
}</div>
else
error(QName("https://sade.textgrid.de/ns/error", "PUBLISH09"), "Please publish only the xml files of the 12 editions/translations.")
......@@ -202,11 +202,11 @@
</div>
</a>
<div class="dropdown-menu keep-open-on-click">
<a class="dropdown-item arch-ul" download="Harrach_Edition_TEIfile.xml" href="https://textgridlab.org/1.0/tgcrud-public/rest/textgrid:34zmq.2/data">
<a id="downloadLinkDE" class="dropdown-item arch-ul" download="Harrach_Edition_TEIfile.xml" href="https://textgridlab.org/1.0/tgcrud-public/rest/textgrid:34zmq.2/data">
<i class="fas fa-code"/>
<span data-template="lang:translate" data-template-content="fullTextDE"/>
</a>
<a class="dropdown-item arch-ul" href="#">
<a id="downloadLinkFR" class="dropdown-item arch-ul" href="#" download="Harrach_Edition_TEIfile.xml">
<i class="fas fa-code"/>
<span data-template="lang:translate" data-template-content="fullTextFR"/>
</a>
......
<div data-template="templates:surround" data-template-with="templates/page_index.html" data-template-at="content-container">
<style>
.nav-pills a:hover {
background-color: #eeeeee;
}
</style>
<div class="arch-content p-content" id="content">
<h1 data-template="lang:translate" data-template-content="Guidelines" />
<h1 data-template="lang:translate" data-template-content="Guidelines"/>
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<div class="nav nav-pills" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-transcription-tab" data-toggle="tab" href="#nav-transcription" role="tab" aria-controls="nav-transcription" aria-selected="true">
<span data-template="lang:translate" data-template-content="Transcription Guidelines"/>
</a>
......@@ -17,15 +22,15 @@
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-transcription" role="tabpanel" aria-labelledby="nav-transcription-tab">
<br/>
<div data-template="confluence:confluence" data-template-id="58499672" />
<div data-template="confluence:confluence" data-template-id="58499672"/>
</div>
<div class="tab-pane fade" id="nav-translation" role="tabpanel" aria-labelledby="nav-translation-tab">
<br/>
<div data-template="confluence:confluence" data-template-id="58499674" />
<div data-template="confluence:confluence" data-template-id="58499674"/>
</div>
<div class="tab-pane fade" id="nav-encoding" role="tabpanel" aria-labelledby="nav-encoding-tab">
<br/>
<div data-template="confluence:confluence" data-template-id="64974540" />
<div data-template="confluence:confluence" data-template-id="64974540"/>
</div>
</div>
......
......@@ -22,7 +22,7 @@
<div class="arch-logo">
<img src="templates/images/logo.svg" class="dd-lg-inline"/>
</div>
</a>
<h4 class="d-none d-sm-block" style="line-height:1em !important;margin:0px;">
......@@ -31,7 +31,7 @@
<h4 class="d-block d-sm-none" style="line-height:1em !important;margin:0px;">
<span class="badge badge-danger">DEV</span>
</h4>
<div class="arch-nav-toggle ml-auto">
<button class="navbar-toggler arch-bars" type="button">
......@@ -123,12 +123,20 @@
</div>
</footer>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"/>
<script src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js" integrity="sha384-wF7Jc4ZlWVxe/L8Ji3hOIBeTgo/HwFuaeEfjGmS3EXAG7Y+7Kjjr91gJpJtr+PAT" crossorigin="anonymous">
</script>
<!--<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"/>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"/>
<script src="https://use.fontawesome.com/releases/v5.8.2/js/all.js" integrity="sha384-DJ25uNYET2XCl5ZF++U8eNxPWqcKohUUBUpKGlNLMchM7q4Wjg2CUpjHLaL8yYPH" crossorigin="anonymous"/>
<script src="https://use.fontawesome.com/releases/v5.8.2/js/all.js" integrity="sha384-DJ25uNYET2XCl5ZF++U8eNxPWqcKohUUBUpKGlNLMchM7q4Wjg2CUpjHLaL8yYPH" crossorigin="anonymous"/>-->
<script src="templates/js/jquery-3.3.1.min.js"/>
<script src="templates/js/popper.min.js"/>
<script src="templates/js/bootstrap.min.js"/>
<script src="templates/js/font-awesome-all.js"/>
<script type="text/javascript" src="templates/js/scripts.js"/>
<script>
Sentry.init({ dsn: 'https://4b9fd5a6c9414f24a1bf773fb1af9d4e@dev2.discuss-data.net/5' });
</script>
</body>
</html>
\ No newline at end of file
</html>
This diff is collapsed.
......@@ -582,7 +582,7 @@ function loadBrowserHistory() {
updatePage();
}
/* A click on FA-icons and -links displays a modal
/* A click on FA-icons and -links displays a modal
function openRegister(textGridURI) {
$("#myModalLabel").text(textGridURI);
$("#myModal").modal("show");
......@@ -700,7 +700,7 @@ function setMainTitle() {
} catch (e) {
console.log('error: could not check for lang');
}
if (mainTitle == "") {
mainTitle = "error: no main title"
};
......@@ -730,25 +730,25 @@ function setCitation() {
} catch (e) {
console.log('error: no edition-dateModified');
}
try {
citeHandle = document.querySelector("#tei-meta-pid").innerText;
} catch (e) {
console.log('error: no edition-PID');
}
try {
citeTitle = document.querySelector("#tei-title-main-de").innerText.replace(/\n/, "");
} catch (e) {
console.log('error: no edition-title');
}
if (lang == 'de') {
citeTEMP = ':';
document.querySelector("#infoCiteTitle").style.fontStyle = 'inherit';
}
else {
citeTEMP = ' :';
citeTEMP = ' :';
document.querySelector("#infoCiteTitle").style.fontStyle = 'italic';
//different title for french translations
try {
......@@ -757,10 +757,33 @@ function setCitation() {
console.log('error: no edition-title');
}
}
citefinal = citePre + citeTEMP + citeTitle + ', ' + citeYear + '. ' + citeHandle + citePost;
document.querySelector("#infoCite").innerText = citefinal;
document.querySelector("#infoCitePre").innerText = citePre + citeTEMP;
document.querySelector("#infoCiteTitle").innerText = citeTitle + ',';
document.querySelector("#infoCitePost").innerText = citeYear + '. ' + citeHandle + citePost;
}
function setDownloadLinks() {
var preLink = "/textgrid/data/";
if (window.location.href.includes("dev")) {
preLink = "/dev"+preLink;
}
var postLink = ".xml";
var textGridURIDE = getParameter("edition");
var textGridURIFR = getParameter("translation");
var downloadLinkDE = preLink+textGridURIDE+postLink;
var downloadLinkFR = preLink+textGridURIFR+postLink;
var downloadTextPre = "ARCHITRAVE_Edition_";
var downloadTextPost = ".xml";
var downloadText = downloadTextPre+document.getElementById('navbarAuthorShort').innerHTML;
var downloadElementDE = document.getElementById("downloadLinkDE");
var downloadElementFR = document.getElementById("downloadLinkFR");
downloadElementDE.setAttribute("href", downloadLinkDE);
downloadElementDE.setAttribute("download", downloadText+"_de"+downloadTextPost);
downloadElementFR.setAttribute("href", downloadLinkFR);
downloadElementFR.setAttribute("download", downloadText+"_fr"+downloadTextPost);
}
......@@ -402,6 +402,7 @@ $(document).ready(function() {
});
resetFont();
setNavbarAuthorShort();
setDownloadLinks();
/* event listeners for drag handlers = rezising imageviewer.js */
var draghandlers = document.getElementsByClassName("lm_drag_handle");
......@@ -466,10 +467,10 @@ function loadFacs(page) {
imageurlfull = 'https://textgridlab.org/1.0/digilib/rest/IIIF/' + facs + '/full/max/0/default.jpg';
//because rendering of pitzler images is currently broken there are no low size images availalbe for pitzler!
if (getParameter("edition") == '34znb') {
imageurllow = imageurlfull;
imageurllow = imageurlfull;
}
else if (getParameter("edition") == '350mg') {
imageurllow = imageurlfull;
imageurllow = imageurlfull;
}
} catch (e) {
console.log(e)
......
This diff is collapsed.
This diff is collapsed.
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