{if 1 == {config key="allow_module_zip_install" default=1}}
<div class="col-md-6 install-module-col">
    <div class="general-block-decorator">

        <div class="title title-without-tabs">
            {intl l='Install or update a module'}
        </div>

        <div class="form-container">
            {form name="thelia.admin.module.install"}
            <form method="POST" action="{url path='/admin/module/install'}" {form_enctype} id="module-install">
                {form_hidden_fields}

                {form_field field='success_url'}
                <input type="hidden" name="{$name}" value="{url path='/admin/module'}" />
                {/form_field}

                {flash type="module-installed"}
                <div class="alert alert-success">{$MESSAGE}</div>
                {/flash}

                {if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}

                {form_field field='module'}
                <div class="form-group {if $error}has-error{/if}">
                    <label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} :
                        <span class="label-help-block">{intl l="Your module should be packaged in a zip file."}</span>
                    </label>
                    <div class="input-group">
                        <input type="file" id="{$label_attr.for}" {if $required}required="required"{/if} name="{$name}" value="{$value}" title="{intl l='Module file'}" placeholder="{intl l='Module file'}" class="form-control">
                        <span class="input-group-btn">
                            <input type="submit" class="form-submit-button btn btn-sm btn-success" value="{intl l="Install !"}" >
                        </span>
                    </div>
                </div>
                {/form_field}

            </form>
            {/form}
        </div>
    </div>
</div>
{/if}


<div class="{if 1 == {config key="allow_module_zip_install" default=1}}col-md-6{else}col-md-12{/if} install-module-col">
    <div class="general-block-decorator">

        <div class="title title-without-tabs">
            {intl l="Search a module"}
        </div>


        <div class="row">
            <div class="col-md-7">
                <p>{intl l="Discover all our modules on <a href='http://thelia.net/modules' target='_blank'>Thelia Modules</a> !"}</p>
                <form action="http://thelia.net/modules/search" method="get" target="_blank">
                    <div class="input-group">
                        <input type="text" class="form-control" id="q" name="q" placeholder="{intl l='Search on Thelia Modules'}">
                        <span class="input-group-btn">
                            <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span></button>
                        </span>
                    </div>
                </form>
            </div>
            <div class="col-md-5">
                <p>{intl l="Display protected modules ?"}</p>
                <form action="{url path="admin/modules"}" method="post">
                    {$visible = $smarty.post.visible|default:'0'}
                    <div class="input-group">
                        <select name="hidden" class="form-control">
                            <option value="0">{intl l='No'}</option>
                            <option value="1" {if $visible} selected {/if}>{intl l='Yes'}</option>
                        </select>
                        <span class="input-group-btn">
                            <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-eye-open"></span></button>
                        </span>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>