mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-22 11:57:34 +00:00
[fileupload] added option for 'add folder'
This commit is contained in:
@@ -205,6 +205,9 @@ ENABLE_MAKE_GROUP_PUBLIC = False
|
||||
# show or hide library 'download' button
|
||||
SHOW_REPO_DOWNLOAD_BUTTON = False
|
||||
|
||||
# enable 'upload folder' or not
|
||||
ENABLE_UPLOAD_FOLDER = False
|
||||
|
||||
# mininum length for password of encrypted library
|
||||
REPO_PASSWORD_MIN_LENGTH = 8
|
||||
|
||||
|
@@ -1170,6 +1170,7 @@ $('#upload-file').click(function () {
|
||||
$('#upload-file-dialog').modal();
|
||||
});
|
||||
{% else %}
|
||||
{% if enable_upload_folder %}
|
||||
if ('webkitdirectory' in $('#upload-file input[type="file"]')[0]) {
|
||||
$('#upload-file').find('input').remove().end().addClass('cspt');
|
||||
$('#upload-menu .item').click(function() {
|
||||
@@ -1202,6 +1203,7 @@ $('#upload-file').click(function () {
|
||||
});
|
||||
}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
$('#add-new-dir').click(function () {
|
||||
|
@@ -22,6 +22,7 @@
|
||||
<span class="icon-upload-alt"></span><span>{% trans "Upload"%}</span>
|
||||
<input type="file" name="file" multiple />
|
||||
</div>
|
||||
{% if enable_upload_folder %}
|
||||
<ul id="upload-menu" class="hide">
|
||||
<li class="item">
|
||||
<span>{% trans "Upload Files" %}</span>
|
||||
@@ -34,6 +35,7 @@
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<button id="add-new-dir" class="op-btn"><span class="icon-plus-sign-alt"></span>{% trans "New Directory"%}</button>
|
||||
{% if repo.encrypted and repo.enc_version == 2 and not server_crypto %}
|
||||
{% else %}
|
||||
|
@@ -290,6 +290,7 @@ def list_dir(request, repo_id):
|
||||
'more_start': more_start,
|
||||
'ENABLE_SUB_LIBRARY': settings.ENABLE_SUB_LIBRARY,
|
||||
"sub_lib_enabled": sub_lib_enabled,
|
||||
"enable_upload_folder": settings.ENABLE_UPLOAD_FOLDER,
|
||||
'current_commit': head_commit,
|
||||
'info_commit': info_commit,
|
||||
}
|
||||
|
@@ -29,7 +29,8 @@ from seahub.utils import gen_file_upload_url, is_org_context, \
|
||||
get_fileserver_root, gen_dir_share_link, gen_shared_upload_link, \
|
||||
get_max_upload_file_size, new_merge_with_no_conflict, \
|
||||
get_commit_before_new_merge, user_traffic_over_limit
|
||||
from seahub.settings import ENABLE_SUB_LIBRARY, FORCE_SERVER_CRYPTO
|
||||
from seahub.settings import ENABLE_SUB_LIBRARY, FORCE_SERVER_CRYPTO, \
|
||||
ENABLE_UPLOAD_FOLDER
|
||||
|
||||
# Get an instance of a logger
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -268,6 +269,7 @@ def render_repo(request, repo):
|
||||
'ENABLE_SUB_LIBRARY': ENABLE_SUB_LIBRARY,
|
||||
'server_crypto': server_crypto,
|
||||
"sub_lib_enabled": sub_lib_enabled,
|
||||
"enable_upload_folder": ENABLE_UPLOAD_FOLDER,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@login_required
|
||||
|
Reference in New Issue
Block a user