<%inherit file="/template.html" />
<%namespace name="components" file="/components.html"/>

<%def name="title()">${_("Import")}</%def>


<%block name="main_content">
<h1>${_("Import")}</h1>

<form method="post" enctype="multipart/form-data" action="/admin/import/do" class="importform">
    ${h.field_token()|n}
    <div>
        <label>
            <input type="checkbox" name="include_user" checked="checked" />
            ${_("Import users")}
        </label>
        %if c.welcome_enabled:
        <div class="importexport_settings">
            <div>
                <label>
                    <input type="checkbox" name="welcome" checked="checked" />
                    ${_("Generate welcome codes")}
                </label>
            </div>
        %endif
    </div>
    <div>
        <label>
            <input type="checkbox" name="include_badge" checked="checked" />
            ${_("Import badges")}
        </label>
    </div>
    <div>
        <label>
            <input type="checkbox" name="include_instance" checked="checked" />
            ${_("Import content (instances)")}
        </label>

        <div class="importexport_settings">
            <div>
                <label>
                    <input type="checkbox" name="include_instance_proposal" checked="checked" />
                    ${_("Include proposals")}
                </label>
                <!--
                Not yet implemented
                <div class="importexport_settings">
                    <div>
                        <label>
                            <input type="checkbox" name="include_proposal_comments" checked="checked" />
                            ${_("Include comments")}
                        </label>
                    </div>
                </div>
                -->
            </div>
        </div>
    </div>
    <div>
        <label>
            <input type="checkbox" name="include_staticpage" checked="checked" />
            ${_("Import static pages")}
        </label>
    </div>

    <div>
        <h6>${_("Replacement strategy")}</h6>
        <label>
            <input type="radio" name="replacement" value="update" checked="checked" />
            ${_("Update duplicate entries")}
        </label>
        <label>
            <input type="radio" name="replacement" value="skip" />
            ${_("Skip duplicate entries")}
        </label>
    </div>

    <div>
        <h6>File to import:</h6>
        <input type="file" name="importfile"/>

        <div>
            <div>Type:
                <label>
                    <input type="radio" name="filetype" value="detect" checked="checked" />
                    ${_('Detect')}
                </label>
                <label>
                    <input type="radio" name="filetype" value="json" />
                    ${_('JSON')}
                </label>
                <label>
                    <input type="radio" name="filetype" value="zip" />
                    ${_('ZIP')}
                </label>
            </div>
        </div>

    </div>

    <div class="savebox">
        <button type="submit">${_("Import Now")}</button>
    </div>
</form>
</%block>
