mourningdove/views/components/error.tt

30 lines
1,023 B
Text
Raw Normal View History

2026-05-24 01:03:05 +00:00
[%# views/components/error.tt
Print an error for a specific component (only used in special-cases, e.g., when grouping related elements together and wanting only one error for the entire thing)
Authors:
Afuna <coder.dw@afunamatata.com>
Copyright (c) 2015 by Dreamwidth Studios, LLC.
This program is free software; you may redistribute it and/or modify it under
the same terms as Perl itself. For a copy of the license, please reference
'perldoc perlartistic' or 'perldoc perlgpl'.
%]
[%# errors are instances of DW::FormErrors %]
[%- IF errors.exist && error_name.defined -%]
[%- err = errors.get( error_name ) -%]
[%- IF err -%]
<div class="row"><div class="columns">
[%- IF err.message # just one error -%]
<small class='error'>[%- err.message -%]</small>
[%- ELSE # multiple errors -%]
[%- FOR e = err -%]
<small class='error'>[%- e.message -%]</small>
[%- END -%]
[%- END -%]
</div></div>
[%- END -%]
[%- END -%]