<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">
        <div py:for="cat in categories">
            <div class="row" style="overflow-wrap: break-word; margin-bottom: 10px">
                <span class="col-md-5 col-xs-12"><b>${cat.name}</b></span>
                <span class="col-md-5 col-xs-12">${cat.description}</span>
                <div class="col-md-2 col-xs-12" role="group" aria-label="...">
                    <a href="${tg.url(mount_point + '/edit_category/' + str(cat._id))}"
                       class="tgappcategories-edit btn btn-primary">
                        <span class="glyphicon glyphicon-pencil"/>
                    </a>
                    <a href="${tg.url(mount_point + '/delete_category/' + str(cat._id))}"
                       class="tgappcategories-delete btn btn-danger col col-md1"
                       onclick="return confirm('Are you sure?')">
                        <span class="glyphicon glyphicon-trash"/>
                    </a>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
