Issue 2762 - fix delete attribute lightbox translation

stable
Juanfran 2015-05-29 10:19:11 +02:00
parent bba644004b
commit e5106c830d
1 changed files with 12 additions and 6 deletions

View File

@ -124,7 +124,7 @@ module.controller("ProjectValuesController", ProjectValuesController)
## Project values directive ## Project values directive
############################################################################# #############################################################################
ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, @translate, $rootscope) -> ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, $translate, $rootscope) ->
## Drag & Drop Link ## Drag & Drop Link
linkDragAndDrop = ($scope, $el, $attrs) -> linkDragAndDrop = ($scope, $el, $attrs) ->
@ -165,7 +165,7 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, @tra
} }
initializeTextTranslations = -> initializeTextTranslations = ->
$scope.addNewElementText = @translate.instant("ADMIN.PROJECT_VALUES_#{objName.toUpperCase()}.ACTION_ADD") $scope.addNewElementText = $translate.instant("ADMIN.PROJECT_VALUES_#{objName.toUpperCase()}.ACTION_ADD")
initializeNewValue() initializeNewValue()
initializeTextTranslations() initializeTextTranslations()
@ -294,7 +294,10 @@ ProjectValuesDirective = ($log, $repo, $confirm, $location, animationFrame, @tra
if _.keys(choices).length == 0 if _.keys(choices).length == 0
return $confirm.error("ADMIN.PROJECT_VALUES.ERROR_DELETE_ALL") return $confirm.error("ADMIN.PROJECT_VALUES.ERROR_DELETE_ALL")
$confirm.askChoice("PROJECT.TITLE_ACTION_DELETE_VALUE", subtitle, choices, "ADMIN.PROJECT_VALUES.REPLACEMENT").then (response) -> title = $translate.instant("ADMIN.COMMON.TITLE_ACTION_DELETE_VALUE")
text = $translate.instant("ADMIN.PROJECT_VALUES.REPLACEMENT")
$confirm.askChoice(title, subtitle, choices, text).then (response) ->
onSucces = -> onSucces = ->
$ctrl.loadValues().finally -> $ctrl.loadValues().finally ->
response.finish() response.finish()
@ -428,7 +431,7 @@ module.controller("ProjectCustomAttributesController", ProjectCustomAttributesCo
## Custom Attributes Directive ## Custom Attributes Directive
############################################################################# #############################################################################
ProjectCustomAttributesDirective = ($log, $confirm, animationFrame) -> ProjectCustomAttributesDirective = ($log, $confirm, animationFrame, $translate) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
$ctrl = $el.controller() $ctrl = $el.controller()
@ -614,7 +617,10 @@ ProjectCustomAttributesDirective = ($log, $confirm, animationFrame) ->
attr = formEl.scope().attr attr = formEl.scope().attr
message = attr.name message = attr.name
$confirm.ask("COMMON.CUSTOM_ATTRIBUTES.DELETE", "COMMON.CUSTOM_ATTRIBUTES.CONFIRM_DELETE", message).then (finish) -> title = $translate.instant("COMMON.CUSTOM_ATTRIBUTES.DELETE")
text = $translate.instant("COMMON.CUSTOM_ATTRIBUTES.CONFIRM_DELETE")
$confirm.ask(title, text, message).then (finish) ->
onSucces = -> onSucces = ->
$ctrl.loadCustomAttributes().finally -> $ctrl.loadCustomAttributes().finally ->
finish() finish()
@ -634,4 +640,4 @@ ProjectCustomAttributesDirective = ($log, $confirm, animationFrame) ->
return {link: link} return {link: link}
module.directive("tgProjectCustomAttributes", ["$log", "$tgConfirm", "animationFrame", ProjectCustomAttributesDirective]) module.directive("tgProjectCustomAttributes", ["$log", "$tgConfirm", "animationFrame", "$translate", ProjectCustomAttributesDirective])