<#macro rootLayout title="" sideMenu="" >
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>${title}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        
        <link rel="shortcut icon" href="/assets/img/favicon.ico" type="image/x-icon">
        <link rel="icon" href="/assets/img/favicon.ico" type="image/x-icon">        

        <link rel="stylesheet" href="/assets/lib/bootstrap/dist/css/bootstrap.css?v=${global.version}">
        <link rel="stylesheet" href="/assets/lib/font-awesome/css/font-awesome.css?v=${global.version}">
        <link rel="stylesheet" href="/assets/lib/bootstrap-select/dist/css/bootstrap-select.css?v=${global.version}" >
        <link rel="stylesheet" href="/assets/lib/bootstrap-daterangepicker/daterangepicker.css?v=${global.version}" >
        <link rel="stylesheet" href="/assets/lib/SlickGrid/slick.grid.css?v=${global.version}" >
        <link rel="stylesheet" href="/assets/css/theme.css?v=${global.version}">
        <link rel="stylesheet" href="/assets/css/unlogged.css?v=${global.version}">
        <link rel="stylesheet" href="/assets/css/google.css?v=${global.version}">

        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="csp-script" data-src="theme.setup" ></div>
        <div id="wrapper">

            <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/">
                        SERPOSCOPE 
                        <span class="version" data-toggle="tooltip" title="${global.version}" data-placement="bottom"
                            >${global.version.shortString()}</span>
                    </a>
                </div>

                <ul class="nav navbar-top-links navbar-left">
                    <#if user.isAdmin() >
                    <li>
                        <a href="${reverseRoute("GroupController","groups")}" >${i18n("label.groups")}</a>
                    </li>
                    <li>
                        <a href="${reverseRoute("admin.AdminController","admin")}" >${i18n("label.admin")}</a>
                    </li>
                    <li>
                        <a href="#" id="btn-run-modules" title="${i18n("label.checkRanksDesc")}" data-toggle="tooltip" data-placement="bottom" >
                           ${i18n("label.checkRanks")}
                        </a>
                    </li>
                    <#if global.update.hasNewVersion() >
                    <li>
                        <a href="https://serposcope.serphacker.com/?pk_campaign=serposcope" id="btn-new-version" target="_blank"
                            data-toggle="tooltip" data-placement="bottom" tool title="${i18n("label.newVersionAvailable")}" >
                            ${i18n("label.newVersion")} !
                        </a>                    
                    </li>
                    </#if>                    
                    </#if>
                </ul>      

                <ul class="hidden-xs nav navbar-top-links navbar-right">
                    <li>
                        <a href="https://serposcope.serphacker.com/doc/?pk_campaign=serposcope" target="_blank" >docs</a>
                    </li>                    
                    <li>
                        <a href="https://forum.serphacker.com/?pk_campaign=serposcope" target="_blank" >support</a>
                    </li>
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            ${i18n("label.account")} <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li>
                                <a href="${reverseRoute("UserPreferences","preferences")}"><i class="fa fa-cogs"></i> ${i18n("label.preferences")}</a>
                            </li>
                            <li class="divider"></li>
                            <li><a href="${reverseRoute("AuthController","logout","_xsrf", session.___AT)}"><i class="glyphicon glyphicon-log-out"></i> ${i18n("label.logout")}</a>
                            </li>
                        </ul>
                    </li>
                </ul>

                <div class="navbar-default sidebar" role="navigation">
                    <div class="sidebar-nav navbar-collapse">
                        <ul class="nav" id="side-menu">
                            <li>
                                <!-- 
                                    Feel free to remove this add, but please, consider making a donation : 
                                    https://www.paypal.com/cgi-bin/webscr?hosted_button_id=3YGPEJUYC96RL&cmd=_s-xclick
                                -->
                                <a id="side-banner" href="https://stats.serphacker.com/serposcope/${global.version}/" >
                                    <img src="https://stats.serphacker.com/serposcope/${global.version}/banner.jpg" />
                                </a>
                            </li>
                            <#noescape>${sideMenu}</#noescape>
                        </ul>
                    </div>
                    <!-- /.sidebar-collapse -->
                </div>
                <!-- /.navbar-static-side -->
            </nav>

            <div id="page-wrapper">
                <div class="container-fluid">

                    <#include "../helpers/alerts.ftl.html" />

                    <#nested/>
                </div>
            </div>

        </div>

        <div id="new-group-modal" class="modal fade">
            <div class="modal-dialog modal-sm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">${i18n("label.newGroup")}</h4>
                    </div>
                    <form class="form" method="post" action="${reverseRoute("GroupController","create")}" >
                          <@authenticityForm/>
                          <div class="modal-body">
                            <div class="form-group" >
                                <label for="groupName" >${i18n("label.name")}</label>
                                <input id="groupName" class="form-control" name="name" >
                            </div>
                            <div class="form-group" >
                                <label for="groupModule" >${i18n("label.module")}</label>
                                <select id="groupModule" class="selectpicker" name="module">
                                    <option data-icon="fa fa-google-plus-square fa-bigger fa-lg" value="0" >Google</option>
<!--                                    <option data-icon="fa fa-twitter-square fa-lg" value="1" >Twitter</option>
                                    <option data-icon="fa fa-github-square fa-lg" value="2" >Github</option>-->
                                </select>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">${i18n("label.close")}</button>
                            <input type="submit" class="btn btn-primary" value="${i18n("label.save")}" />
                        </div>
                    </form>
                </div>
            </div>
        </div>
        
        <div id="run-modal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">${i18n("label.checkRanks")}</h4>
                    </div>
                    
                    <div class="modal-body">
                        <div>
                            <p class="text-center">
                                <a  class="btn btn-primary"
                                    href="${reverseRoute("admin.TaskController","startTask","_xsrf", session.___AT)}" >
                                    ${i18n("root.checkAllKeywords")}
                                </a>
                            </p>
                            <p class="help-block">${i18n("root.checkAllKeywordsDesc")}</p>
                        </div>
                        <hr/>
                        <div>
                            <p class="text-center">
                                <a  class="btn btn-warning"
                                    href="${reverseRoute("admin.TaskController","startTask","_xsrf", session.___AT, "update", "true")}" >
                                    ${i18n("root.recheckKeywords")}
                                </a>
                            </p>
                            <p class="help-block">${i18n("root.recheckKeywordsDesc")}</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <#if global.prod >
        <script type="text/javascript" src="/assets/combined.min.js?v=${global.version}"></script>
        <#else>
        <!-- start-js -->
        <script type="text/javascript" src="/assets/js/init.js"></script>

        <script type="text/javascript" src="/assets/lib/jquery/dist/jquery.js"></script>
        <script type="text/javascript" src="/assets/lib/moment/moment.js"></script>
        <script type="text/javascript" src="/assets/lib/bootstrap/dist/js/bootstrap.js"></script>
        <script type="text/javascript" src="/assets/lib/bootstrap-daterangepicker/daterangepicker.js"></script>
        <script type="text/javascript" src="/assets/lib/bootstrap-select/dist/js/bootstrap-select.js"></script>
        <script type="text/javascript" src="/assets/js/lib/bootstrap3-typeahead.js"></script>
        <script type="text/javascript" src="/assets/lib/jquery-sparkline/jquery.sparkline.js" ></script>
        <script type="text/javascript" src="/assets/lib/Chart.js/Chart.js" ></script>
        <script type="text/javascript" src="/assets/lib/dygraphs/dygraph-combined-dev.js"></script>
        <script type="text/javascript" src="/assets/lib/SlickGrid/lib/jquery.event.drag-2.2.js"></script>
        <script type="text/javascript" src="/assets/lib/SlickGrid/slick.core.js"></script>
        <script type="text/javascript" src="/assets/lib/SlickGrid/slick.dataview.js"></script>
        <script type="text/javascript" src="/assets/lib/SlickGrid/slick.grid.js"></script>
        <script type="text/javascript" src="/assets/lib/SlickGrid/plugins/slick.checkboxselectcolumn.js"></script>
        <script type="text/javascript" src="/assets/lib/SlickGrid/plugins/slick.rowselectionmodel.js"></script>
        
        <script type="text/javascript" src="/assets/js/lib/dygraph-annotations-override.js"></script>
        <script type="text/javascript" src="/assets/js/lib/dygraph-serposcope-plugins.js"></script>
        <script type="text/javascript" src="/assets/js/lib/dygraph-plugins-loader.js"></script>
        
        <script type="text/javascript" src="/assets/lib/jquery-stupid-table/stupidtable.js"></script>
        <script type="text/javascript" src="/assets/lib/papaparse/papaparse.js"></script>

        <script type="text/javascript" src="/assets/js/utils.js"></script>
        <script type="text/javascript" src="/assets/js/theme.js"></script>
        <script type="text/javascript" src="/assets/js/sidebar.js"></script>
        <script type="text/javascript" src="/assets/js/views/HomeController.js"></script>
        <script type="text/javascript" src="/assets/js/views/GroupController.js"></script>
        <script type="text/javascript" src="/assets/js/views/admin/MenuController.js"></script>
        <script type="text/javascript" src="/assets/js/views/admin/SettingsController.js"></script>
        <script type="text/javascript" src="/assets/js/views/admin/UsersController.js"></script>
        <script type="text/javascript" src="/assets/js/views/admin/DebugController.js"></script>
        <script type="text/javascript" src="/assets/js/views/admin/GoogleSettingsController.js"></script>
        <script type="text/javascript" src="/assets/js/views/admin/TaskController.js"></script>
        <script type="text/javascript" src="/assets/js/views/admin/ProxyController.js"></script>
        <script type="text/javascript" src="/assets/js/views/google/GoogleSidebar.js"></script>
        <script type="text/javascript" src="/assets/js/views/google/GoogleGroupController.js"></script>
        <script type="text/javascript" src="/assets/js/views/google/GoogleGroupControllerGrid.js"></script>
        <script type="text/javascript" src="/assets/js/views/google/GoogleSearchController.js"></script>
        <script type="text/javascript" src="/assets/js/views/google/GoogleTargetControllerGrid.js"></script>
        <script type="text/javascript" src="/assets/js/views/google/GoogleTargetControllerVariation.js"></script>
        <script type="text/javascript" src="/assets/js/views/google/GoogleTargetController.js"></script>

        <script type="text/javascript" src="/assets/js/loader.js"></script>
        <!-- end-js -->
        </#if>
        <div id="_xsrf" data-value="<@authenticityToken/>" ></div>
    </body>
    <!--
    serposcope by serphacker.com is open source under MIT license
    https://serposcope.serphacker.com/
    https://github.com/serphacker/serposcope
    -->
</html>

</#macro>