From: Mischa POSLAWSKY Date: Sat, 30 May 2020 06:29:30 +0000 (+0200) Subject: word edit: list and link translation references X-Git-Tag: v1.13~240 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/9dc2832c7ac6c8d5f5f7c086c2725657b4df30a9 word edit: list and link translation references --- diff --git a/writer.plp b/writer.plp index f4819b7..f0554c0 100644 --- a/writer.plp +++ b/writer.plp @@ -15,18 +15,18 @@ form > ul { display: table; border-spacing: 0 2px; } -form > ul li { +form > ul > li { display: table-row; } -form > ul li > * { +form > ul > li > * { display: table-cell; padding-right: .5em; } -form > ul li > label { +form > ul > li > label { /* th */ text-align: right; } -form > ul li > label + * { +form > ul > li > label + * { /* td */ width: 32em; } @@ -109,13 +109,18 @@ my @wordcols = ( grade => undef, # " prio => 'Level', cover => undef, # included with prio - form => 'Translation', + form => 'Title', alt => 'Synonyms', wptitle => 'Wikipedia', source => 'Image', thumb => 'Convert options', ); my @prioenum = qw( essential basic common distinctive rare invisible ); +my %langflag = ( + nld => "\N{REGIONAL INDICATOR SYMBOL LETTER N}\N{REGIONAL INDICATOR SYMBOL LETTER L}", + eng => "\N{REGIONAL INDICATOR SYMBOL LETTER G}\N{REGIONAL INDICATOR SYMBOL LETTER B}", + epo => '★', +); my ($find) = map {{id => $_}} $fields{id} || $Request || (); my $row; @@ -247,6 +252,17 @@ for my $colinfo (pairs @wordcols) { ) for $col eq 'source' ? "data/word/org/$row->{id}.jpg" : (); say '

'; } + +if ($row->{id}) { + my $children = $db->select(word => '*', {ref => $row->{id}}, 'lang, id'); + printf '
    • ', 'Translations'; + while (my $row = $children->hash) { + printf '
    • %s
    • ', + "trans-$row->{lang}", $langflag{$row->{lang}}, + "/writer/$row->{id}", Entity($row->{form}); + } + say '
  • '; +} :>