mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
[repo snapshot] enable department admin to restore department repo (#4446)
This commit is contained in:
@@ -16,7 +16,7 @@ import './css/search.css';
|
||||
import './css/repo-snapshot.css';
|
||||
|
||||
const {
|
||||
repoID, repoName, isRepoOwner,
|
||||
repoID, repoName, canRestoreRepo,
|
||||
commitID, commitTime, commitDesc, commitRelativeTime,
|
||||
showAuthor, authorAvatarURL, authorName, authorNickName
|
||||
} = window.app.pageOptions;
|
||||
@@ -159,7 +159,7 @@ class RepoSnapshot extends React.Component {
|
||||
)}
|
||||
<div className="d-flex justify-content-between align-items-center op-bar">
|
||||
<p className="m-0">{gettext('Current path: ')}{this.renderPath()}</p>
|
||||
{(folderPath == '/' && isRepoOwner) &&
|
||||
{(folderPath == '/' && canRestoreRepo) &&
|
||||
<button className="btn btn-secondary op-bar-btn" onClick={this.toggleDialog}>{gettext('Restore')}</button>
|
||||
}
|
||||
</div>
|
||||
|
@@ -27,7 +27,7 @@ window.app.pageOptions = {
|
||||
authorNickName: '{{ current_commit.props.creator_name|email2nickname|escapejs }}',
|
||||
{% endif %}
|
||||
|
||||
isRepoOwner: {% if is_repo_owner %} true {% else %} false {% endif %}
|
||||
canRestoreRepo: {% if can_restore_repo %} true {% else %} false {% endif %}
|
||||
};
|
||||
</script>
|
||||
{% render_bundle 'repoSnapshot' 'js' %}
|
||||
|
@@ -202,7 +202,7 @@ def repo_snapshot(request, repo_id):
|
||||
|
||||
return render(request, 'repo_snapshot_react.html', {
|
||||
'repo': repo,
|
||||
"is_repo_owner": has_perm,
|
||||
"can_restore_repo": has_perm,
|
||||
'current_commit': current_commit,
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user