h2
  ' Team #{user.email}
  - challange = user.challange(@combat)
  - if challange.pending?
    = link_to 'Accept challange', join_to_combat_combat_user_path(combat_id: @combat.id, id: user.id), class: 'btn btn-small btn-success'
  - elsif challange.surrendered?
    em.muted Gived up
  - elsif challange.rejected?
    em.muted Rejected
  - else
    - leave_combat_btn_text = @combat.in_course? ? 'Surrender' : 'Leave combat'
    = link_to leave_combat_btn_text, leave_combat_combat_user_path(combat_id: @combat.id, id: user.id), class: 'btn btn-small btn-danger', method: :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }
ul.unstyled.inline
  - user.units.each do |unit|
    li
      .btn-group
        - if unit.dead?
          .btn.disabled #{unit.name} &#9760;
        - else
          a.btn.dropdown-toggle data-toggle="dropdown" href="#"
            =' unit.name
            | (
            =' unit.current_health
            | )
            span.caret
          = render 'skills', combat: combat, unit: unit

h2
  ' Team #{user.email}
  - challange = user.challange(@combat)
  - if challange.pending?
    = link_to 'Accept challange', join_to_combat_combat_user_path(combat_id: @combat.id, id: user.id), class: 'btn btn-small btn-success'
  - elsif challange.surrendered?
    em.muted Gived up
  - elsif challange.rejected?
    em.muted Rejected
  - else
    - leave_combat_btn_text = @combat.in_course? ? 'Surrender' : 'Leave combat'
    = link_to leave_combat_btn_text, leave_combat_combat_user_path(combat_id: @combat.id, id: user.id), class: 'btn btn-small btn-danger', method: :delete, :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) }
ul.unstyled.inline
  - user.units.each do |unit|
    li
      .btn-group
        - if unit.dead?
          .btn.disabled #{unit.name} &#9760;
        - elsif challange.surrendered? or challange.rejected?
          .btn.disabled #{unit.name}
        - else
          a.btn.dropdown-toggle data-toggle="dropdown" href="#"
            =' unit.name
            | (
            =' unit.current_health
            | )
            span.caret
          = render 'skills', combat: combat, unit: unit

Disable surrendered or rejected teams.
Disable surrendered or rejected teams.

kirthar/med-warfare,kirthar/med-warfare