% layout 'AdminLTE' , title => "Sme server 2 - login";

% content_for 'module' => begin

  % if ( config 'debug' ) {
  <div>
  <!-- %= dumper $c->current_route -->
      % if ( stash 'trt' ) {
          %= dumper stash 'trt'
      % }
  </div>
  % }

% if ( stash 'error' ) {
    <br>
    <div class="container text-center">
        <div class="row">
            <div class="col-sm">
                <div class="text-danger">
                <%= $c->render_to_string(inline => stash 'error') %>
                </div>
        </div>
    </div>
% }

% my $btn = l('use_SIGNIN');
% if ( $trt eq 'RESET' ) {
      <br>
      <div>
          <h2><%= $c->render_to_string(inline => l 'use_DESC_RESET') %></h2>
      </div>
  % $btn = l('use_RESET');
% }

<div class="login-page bg-body-secondary-subtle app-loaded">
      <!-- /.login-logo -->

    <div class="login-box">
      <div class="card card-outline card-success">
        <div class="card-header">
            <div class="d-flex justify-content-center">
              <img class="img-fluid" src="images/KoozaliServerManager.png" alt="Koozali Logo">
            </div>
            <br>
            <a href="/smanager" class="link-dark text-center link-offset-2 link-opacity-100 link-opacity-50-hover">
              <h1 class="mb-0"><b>Koozali</b></h1>
              <br>
              <h3>Server Manager</h3>
            </a>
            <br>
            <h1 class="text-center">
                %=l 'use_TITLE'
            </h1>
          </div>


        <div class="card-body login-card-body">
          <p class="login-box-msg">Sign in to start your session</p>
          <form action="/smanager/login" method="POST">
            <div class="input-group mb-1">
              <div class="form-floating">
                <input name='Username' id="Username" type="text" class="form-control" placeholder="<%=l 'USER_NAME'%>">
                <label for="Username">User</label>
              </div>
              <div class="input-group-text"><span class="bi bi-person-fill"></span></div>
            </div>
            <div class="input-group mb-1">
              <div class="form-floating">
                <input name='Password' id="Password" type="password" class="form-control" placeholder="<%=l 'PASSWORD'%>">
                <label for="Password">Password</label>
              </div>
              <div class="input-group-text"><span class="bi bi-lock-fill"></span></div>
            </div>

            <%= hidden_field 'From' => $c->tx->req->url %>
            <%= hidden_field 'Trt' => stash 'trt' %>

            <!--begin::Row-->
            <div class="row">
              <div class="col-8 d-inline-flex align-items-center">
                <div class="form-check">
                  <input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
                  <label class="form-check-label" for="flexCheckDefault"> Remember Me </label>
                </div>
              </div>
              <!-- /.col -->
              <div class="col-4">
                <div class="d-grid gap-2">
                  <button type="submit" class="btn btn-primary">Login</button>
                </div>
              </div>
              <!-- /.col -->
            </div>
            <!--end::Row-->
          </form>
          <br>
          <div class="mb-1 text-center">
              <a href="login2">I forgot my password</a>
          </div>
        </div>
        <!-- /.login-card-body -->
      </div>
    </div>
    <!-- /.login-box -->
</div>

% end
