mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-22 20:08:19 +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 or hide library 'download' button
|
||||||
SHOW_REPO_DOWNLOAD_BUTTON = False
|
SHOW_REPO_DOWNLOAD_BUTTON = False
|
||||||
|
|
||||||
|
# enable 'upload folder' or not
|
||||||
|
ENABLE_UPLOAD_FOLDER = False
|
||||||
|
|
||||||
# mininum length for password of encrypted library
|
# mininum length for password of encrypted library
|
||||||
REPO_PASSWORD_MIN_LENGTH = 8
|
REPO_PASSWORD_MIN_LENGTH = 8
|
||||||
|
|
||||||
|
@@ -1170,6 +1170,7 @@ $('#upload-file').click(function () {
|
|||||||
$('#upload-file-dialog').modal();
|
$('#upload-file-dialog').modal();
|
||||||
});
|
});
|
||||||
{% else %}
|
{% else %}
|
||||||
|
{% if enable_upload_folder %}
|
||||||
if ('webkitdirectory' in $('#upload-file input[type="file"]')[0]) {
|
if ('webkitdirectory' in $('#upload-file input[type="file"]')[0]) {
|
||||||
$('#upload-file').find('input').remove().end().addClass('cspt');
|
$('#upload-file').find('input').remove().end().addClass('cspt');
|
||||||
$('#upload-menu .item').click(function() {
|
$('#upload-menu .item').click(function() {
|
||||||
@@ -1201,6 +1202,7 @@ $('#upload-file').click(function () {
|
|||||||
closePopup($('#upload-menu'), $('#upload-file'));
|
closePopup($('#upload-menu'), $('#upload-file'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
<span class="icon-upload-alt"></span><span>{% trans "Upload"%}</span>
|
<span class="icon-upload-alt"></span><span>{% trans "Upload"%}</span>
|
||||||
<input type="file" name="file" multiple />
|
<input type="file" name="file" multiple />
|
||||||
</div>
|
</div>
|
||||||
|
{% if enable_upload_folder %}
|
||||||
<ul id="upload-menu" class="hide">
|
<ul id="upload-menu" class="hide">
|
||||||
<li class="item">
|
<li class="item">
|
||||||
<span>{% trans "Upload Files" %}</span>
|
<span>{% trans "Upload Files" %}</span>
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
<input type="file" name="file" multiple directory webkitdirectory />
|
<input type="file" name="file" multiple directory webkitdirectory />
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button id="add-new-dir" class="op-btn"><span class="icon-plus-sign-alt"></span>{% trans "New Directory"%}</button>
|
<button id="add-new-dir" class="op-btn"><span class="icon-plus-sign-alt"></span>{% trans "New Directory"%}</button>
|
||||||
|
@@ -290,6 +290,7 @@ def list_dir(request, repo_id):
|
|||||||
'more_start': more_start,
|
'more_start': more_start,
|
||||||
'ENABLE_SUB_LIBRARY': settings.ENABLE_SUB_LIBRARY,
|
'ENABLE_SUB_LIBRARY': settings.ENABLE_SUB_LIBRARY,
|
||||||
"sub_lib_enabled": sub_lib_enabled,
|
"sub_lib_enabled": sub_lib_enabled,
|
||||||
|
"enable_upload_folder": settings.ENABLE_UPLOAD_FOLDER,
|
||||||
'current_commit': head_commit,
|
'current_commit': head_commit,
|
||||||
'info_commit': info_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_fileserver_root, gen_dir_share_link, gen_shared_upload_link, \
|
||||||
get_max_upload_file_size, new_merge_with_no_conflict, \
|
get_max_upload_file_size, new_merge_with_no_conflict, \
|
||||||
get_commit_before_new_merge, user_traffic_over_limit
|
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
|
# Get an instance of a logger
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -268,6 +269,7 @@ def render_repo(request, repo):
|
|||||||
'ENABLE_SUB_LIBRARY': ENABLE_SUB_LIBRARY,
|
'ENABLE_SUB_LIBRARY': ENABLE_SUB_LIBRARY,
|
||||||
'server_crypto': server_crypto,
|
'server_crypto': server_crypto,
|
||||||
"sub_lib_enabled": sub_lib_enabled,
|
"sub_lib_enabled": sub_lib_enabled,
|
||||||
|
"enable_upload_folder": ENABLE_UPLOAD_FOLDER,
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
Reference in New Issue
Block a user