<div ng-repeat = "comment in item.comments" ng-init="item.show_all_comments = true">
    <div ng-repeat = "attach in comment.attachments">
        <div ng-if="attach.name.substring(attach.name.length - 4) === '.xml'"
            ng-init = "item.shown_attach = item.shown_attach ? item.shown_attach : attach.name"
            ng-show = "item.shown_attach === attach.name || item.show_all_comments">
            <a ng-if = "aux.canDownloadReport || aux.canDownloadReport === undefined" href="{{ attach.path }}" ng-click="item.shown_attach === attach.name ? aux.setDownloadedStatus(item) : ''">
            {{attach.name}}
            </a>
            <span ng-if = "!(aux.canDownloadReport || aux.canDownloadReport === undefined)">
            {{attach.name}}
            </span>
            <button class="btn btn-default btn-xs padB-4 padT-2" 
                ng-click="aux.loadFormByXmlPath(attach.path, attach.name, item)"><div class="eye-icon"></div></button>
            <button class="btn btn-default btn-xs padB-4 padT-2"
                ng-click="aux.downloadWithAttachments(item, attach.name)"
                ng-if="(aux.canDownloadReport || aux.canDownloadReport === undefined)"><div class="download-icon"></div></button>
        </div>
    </div>
</div>
