printf '<span class=inline>';
print $row->input($col => $attr);
if (my $imgsrc = $attr->{-src}) {
- printf('<img id="%spreview" src="/%s" alt="%s"%s />',
- $col, $_, $row->{form}, $col eq 'source' && ' hidden'
+ my $hide = $col eq 'source';
+ printf '<span id="%spreview">', $col unless $hide;
+ printf('<img src="/%s" alt="%s"%s />',
+ $_, $row->{form}, $hide && qq( id="${col}preview" hidden)
) for grep { -e } $imgsrc->($row);
+ printf '</span>' unless $hide;
}
print $row->input($_ => delete $wordcol{$_}) for @span;
print '</span>';
<input type="submit" value="Add" />
</form></li>
</ul>
+
+<form id="search">
+ <input type="search" name="q" value="" placeholder="search" /><button type="submit">🔍</button>
+</form>
</section>
<:
}