 
     return {link:link}
 
+module.directive("tgLbCreateIssue", ["$tgRepo", "$tgConfirm", "$rootScope", "lightboxService",
+                                     CreateIssueDirective])
 
-CreateBulkIssuesDirective = ($repo, $rs, $rootscope, lightboxService) ->
+
+#############################################################################
+## Issue Bulk Create Lightbox Directive
+#############################################################################
+
+CreateBulkIssuesDirective = ($repo, $rs, $confirm, $rootscope, lightboxService) ->
     link = ($scope, $el, attrs) ->
         $scope.$on "issueform:bulk", (ctx, projectId, status)->
             lightboxService.open($el)

            promise.then (result) ->
                $rootscope.$broadcast("issueform:new:success", result)
                lightboxService.close($el)

            # TODO: error handling
            promise.then null, ->
                console.log "FAIL"

        $scope.$on "$destroy", ->
            $el.off()

    return {link: link}

module.directive("tgLbCreateIssue", [
    "$tgRepo",
    "$tgModel",
    "$tgResources",
    "$rootScope",
    "lightboxService",
    CreateIssueDirective
])

module.directive("tgLbCreateBulkIssues", [
    "$tgRepo",
    "$tgResources",
    "$rootScope",
    "lightboxService",
    CreateBulkIssuesDirective
])

#############################################################################
## Issue Create Lightbox Directive
#############################################################################

# BulkCreateIssuesDirective = ($repo, $model, $rs, $rootscope) ->
#     link = ($scope, $el, $attrs) ->
#         $scope.$on "issueform:new", ->
#             $el.removeClass("hidden")
#
#         $scope.$on "$destroy", ->
#             $el.off()
#
#         $el.on "click", ".close", (event) ->
#             event.preventDefault()
#             $el.addClass("hidden")
#
#     return {link:link}

# module.directive("tgLbCreateIssue", [
#     "$tgRepo",
#     "$tgModel",
#     "$tgResources",
#     "$rootScope",
#     CreateIssueDirective
# ])

## Issue Create Lightbox Directive
#############################################################################

CreateIssueDirective = ($repo, $confirm, $rootscope, lightboxService) ->
    link = ($scope, $el, $attrs) ->
        form = $el.find("form").checksley()
        $scope.issue = {}
