X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/e3fb22aca3122b87432194fb49ddfa8a5c8c95e2..9ddf2e9a6173fcb1649ab9dd72ded3896195c83f:/writer.plp?ds=inline
diff --git a/writer.plp b/writer.plp
index 493f745..256a074 100644
--- a/writer.plp
+++ b/writer.plp
@@ -71,6 +71,7 @@ my %lang = (
en => ["\N{REGIONAL INDICATOR SYMBOL LETTER G}\N{REGIONAL INDICATOR SYMBOL LETTER B}", 'english'],
eo => ['â
', 'esperanto'],
ru => ["\N{REGIONAL INDICATOR SYMBOL LETTER R}\N{REGIONAL INDICATOR SYMBOL LETTER U}", 'ÑÑÑÑкий'],
+ la => ["\N{PUSHPIN}", 'latin'],
);
my @wordcols = pairkeys
my %wordcol = (
@@ -98,8 +99,20 @@ my %wordcol = (
source => {-label => 'Image'},
thumb => {-label => 'Convert options', -multiple => 1},
);
-my ($find) = map {{id => $_}} $fields{id} || $Request || ();
+if (my $search = $fields{q}) {
+ my %filter = (form => {ilike => '%'.$search.'%'});
+ my $results = $db->select(word => '*', \%filter);
+ say '
Search
';
+ printf("- %s %s %s
\n",
+ $_->{id}, showlink($_->{form}, "/writer/$_->{id}"),
+ sprintf('', Shiar_Sheet::FormRow::imagepath($_ => 'thumb')) x defined $_->{thumb}
+ ) for $results->hashes;
+ say "
\n";
+ exit;
+}
+
+my ($find) = map {{id => $_}} $fields{id} || $Request || ();
my $row;
if ($find) {
$row = $db->select(word => '*', $find)->hash
@@ -160,6 +173,7 @@ elsif (defined $post{form}) {{
prio => undef,
);
$subrow{wptitle} = $1 if $subrow{form} =~ s/\h*\[(.*)\]$//; # [Link] shorthand
+ $subrow{alt} = [split m{/}, $1] if $subrow{form} =~ s{/(\S.*)}{}; # /alternates shorthand
$db->insert(word => \%subrow);
delete $fields{$field};
}
@@ -207,7 +221,7 @@ elsif (defined $post{form}) {{
'convert',
$imgpath,
-delete => '1--1', -background => 'white',
- -gravity => @cmds ? 'northwest' : 'center',
+ -gravity => defined $row->{thumb} ? 'northwest' : 'center',
@cmds,
-resize => "$xyres^", -extent => $xyres,
'-strip', -quality => '60%', -interlace => 'plane',