Skip to content

Commit adcfb38

Browse files
committed
feat: add handling for “pending” documents
… which will be published once its chapter is fully cleared
1 parent c24cffc commit adcfb38

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

modules/frus-toc-html.xqm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ declare function toc:toc($model as map(*), $root as node()?, $show-heading as xs
6161
toc:toc-passthru(
6262
$model,
6363
$root/ancestor-or-self::tei:TEI/tei:text,
64-
if ($highlight) then $root/ancestor-or-self::tei:div[@type != "document"][1] else ()
64+
if ($highlight) then $root/ancestor-or-self::tei:div[@type != ("document", "document-pending")][1] else ()
6565
)
6666
}</ul>
6767
</div>
@@ -103,8 +103,8 @@ declare function toc:volume-title($node as node(), $type as xs:string) as text()
103103
(: handles divs for TOCs :)
104104
declare function toc:toc-div($model as map(*), $node as element(tei:div), $current as element()?) {
105105
(: we only show certain divs :)
106-
for $node in $node[@xml:id != 'toc'][@type != 'document']
107-
let $descendant-docs := $node//tei:div[@type = 'document']
106+
for $node in $node[@xml:id != 'toc'][not(@type = ('document', 'document-pending'))]
107+
let $descendant-docs := $node//tei:div[@type = ('document', 'document-pending')]
108108
return
109109
<li>
110110
{
@@ -186,11 +186,11 @@ declare function toc:document-list($config as map(*), $node as element(tei:div),
186186
let $start := xs:integer(request:get-parameter("start", 1))
187187
let $headConfig := map:merge(($config, map { "parameters": map:put($config?parameters, "omit-notes", true())}), map{"duplicates": "use-last"})
188188
let $head := $node/tei:head[1]
189-
let $child-documents := $node/tei:div[@type='document']
189+
let $child-documents := $node/tei:div[@type=('document', 'document-pending')]
190190
let $child-document-count := count($child-documents)
191191
(: let $child-documents-to-show := $node/tei:div[@type='document'] :)
192192
let $child-documents-to-show := subsequence($child-documents, $start, $toc:ENTRIES_PER_PAGE)
193-
let $has-inner-sections := $node/tei:div[@type != 'document']
193+
let $has-inner-sections := $node/tei:div[not(@type = ('document', 'document-pending'))]
194194
return
195195
<div class="{$class}">
196196
<h3>{
@@ -235,7 +235,7 @@ declare function toc:document-list($config as map(*), $node as element(tei:div),
235235
<a href="{$href}">
236236
{
237237
(: show a bracketed document number for volumes that don't use document numbers :)
238-
if (not(starts-with($doctitle, concat($docnumber, '.')))) then
238+
if (not(starts-with($doctitle, concat($docnumber, '.'))) and $document/@type ne 'document-pending') then
239239
concat('[', $docnumber, '] ')
240240
else
241241
()

resources/odd/source/frus.odd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
</elementSpec>
228228
<elementSpec ident="div" mode="change">
229229
<model output="web" predicate="$parameters?document-list and div[@type='question']" behaviour="document-list"/>
230-
<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"/>
230+
<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"/>
231231
<model behaviour="block"/>
232232
</elementSpec>
233233
<elementSpec ident="xhtml:object" mode="add">

0 commit comments

Comments
 (0)