[#986] Create an errors component to be used in .tt files

Fixes #986.
The place with the extra HTML, in entry/options is a bit of a
unique case since it's an HTML fragment which is loaded via JS
into other (foundation) pages.





On Wed, Oct 15, 2014, at 03:19 PM, [1]afunamatata@fastmail.fm
wrote:

Oh yeah, this component is primarily for non-foundation-page
use (pages converted from bml -> tt, but not to foundation) --
the alert/alert-box classes can still make sense on those
pages, but the .row and .columns don't make sense in that
context.





On Wed, Oct 15, 2014, at 03:17 PM, Mark Smith wrote:

  In views/entry/options.tt:
> @@ -23,9 +23,7 @@ the same terms as Perl itself.  For a copy of the li
cense, please reference
>  [%- IF use_js && errors.exist -%]
>  <div class="row">
>      <div class="columns large-12">
> -        [%- FOREACH err = errors.get_all -%]
> -            <div class="alert-box alert radius">[%- err.message -%]</
div>
> -        [%- END -%]
> +    [%- INCLUDE components/errors.tt errors = errors -%]

  Since the HTML inside the component requires the HTML
  outside, I feel like they should all be in the same place.
  That way you'll save typing in the future everywhere you use
  the component.

  I guess one reason you might not is if the surrounding HTML
  actually changes from place to place?

  —
  Reply to this email directly or [2]view it on GitHub.

References

1. mailto:afunamatata@fastmail.fm
2. https://github.com/dreamwidth/dw-free/pull/987/files#r18877790