<!--
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (c) 2014 Mozilla Corporation

Contributors:
Jeff Bryner jbryner@mozilla.com
Anthony Verez averez@mozilla.com
-->

<!--a striped table of incidents-->
<template name="incidents">
    <div class="incidents container">
        <div class="fluid center">            
            <table class="table table-striped table-hover table-condensed">
                <caption><p class="lead">Last 100 incidents</p></caption>
                <thead>
                    <tr>
                        <td></td>
                        <td>Summary</td>
                        <td>Phase</td>
                        <td>Opened</td>
                        <td>Closed</td>
                        <td></td>
                    </tr>
                </thead>
                <tbody>
                {{#each incident}}
                    {{>each_incident}}
                {{/each}}
                </tbody>
            </table>
            </div>
    </div>
</template>

<!--each individual incident -->
<template name="each_incident">

			<tr class="tooltip-wrapper info-row" title="{{creator}} at {{dateOpened}}" data-toggle="tooltip">
                <td><button class="btn btn-xs btn-default incidentedit" data-incidentid={{_id}}>edit</button></td>
				<td>{{summary}}</td>
                <td>{{phase}}</td>
				<td>{{dateOpened}}</td>
				<td>{{dateClosed}}</td>
                <td><button class="btn btn-xs btn-warning" data-toggle="collapse" data-target="#delete{{_id}}">arm delete</button>
                    <div id="delete{{_id}}" class="collapse">
                        <button class="btn btn-xs btn-danger incidentdelete" data-incidentid={{_id}}>delete</button>
                    </div>
                </td>
			</tr>

</template>
