mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 00:20:07 +00:00
enable library template when create group/pub repo
This commit is contained in:
@@ -741,6 +741,7 @@ class PubRepos(APIView):
|
|||||||
if permission != 'r' and permission != 'rw':
|
if permission != 'r' and permission != 'rw':
|
||||||
return api_error(status.HTTP_400_BAD_REQUEST, 'Invalid permission')
|
return api_error(status.HTTP_400_BAD_REQUEST, 'Invalid permission')
|
||||||
|
|
||||||
|
org_id = -1
|
||||||
if is_org_context(request):
|
if is_org_context(request):
|
||||||
org_id = request.user.org.org_id
|
org_id = request.user.org.org_id
|
||||||
repo_id = seafile_api.create_org_repo(repo_name, repo_desc,
|
repo_id = seafile_api.create_org_repo(repo_name, repo_desc,
|
||||||
@@ -754,6 +755,13 @@ class PubRepos(APIView):
|
|||||||
repo = seafile_api.get_repo(repo_id)
|
repo = seafile_api.get_repo(repo_id)
|
||||||
seafile_api.add_inner_pub_repo(repo.id, permission)
|
seafile_api.add_inner_pub_repo(repo.id, permission)
|
||||||
|
|
||||||
|
library_template = request.data.get("library_template", None)
|
||||||
|
repo_created.send(sender=None,
|
||||||
|
org_id=org_id,
|
||||||
|
creator=username,
|
||||||
|
repo_id=repo_id,
|
||||||
|
repo_name=repo_name,
|
||||||
|
library_template=library_template)
|
||||||
pub_repo = {
|
pub_repo = {
|
||||||
"id": repo.id,
|
"id": repo.id,
|
||||||
"name": repo.name,
|
"name": repo.name,
|
||||||
@@ -3711,6 +3719,7 @@ class GroupRepos(APIView):
|
|||||||
if permission != 'r' and permission != 'rw':
|
if permission != 'r' and permission != 'rw':
|
||||||
return api_error(status.HTTP_400_BAD_REQUEST, 'Invalid permission')
|
return api_error(status.HTTP_400_BAD_REQUEST, 'Invalid permission')
|
||||||
|
|
||||||
|
org_id = -1
|
||||||
if is_org_context(request):
|
if is_org_context(request):
|
||||||
org_id = request.user.org.org_id
|
org_id = request.user.org.org_id
|
||||||
repo_id = seafile_api.create_org_repo(repo_name, repo_desc,
|
repo_id = seafile_api.create_org_repo(repo_name, repo_desc,
|
||||||
@@ -3724,6 +3733,13 @@ class GroupRepos(APIView):
|
|||||||
repo = seafile_api.get_repo(repo_id)
|
repo = seafile_api.get_repo(repo_id)
|
||||||
seafile_api.set_group_repo(repo.id, group.id, username, permission)
|
seafile_api.set_group_repo(repo.id, group.id, username, permission)
|
||||||
|
|
||||||
|
library_template = request.data.get("library_template", None)
|
||||||
|
repo_created.send(sender=None,
|
||||||
|
org_id=org_id,
|
||||||
|
creator=username,
|
||||||
|
repo_id=repo_id,
|
||||||
|
repo_name=repo_name,
|
||||||
|
library_template=library_template)
|
||||||
group_repo = {
|
group_repo = {
|
||||||
"id": repo.id,
|
"id": repo.id,
|
||||||
"name": repo.name,
|
"name": repo.name,
|
||||||
|
@@ -12,7 +12,8 @@ define([
|
|||||||
templateData: function() {
|
templateData: function() {
|
||||||
return {
|
return {
|
||||||
showSharePerm: true,
|
showSharePerm: true,
|
||||||
enable_encrypted_library: app.pageOptions.enable_encrypted_library
|
enable_encrypted_library: app.pageOptions.enable_encrypted_library,
|
||||||
|
library_templates: app.pageOptions.library_templates
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -12,7 +12,8 @@ define([
|
|||||||
templateData: function() {
|
templateData: function() {
|
||||||
return {
|
return {
|
||||||
showSharePerm: true,
|
showSharePerm: true,
|
||||||
enable_encrypted_library: app.pageOptions.enable_encrypted_library
|
enable_encrypted_library: app.pageOptions.enable_encrypted_library,
|
||||||
|
library_templates: app.pageOptions.library_templates
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user