<div class="page">
  <header class="page-header">
    <h1 class="page-title"><%= message('provisioning.page') -%></h1>
    <div class="page-actions">
      <%= link_to message('create'), {:action => :create_form}, :id => "create-link-provisioning", :class => 'open-modal' %>
    </div>
    <p class="page-description"><%= message('provisioning.page.description') -%></p>
  </header>

  <% if  @query_result.empty? %>
    <br/>
    <%= message('provisioning.no_results') -%>
  <% else %>

    <table class="data" id="provisioned-resources">
      <thead>
      <tr>
        <th><%= message('key') -%></th>
        <th><%= message('name') -%></span></th>
        <th><%= message('created') -%></th>
        <th class="operations"><%= message('operations') -%></th>
      </tr>
      </thead>
      <tbody>
      <% @query_result.each_with_index do |resource, index| %>

        <tr id="entry-<%= resource.key.parameterize -%>" class="<%= cycle 'even', 'odd' -%>">
          <td>
            <%= link_to h(resource.key), {:controller => 'dashboard', :action => 'index', :id => resource.id},
                        :id => "view-#{resource.key.parameterize}" %>
          </td>
          <td><%= h resource.name -%></td>
          <td><%= format_datetime(resource.created_at) -%></td>
          <td class="operations">
            <%= link_to message('delete'), {:action => :delete_form, :id => resource.id},
                        {:id => "delete-#{resource.key.parameterize}", :class => 'open-modal link-action link-red'} -%>
          </td>
        </tr>
      <% end %>
      </tbody>
    </table>

  <% end %>

</div>

