From 3edb83ee9f75e9b84386289fa3768db805ead556 Mon Sep 17 00:00:00 2001 From: ilearnit Date: Mon, 17 Dec 2018 08:58:43 +0000 Subject: [PATCH] update repo history setting --- .../components/dialog/lib-history-setting-dialog.js | 13 +++++++++---- frontend/src/utils/constants.js | 1 + seahub/templates/base_for_react.html | 1 + seahub/views/__init__.py | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/dialog/lib-history-setting-dialog.js b/frontend/src/components/dialog/lib-history-setting-dialog.js index 5dcabcecd3..19252ffafa 100644 --- a/frontend/src/components/dialog/lib-history-setting-dialog.js +++ b/frontend/src/components/dialog/lib-history-setting-dialog.js @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; -import { gettext } from '../../utils/constants'; +import { gettext, enableRepoHistorySetting } from '../../utils/constants'; import toaster from '../toast'; import { Button, Modal, ModalHeader, ModalBody, Form, FormGroup, Label, Input } from 'reactstrap'; import { seafileAPI } from '../../utils/seafile-api.js'; @@ -101,16 +101,21 @@ class LibHistorySetting extends React.Component {
+ {!enableRepoHistorySetting && + + + + } - {this.setLimitDays('allHistory')}}/>{' '} + {this.setLimitDays('allHistory')}}/>{' '} - {this.setLimitDays('noHistory')}}/>{' '} + {this.setLimitDays('noHistory')}}/>{' '} - {this.setLimitDays('autoHistory')}}/>{' '} + {this.setLimitDays('autoHistory')}}/>{' '} diff --git a/seahub/views/__init__.py b/seahub/views/__init__.py index ecd653be3d..7204a56df4 100644 --- a/seahub/views/__init__.py +++ b/seahub/views/__init__.py @@ -719,6 +719,7 @@ def libraries(request): 'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN, 'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX, 'enable_encrypted_library': config.ENABLE_ENCRYPTED_LIBRARY, + 'enable_repo_history_setting': config.ENABLE_REPO_HISTORY_SETTING, }) return render(request, 'libraries.html', {