1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

[repo snapshot] enable department admin to restore department repo (#4446)

This commit is contained in:
llj
2020-02-21 20:26:13 +08:00
committed by GitHub
parent 64e7a5ebde
commit 0b0d118ca0
3 changed files with 4 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ import './css/search.css';
import './css/repo-snapshot.css'; import './css/repo-snapshot.css';
const { const {
repoID, repoName, isRepoOwner, repoID, repoName, canRestoreRepo,
commitID, commitTime, commitDesc, commitRelativeTime, commitID, commitTime, commitDesc, commitRelativeTime,
showAuthor, authorAvatarURL, authorName, authorNickName showAuthor, authorAvatarURL, authorName, authorNickName
} = window.app.pageOptions; } = window.app.pageOptions;
@@ -159,7 +159,7 @@ class RepoSnapshot extends React.Component {
)} )}
<div className="d-flex justify-content-between align-items-center op-bar"> <div className="d-flex justify-content-between align-items-center op-bar">
<p className="m-0">{gettext('Current path: ')}{this.renderPath()}</p> <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> <button className="btn btn-secondary op-bar-btn" onClick={this.toggleDialog}>{gettext('Restore')}</button>
} }
</div> </div>

View File

@@ -27,7 +27,7 @@ window.app.pageOptions = {
authorNickName: '{{ current_commit.props.creator_name|email2nickname|escapejs }}', authorNickName: '{{ current_commit.props.creator_name|email2nickname|escapejs }}',
{% endif %} {% endif %}
isRepoOwner: {% if is_repo_owner %} true {% else %} false {% endif %} canRestoreRepo: {% if can_restore_repo %} true {% else %} false {% endif %}
}; };
</script> </script>
{% render_bundle 'repoSnapshot' 'js' %} {% render_bundle 'repoSnapshot' 'js' %}

View File

@@ -202,7 +202,7 @@ def repo_snapshot(request, repo_id):
return render(request, 'repo_snapshot_react.html', { return render(request, 'repo_snapshot_react.html', {
'repo': repo, 'repo': repo,
"is_repo_owner": has_perm, "can_restore_repo": has_perm,
'current_commit': current_commit, 'current_commit': current_commit,
}) })