Template:SidebarPersonBadge: Difference between revisions
From Bodhicitta
(VSCode edit) Tag: Manual revert |
(Space both sides of the role separator) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly>{{#ifeq:{{{ 1 | }}}|Anon||<div class=" | <includeonly>{{#ifeq:{{{ 1 | }}}|Anon||<div class="sidebar-person position-relative rounded-xl"><!-- | ||
Portrait, name and roles for one person in a library-item sidebar. | Portrait, name and roles for one person in a library-item sidebar. | ||
A horizontal row — small round avatar, then name and roles — rather than a | |||
portrait with the name centred underneath. The old layout sized the image at | |||
100% of the sidebar column with padding-top:100%, so every person cost about | |||
250px of height. Two thirds of library items have exactly one person, but the | |||
tail is long: "A Gathering of Brilliant Moons" has 26 (12 source authors, 13 | |||
translators, editors, a publisher), which ran to roughly 5,000px of sidebar. | |||
At 48px per avatar the same list is about a fifth of the height and scans as | |||
a list rather than a stack of posters. | |||
48px, not smaller: these are portraits of masters that readers recognise by | |||
face, so the avatar has to stay legible as a face. | |||
Roles are separated by a middot rather than <br>. The row is only two lines | |||
tall, and stacking three roles vertically would undo the saving. | |||
The image, phonetic name and Tibetan name arrive as parameters from | The image, phonetic name and Tibetan name arrive as parameters from | ||
| Line 13: | Line 28: | ||
module now asks for ?FirstImage# and passes the raw title. | module now asks for ?FirstImage# and passes the raw title. | ||
--> | --> | ||
<div class=" | <div class="sidebar-person-avatar">{{#widget:SidebarPersonPageRoundImage | ||
|filepath={{#if: {{{ img | }}} | |||
|{{#ifeq: {{{ img | }}} | |||
|File:Noimagefound.jpg | |||
|{{filepath:Teaching_Mudra_2_reduced_opacity.png|300}} | |||
|{{filepath:{{#titleparts:{{PAGENAME:{{{ img | }}}}} }}|150}} | |||
}} | }} | ||
|{{filepath:Teaching_Mudra_2_reduced_opacity.png|300}} | |||
</div> | }} | ||
<div class=" | |size=100% | ||
|bgSize=cover | |||
|depth=0 | |||
}} | |||
</div> | |||
<div class="sidebar-person-text font-serif"> | |||
<div class="w-100"> | <div class="w-100"> | ||
<div class=" | <div class="sidebar-person-name line12">{{#if: {{{ phon | }}} | ||
|{{#if: {{{ tib | }}} | |{{#if: {{{ tib | }}} | ||
|{{I18n | |{{I18n | ||
| Line 46: | Line 58: | ||
}} | }} | ||
|{{{ phon | }}} | |{{{ phon | }}} | ||
}}<!-- | |||
Organisations have no MainNamePhon; they carry Orgname instead. Without this | |||
fallback an institutional credit shows only its raw page title. | |||
--> |{{#if: {{{ org | }}} | |||
|{{{ org | }}} | |||
|[[{{{ 1 | }}}]] | |||
}} | }} | ||
}}</div> | }}</div> | ||
<div class="opac-50 | <div class="sidebar-person-roles opac-50 font-italic line11">{{#arraymap:{{{ 2 | }}} | ||
|; | |; | ||
|@@@ | |@@@ | ||
|@@@ | |@@@ | ||
| | | · | ||
}}</div>{{#ifexist:{{{ 1 | }}}||{{#ifexist:People/{{{ 1 | }}}| | }}</div>{{#ifexist:{{{ 1 | }}}||{{#ifexist:People/{{{ 1 | }}}| | ||
<div class="carnelian mb-2">redirect needed</div>{{#set:PersonNameNeedsRedirect={{{ 1 | }}}}}| | <div class="carnelian mb-2">redirect needed</div>{{#set:PersonNameNeedsRedirect={{{ 1 | }}}}}| | ||
<div class="carnelian mb-2">page missing</div>{{#set:PersonNameNeedsPage={{{ 1 | }}}}} }} }} | <div class="carnelian mb-2">page missing</div>{{#set:PersonNameNeedsPage={{{ 1 | }}}}} }} }} | ||
</div> | </div> | ||
</div>{{#widget:OverlayLink | |||
|link=/index.php/{{#ifexist:{{{ 1 | }}} | |link=/index.php/{{#ifexist:{{{ 1 | }}} | ||
|{{{ 1 | }}} | |{{{ 1 | }}} | ||