if user.email
  /.ui.horizontal.divider= user.nickname
  span.ui.segment.pull-right= user.nickname
  if statistics
    ui-checkbox class='toggle' label=(t 'user.statistics1.project_specific.label') checked=project_specific onChange=(action (mut project_specific))
    '
    if project_specific
      each-in statistics as |project_name stats|
        .ui.header= project_name
        = each stats as |stat|
          if (can 'read' 'model' 'panda/project-instance')
            = link-to 'project.show.project-instance-action' stat.project_id (query-params state=stat.state)
              = state-badge stat.state
                '
                span.between-brackets= stat.count
          else
            = state-badge stat.state
              '
              span.between-brackets= stat.count
    else
      /.ui.header= t 'user.statistics1.global.title'
      each-in statistics as |state count|
        if (can 'read' 'model' 'panda/project-instance')
          = link-to 'action-list' (query-params state=state)
            = state-badge state
              '
              span.between-brackets= count
        else
          = state-badge state
            '
            span.between-brackets= count
    = yield
  else
    .ui.active.inline.centered.loader
else
  .ui.active.inline.centered.loader
