header(tg-backlog-sprint-header)

.summary-progress-wrapper
    div.sprint-progress-bar(tg-progress-bar="100 * sprint.closed_points / sprint.total_points")

div.sprint-table(tg-bind-scope, ng-class="{'sprint-empty-wrapper': !sprint.user_stories.length}")
    div.sprint-empty(ng-if="!sprint.user_stories.length")
        span(tg-class-permission="{'hidden': 'modify_us'}") {{ 'BACKLOG.SPRINTS.WARNING_EMPTY_SPRINT_ANONYMOUS' | translate }}
        span(tg-class-permission="{'hidden': '!modify_us'}") {{ 'BACKLOG.SPRINTS.WARNING_EMPTY_SPRINT' | translate }}
    div.row.milestone-us-item-row(
        ng-repeat="us in sprint.user_stories track by us.id"
        tg-bind-scope
        tg-class-permission="{'readonly': '!modify_us'}"
    )
        div.column-us
            a.us-name.clickable(tg-nav="project-userstories-detail:project=project.slug,ref=us.ref",
                                tg-nav-get-params="{\"milestone\": {{us.milestone}}}"
                                tg-bo-title="'#' + us.ref + ' ' +  us.subject",
                                ng-class="{closed: us.is_closed, blocked: us.is_blocked}")
                span(tg-bo-ref="us.ref")
                span(tg-bo-bind="us.subject")
                tg-belong-to-epics(
                    format="pill"
                    ng-if="us.epics"
                    epics="us.epics"
                )
        div.column-points.width-1(tg-bo-bind="us.total_points",
                                  ng-class="{closed: us.is_closed, blocked: us.is_blocked}")

a.button-gray(title="{{ 'BACKLOG.SPRINTS.TITLE_LINK_TASKBOARD' | translate: {\"name\": sprint.name} }}",
              tg-nav="project-taskboard:project=project.slug,sprint=sprint.slug",
              tg-check-permission="view_milestones")

    span(translate="BACKLOG.SPRINTS.LINK_TASKBOARD")
