Template:QuoteFolio: Difference between revisions

From Bodhicitta
(Segment page: show each quoted-text folio as a card (title, Derge location, link buttons, status))
(Card title: let long Sanskrit compounds wrap on phones)
Line 38: Line 38:
|QuoteFolioAdarshah={{{linkAdarshah|}}}
|QuoteFolioAdarshah={{{linkAdarshah|}}}
|QuoteFolioChecked={{#ifeq:{{lc:{{{checked|}}}}}|yes|true|false}}
|QuoteFolioChecked={{#ifeq:{{lc:{{{checked|}}}}}|yes|true|false}}
}}{{#ifeq:{{lc:{{{checked|}}}}}|yes|{{#set:QuoteFolioDisplay={{#if:{{{link84000|}}}|84000@@{{{toh|}}}@@{{{folio|}}}@@{{{link84000|}}}|{{#if:{{{linkAdarshah|}}}|Adarshah@@{{{toh|}}}@@{{{folio|}}}@@{{{linkAdarshah|}}}|none@@{{{toh|}}}@@{{{folio|}}}@@}}}}}}|}}<div class="quote-folio-entry offwhite-bg rounded shadow-sm my-3 p-3 p-md-4" style="border-left:3px solid #897435;max-width:46rem"><div class="d-flex flex-wrap justify-content-between align-items-center mb-2" style="gap:.5rem"><div class="font-sans text-uppercase" style="font-size:.72rem;letter-spacing:.16em;color:#897435"><i class="fa-sharp-duotone fa-solid fa-book-open fa-fw mr-1"></i>Quoted text</div>{{#ifeq:{{lc:{{{checked|}}}}}|yes|<span class="font-sans" style="font-size:.78rem;padding:.15rem .6rem;border-radius:999px;background:rgba(46,125,50,.1);color:#2e7d32">✓ Checked · shown to readers</span>|<span class="font-sans" style="font-size:.78rem;padding:.15rem .6rem;border-radius:999px;background:rgba(179,107,0,.12);color:#8a5200">Not checked · hidden from readers</span>}}</div><div class="h4 font-serif mt-0 mb-3" style="line-height:1.25">{{#if:{{{text|}}}|[[{{{text|}}}|{{#titleparts:{{{text|}}}||2}}]]|<i>Quoted text not set</i>}}</div><div class="d-flex flex-wrap mb-3" style="gap:.75rem 2.5rem"><div style="min-width:0"><div class="font-sans text-uppercase" style="font-size:.68rem;letter-spacing:.14em;color:#7d7a70">Tohoku</div><div class="font-serif" style="font-size:1.05rem">{{{toh|—}}}</div></div><div style="min-width:0"><div class="font-sans text-uppercase" style="font-size:.68rem;letter-spacing:.14em;color:#7d7a70">Derge volume</div><div class="font-serif" style="font-size:1.05rem">{{{volume|—}}}</div></div><div style="min-width:0"><div class="font-sans text-uppercase" style="font-size:.68rem;letter-spacing:.14em;color:#7d7a70">Folio</div><div class="font-serif" style="font-size:1.05rem">{{{folio|—}}}</div></div></div>{{#if:{{{link84000|}}}{{{linkAdarshah|}}}|<div class="font-sans">{{#if:{{{link84000|}}}|<span style="display:inline-block;padding:.3rem .8rem;border:1px solid rgba(137,116,53,.45);border-radius:999px;background:#fff;font-size:.88rem;margin:0 .5rem .5rem 0">[{{{link84000|}}} Read on 84000]</span>|}}{{#if:{{{linkAdarshah|}}}|<span style="display:inline-block;padding:.3rem .8rem;border:1px solid rgba(137,116,53,.45);border-radius:999px;background:#fff;font-size:.88rem;margin:0 .5rem .5rem 0">[{{{linkAdarshah|}}} Derge folio on Adarshah]</span>|}}</div>|<div class="font-sans" style="font-size:.88rem;color:#7d7a70">No link: shown to readers as "not in the Derge Kangyur".</div>}}</div></includeonly>
}}{{#ifeq:{{lc:{{{checked|}}}}}|yes|{{#set:QuoteFolioDisplay={{#if:{{{link84000|}}}|84000@@{{{toh|}}}@@{{{folio|}}}@@{{{link84000|}}}|{{#if:{{{linkAdarshah|}}}|Adarshah@@{{{toh|}}}@@{{{folio|}}}@@{{{linkAdarshah|}}}|none@@{{{toh|}}}@@{{{folio|}}}@@}}}}}}|}}<div class="quote-folio-entry offwhite-bg rounded shadow-sm my-3 p-3 p-md-4" style="border-left:3px solid #897435;max-width:46rem"><div class="d-flex flex-wrap justify-content-between align-items-center mb-2" style="gap:.5rem"><div class="font-sans text-uppercase" style="font-size:.72rem;letter-spacing:.16em;color:#897435"><i class="fa-sharp-duotone fa-solid fa-book-open fa-fw mr-1"></i>Quoted text</div>{{#ifeq:{{lc:{{{checked|}}}}}|yes|<span class="font-sans" style="font-size:.78rem;padding:.15rem .6rem;border-radius:999px;background:rgba(46,125,50,.1);color:#2e7d32">✓ Checked · shown to readers</span>|<span class="font-sans" style="font-size:.78rem;padding:.15rem .6rem;border-radius:999px;background:rgba(179,107,0,.12);color:#8a5200">Not checked · hidden from readers</span>}}</div><div class="h4 font-serif mt-0 mb-3" style="line-height:1.25;overflow-wrap:anywhere"><!-- anywhere: Sanskrit titles are single long compounds that cannot otherwise wrap on a phone -->{{#if:{{{text|}}}|[[{{{text|}}}|{{#titleparts:{{{text|}}}||2}}]]|<i>Quoted text not set</i>}}</div><div class="d-flex flex-wrap mb-3" style="gap:.75rem 2.5rem"><div style="min-width:0"><div class="font-sans text-uppercase" style="font-size:.68rem;letter-spacing:.14em;color:#7d7a70">Tohoku</div><div class="font-serif" style="font-size:1.05rem">{{{toh|—}}}</div></div><div style="min-width:0"><div class="font-sans text-uppercase" style="font-size:.68rem;letter-spacing:.14em;color:#7d7a70">Derge volume</div><div class="font-serif" style="font-size:1.05rem">{{{volume|—}}}</div></div><div style="min-width:0"><div class="font-sans text-uppercase" style="font-size:.68rem;letter-spacing:.14em;color:#7d7a70">Folio</div><div class="font-serif" style="font-size:1.05rem">{{{folio|—}}}</div></div></div>{{#if:{{{link84000|}}}{{{linkAdarshah|}}}|<div class="font-sans">{{#if:{{{link84000|}}}|<span style="display:inline-block;padding:.3rem .8rem;border:1px solid rgba(137,116,53,.45);border-radius:999px;background:#fff;font-size:.88rem;margin:0 .5rem .5rem 0">[{{{link84000|}}} Read on 84000]</span>|}}{{#if:{{{linkAdarshah|}}}|<span style="display:inline-block;padding:.3rem .8rem;border:1px solid rgba(137,116,53,.45);border-radius:999px;background:#fff;font-size:.88rem;margin:0 .5rem .5rem 0">[{{{linkAdarshah|}}} Derge folio on Adarshah]</span>|}}</div>|<div class="font-sans" style="font-size:.88rem;color:#7d7a70">No link: shown to readers as "not in the Derge Kangyur".</div>}}</div></includeonly>

Revision as of 14:15, 13 October 2026

One quoted text a translation-memory segment cites, with the folio where the passage is found and links to it. Placed on the segment page after the Template:TranslationMemory call, one per quoted text; edit it through Form:Segment. (Kept outside TranslationMemory on purpose: adding a parameter there would re-render all ~29,000 segment pages.)

Parameter Holds
text Page of the quoted text, e.g. Texts/Ratnameghasūtra
toh Tohoku number without the D: 127, 44-31
volume Derge volume: 55
folio Derge folio: 128a, or a range 175a–176a
link84000 84000 folio link. Preferred for readers.
linkAdarshah Adarshah link to the Derge folio. Shown when there is no 84000 link.
checked Yes once a curator has confirmed the match. Only checked folios are shown to readers.

A checked folio with neither link is shown as "not in Derge".

Stores a subobject (QuoteFolioText, QuoteFolioToh, QuoteFolioVolume, QuoteFolioFolio, QuoteFolio84000, QuoteFolioAdarshah, QuoteFolioChecked) and, for checked folios, QuoteFolioDisplay on the segment as source@@toh@@folio@@url, which Module:SegmentQuery turns into the link under the Tibetan.