diff --git a/app/coffee/modules/common/components.coffee b/app/coffee/modules/common/components.coffee
index 98e60bc3..8f3c04c8 100644
--- a/app/coffee/modules/common/components.coffee
+++ b/app/coffee/modules/common/components.coffee
@@ -24,6 +24,7 @@ bindOnce = @.taiga.bindOnce
module = angular.module("taigaCommon")
+
#############################################################################
## Date Range Directive (used mainly for sprint date range)
#############################################################################
@@ -156,7 +157,7 @@ module.directive("tgCreatedByDisplay", CreatedByDisplayDirective)
## Watchers directive
#############################################################################
-WatchersDirective = ($rootscope, $confirm, $tgrepo) ->
+WatchersDirective = ($rootscope, $confirm, $repo) ->
# You have to include a div with the tg-lb-watchers directive in the page
# where use this directive
#
@@ -187,7 +188,7 @@ WatchersDirective = ($rootscope, $confirm, $tgrepo) ->
link = ($scope, $el, $attrs, $model) ->
save = (model) ->
- promise = $tgrepo.save($model.$modelValue)
+ promise = $repo.save($model.$modelValue)
promise.then ->
$confirm.notify("success")
watchers = _.map(model.watchers, (watcherId) -> $scope.usersById[watcherId])
@@ -255,7 +256,7 @@ module.directive("tgWatchers", ["$rootScope", "$tgConfirm", "$tgRepo", WatchersD
## Assigned to directive
#############################################################################
-AssignedToDirective = ($rootscope, $confirm, $tgrepo, $loading) ->
+AssignedToDirective = ($rootscope, $confirm, $repo, $loading) ->
# You have to include a div with the tg-lb-assignedto directive in the page
# where use this directive
#
@@ -288,7 +289,7 @@ AssignedToDirective = ($rootscope, $confirm, $tgrepo, $loading) ->
save = (model) ->
$loading.start($el)
- promise = $tgrepo.save($model.$modelValue)
+ promise = $repo.save($model.$modelValue)
promise.then ->
$loading.finish($el)
$confirm.notify("success")
@@ -339,6 +340,7 @@ AssignedToDirective = ($rootscope, $confirm, $tgrepo, $loading) ->
module.directive("tgAssignedTo", ["$rootScope", "$tgConfirm", "$tgRepo", "$tgLoading", AssignedToDirective])
+
#############################################################################
## Block Button directive
#############################################################################
@@ -387,11 +389,12 @@ BlockButtonDirective = ($rootscope, $loading) ->
module.directive("tgBlockButton", ["$rootScope", "$tgLoading", BlockButtonDirective])
+
#############################################################################
## Delete Button directive
#############################################################################
-DeleteButtonDirective = ($tgrepo, $confirm, $navurls, $location) ->
+DeleteButtonDirective = ($repo, $confirm, $navurls, $location) ->
template = _.template("""
Delete
""")
@@ -413,7 +416,7 @@ DeleteButtonDirective = ($tgrepo, $confirm, $navurls, $location) ->
subtitle = $model.$modelValue.subject
$confirm.ask(title, subtitle).then (finish) =>
- promise = $tgrepo.remove($model.$modelValue)
+ promise = $repo.remove($model.$modelValue)
promise.then =>
finish()
$location.path($navurls.resolve($attrs.onDeleteGoToUrl, {project: $attrs.projectSlug}))
@@ -429,15 +432,16 @@ DeleteButtonDirective = ($tgrepo, $confirm, $navurls, $location) ->
module.directive("tgDeleteButton", ["$tgRepo", "$tgConfirm", "$tgNavUrls", "$tgLocation", DeleteButtonDirective])
+
#############################################################################
## Editable subject directive
#############################################################################
-EditableSubjectDirective = ($rootscope, $tgrepo, $confirm, $navurls, $location, $loading) ->
+EditableSubjectDirective = ($rootscope, $repo, $confirm, $loading) ->
viewTemplate = _.template("""
<%- item.subject %>
<% if (canEdit) { %>
-
+
<% } %>
""")
@@ -462,8 +466,9 @@ EditableSubjectDirective = ($rootscope, $tgrepo, $confirm, $navurls, $location,
save = ->
$model.$modelValue.subject = $el.find('input').val()
$loading.start($el.find('.save-container'))
- promise = $tgrepo.save($model.$modelValue)
+ promise = $repo.save($model.$modelValue)
promise.then ->
+ $confirm.notify("success")
$rootscope.$broadcast("history:reload")
editing = false
$loading.finish($el.find('.save-container'))
@@ -503,13 +508,15 @@ EditableSubjectDirective = ($rootscope, $tgrepo, $confirm, $navurls, $location,
require: "ngModel"
}
-module.directive("tgEditableSubject", ["$rootScope", "$tgRepo", "$tgConfirm", "$tgNavUrls", "$tgLocation", "$tgLoading", EditableSubjectDirective])
+module.directive("tgEditableSubject", ["$rootScope", "$tgRepo", "$tgConfirm", "$tgLoading",
+ EditableSubjectDirective])
+
#############################################################################
## Editable subject directive
#############################################################################
-EditableDescriptionDirective = ($rootscope, $tgrepo, $confirm, $navurls, $location, $compile, $loading) ->
+EditableDescriptionDirective = ($rootscope, $repo, $confirm, $compile, $loading) ->
viewTemplate = _.template("""