mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-18 15:08:22 +00:00
enable admin change repo history when enable_repo_history_setting (#2469)
This commit is contained in:
parent
ebda1a316d
commit
a43389a126
@ -52,9 +52,7 @@ class AdminLibraryHistoryLimit(APIView):
|
|||||||
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
return api_error(status.HTTP_404_NOT_FOUND, error_msg)
|
||||||
|
|
||||||
# no settings for virtual repo
|
# no settings for virtual repo
|
||||||
if repo.is_virtual or \
|
if repo.is_virtual:
|
||||||
not config.ENABLE_REPO_HISTORY_SETTING:
|
|
||||||
|
|
||||||
error_msg = 'Permission denied.'
|
error_msg = 'Permission denied.'
|
||||||
return api_error(status.HTTP_403_FORBIDDEN, error_msg)
|
return api_error(status.HTTP_403_FORBIDDEN, error_msg)
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ define([
|
|||||||
this.repo_name = options.repo_name;
|
this.repo_name = options.repo_name;
|
||||||
this.repo_id = options.repo_id;
|
this.repo_id = options.repo_id;
|
||||||
this.url_name = options.url_name;
|
this.url_name = options.url_name;
|
||||||
|
this.is_admin_panel = options.is_admin_panel;
|
||||||
|
|
||||||
this.render();
|
this.render();
|
||||||
this.$('.op-target').css({'max-width':280}); // for long repo name
|
this.$('.op-target').css({'max-width':280}); // for long repo name
|
||||||
@ -68,7 +69,7 @@ define([
|
|||||||
}
|
}
|
||||||
_this.$radios.filter(':checked').trigger('focus');
|
_this.$radios.filter(':checked').trigger('focus');
|
||||||
|
|
||||||
if (!app.pageOptions.enable_repo_history_setting) {
|
if (!app.pageOptions.enable_repo_history_setting && !_this.is_admin_panel) {
|
||||||
_this.$('.history-settings-notice').removeClass('hide');
|
_this.$('.history-settings-notice').removeClass('hide');
|
||||||
_this.$radios.prop('disabled', true);
|
_this.$radios.prop('disabled', true);
|
||||||
_this.$days_input.prop('disabled', true).addClass('input-disabled');
|
_this.$days_input.prop('disabled', true).addClass('input-disabled');
|
||||||
|
@ -43,6 +43,7 @@ define([
|
|||||||
var options = {
|
var options = {
|
||||||
'repo_name': this.model.get('name'),
|
'repo_name': this.model.get('name'),
|
||||||
'repo_id': this.model.get('id'),
|
'repo_id': this.model.get('id'),
|
||||||
|
'is_admin_panel': true,
|
||||||
'url_name': 'admin-library-history-limit'
|
'url_name': 'admin-library-history-limit'
|
||||||
};
|
};
|
||||||
this.togglePopup(); // close the popup
|
this.togglePopup(); // close the popup
|
||||||
|
Loading…
Reference in New Issue
Block a user