package DTA::View::Plain;
use parent 'Catalyst::View::TT';

use warnings;
use strict;

__PACKAGE__->config(
    TEMPLATE_EXTENSION => '.tt',
    ENCODING           => 'utf-8',
    PRE_PROCESS        => 'macros.tt',
    render_die         => 0,
);

$Template::Stash::SCALAR_OPS->{ ref } = sub {
    return ref ($_[0]);
};
$Template::Stash::LIST_OPS->{ ref } = sub {
    return ref ($_[0]);
};

$Template::Stash::SCALAR_OPS->{spacify} = sub {
    my $text = reverse $_[0];
    $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1\x{202f}/g;
    return scalar reverse $text;
};

1;
