{% 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 id="dialogTitle">{% trans "New Folder" %}</h3>
        <label for="dir-name">{% trans "Name" %}</label><br />
        <input type="text" name="name" value="" class="input" maxlength="{{max_file_name}}" id="dir-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 id="dialogTitle">{% 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 for="file-name">{% trans "File Name" %}</label><br/>
        <input type="text" name="name" value="" class="input" maxlength="{{max_file_name}}" id="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" class="inline-rename-form" action="" method="post">
        <input type="text" name="newname" value="<%- dirent_name %>" class="input vam" maxlength="{{max_file_name}}" />
        <button type="submit" class="submit sf2-icon-tick tick-green vam" title="{% trans "Submit" %}"></button>
        <button type="button" class="cancel sf2-icon-x2 vam" title="{% trans "Cancel" %}"></button>
    </form>
    </script>

    <script type="text/template" id="dirent-rename-dialog-template">
    <form id="rename-form" class="dirent-rename-dialog" action="" method="post">
        <h3><%= form_title %></h3>
        <input type="text" name="newname" value="<%- dirent_name %>" class="input vam" 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">{% csrf_token %}
        <h3 id="dialogTitle"><%= form_title %></h3>
        <div id="mv-dir-list" class="dir-tree-cont">
            <% if (show_cur_repo) { %>
            <h5 class="hd cspt"><span class="icon-caret-down"></span>{% trans "Current Library"%}</h5>
            <div id="current-repo-dirs">
                <span class="loading-icon loading-tip"></span>
            </div>
            <% } %>
            <% if (show_other_repos) { %>
            <div id="other-repos">
                <h5 class="hd cspt"><span class="icon-caret-right"></span>{% trans "Other Libraries"%}</h5>
                <span class="loading-icon loading-tip" style="display:none;"></span>
                <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">
        <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">
            <span class="fold-switch sf2-icon-minus op-icon"></span>
            <span class="sf-close sf2-icon-x1 op-icon hide" title="{% trans "Close" %}"></span>
        </div>
        <div class="con">
            <div class="fileupload-buttonbar">
                <button type="button" class="cancel cspt fright">{% trans "Cancel All" %}</button>
            </div>
            <p class="saving-tip alc clear hide">
                <span class="loading-icon vam"></span>
                <span class="vam">{% trans "Saving..." %}</span>
            </p>
            <table class="fileupload-table"><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="" aria-hidden="true" />
        <p class="intro" id="dialogTitle">{% 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 id="dialogTitle"><%= 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">{% trans "Replace" %}</button>
            <button class="no" style="margin-left:5px;">{% trans "Don't replace" %}</button>
            <button class="simplemodal-close">{% trans "Cancel" %}</button>
        </div>
    </script>

    <script type="text/template" id="repo-rename-form-template">
    <form id="repo-rename-form" class="inline-rename-form" action="" method="post">
        <input type="text" name="newname" value="<%- repo_name %>" class="input vam" maxlength="{{max_file_name}}" />
        <button type="submit" class="submit sf2-icon-tick tick-green vam" title="{% trans "Submit" %}"></button>
        <button type="button" class="cancel sf2-icon-x2 vam" title="{% trans "Cancel" %}"></button>
    </form>
    </script>
