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

% content_for 'module' => begin

<div class="card-body">

    % if (config->{debug} == 1) {
        <pre>
            <%= dumper $c->current_route %>
            <%= dumper $yum_datas %>
        </pre>
    % }


    <h1><%= $title%></h1>

    % if ( $notif ) {
        <br>
        <div class="text-warn">
            <%= $notif %>
        </div>
        <br>
    % }


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

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'yum_LABEL_YUM_STATUS' %>
            </div>
            <div class="col-auto">
                % param 'yum_check4updates' => $c->get_status('check4updates') unless param 'yum_check4updates';
                <%= select_field 'yum_check4updates' => $c->get_check_freq_opt(), class => "form-select" %>
            </div>
        </div>

        <br>

        <%= l 'yum_DESC_YUM_PACKAGEFUNCTIONS' %>

        <br><br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'yum_LABEL_YUM_PACKAGEFUNCTIONS' %>
            </div>
            <div class="col-auto">
                % param 'yum_PackageFunctions' => $c->get_status('PackageFunctions') unless param 'yum_PackageFunctions';
                <%= select_field 'yum_PackageFunctions' => [[ $c->l('DISABLED') => 'disabled'], [ $c->l('ENABLED') => 'enabled']], class => "form-select" %>
            </div>
        </div>

        <br>

        <%= l 'yum_DESC_ENABLED_REPOSITORIES' %>

        <br><br>

        <br>



        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'yum_LABEL_ENABLED_REPOSITORIES' %>
            </div>
            <div class="col-auto">
                % param 'SelectedRepositories' => $c->get_repository_current_options() unless param 'SelectedRepositories';

                <%= select_field 'SelectedRepositories' => $c->get_repository_options2(), multiple => '1', size => "16", class => "form-select" %>
            </div>
        </div>

<br>
        <%= dumper $c->get_repository_options2() %>
<br>
        <%= dumper $c->get_repository_current_options () %>
<br>
        <%= dumper $c->every_param('SelectedRepositories') %>
<br>


        %# my @repo ();
        %# my %repositories = $c->get_repository_options2();
        <%#= dumper %repositories %>

        %# foreach my @repository (keys %$repositories) {
            <%#= dumper @repository %>
            <br>
            %# my $repoName = $_->{Name};
            %# my $repoStatus = $_ -> {Status};
        %# }



        <br>

        <%= l 'yum_DESC_YUM_DELTARPMPROCESS' %>

        <br><br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'yum_LABEL_YUM_DELTARPMPROCESS' %>
            </div>
            <div class="col-auto">
                % param 'yum_DeltaRpmProcess' => $c->get_status('DeltaRpmProcess') unless param 'yum_DeltaRpmProcess';
                <%= select_field 'yum_DeltaRpmProcess' => [[ $c->l('DISABLED') => 'disabled'], [ $c->l('ENABLED') => 'enabled']], class => "form-select" %>
            </div>
        </div>

        <br>

        <%= l 'yum_DESC_YUM_DOWNLOADONLY' %>

        <br><br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'yum_LABEL_YUM_DOWNLOADONLY' %>
            </div>
            <div class="col-auto">
                % param 'yum_DownloadOnly' => $c->get_status('DownloadOnly') unless param 'yum_DownloadOnly';
                <%= select_field 'yum_DownloadOnly' => [[ $c->l('DISABLED') => 'disabled'], [ $c->l('ENABLED') => 'enabled']], class => "form-select" %>
            </div>
        </div>

        <br>

        <%= l 'yum_DESC_YUM_AUTOINSTALLUPDATES' %>

        <br><br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'yum_LABEL_YUM_AUTOINSTALLUPDATES' %>
            </div>
            <div class="col-auto">
                % param 'yum_AutoInstallUpdates' => $c->get_status('AutoInstallUpdates') unless param 'yum_AutoInstallUpdates';
                <%= select_field 'yum_AutoInstallUpdates' => [[ $c->l('DISABLED') => 'disabled'], [ $c->l('ENABLED') => 'enabled']], class => "form-select" %>
            </div>
        </div>

        <br>

        % my $btnSave = $c->l('SAVE');
        <%=  hidden_field 'trt' => 'CONF' %>

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

    </form>



</div>

% end
