         require: "ngModel"
     }
 
-module.directive("tgUsStatusButton", ["$rootScope", "$tgRepo", UsStatusButtonDirective])
+module.directive("tgUsStatusButton", ["$rootScope", "$tgRepo", "$tgConfirm", UsStatusButtonDirective])
 
 
 #############################################################################

    """) #TODO: i18n

    link = ($scope, $el, $attrs, $model) ->
        render = (us) =>
            status = $scope.statusById[us.status]

            html = template({
                status: status
                statuses: $scope.statusList
            })
            $el.html(html)

        $el.on "click", ".status-data", (event) ->
            event.preventDefault()
            event.stopPropagation()

            $el.find(".pop-status").popover().open()

        $el.on "click", ".status", (event) ->
            event.preventDefault()
            event.stopPropagation()
            target = angular.element(event.currentTarget)

            $.fn.popover().closeAll()

            us = $model.$modelValue.clone()
            us.status = target.data("status-id")

            $model.$setViewValue(us)
            $repo.save($model.$modelValue).then ->
                $rootScope.$broadcast("history:reload")

        $scope.$watch $attrs.ngModel, (us) ->
            render(us) if us

## User story status button directive
#############################################################################

UsStatusButtonDirective = ($rootScope, $repo, $confirm) ->
    # Display the status of a US and you can edit it.
    #
    # Example:
