<#assign sideMenu>
<li>
    <span class="first-level"><i class="fa fa-cubes fw"></i> ${i18n("label.groups")}</span>
    <ul class="nav nav-second-level">
        <li>
            <div class="form-search form-group has-feedback has-feedback">
                <input id="sidebar-group-search" type="text" class="form-control" placeholder="${i18n("label.searchGroup")} ..." />
                <i class="form-control-feedback glyphicon glyphicon-search"></i>
            </div>
        </li>
    </ul>
</li>
</#assign>
<#import "../layout/root.ftl.html" as layout> 
<@layout.rootLayout i18n("label.groups") "${sideMenu}" >
<#if h2warning?? && h2warning >
    <div class="alert alert-warning alert-dismissible" role="alert">
        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">${i18n("label.close")}</span></button>
        <div class="alert-upper">${i18n("groups.h2warning")}</div>
    </div>
</#if>
<div class="row" >
    <div class="col-xs-12" >

        <ul class="nav nav-tabs" role="tablist">
            <li class="active">
                <a href="#groups" data-toggle="tab">${i18n("label.groups")}</a>
            </li>
        </ul>

        <div class="tab-content tab-groups">
            <div class="tab-pane active" id="groups">
                <div class="row top5" >
                    <div class="col-xs-12" >
                        <p>${i18n("groups.uniqueKWnumber")} : <strong>${search_count}</strong></p>
                        <#if user.isAdmin()>
                        <div class="row bottom15" >
                            <div class="col-xs-12" >
                                <a href="#"  class="btn btn-primary btn-add-group" >${i18n("label.newGroup")}</a>
                            </div>
                        </div>
                        </#if>
                        <table class="table table-condensed table-bordered" >
                            <tr>
                                <th class="width30" >#</th>
                                <th class="width40" >${i18n("label.module")}</th>
                                <th>${i18n("label.name")}</th>
                            </tr>
                            <#list groups as group>
                            <tr>
                                <td>
                                    <#if user.isAdmin() >
                                    <a href="${reverseRoute("google.GoogleGroupController","delete", "groupId",group.getId())}" class="btn-delete-group text-danger" 
                                       data-id="${group.getId()}" data-name="${group.getName()}"
                                       title="${i18n("label.delete")}" data-toggle="tooltip" 
                                    >
                                        <i class="glyphicon glyphicon-remove" ></i>
                                    </a>                                    
                                    </#if>
                                </td>
                                <td>${group.getModule()}</td>
                                <td><a href="${fu.groupLink(group)}" >${group.getName()}</a></td>
                            </tr>
                            </#list>
                        </table>
                    </div>
                </div>                
            </div>
        </div>
    </div>
</div>

<div class="csp-script" data-src="GroupController.render" ></div>

</@>