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

% content_for 'module' => begin

<div class="card-body">

    %if (config->{debug} == 1) {
    <div>
        (DBG)route: <%= $c->current_route %><br>
        (DBG)pdc: <%= $wkg_datas->{ServerRole}%><br>
        (DBG)roam: <%= $wkg_datas->{RoamingProfiles}%><br>
    </div>
    %}

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

    <form action="/smanager/workgroup" method="POST">

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

        <br>
            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                    <label for="inputWorkgroup" class="col-form-label"><%= l 'wkg_LABEL_WORKGROUP' %></label>
                </div>
                <div class="col-auto">
                    <input type="text" name="Workgroup" id="inputWorkgroup" class="form-control" aria-describedby="inputWorkgroup" maxlength="15" value="<%= $wkg_datas->{Workgroup}%>" >
            </div>
                <div class="col-auto">
                  <span id="passwordHelpInline" class="form-text">
                    Limited to 15 characters by the NETBIOS
                  </span>
                </div>
        </div>

        <br>

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

        <br>
            <div class="row g-3 align-items-center">
                <div class="col-md-1">
                    <label for="inputSambaServerName" class="col-form-label"><%= l 'wkg_LABEL_SERVERNAME' %></label>
                </div>
                <div class="col-auto">
                <input type="text" name="ServerName" id="inputSambaServerName" class="form-control" aria-describedby="inputSambaServerName"  value="<%= $wkg_datas->{ServerName}%>" >
            </div>
        </div>

        <br>

        <div>
            %= $c->render_to_string(inline => l 'wkg_DESC_PDC')
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <%= l 'wkg_LABEL_PDC' %>
            </div>
            <div class="col-auto">
                % param 'ServerRole' => $wkg_datas->{ServerRole} unless param 'ServerRole';
                <%= select_field 'ServerRole' =>  [[ (l 'YES') => 'PDC'], [ (l 'NO') => 'WS']], class => "form-select" %>
            </div>
        </div>

        <br>

        <div>
            <%= $c->render_to_string(inline => l 'wkg_DESC_ROAM') %>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <%= l 'wkg_LABEL_ROAM' %>
            </div>
            <div class="col-auto">
                % param 'RoamingProfiles' => $wkg_datas->{RoamingProfiles} unless param 'RoamingProfiles';
                <%= select_field 'RoamingProfiles' =>  [[ (l 'YES') => 'yes'], [ (l 'NO') => 'no']], class => "form-select" %>
            </div>
        </div>

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

    </form>
</div>

%end