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

% content_for 'module' => begin

<div  class="card-body">

    %if (config->{debug} == 1) {
    <p>
    (DBG)route: <%= $c->current_route %><br>
    (DBG)dir. access: <%= $dir_datas->{access}%><br>
    </p>
    %}
    
    <h1><%= $title %></h1>
    <br>
    <%= $modul %>
    <%  my $btn = l('SAVE');
     %>


    %= form_for 'directory' => (method => 'POST') => begin
    <br>
    <p>
    <span class="">
    %= l('dir_LABEL_ROOT'), class => ""
    </span>
    <span class="">
    %= $dir_datas->{root}, class => "" 
    </span>
    </p>
    <p>
    %=l 'dir_DESC_DIRECTORY_ACCESS', class => ""
    <br>
    <span class="">
    %=l 'dir_DIRECTORY_ACCESS', class => ""
    </span>
    <span class="">
    % param 'access' => $dir_datas->{access} unless param 'access';
    %= select_field 'access' =>  [[ (l 'NETWORKS_ALLOW_LOCAL') => 'private'], [ (l 'NETWORKS_ALLOW_PUBLIC') => 'public']], class => "", id => ""
    </span>
    </p>
    <p>
    %=l 'dir_DESC_DEPARTMENT', class => ""
    <br><br>
    <span class="">
    %=l 'dir_DEPARTMENT', class => ""
    </span><span class="">
    %= text_field 'department' =>  $dir_datas->{department}, class => ""
    </span>
    </p><p>
    <span class="">
    %=l 'dir_COMPANY', class => ""
    </span><span class="">
    %= text_field 'company', $dir_datas->{company}, class => ""
    </span>
    </p><p>
    <span class="">
    %=l 'dir_STREET', class => ""
    </span><span class="">
    %= text_field 'street' =>  $dir_datas->{street}, class => ""
    </span>
    </p><p>
    <span class="">
    %=l 'dir_CITY', class => ""
    </span><span class="">
    %= text_field 'city', $dir_datas->{city}, class => ""
    </span>
    </p><p>
    <span class="">
    %=l 'dir_PHONENUMBER', class => ""
    </span><span class="">
    %= text_field 'phonenumber', $dir_datas->{phonenumber}, class => ""
    </span>
    </p>
    <p>
    %=l 'dir_DESC_EXISTING', class => ""
    <br><br>
    <span class="">
    %=l 'dir_EXISTING', class => ""
    </span><span class="">
    %= select_field 'existing'=> [[ (l 'dir_LEAVE') => 'leave'], [ (l 'dir_UPDATE') => 'update' ]], class => ""
    </span>
    </p>
    <p>
    <br>
    %= submit_button "$btn", class => ""
    </p>
    % end    

</div>
%end