<div class="widget-content">
    <h4>Current Boards</h4>
    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>Name</th><th>Lanes</th><th>Categories</th><th>Users</th><th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <tr data-ng-if="loadingBoards">
                    <td colspan="5" align="center"><span class="fa fa-refresh fa-spin"></span> Loading Boards...</td>
                </tr>
                <tr data-ng-if="!loadingBoards && !boards.length">
                    <td data-ng-if="currentUser.isAdmin == '0'" colspan="5" align="center">You are not assigned to any boards. Contact an admin user to be added to a board.</td>
                    <td data-ng-if="currentUser.isAdmin == '1'" colspan="5" align="center">There are no current boards. Use the <strong>Add Board</strong> button below to add one.</td>
                </tr>
                <tr data-ng-repeat="board in boards">
                    <td><a title="Go To Board" href="#/boards/{{ board.id }}">{{ board.name }}</a></td>
                    <td>
                        <ul class="list-group">
                            <li class="list-group-item" data-ng-repeat="lane in board.ownLane | orderBy:'position':false">{{ lane.name }}
                                <span class="badge" title="Item Count">{{ lane.ownItem.length || 0 }}</span>
                            </li>
                        </ul>
                    </td>
                    <td>
                        <ul class="list-group">
                            <li class="list-group-item" data-ng-repeat="category in board.ownCategory | orderBy:'name':false">{{ category.name }}</li>
                        </ul>
                    </td>
                    <td>
                        <ul class="list-group">
                            <li class="list-group-item" data-ng-repeat="user in board.sharedUser">{{ user.username }}</li>
                        </ul>
                    </td>
                    <td>
                        <span class="links" data-ng-if="currentUser.isAdmin == '1' && !isDeleting[board.id]">
                            <a class="fa fa-edit" title="Edit Board"
                               data-toggle="modal" data-target=".boardModal"
                               data-ng-click="boardFormData.setBoard(board)"></a>
                            <a class="fa fa-trash-o" title="Remove Board"
                               data-ng-click="removeBoard(board.id)"></a>
                        </span>
                        <span data-ng-if="isDeleting[board.id]" class="fa fa-refresh fa-spin"></span>
                    </td>
                </tr>
            </tbody>
        </table>
        <div data-ng-if="currentUser.isAdmin == '1'">
            <p><a role="button" id="addBoard" class="btn btn-info" data-toggle="modal" data-target=".boardModal" data-ng-click="boardFormData.reset()" title="Add Board">Add Board <span class="fa fa-plus"> </span></a></p>
        </div>
    </div>
</div>
