template(name="boardList")
  .wrapper
    ul.AllBoardTeamsOrgs
      li.AllBoardTeams
        if userHasTeams
          select.js-AllBoardTeams#jsAllBoardTeams("multiple")
            option(value="-1") {{_ 'teams'}} :
            each teamsDatas
              option(value="{{teamId}}") {{_ teamDisplayName}}

      li.AllBoardOrgs
        if userHasOrgs
          select.js-AllBoardOrgs#jsAllBoardOrgs("multiple")
            option(value="-1") {{_ 'organizations'}} :
            each orgsDatas
              option(value="{{orgId}}") {{orgDisplayName}}

      //li.AllBoardTemplates
      //  if userHasTemplates
      //  select.js-AllBoardTemplates#jsAllBoardTemplates("multiple")
      //    option(value="-1") {{_ 'templates'}} :
      //    each templatesDatas
      //      option(value="{{templateId}}") {{_ templateDisplayName}}

      li.AllBoardBtns
        div.AllBoardButtonsContainer
          if userHasOrgsOrTeams
            i.fa.fa-filter
            input#filterBtn(type="button" value="{{_ 'filter'}}")
            input#resetBtn(type="button" value="{{_ 'filter-clear'}}")

    ul.board-list.clearfix.js-boards
      li.js-add-board
        a.board-list-item.label(title="{{_ 'add-board'}}")
          | {{_ 'add-board'}}
      each boards
        li(class="{{_id}}" class="{{#if isStarred}}starred{{/if}}" class=colorClass).js-board
          if isInvited
            .board-list-item
              span.details
                span.board-list-item-name= title
                i.fa.js-star-board(
                  class="fa-star{{#if isStarred}} is-star-active{{else}}-o{{/if}}"
                  title="{{_ 'star-board-title'}}")
                p.board-list-item-desc {{_ 'just-invited'}}
                button.js-accept-invite.primary {{_ 'accept'}}
                button.js-decline-invite {{_ 'decline'}}
          else
            if $eq type "template-container"
              a.js-open-board.template-container.board-list-item(href="{{pathFor 'board' id=_id slug=slug}}")
                span.details
                  span.board-list-item-name(title="{{_ 'template-container'}}")
                    +viewer
                      = title
                  i.fa.js-star-board(
                    class="fa-star{{#if isStarred}} is-star-active{{else}}-o{{/if}}"
                    title="{{_ 'star-board-title'}}")
                  p.board-list-item-desc
                    +viewer
                      = description
                  if hasSpentTimeCards
                    i.fa.js-has-spenttime-cards(
                      class="fa-circle{{#if hasOvertimeCards}} has-overtime-card-active{{else}} no-overtime-card-active{{/if}}"
                      title="{{#if hasOvertimeCards}}{{_ 'has-overtime-cards'}}{{else}}{{_ 'has-spenttime-cards'}}{{/if}}")
                  if isTouchScreenOrShowDesktopDragHandles
                    i.fa.board-handle(
                        class="fa-arrows"
                        title="{{_ 'drag-board'}}")
                  else
                    if isSandstorm
                      i.fa.js-clone-board(
                          class="fa-clone"
                          title="{{_ 'duplicate-board'}}")
                      i.fa.js-archive-board(
                          class="fa-archive"
                          title="{{_ 'archive-board'}}")
                    else if isAdministrable
                      i.fa.js-clone-board(
                          class="fa-clone"
                          title="{{_ 'duplicate-board'}}")
                      i.fa.js-archive-board(
                          class="fa-archive"
                          title="{{_ 'archive-board'}}")
                    else if currentUser.isAdmin
                      i.fa.js-clone-board(
                          class="fa-clone"
                          title="{{_ 'duplicate-board'}}")
                      i.fa.js-archive-board(
                          class="fa-archive"
                          title="{{_ 'archive-board'}}")
            else
              a.js-open-board.board-list-item(href="{{pathFor 'board' id=_id slug=slug}}")
                span.details
                  span.board-list-item-name(title="{{_ 'board-drag-drop-reorder-or-click-open'}}")
                    +viewer
                      = title
                  unless currentSetting.hideBoardMemberList
                    if allowsBoardMemberList
                      .minicard-members
                        each member in boardMembers _id
                          a.name
                            +userAvatar(userId=member noRemove=true)
                  unless currentSetting.hideCardCounterList
                    if allowsCardCounterList
                      .minicard-lists.flex.flex-wrap
                        each list in boardLists _id
                          .item
                            | {{ list }}
                  i.fa.js-star-board(
                    class="fa-star{{#if isStarred}} is-star-active{{else}}-o{{/if}}"
                    title="{{_ 'star-board-title'}}")
                  p.board-list-item-desc
                    +viewer
                      = description
                  if hasSpentTimeCards
                    i.fa.js-has-spenttime-cards(
                      class="fa-circle{{#if hasOvertimeCards}} has-overtime-card-active{{else}} no-overtime-card-active{{/if}}"
                      title="{{#if hasOvertimeCards}}{{_ 'has-overtime-cards'}}{{else}}{{_ 'has-spenttime-cards'}}{{/if}}")
                  if isTouchScreenOrShowDesktopDragHandles
                    i.fa.board-handle(
                        class="fa-arrows"
                        title="{{_ 'drag-board'}}")
                  else
                    if isSandstorm
                      i.fa.js-clone-board(
                          class="fa-clone"
                          title="{{_ 'duplicate-board'}}")
                      i.fa.js-archive-board(
                          class="fa-archive"
                          title="{{_ 'archive-board'}}")
                    else if isAdministrable
                      i.fa.js-clone-board(
                          class="fa-clone"
                          title="{{_ 'duplicate-board'}}")
                      i.fa.js-archive-board(
                          class="fa-archive"
                          title="{{_ 'archive-board'}}")
                    else if currentUser.isAdmin
                      i.fa.js-clone-board(
                          class="fa-clone"
                          title="{{_ 'duplicate-board'}}")
                      i.fa.js-archive-board(
                          class="fa-archive"
                          title="{{_ 'archive-board'}}")

template(name="boardListHeaderBar")
  h1 {{_ title }}
  //.board-header-btns.right
  //  a.board-header-btn.js-open-archived-board
  //    i.fa.fa-archive
  //    span {{_ 'archives'}}
  //  a.board-header-btn(href="{{pathFor 'board' id=templatesBoardId slug=templatesBoardSlug}}")
  //    i.fa.fa-clone
  //    span {{_ 'templates'}}
