{% load i18n upload_tags %}

    <script type="text/template" id="add-new-dir-form-template">
    <form id="add-new-dir-form" action="" method="post" class="hide">{% csrf_token %}
        <h3>{% trans "New Directory" %}</h3>
        <label>{% trans "Directory Name" %}</label><br />
        <input type="text" name="name" value="" class="input" maxlength="{{max_file_name}}"/><br />
        <p class="error hide"></p>
        <button type="submit" class="submit">{% trans "Submit" %}</button>
        <button class="simplemodal-close">{% trans "Cancel" %}</button>
    </form>
    </script>

    <script type="text/template" id="add-new-file-form-template">
    <form id="add-new-file-form" action="" method="post" class="hide">{% csrf_token %}
        <h3>{% trans "New File" %}</h3>
        <div id="featured-filetype">
            <label>{% trans "Featured File Type" %}</label><br />
            <button type="button" class="set-file-type" data-filetype="md" title="{% trans "Click to choose" %}">markdown</button> <span>{% trans "simple markup format." %}</span>
            {% if LANGUAGE_CODE == 'zh-cn' %}
            <a href="http://www.seafile.com/help/markdown/" target="_blank">{% trans 'Details' %}</a>
            {% else %}
            <a href="http://www.seafile.com/en/help/markdown/" target="_blank">{% trans 'Details' %}</a>
            {% endif %}
        </div>
        <label>{% trans "File Name" %}</label><br/>
        <input type="text" name="name" value="" class="input" maxlength="{{max_file_name}}"/><br />
        <p class="error hide"></p>
        <button type="submit" class="submit">{% trans "Submit" %}</button>
        <button class="simplemodal-close">{% trans "Cancel" %}</button>
    </form>
    </script>

    <script type="text/template" id="rename-form-template">
    <form id="rename-form" action="" method="post" class="hide">{% csrf_token %}
        <h3><%= form_title %></h3>
        <p class="detail">{% trans "Rename %(name)s as:" %}</p>
        <input type="hidden" name="oldname" value="<%- dirent_name %>" />
        <input type="text" name="newname" value="<%- dirent_name %>" class="input" maxlength="{{max_file_name}}" /><br />
        <p class="error hide"></p>
        <button type="submit" class="submit">{% trans "Submit" %}</button>
        <button class="simplemodal-close">{% trans "Cancel" %}</button>
    </form>
    </script>

    <script type="text/template" id="mvcp-form-template">
    <form id="mv-form" action="" method="post" class="file-choose-form hide">{% csrf_token %}
        <h3><%= form_title %></h3>
        <div id="mv-dir-list" class="dir-tree-cont">
            <h5 class="hd cspt"><span class="icon-caret-down"></span>{% trans "Current Library"%}</h5>
            <img class="loading-tip" width="32" src="{{MEDIA_URL}}img/loading-new.gif" alt="{% trans 'Loading...' %}" />
            <div id="current-repo-dirs"></div>
            <% if (show_other_repos) { %>
            <div id="other-repos">
                <h5 class="hd cspt"><span class="icon-caret-right"></span>{% trans "Other Libraries"%}</h5>
                <img class="loading-tip" width="32" src="{{MEDIA_URL}}img/loading-new.gif" alt="{% trans 'Loading...' %}" style="display:none;" />
                <div id="other-repos-dirs" class="hide"></div>
            </div>
            <% } %>
        </div>
        <input type="hidden" name="obj_name" value="<%- obj_name %>" />
        <input type="hidden" name="obj_type" value="<%= obj_type %>" />
        <input type="hidden" name="op" value="<%= op_type %>" />
        <input type="hidden" name="dst_repo" value="" />
        <input type="hidden" name="dst_path" value="" />
        <p class="error hide">{% trans "Please click and choose a directory."%}</p>
        <button type="submit" class="submit">{% trans "Submit" %}</button>
        <button class="simplemodal-close">{% trans "Cancel"%}</button>
    </form>
    </script>

    <script type="text/template" id="mv-progress-popup-template">
    <div id="mv-progress-popup" class="alc hide">
        <p id="mv-details" class="ellipsis"></p>
        <div id="mv-progress"></div>
        <p id="mv-other-info" class="hide"></p>
        <button id="cancel-mv">{% trans "Cancel" %}</button>
    </div>
    </script>

    {% upload_js %}

    <!--script type="text/template" id="upload-file-dialog-template"-->
    <div id="upload-file-dialog" class="hide">
        <h3 class="hd"><span class="status">{% trans "File Upload" %}</span> <span class="total-progress hide"></span></h3>
        <div class="ops">
            <img src="{{MEDIA_URL}}img/minus.png" alt="" class="fold-switch cspt" />
            <img src="{{MEDIA_URL}}img/close.png" alt="close" title="{% trans "close" %}" class="close cspt hide" />
        </div>
        <div class="con">
            <div class="row fileupload-buttonbar">
                <button type="button" class="cancel cspt fright">{% trans "Cancel All" %}</button>
            </div>
            <p class="saving-tip alc clear hide"><img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" style="margin-right:5px;" class="vam" />{% trans "Saving..." %}</p>
            <table class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
        </div>
    </div>
    <!--/script-->

    <script type="text/template" id="repo-decrypt-form-template">
    <form id="repo-decrypt-form" action="" class="alc lib-decrypt-form">
        <img src="{{MEDIA_URL}}img/lock.png" alt="" />
        <p class="intro">{% trans "This library is password protected" %}</p>
        <p class="error hide"></p>
        <input type="password" name="password" class="input" placeholder="{% trans "Password" %}" /><br />
        <button type="submit" class="submit">{% trans "Submit" %}</button>
        <p class="tip">{% trans '*The password will be kept in the server for only 1 hour.' %}</p>
    </form>
    </script>

    <script type="text/template" id="fileupdate-confirm-template">
        <div>
            <h3><%= title %></h3>
            <p>{% trans "A file with the same name already exists in this folder." %}<br />{% trans "Replacing it will overwrite its content." %}</p>
            <p class="error hide"></p>
            <button class="yes btn">{% trans "Replace" %}</button>
            <button class="no btn" style="margin-left:5px;">{% trans "Don't replace" %}</button>
            <button class="simplemodal-close btn">{% trans "Cancel" %}</button>
        </div>
    </script>

    <script type="text/template" id="repo-del-confirm-template">
        <div class="op-confirm repo-del-confirm">
            <p><%= content %></p>
            <button class="yes">{% trans "Yes" %}</button>
            <button class="no">{% trans "No" %}</button>
        </div>
    </script>
