<%unless sqms.blank?%>
  <div class="row">
    <div class="col-md-12 col-xs-12">
      <div class="panel panel-default">
        <div class="panel-heading heading-text-panel clearfix">
          <i class="icon-dashboard"></i>
          <h3 class="panel-title">Smart Queue Lists</h3>
        </div>
        <div class="panel-body">
          <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
            <thead>
              <tr>
                <th width="30%">AP / Network / AP Tags</th>
                <th>Status</th>
                <th>Uplink</th>
                <th>Download Speed</th>
                <th>Upload Speed</th>
                <th>Queuing disciplines</th>
                <th>Queue setup script</th>
                <th class='datatable-nosort'>Action</th>
              </tr>
            </thead>
            <tbody>
              <%@sqms.each do |x|%>
                <tr>
                <% arr = x.tagging_lists.split("&&")  unless x.tagging_lists.blank?%>
                  <td>
                    <% x.config_mappings.each do |list|%>
                      <% unless list.resourceable.blank?%>
                        <%name,path,title = show_tags(list,:sqms) %>
                        <%= link_to name, path ,:class=>"label label-primary",:title => title%> &nbsp;
                      <% end %>
                    <% end %>
                  </td>
                  
                  <% if(x.is_enabled) %>
                    <td><%= "Enabled" %></td>
                  <% else %>
                    <td><%= "Disabled" %></td>
                  <%end%>

                  <td><%= x.uplink %></td>

                  <% if("#{x.download_speed}").blank? %>
                    <td><%= "1 Mbps" %></td>
                  <% else %>
                    <td><%= x.download_speed %><%=  ' Mbps'  %></td>
                  <% end %>
                  
                  <% if("#{x.upload_speed}").blank? %>
                    <td><%= "1 Mbps" %></td>
                  <% else %>
                    <td><%= x.upload_speed %><%=  ' Mbps'  %></td>
                  <% end %>
                  
                  <td><%= x.queuing_disciplines %></td>
                  <td><%= x.queue_setup_script %></td>
                  <td><%= link_to 'Edit', {:controller=>:sqms, :action=>:index, :id=>x.id}, :class => "label label-info" %>
                  <%= link_to 'Destroy', x, method: :delete, data: { confirm: 'Are you sure you want to delete?' }, :class => "label label-danger" %></td>
                </tr>
              <%end%>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
<%end%>
