<template name="navigation">
    <nav class="navbar-default navbar-static-side " role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav metismenu" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear">
                                {{#if isConnected}}
                                    <span class="block m-t-xs"> <strong
                                            class="font-bold">{{getConnection.name}}</strong>
                                </span>
                                <span class="block m-t-xs">
                                    {{getConnection.host}} : {{getConnection.port}}
                                </span>
                                    <span class="text-muted text-xs block">{{getConnection.databaseName}} <b
                                            class="caret"></b>
                                    </span>
                                {{else}}
                                    <span class="block mt-xs">Not Connected !</span>
                                {{/if}}
                            </span>
                        </a>
                        {{#if isConnected}}
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a id="btnDropDatabase" href="#"><i class="fa fa-remove"></i> Drop database</a></li>
                                <li><a id="btnDropAllCollections" href="#"><i class="fa fa-remove"></i> Drop all
                                    collections</a></li>
                                <!--
                                <li class="divider"></li>
                                <li><a href="#">Item</a></li>-->
                            </ul>
                        {{/if}}
                    </div>
                    <div class="logo-element">
                        MC+
                    </div>
                </li>
                {{#if isConnected}}
                    <li class="{{isActiveRoute regex='databaseStats|home'}}">
                        <a class="aNavigations" href="{{pathFor route='databaseStats'}}"><i
                                class="fa fa-eye"></i> <span
                                class="nav-label">Database Stats</span>
                        </a>
                    </li>

                    <li>
                        <a href=""><i
                                class="fa fa-wrench"></i> <span
                                class="nav-label">Management</span>
                            <span class="fa arrow"></span>
                        </a>

                        <ul class="nav nav-second-level collapse out">
                            <li class="{{isActiveRoute regex='databaseDumpRestore'}}">
                                <a class="aNavigations" href="{{pathFor route='databaseDumpRestore'}}"><i
                                        class="fa fa-download"></i> <span
                                        class="nav-label">Database Dump/Restore</span>
                                    <span class="pull-right label label-primary">BETA</span>
                                </a>
                            </li>

                            <li class="{{isActiveRoute regex='fileManagement'}}">
                                <a class="aNavigations" href="{{pathFor route='fileManagement'}}"><i
                                        class="fa fa-file"></i> <span
                                        class="nav-label">File Management</span>
                                </a>
                            </li>

                            <li class="{{isActiveRoute regex='adminQueries'}}">
                                <a class="aNavigations" href="{{pathFor route='adminQueries'}}"><i
                                        class="fa fa-key"></i> <span
                                        class="nav-label">Admin Queries</span>
                                </a>
                            </li>

                            <li class="{{isActiveRoute regex='editDocument'}}">
                                <a class="aNavigations" href="{{pathFor route='editDocument'}}"><i
                                        class="fa fa-edit"></i> <span
                                        class="nav-label">Easy Edit</span>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a href=""><i class="fa fa-dashboard"></i> <span
                                class="nav-label">Collections</span>
                            <span id="btnAddCollection" class="label label-info" style="margin-left: 90px;">Add</span>
                            <span class="fa arrow pull-right"></span>
                        </a>

                        <ul id="listCollectionNames" class="nav nav-second-level">
                            {{#each getCollectionNames}}
                                <li>
                                    <a class="navCollection" href="{{pathFor route='browseCollection'}}"><i
                                            class="fa fa-book"></i> <span
                                            class="nav-label">{{name}}</span>
                                        <span id="btnDropCollection" class="pull-right label label-danger">Drop</span>
                                    </a>
                                </li>
                            {{/each}}
                        </ul>
                    </li>

                    {{#if getSystemCollectionNames}}
                        <li>
                            <a href="#"><i class="fa fa-server"></i> <span
                                    class="nav-label">System</span>
                                <span class="fa arrow pull-right"></span>
                            </a>

                            <ul id="listSystemCollections" class="nav nav-second-level collapse out">
                                {{#each getSystemCollectionNames}}
                                    <li>
                                        <a class="navCollection" href="{{pathFor route='browseCollection'}}"><i
                                                class="fa fa-book"></i> <span
                                                class="nav-label">{{name}}</span>
                                        </a>
                                    </li>
                                {{/each}}
                            </ul>
                        </li>
                    {{/if}}

                    {{initializeMetisMenu}}
                {{/if}}
            </ul>
        </div>
    </nav>

    {{>addCollection}}
</template>