<div class="panel panel-default" ng-if="dashboard.Enabled">
    <div class="panel-heading">
        <div class="btn-group btn-group-xs">
            <div class="col-md-4">
                <div class="input-group">
                    <input class="form-control" id="txtStartDate" type="text" datepicker-popup="dd-MMM-yyyy"
                           ng-model="dashboard.StartDate"/>
                <span class="input-group-btn">
                    <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
                </span>
                </div>
            </div>
            <div class="col-md-4">
                <button class="btn btn-block btn-default" tan-click="getDashboard()">Show Dashboard</button>
            </div>
            <div class="col-md-4">
                <div class="input-group">
                    <input type="text" id="txtFinishDate" class="form-control" datepicker-popup="dd-MMM-yyyy"
                           ng-model="dashboard.FinishDate"/>
                <span class="input-group-btn">
                    <button class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></button>
                </span>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="panel panel-default" ng-if="dashboard.Enabled && Data.HasCash">
    <div class="panel-heading" ng-click="cashCollapsed = !cashCollapsed">
        <div class="btn-group btn-group-xs">
            <h3 class="panel-title">Cash/Bank in Hand</h3>
        </div>
        <span class="badge pull-right">{{Cash.Total | currency}}</span>
    </div>
    <div class="panel-body panel-collapse collapse" ng-class="{'in':!cashCollapsed}">
        <div class="col-md-8">
            <div chart-line-plus-bar="Data.Cash.LinePlusBar" id="cashLinePlusBarId">
                <svg style="height: 400px;"></svg>
            </div>
        </div>
        <div class="col-md-4">
            <div chart-pie="Data.Cash.Pie" id="cashPieId">
                <svg style="height: 400px;"></svg>
            </div>
        </div>
    </div>
</div>
<div class="panel panel-default" ng-if="dashboard.Enabled && Data.HasCreditors">
    <div class="panel-heading" ng-click="creditorsCollapsed = !creditorsCollapsed">
        <div class="btn-group btn-group-xs">
            <h3 class="panel-title">Creditors</h3>
        </div>
        <span class="badge pull-right">{{Creditors.Total | currency}}</span>
    </div>
    <div class="panel-body panel-collapse collapse" ng-class="{'in':!creditorsCollapsed}">
        <div class="col-md-8">
            <div chart-line-plus-bar="Data.Creditors.LinePlusBar" id="creditorsLinePlusBarId">
                <svg style="height: 400px;"></svg>
            </div>
        </div>
        <div class="col-md-4">
            <div chart-pie="Data.Creditors.Pie" id="creditorsPieId">
                <svg style="height: 400px;"></svg>
            </div>
        </div>
    </div>
</div>
<h2>Messages <a href="/Message" class="btn btn-success pull-right">Add <i class="glyphicon glyphicon-plus"></i></a>
</h2>
<div class="widget-box">
    <div class="widget-title">
        <ul class="nav nav-tabs">
            <li ng-class="{active: chosen == 'open'}"><a href ng-click="getMessages('open')">Open</a></li>
            <li ng-class="{active: chosen == 'closed'}"><a href ng-click="getMessages('closed')">Closed</a></li>
            <li ng-class="{active: chosen == 'all'}"><a href ng-click="getMessages('all')">All</a></li>
            <li class="dropdown pull-right">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tags
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li ng-repeat="(name, count) in tags"><a href="#"><span class="badge pull-right">{{count}}</span>{{name}}</a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
    <div class="widget-content nopadding">
        <table class="table table-bordered table-striped">
            <tbody>
            <tr ng-repeat="item in info" ng-class="{info: !item.Read}">
                <td>
                    <span class="user-info">User: {{item.User}} {{item.Age}} ago.  Updated {{item.LastUpdated}} ago.</span>

                    <p><a href="/Message/{{item.ThreadID}}">{{item.Title}}</a></p>
                    <a class="btn btn-success btn-xs" ng-repeat="tag in item.Tags">{{tag}}</a>
                    <span class="label label-danger" ng-repeat="subscriber in item.Subscribers">{{subscriber}}</span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
</table>
