template(name="swimlane")
  .swimlane
    +swimlaneHeader
  unless collapseSwimlane
    .swimlane.js-lists.js-swimlane(id="swimlane-{{_id}}")
      if isMiniScreen
        if currentListIsInThisSwimlane _id
          +list(currentList)
        unless currentList
          each lists
            +miniList(this)
          if currentUser.isBoardMember
            unless currentUser.isCommentOnly
              +addListForm
      else
        each lists
          if visible this
            +list(this)
          if currentCardIsInThisList _id ../_id
            +cardDetails(currentCard)
        if currentUser.isBoardMember
          unless currentUser.isCommentOnly
            +addListForm

template(name="listsGroup")
  .swimlane.list-group.js-lists
    if isMiniScreen
      if currentList
        +list(currentList)
      else
        each lists
          +miniList(this)
        if currentUser.isBoardMember
          unless currentUser.isCommentOnly
            +addListForm
    else
      each lists
        if visible this
          +list(this)
        if currentCardIsInThisList _id null
          +cardDetails(currentCard)
      if currentUser.isBoardMember
        unless currentUser.isCommentOnly
          +addListForm

template(name="addListForm")
  unless currentUser.isWorker
    .list.list-composer.js-list-composer(class="{{#if isMiniScreen}}mini-list{{/if}}")
      if currentUser.isBoardAdmin
        .list-header-add
          +inlinedForm(autoclose=false)
            input.list-name-input.full-line(type="text" placeholder="{{_ 'add-list'}}"
              autocomplete="off" autofocus)
            .edit-controls.clearfix
              button.primary.confirm(type="submit") {{_ 'save'}}
              .fa.fa-times-thin.js-close-inlined-form
              unless currentBoard.isTemplatesBoard
                unless currentBoard.isTemplateBoard
                  span.quiet
                    | {{_ 'or'}}
                    a.js-list-template {{_ 'template'}}
          else
            a.open-list-composer.js-open-inlined-form(title="{{_ 'add-list'}}")
              i.fa.fa-plus

template(name="moveSwimlanePopup")
  unless currentUser.isWorker
    label {{_ 'boards'}}:
    select.js-select-boards(autofocus)
      each toBoard in toBoards
        option(value="{{toBoard._id}}") {{toBoard.title}}

  .edit-controls.clearfix
    button.primary.confirm.js-done {{_ 'done'}}

template(name="copySwimlanePopup")
  unless currentUser.isWorker
    label {{_ 'boards'}}:
    select.js-select-boards(autofocus)
      each toBoard in toBoards
        option(value="{{toBoard._id}}" selected="{{#if $eq toBoard.title board.title}}1{{/if}}") {{toBoard.title}}

  .edit-controls.clearfix
    button.primary.confirm.js-done {{_ 'done'}}
