@import "bootstrap-sprockets"
@import "bootstrap"

body
  padding-top: 20px

dl
  @extend .dl-horizontal

.log
  @extend .pre-scrollable
  word-wrap: normal
  white-space: pre
  overflow-x: scroll

.tasksets
  ul
    list-style-type: none
    padding-left: 0

    li
      display: inline-block

  .taskset-status
    width: 7em
    text-transform: uppercase
  .username
    width: 12em
    padding-right: 2em

.taskset
  @extend .container

  .head, .tasks, .worker-logs, .slaves
    @extend .panel
    @extend .panel-default

    > .panel-heading
      cursor: pointer
      font-size: large
      &:hover
        color: darken(#428bca, 15%)
        border-color: #428bca

  .tasks-list, .worker-logs-list, .slaves-list
    > *
      padding: 0

    .list-group-item > *
      padding: 10px 15px

  .head
    .panel-heading
      .name
        font-size: x-large
        overflow: hidden
        text-overflow: ellipsis
        white-space: nowrap
        float: left
        width: 80%

      .status
        font-size: large
        width: 20%
        text-transform: uppercase
        float: left

      .running
        @extend .label-primary
      .succeeded
        @extend .label-success
      .cancelled
        @extend .label-warning
      .failed
        @extend .label-danger

  .progressbars
    .spec-progress
      @extend .progress
      .spec-progress-bar
        @extend .progress-bar
      .passed-spec-bar
        @extend .progress-bar
        @extend .progress-bar-success
      .pending-spec-bar
        @extend .progress-bar
        @extend .progress-bar-warning
      .failed-spec-bar
        @extend .progress-bar
        @extend .progress-bar-danger
    .example-progress
      @extend .progress
      .passed-example-bar
        @extend .progress-bar
        @extend .progress-bar-success
      .pending-example-bar
        @extend .progress-bar
        @extend .progress-bar-warning
      .failed-example-bar
        @extend .progress-bar
        @extend .progress-bar-danger

  .tasks
    .tasks-heading
      @extend .panel-heading

    .tasks-list
      @extend .list-group

    .tasks-list-header, .tasks-list-item-header
      list-style-type: none

      li
        display: inline-block

      .taskstatus, .trial-count, .estimate-sec
        width: 6em
        text-align: center

      .trial-count, .estimate-sec
        @extend .pull-right

      .file
        text-align: left
        text-overflow: ellipsis

    .tasks-list-item-header
      cursor: pointer

    .running .tasks-list-item-header
      background-color: #f5f5f5
      &:hover
        background-color: darken(#f5f5f5, 20%)
    .passed .tasks-list-item-header
      background-color: #dff0d8
      &:hover
        background-color: darken(#dff0d8, 20%)
    .pending .tasks-list-item-header
      background-color: #fcf8e3
      &:hover
        background-color: darken(#fcf8e3, 20%)
    .failed .tasks-list-item-header
      background-color: #f2dede
      &:hover
        background-color: darken(#f2dede, 20%)

    .tasks-list-item-header
      .taskstatus
        text-transform: uppercase

  .trials-list-heading
    @extend .panel-heading

  .worker-logs
    .worker-logs-heading
      @extend .panel-heading

    .worker-logs-list
      @extend .list-group

    .worker-logs-list-item-header
      cursor: pointer
      &:hover
        color: darken(#428bca, 15%)
        text-decoration: underline

  .slaves
    .slaves-heading
      @extend .panel-heading

    .slaves-list
      @extend .list-group

    .slaves-list-item-header
      cursor: pointer
      &:hover
        color: darken(#428bca, 15%)
        text-decoration: underline

    .exit-status
      @extend .pull-right
      text-transform: uppercase

    .normal_exit .slaves-list-item-header
      background-color: #dff0d8
    .timeout_exit .slaves-list-item-header
      background-color: #fcf8e3
    .failure_exit .slaves-list-item-header
      background-color: #f2dede
