<html py:extends="master.xhtml" py:strip="True">
<head py:block="head" py:strip="True">
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" py:if="False"/>
  <title py:block="master_title">Welcome to TurboGears pluggable Application</title>
  <link rel="stylesheet" type="text/css" media="screen" href="${tg.url('/_pluggable/tgappcategories/css/style.css')}" />
</head>

<body py:block="body" py:strip="True">
  <div class="row">
    <div class="col-md-2 col-xs-12 col-md-offset-10">
      <a href="${tg.url(mount_point + '/new_category')}" class="btn btn-success">Add Category</a>
    </div>
  </div>
  <div class="tgappcategories-list">
    <table class="table table-striped">
      <thead>
        <tr>
          <th>Actions</th>
          <th>Name</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr py:for="cat in categories">
          <td>
            <a href="${tg.url(mount_point + '/edit_category/' +
                       h.tgappcategories.instance_primary_key(cat, True))}"
               class="tgappcategories-edit btn btn-primary">
              <span class="glyphicon glyphicon-pencil"/>
            </a>
            <a href="${tg.url(mount_point + '/delete_category/' +
                       h.tgappcategories.instance_primary_key(cat, True))}"
               class="tgappcategories-delete btn btn-danger col col-md1"
               onclick="return confirm('Are you sure?')">
              <span class="glyphicon glyphicon-trash"/>
            </a>
          </td>
          <td>
            <span class="col-md-5 col-xs-12"><b>${cat.name}</b></span>
          </td>
          <td>
            <span class="col-md-5 col-xs-12">${cat.description}</span>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</body>
</html>
