{{!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
}}

{{#each view.leaf}}
  {{#link-to "queue" this classNameBindings=":list-group-item overCapacity:list-group-item-danger isNew:list-group-item-info" }}
    <div class="col-md-offset-{{unbound this.depth}} col-sm-offset-{{unbound this.depth}} col-xs-offset-{{unbound this.depth}}">
      
    {{name}} ({{capacity}}%)

    <span class="badge pull-right">
      {{#if overCapacity}}
        <i class="fa fa-fw fa-lg red fa-warning"></i>
      {{/if}}
      {{#if isNewQueue }}
        {{#if isSaving}}
        <i class="fa fa-fw fa-lg gray fa-spinner fa-spin"></i>
        {{else}}
        <i class="fa fa-fw fa-lg blue fa-plus"></i> 
        {{/if}}
      {{else}}
        {{#if isError}}
          {{#if isSaving}}
            <i class="fa fa-fw fa-lg gray fa-spinner fa-spin"></i>
          {{else}}
            <span> queue was not saved </span> <i class="fa fa-fw fa-lg red fa-warning"></i>
          {{/if}}
        {{else}}    
          {{#if isDirty}}
            {{#if isSaving}}
              <i class="fa fa-fw fa-lg gray fa-spinner fa-spin"></i>
            {{else}}
              <i class="fa fa-fw fa-lg blue fa-pencil"></i>
            {{/if}}
          {{else}}
            <i class="fa fa-fw fa-lg green fa-check"></i> 
          {{/if}}
        {{/if}}
      {{/if}}
    </span>
    
    </div>
  {{/link-to}}

  {{recurce-queues depth=view.childDepth parent=this.path}}
{{/each}}
