template(name="formLabel")
  label(for="labelName") {{_ 'name'}}
  input.js-label-name#labelName(type="text" name="name" value=name autofocus)

  label {{_ "select-color"}}
  .palette-colors: each labels
    span.card-label.palette-color.js-palette-color(class="card-label-{{color}}")
      if(isSelected color)
        i.fa.fa-check

template(name="createLabelPopup")
  form.create-label
    with(color=defaultColor)
      +formLabel
    button.primary.wide(type="submit") {{_ 'create'}}

template(name="editLabelPopup")
  form.edit-label
    +formLabel
    button.primary.wide.left(type="submit") {{_ 'save'}}
    button.js-delete-label.negate.wide.right {{_ 'delete'}}

template(name="deleteLabelPopup")
  p {{_ "label-delete-pop"}}
  button.js-confirm.negate.full(type="submit") {{_ 'delete'}}

template(name="cardLabelsPopup")
  ul.edit-labels-pop-over
    each board.labels
      li.js-card-label-item
        a.card-label-edit-button.fa.fa-pencil.js-edit-label
        if isTouchScreenOrShowDesktopDragHandles
          span.fa.label-handle(class="fa-arrows" title="{{_ 'dragLabel'}}")
        span.card-label.card-label-selectable.js-select-label.card-label-wrapper(class="card-label-{{color}}"
          class="{{# if isLabelSelected ../_id }}active{{/if}}")
            +viewer
              = name
            if(isLabelSelected ../_id)
              i.card-label-selectable-icon.fa.fa-check
  if currentUser.isBoardAdmin
    a.quiet-button.full.js-add-label {{_ 'label-create'}}
