<!-- 
 Copyright 2013 The MITRE Corporation 
   and the MIT Kerberos and Internet Trust Consortium
 
 Licensed 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.
-->
<!-- approved sites (grants) -->

<script type="text/html" id="tmpl-grant-table">

	<h2>Approved sites</h2>

    <div class="well well-small">
		<button class="btn btn-small refresh-table"><i class="icon-refresh"></i> Refresh</button>
    </div>

	<h3>Sites you have manually approved</h3>

	<div id="grant-table-empty" class="alert alert-info">
		You have not approved any sites.
	</div>

    <table id="grant-table" class="table table-hover table-striped">
        <thead>
        <tr>
			<th></th>
            <th>Application</th>
			<th>Created</th>
			<th>Last Accessed</th>
			<th>Expires</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>

	<div class="well">
	
	<h3>Sites that have been whitelisted by an administrator</h3>
	<p>If you revoke them here, they will automatically be re-approved on your next visit.</p>

	<div id="grant-whitelist-table-empty" class="alert alert-info">
		You have not accessed any whitelisted sites.
	</div>

    <table id="grant-whitelist-table" class="table table-hover table-striped">
        <thead>
        <tr>
			<th></th>
            <th>Application</th>
			<th>Created</th>
			<th>Last Accessed</th>
			<th>Expires</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>

	</div>

    <div class="well well-small">
		<button class="btn btn-small refresh-table"><i class="icon-refresh"></i> Refresh</button>
    </div>

</script>

<script type="text/html" id="tmpl-grant">
	<td>
		<% if (client.dynamicallyRegistered) { %>
			<span class="label label-inverse dynamically-registered"><i class="icon-globe icon-white"></i></span>
		<% } %>
	</td>

    <td>
        <%= client.clientName != null ? client.clientName : client.clientId %>
		<% if (client.clientDescription) { %>
        <blockquote><small><%=client.clientDescription%></small></blockquote>
		<% } %>
		<div class="scope-list"></div>
    </td>


	<!-- TODO: make these dates collapsable/expandable -->

	<td>
		<%= formattedDate.creationDate %>
	</td>

	<td>
		<%= formattedDate.accessDate %>
	</td>

	<td>
		<%= formattedDate.timeoutDate %>
	</td>

    <td>
        <button class="btn btn-danger btn-delete pull-right"><i class="icon-trash"></i> Revoke</button>
    </td>

</script>

