mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Make sure to send description before publishing
This commit is contained in:
parent
c9e5583394
commit
a59a2dcf39
2 changed files with 20 additions and 19 deletions
|
@ -15,7 +15,6 @@ script(type="text/ng-template", id="publishProjectAsTemplateModalTemplate")
|
|||
rows=5,
|
||||
name='Description',
|
||||
ng-model="templateDetails.description",
|
||||
ng-blur="updateProjectDescription()",
|
||||
value=""
|
||||
)
|
||||
div(ng-show="templateDetails.exists").text-center.templateDetails
|
||||
|
|
|
@ -38,30 +38,32 @@ define [
|
|||
problemTalkingToTemplateApi()
|
||||
|
||||
refreshPublishedStatus()
|
||||
$scope.$watch $scope.problemTalkingToTemplateApi, refreshPublishedStatus
|
||||
$scope.$watch $scope.problemTalkingToTemplateApi, (value) ->
|
||||
if value?
|
||||
refreshPublishedStatus()
|
||||
|
||||
$scope.updateProjectDescription = ->
|
||||
description = $scope.templateDetails.description
|
||||
if description?
|
||||
$http
|
||||
.post("/project/#{ide.project_id}/template/description", {
|
||||
description: description
|
||||
_csrf: window.csrfToken
|
||||
})
|
||||
.error () ->
|
||||
problemTalkingToTemplateApi()
|
||||
updateProjectDescription = ->
|
||||
$http.post("/project/#{ide.project_id}/template/description", {
|
||||
description: $scope.templateDetails.description
|
||||
_csrf: window.csrfToken
|
||||
})
|
||||
|
||||
$scope.publishTemplate = ->
|
||||
$scope.state.publishInflight = true
|
||||
$http
|
||||
.post("/project/#{ide.project_id}/template/publish", {
|
||||
_csrf: window.csrfToken
|
||||
})
|
||||
.success () ->
|
||||
refreshPublishedStatus()
|
||||
$scope.state.publishInflight = false
|
||||
updateProjectDescription()
|
||||
.error () ->
|
||||
problemTalkingToTemplateApi()
|
||||
.success () ->
|
||||
$http
|
||||
.post("/project/#{ide.project_id}/template/publish", {
|
||||
_csrf: window.csrfToken
|
||||
})
|
||||
.error () ->
|
||||
problemTalkingToTemplateApi()
|
||||
.success () ->
|
||||
refreshPublishedStatus()
|
||||
$scope.state.publishInflight = false
|
||||
|
||||
|
||||
$scope.unpublishTemplate = ->
|
||||
$scope.state.unpublishInflight = true
|
||||
|
|
Loading…
Reference in a new issue