Skip to content

Commit

Permalink
feat: add handling for “pending” documents
Browse files Browse the repository at this point in the history
… which will be published once its chapter is fully cleared
  • Loading branch information
joewiz committed Dec 13, 2024
1 parent c24cffc commit adcfb38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions modules/frus-toc-html.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ declare function toc:toc($model as map(*), $root as node()?, $show-heading as xs
toc:toc-passthru(
$model,
$root/ancestor-or-self::tei:TEI/tei:text,
if ($highlight) then $root/ancestor-or-self::tei:div[@type != "document"][1] else ()
if ($highlight) then $root/ancestor-or-self::tei:div[@type != ("document", "document-pending")][1] else ()
)
}</ul>
</div>
Expand Down Expand Up @@ -103,8 +103,8 @@ declare function toc:volume-title($node as node(), $type as xs:string) as text()
(: handles divs for TOCs :)
declare function toc:toc-div($model as map(*), $node as element(tei:div), $current as element()?) {
(: we only show certain divs :)
for $node in $node[@xml:id != 'toc'][@type != 'document']
let $descendant-docs := $node//tei:div[@type = 'document']
for $node in $node[@xml:id != 'toc'][not(@type = ('document', 'document-pending'))]
let $descendant-docs := $node//tei:div[@type = ('document', 'document-pending')]
return
<li>
{
Expand Down Expand Up @@ -186,11 +186,11 @@ declare function toc:document-list($config as map(*), $node as element(tei:div),
let $start := xs:integer(request:get-parameter("start", 1))
let $headConfig := map:merge(($config, map { "parameters": map:put($config?parameters, "omit-notes", true())}), map{"duplicates": "use-last"})
let $head := $node/tei:head[1]
let $child-documents := $node/tei:div[@type='document']
let $child-documents := $node/tei:div[@type=('document', 'document-pending')]
let $child-document-count := count($child-documents)
(: let $child-documents-to-show := $node/tei:div[@type='document'] :)
let $child-documents-to-show := subsequence($child-documents, $start, $toc:ENTRIES_PER_PAGE)
let $has-inner-sections := $node/tei:div[@type != 'document']
let $has-inner-sections := $node/tei:div[not(@type = ('document', 'document-pending'))]
return
<div class="{$class}">
<h3>{
Expand Down Expand Up @@ -235,7 +235,7 @@ declare function toc:document-list($config as map(*), $node as element(tei:div),
<a href="{$href}">
{
(: show a bracketed document number for volumes that don't use document numbers :)
if (not(starts-with($doctitle, concat($docnumber, '.')))) then
if (not(starts-with($doctitle, concat($docnumber, '.'))) and $document/@type ne 'document-pending') then
concat('[', $docnumber, '] ')
else
()
Expand Down
2 changes: 1 addition & 1 deletion resources/odd/source/frus.odd
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
</elementSpec>
<elementSpec ident="div" mode="change">
<model output="web" predicate="$parameters?document-list and div[@type='question']" behaviour="document-list"/>
<model output="web" predicate="$parameters?document-list and @type = ('compilation', 'chapter', 'subchapter', 'section', 'part') and exists(div[@type and not(@type = 'online-supplement')])" behaviour="document-list"/>
<model output="web" predicate="$parameters?document-list and @type = ('compilation', 'chapter', 'chapter-pending', 'subchapter', 'section', 'section-pending', 'part') and exists(div[@type and not(@type = 'online-supplement')])" behaviour="document-list"/>
<model behaviour="block"/>
</elementSpec>
<elementSpec ident="xhtml:object" mode="add">
Expand Down

0 comments on commit adcfb38

Please sign in to comment.