<div>

    % my $retref = $c->stash("ret");
    % my %ret = $retref ? %$retref : (ret => "");
    % my @vars = split(/,/, $ret{vars} // '');
    % my ($var1, $var2, $var3, $var4, $var5, $var6, $var7) = @vars;

    % if ($c->app->config->{debug}) {
        <br>
        <pre>
            <%= dumper { ret_data => \%ret } %>
        </pre>
    % }

	% if ($ret{ret} eq "") {
		<div>
            <%= l "ln_FIRSTPAGE_DESC" %>
        </div>
        % } elsif (index($ret{ret},"SUCCESS") != -1) {
           <div>
               <!-- <h2> Operation Status Report</h2> -->
                <%= $c->render_to_string(inline => l($ret{ret}, @vars[0..6])) %>
            </div>
        % } else {
           <div class="text-danger">
               <!-- <h2> Operation Status Report - Error</h2> -->
                <%= $c->render_to_string(inline => l($ret{ret}, @vars[0..6])) %>
            </div>
    % }

    <br>

    % my $network_db = esmith::NetworksDB::UTF8->open() || die "Couldn't open NetworksDB db";

    % if (config->{debug} == 1) {
        <div>
            <%= dumper $c->current_route %>
            <%= dumper $c->stash("ret") %>
        </div>
    % }

    <form action="/smanager/localnetworksb" method="POST">
        <div>
            <h2><%=l "ln_ADD_TITLE" %></h2>
        </div>
        <br>
        <div>
            <%= $c->render_to_string(inline => l('ln_ADD_DESC')); %>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
              <label for="inputNetwork" class="col-form-label"><%= l "NETWORK" %></label>
            </div>
            <div class="col-auto">
              <input type="text" name="networkAddress" id="inputNetwork" class="form-control" aria-describedby="Network" >
            </div>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
              <label for="inputNetworkMask" class="col-form-label"><%= l "ln_SUBNET_MASK" %></label>
            </div>
            <div class="col-auto">
              <input type="text" name="networkMask" id="inputNetworkMask" class="form-control" aria-describedby="Network Subnet Mask" >
            </div>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
              <label for="inputNetworkRouter" class="col-form-label"><%= l "ROUTER" %></label>
            </div>
            <div class="col-auto">
              <input type="text" name="networkRouter" id="inputNetworkRouter" class="form-control" aria-describedby="Network Router" >
            </div>
        </div>

        <br><br>

        % my $btn = l('ADD');

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
            </div>
        </div>

    </form>

</div>

