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

% content_for 'module' => begin

<div class="card-body">

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

    % if ( stash 'warning' ) {
        <br>
        <div class="">
        %= $c->render_to_string(inline => stash 'warning') 
        </div>
    %}
    % if ( stash 'error' ) {
        <br>
        <div class="">
        %= $c->render_to_string(inline => stash 'error') 
        </div>
    %}

    <h1><%= $title%></h1>
    <!--br>Still incomplete click here for previous version
    <a href="/server-manager/cgi-bin/backup" target='_blank'><b>(Previous Backup version)</b></a>
    <br-->

    <%= $c->render_to_string(inline => (l 'bac_BACKUP_DESC_DAR', $bac_datas->{module}, 
        $bac_datas->{dumpsize}, $bac_datas->{tarsize})) %>

    %= form_for '/backup' => (method => 'POST') => begin

    <h2>
    %=l 'bac_BACKUP_CONFIG_STATUS'
    </h2>

    <p>
    <span class="">
    %=l 'bac_TAPE_BACKUPS',
    </span>
    <span class="">
    %= $c->l(uc($bac_datas->{'backupStatus'})).'.'
    </span>
    % if ( $bac_datas->{'backupStatus'} eq 'enabled' ) {
        %= $c->l('bac_BACKUPS_RUN_AT')
        <span class="">
        %=  $bac_datas->{'backupTime'}
        </span>
        %= $c->l('bac_REMINDER_MESSAGE_AT')
        <span class="">
        %= $bac_datas->{'reminderTime'}
        </span>    
    %}
    </p>
    
    <p>
    <span class="">
    %=l 'bac_WORKSTN_BACKUPS',
    </span>
    <span class="">
    %= $c->l(uc($bac_datas->{'backupwkStatus'})).'.'
    </span>
    % if ( $bac_datas->{'backupwkStatus'} eq 'enabled' ) {
         %= $c->l('bac_WKBACKUPS_RUN_AT')
         <b>
         %= $bac_datas->{'backupwkTime'}
         </b>
    %}
    </p>

    <p>
    <span class="">
    %=l 'bac_SELECT_AN_ACTION'
    </span>
    <span class="">
    % param 'Function' => $bac_datas->{function} unless param 'Function';
    %= select_field 'Function' => $c->get_function_options(), class => ""
    </span>
    </p>

    <br>
    %= submit_button $c->l('PERFORM'), class => ""
 
    % end

</div>

% end