         location = if load then @location else @location.noreload(@scope)
         location.search(name, value)
 
+taiga.FiltersMixin = FiltersMixin
 
-taiga = @.taiga
-taiga.PageMixin = PageMixin
-taiga.FiltersMixin = FiltersMixin
+
+#############################################################################
+## Attachments Mixin
+#############################################################################
+# This mixin requires @rs ($tgResources), @scope and @log ($tgLog)
+# The mixin required @..attachmentsUrlName (p.e. 'issues/attachments',see resources.coffee)
+
+class AttachmentsMixin
+    loadAttachments: (objectId) ->
+        if not @.attachmentsUrlName
+            return @log.error "AttachmentsMixin: @.attachmentsUrlName is required"
+
+        @scope.attachmentsCount = 0
+        @scope.activeAttachmentsCount = 0
+        @scope.deprecatedAttachmentsCount = 0
+
+        return @rs.attachments.list(@.attachmentsUrlName, objectId).then (attachments) =>
+            @scope.attachments = _.sortBy(attachments, "order")
+            @scope.attachmentsCount = @scope.attachments.length
+            @scope.activeAttachments = _.filter(@scope.attachments, is_deprecated: false)
+            @scope.activeAttachmentsCount = @scope.activeAttachments.length
+            @scope.deprecatedAttachments = _.filter(@scope.attachments, is_deprecated: true)
+            @scope.deprecatedAttachmentsCount = @scope.deprecatedAttachments.length
+            return attachments
+
+taiga.AttachmentsMixin = AttachmentsMixin

toString = @.taiga.toString


class PageMixin
    loadUsersAndRoles: ->
        promise = @q.all([


            return results

taiga.PageMixin = PageMixin


#############################################################################
## Filters Mixin
#############################################################################
# This mixin requires @location ($tgLocation) and @scope

class FiltersMixin
    selectFilter: (name, value, load=false) ->
