                     _.sorBy($scope.attachments, 'order')
 
         ## Total attachments counter
-        $scope.$watch "attachmentsCount", (attachmentsCount) ->
-            $el.find("span.attachments-num").html(attachmentsCount)
-
-        ## See deprecated attachments
+        $scope.$watch "attachmentsCount", (count) ->
+            $el.find("span.attachments-num").html(count)
+
+        ## Show/Hide deprecated attachments
         $scope.showDeprecatedAttachments = false
 
         $scope.$watch "deprecatedAttachmentsCount", (deprecatedAttachmentsCount) ->

            newIsDeprecated = $el.find("input[name='is-deprecated']").prop("checked")

            if newDescription != attachment.description
                attachment.setAttr("description", newDescription)
            if newIsDeprecated != attachment.is_deprecated
                attachment.setAttr("is_deprecated", newIsDeprecated)

            onSuccess = ->
                $ctrl.loadAttachments(attachment.object_id)

    <a class="editable icon icon-delete" href="" title="Cancel"></a>
    """) # TODO: i18n

    link = ($scope, $el, $attrs) ->
        $ctrl = $el.controller()

        render = (attachment, isEditable=false) ->
