Improved Feedback list page

This commit is contained in:
Tom Bloor 2017-09-28 16:39:03 +01:00
parent 4beb26a0a4
commit c3519fa4df
5 changed files with 61 additions and 8 deletions

View file

@ -0,0 +1,18 @@
package Pear::LocalLoop::Plugin::TemplateHelpers;
use Mojo::Base 'Mojolicious::Plugin';
sub register {
my ( $plugin, $app, $conf ) = @_;
$app->helper( truncate_text => sub {
my ( $c, $string, $length ) = @_;
if ( length $string < $length ) {
return $string;
} else {
return substr( $string, 0, $length - 3 ) . '...';
}
});
}
1;