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

% content_for 'module' => begin

<div class="card-body">

    %if (config->{debug} == 1) {
    <div>
        <%= dumper $c->current_route %><br>
        <%= dumper $dir_datas->{access}%><br>
    </div>
    % }

    <h1><%= $title %></h1>
    <br>
    <%= $modul %>
    <%  my $btn = l('SAVE'); %>

    <form action="/smanager/directory" method="POST">
    <br>
    <div>
        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l('dir_LABEL_ROOT') %>
            </div>
            <div class="col-auto">
                <%= $dir_datas->{root} %>
            </div>
        </div>

        <br>

        <div>
            <%= l 'dir_DESC_DIRECTORY_ACCESS' %>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'dir_DIRECTORY_ACCESS' %>
            </div>
            <div class="col-auto">
            % param 'access' => $dir_datas->{access} unless param 'access';
            <%= select_field 'access' =>  [[ (l 'NETWORKS_ALLOW_LOCAL') => 'private'], [ (l 'NETWORKS_ALLOW_PUBLIC') => 'public']], class => "form-select" %>
        </div>

        <br><br>

        <div>
            <%= l 'dir_DESC_DEPARTMENT' %>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputDirDepartment" class="col-form-label"><%= l 'dir_DEPARTMENT' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="department" id="inputDirDepartment" class="form-control" aria-describedby="DirectoryDepartment" value="<%= $dir_datas->{department} %>">
            </div>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputDirCompany" class="col-form-label"><%= l 'dir_COMPANY' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="company" id="inputDirCompany" class="form-control" aria-describedby="DirectoryCompany" value="<%= $dir_datas->{company} %>">
            </div>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputDirStreet" class="col-form-label"><%= l 'dir_STREET' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="street" id="inputDirStreet" class="form-control" aria-describedby="DirectoryStreet" value="<%= $dir_datas->{street} %>">
            </div>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputDirCity" class="col-form-label"><%= l 'dir_CITY' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="city" id="inputDirCity" class="form-control" aria-describedby="DirectoryCity" value="<%= $dir_datas->{city} %>">
            </div>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputDirPhoneNumber" class="col-form-label"><%= l 'dir_PHONENUMBER' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="phonenumber" id="inputDirPhoneNumber" class="form-control" aria-describedby="DirectoryPhoneNmber" value="<%= $dir_datas->{phonenumber} %>">
            </div>
        </div>

        <br><br>

        <div>
            <%= l 'dir_DESC_EXISTING' %>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
            <%= l 'dir_EXISTING' %>
            </div>
            <div class="col-auto">
                <%= select_field 'existing'=> [[ (l 'dir_LEAVE') => 'leave'], [ (l 'dir_UPDATE') => 'update' ]], class => "form-select" %>
            </div>
        </div>

        <br>

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

    </form>
</div>

%end