template(name="archivesSidebar")
  if isArchiveReady.get
    +basicTabs(tabs=tabs)
      +tabContent(slug="cards")
        unless isWorker
          p.quiet
            a.js-restore-all-cards {{_ 'restore-all'}}
            if currentUser.isBoardAdmin
              | -
              a.js-delete-all-cards {{_ 'delete-all'}}
        each archivedCards
          .minicard-wrapper.js-minicard
            +minicard(this)
          if currentUser.isBoardMember
            unless isWorker
              p.quiet
                if this.archivedAt
                  | {{_ 'archived-at' }}
                  | 
                  | {{ moment this.archivedAt 'LLL' }}
                  br
                a.js-restore-card {{_ 'restore'}}
                if currentUser.isBoardAdmin
                  | -
                  a.js-delete-card {{_ 'delete'}}
            if cardIsInArchivedList
              p.quiet.small ({{_ 'warn-list-archived'}})
        else
          p.no-items-message {{_ 'no-archived-cards'}}

      +tabContent(slug="lists")
        unless isWorker
          p.quiet
            a.js-restore-all-lists {{_ 'restore-all'}}
            if currentUser.isBoardAdmin
              | -
              a.js-delete-all-lists {{_ 'delete-all'}}
        ul.archived-lists
          each archivedLists
            li.archived-lists-item
              = title
              if currentUser.isBoardMember
                unless isWorker
                  p.quiet
                    if this.archivedAt
                      | {{_ 'archived-at' }}
                      | 
                      | {{ moment this.archivedAt 'LLL' }}
                      br
                    a.js-restore-list {{_ 'restore'}}
                    if currentUser.isBoardAdmin
                      | -
                      a.js-delete-list {{_ 'delete'}}
          else
            li.no-items-message {{_ 'no-archived-lists'}}

      +tabContent(slug="swimlanes")
        unless isWorker
          p.quiet
            a.js-restore-all-swimlanes {{_ 'restore-all'}}
            if currentUser.isBoardAdmin
              | -
              a.js-delete-all-swimlanes {{_ 'delete-all'}}
        ul.archived-lists
          each archivedSwimlanes
            li.archived-lists-item
              = title
              if currentUser.isBoardMember
                unless isWorker
                  p.quiet
                    if this.archivedAt
                      | {{_ 'archived-at' }}
                      | 
                      | {{ moment this.archivedAt 'LLL' }}
                      br
                    a.js-restore-swimlane {{_ 'restore'}}
                    if currentUser.isBoardAdmin
                      | -
                      a.js-delete-swimlane {{_ 'delete'}}
          else
            li.no-items-message {{_ 'no-archived-swimlanes'}}
  else
    +spinner
