<form action="index.cgi" method="post" enctype="multipart/form-data">
<input type="hidden" name="show" value="add" />
    <table class="source">
        <colgroup>
            <col width="15%"/>
            <col/>
            <col width="15%"/>
        </colgroup>

        <tbody>
        <tr>
            <td class="label">
                <label for="link">[% gettext('Link') %]:</label>
            </td>
            <td class="input" colspan="2">
                <textarea rows="4" name="link" id="link"
                    title="[% gettext('One link per line') %]"
                    ></textarea>
            </td>
        </tr>

        <tr>
            <td/>
            <td class="note" colspan="2">
                [%
                  gettext('Note: rTorrent don`t notify you about broken links.')
                  _ ' ' _
                  gettext('Just attempt to load this links.')
                %]
            </td>
        </tr>

        <tr>
            <td class="label">
                <label for="file">[% gettext('File') %]:</label>
            </td>
            <td class="input" colspan="2">
                <input type="file" name="file" id="file" />
            </td>
        </tr>

        <tr>
            <td class="label">
                <label for="start">[% gettext('Start torrent') %]:</label>
            </td>
            <td class="input" colspan="2">
                <input type="checkbox" name="start" id="start"
                    checked="checked" />
            </td>
        </tr>

        <tr>
            <td/>
            <td class="add">
                <button>
                    <img src="[% config.url.skin.panel %]/add.png" />
                    [% gettext('Add') %]
                </button>
            </td>
            <td class="close">
                <button class="close">
                    <img src="[% config.url.skin.panel %]/close.png" />
                    [% gettext('Close') %]
                </button>
            </td>
        </tr>
        </tbody>
    </table>
</form>

[% FOREACH result = data.result %]
    [%
        SET class = ['message'];
        IF one.error; class.push('error'); END;
    %]
    <div class="[% class.join(' ') %]">
        [% SWITCH result.type %]
            [% CASE 'file' %]
                [% gettext('Adding file') %]:
            [% CASE 'link' %]
                [% gettext('Adding link') %]:
            [% CASE DEFAULT %]
                [% gettext('Internal error') %]:
        [% END %]
        <span class="source">[% result.torrent %]</span>
        -
        [% IF result.error %]
            <span class="error">[% result.error %]</span>
        [% ELSE %]
            ... [% gettext('Done') %]
        [% END %]
    </div>
[% END %]
