Skip to content

Commit

Permalink
Merge pull request #475 from Edirom/issue-474
Browse files Browse the repository at this point in the history
fix output of correspondence partners in the context pane
  • Loading branch information
peterstadler authored Jun 23, 2024
2 parents 9169024 + 2ce95bd commit 995e2ad
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions modules/app.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -627,20 +627,20 @@ declare %private function app:createLetterLink($teiDate as element(tei:date)?, $
};

(:~
: Construct a name from a tei:persName or tei:name element wrapped in a <span>
: If a @key is given on persName the regularized form will be returned, otherwise the content of persName.
: If persName is empty than "unknown" is returned.
: Construct a name from a tei:persName, tei:orgName, or tei:name element wrapped in a <span>
: If a @key is given on the element the regularized form will be returned, otherwise the content of the element.
: If the element is empty than "unknown" is returned.
:
: @author Peter Stadler
: @param $persName the tei:persName element
: @param $persName the tei:persName, tei:orgName, or tei:name element
: @param $lang the current language (de|en)
: @param $order (sf|fs) whether to print "surname, forename" or "forename surname"
: @return
: @param $order (sf|fs|s) whether to print "surname, forename", or "forename surname", or just the surname
: @return a html:span element with the constructed name
:)
declare function app:printCorrespondentName($persName as element()?, $lang as xs:string, $order as xs:string) as element() {
declare function app:printCorrespondentName($persName as element()?, $lang as xs:string, $order as xs:string) as element(xhtml:span) {
if(exists($persName/@key)) then
if ($order eq 'fs') then app:createDocLink(crud:doc($persName/string(@key)), wega-util:print-forename-surname-from-nameLike-element($persName), $lang, ('class=' || config:get-doctype-by-id($persName/@key)))
else if ($order eq 's') then app:createDocLink(crud:doc($persName/string(@key)), substring-before(query:title($persName/@key),','), $lang, ('class=preview ' || concat($persName/@key, " ", config:get-doctype-by-id($persName/@key))))
else if ($order eq 's') then app:createDocLink(crud:doc($persName/string(@key)), functx:substring-before-if-contains(query:title($persName/@key), ', '), $lang, ('class=preview ' || concat($persName/@key, " ", config:get-doctype-by-id($persName/@key))))
else app:createDocLink(crud:doc($persName/string(@key)), query:title($persName/@key), $lang, ('class=' || config:get-doctype-by-id($persName/@key)))
else if(not(functx:all-whitespace($persName))) then
if ($order eq 'fs') then <xhtml:span class="noDataFound">{wega-util:print-forename-surname-from-nameLike-element($persName)}</xhtml:span>
Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A041782.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h4>Vorausgehend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A041743.html">1821-05-31</a>: an <a href="" class="preview A001002 persons"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>
<h4>Folgend</h4>
Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A041797.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h4>Vorausgehend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A041782.html">1821-09-17</a>: an <a href="" class="preview A000477 persons"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>
<h4>Folgend</h4>
Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A041822.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ <h4>Vorausgehend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A041797.html">1821-10-25</a>: an <a href="" class="preview A001898 persons"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>
<h4>Folgend</h4>
Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A041890.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h4>Vorausgehend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A041822.html">1821-12-17</a>: an <a href="" class="preview A001980 persons"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>
<h4>Folgend</h4>
Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A041892.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h4>Vorausgehend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A041890.html">1822-01-18</a>: an <a href="" class="preview A080002 orgs"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>
<h4>Folgend</h4>
Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A041894.html
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ <h4>Vorausgehend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A041892.html">1822-01-21</a>: an <a href="" class="preview A001693 persons"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A041712.html">1821-08-16</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>
<h4>Folgend</h4>
Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A042166.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ <h4>Folgend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A042301.html">1824-05-26</a>: an <a href="" class="preview A000354 persons"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A042080.html">1823-12-04</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A042080.html">1823-12-04</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion testing/expected-results/letters/A045410.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ <h4>Folgend</h4>
<a href="/exist/apps/WeGA-WebApp/de/A002068/Korrespondenz/A042166.html">1823-11-04</a>: an <a href="" class="preview A001848 persons"></a>
</li>
<li>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A042080.html">1823-12-04</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs"></a>
<a href="/exist/apps/WeGA-WebApp/de/A080005/Korrespondenz/A042080.html">1823-12-04</a>: von <a href="/exist/apps/WeGA-WebApp/de/A080005.html" class="preview A080005 orgs">Theaterintendanz Karlsruhe</a>
</li>
</ul>

Expand Down

0 comments on commit 995e2ad

Please sign in to comment.