section.related-userstories(
    ng-if="vm.showRelatedUserStoriesSection()"
)
    .related-userstories-header
        span.related-userstories-title(translate="COMMON.RELATED_USERSTORIES")
        tg-related-userstories-create(
          tg-check-permission="modify_epic"
          show-create-related-userstories-lightbox="vm.showCreateRelatedUserstoriesLightbox"
          project="vm.project"
          epic="vm.epic"
          epic-userstories="vm.userstories"
          load-related-userstories="vm.loadRelatedUserstories()"
        )

    .related-userstories-body(
        tg-related-userstories-sortable="vm.reorderRelatedUserstory(us, newIndex)"
    )
        tg-related-userstory-row.row(
            tg-repeat="us in vm.userstories track by us.get('id')"
            ng-class="{closed: us.get('is_closed'), blocked: us.get('is_blocked'), sortable: vm.userCanSort()}"
            userstory="us"
            epic="vm.epic"
            project="vm.project"
            load-related-userstories="vm.loadRelatedUserstories()"
            tg-bind-scope
        )

    div(tg-related-userstories-create-form)
