  [% META title = 'Resources &raquo; Check New Terms' -%]
<!-- BEGIN [% template.title %] -->

  [% # PROCESS dumper.tt dump = words %]

	<h2 class="header">New dictionary terms</h2>

    [% IF words.size %]
    <form action="[% app_url %]/resources/update_user_dictionary" method="post"
          name="words">
        <table class="indent">
            <tr>
                <td></td>
                <th>Username</th>
                <th>New Term</th>
            </tr>
          [% FOREACH entry IN words;
               parts = entry.split('~'); # PROCESS dumper.tt dump = parts; %]
              <tr>
                <td>[% loop.count %]</td>
                [% IF parts.1 # must have been username~word, otherwise just word %]
                    <td>[% parts.0.upper %]</td>
                    <td>[% parts.1 %]</td>
                    <td><input type="checkbox" name="word" value="[% parts.1 %]" /></td>
                [% ELSE %]
                    <td>[% site.html.grey_null %]</td>
                    <td>[% entry %]</td>
                    <td><input type="checkbox" name="word" value="[% entry %]" /></td>
                [% END %]
              </tr>
          [% END %]
           <tr class="borderless">
            <td align="right" colspan="3">
                <input type="button" name="CheckAll" value="Select all"
                  onClick="checkAll(document.words.word)" />
                <input type="button" name="UnCheckAll" value="Clear all"
                  onClick="uncheckAll(document.words.word)" />
                [% site.html.submit %] [% site.html.reset %]
            </td>
           </tr>
        </table>
    </form>
    [% ELSE %]
        <p class="info indent">No new words to add</p>
    [% END %]
<!-- END [% template.title %] -->
