<% jagg.template("user/login", function(inputs, outputs, jagg) { %>

<%      if(request.isSecure()){

            if(jagg.getUser() != null){
                response.sendRedirect('index.jag');
            }
%>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span2">
            <div class="left-side-col">
            </div>
        </div>
        <div class="span6 ">
            <div class="title-section">
                <h2>Login</h2>
            </div>

            <div class="clear"></div>
            <div class="content-section shadow-up">
                <div class="content-data">
                       <div class="alert alert-error" id="loginError" style="display:none">
                           <span id="loginErrorSpan"></span>
                       </div>
                       <form class="" action="index.jag" id="loginForm">
                           <label><%=i18n.localize("username")%>:<span class="requiredAstrix">*</span></label>
                           <input type="text" id="username" autofocus="autofocus" validation="required"  />

                           <label><%=i18n.localize("password")%>:<span class="requiredAstrix">*</span></label>
                           <input type="password" id="pass" />
                           <input type="hidden"  id="tenant" value="<%=request.getParameter("tenant")%>"/>
                           <div>
                               <input type="button" class="btn btn-primary" onclick="login()"  value="<%=i18n.localize("login")%>" id="loginButton" />
                               <input type="reset" class="btn" value="<%=i18n.localize("reset")%>" />
                           </div>
                       </form>
                </div>
            </div>
            <style>
                .api-count-display {
                    color: #747474;
                    font-size: 15px;
                    padding: 10px 20px 5px;
                }

                .api-count-display span {
                    font-size: 16px;
                    font-weight: bold;
                }
            </style>
        </div>
        <div class="span4">
        </div>
    </div>
    <div id="push"></div>
</div>
<% } else {
        var mod,httpsUrl;
        mod = jagg.module("manager");
        httpsUrl= mod.getHTTPsURL();
        response.sendRedirect(httpsUrl+site.context);
} %>
<%});%>