% 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 'error' ) {
        <br><div class="">
        %= $c->render_to_string(inline => stash 'error') 
    </div>
    %}

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

    <h2>
    %=l 'bac_ENABLE_DISABLE_TAPE'
    </h2><br>

    %= $c->render_to_string(inline => (l 'bac_TAPE_CONFIG_DESC'))

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

    <p>
    <span class="">
    %=l 'bac_ENABLE_TAPE_BACKUP'
    </span>
    <span class="">
    % if ( $bac_datas->{status} eq 'checked' ) {
    <input type='checkbox' name='Tapebackup' checked >
    %} else {
    %= check_box 'Tapebackup'
    %}
    </span>
    </p>


    <p>
    <span class="">
    %=l 'bac_TAPE_BACKUP_TIME'
    </span>
    <span class="">
    % param 'BackupHour' => $bac_datas->{backupHour} unless param 'BackupHour';
    %= text_field 'BackupHour', size => '2'
    % param 'BackupMin' => $bac_datas->{backupMin} unless param 'BackupMin';
    %= text_field 'BackupMin', size => '2'
    </span>
    <!--span class="">
    %=l 'AM/PM:'
    <!--/span-->
    <span class="">
    % param 'BackupAMPM' => $bac_datas->{backupAMPM} unless param 'BackupAMPM';
    %= select_field 'BackupAMPM' => ['AM', 'PM'], class => ""
    </span>
    </p>

    <p>
    <span class="">
    %=l 'bac_LOAD_TAPE_REMINDER_TIME'
    </span>
    <span class="">
    % param 'ReminderHour' => $bac_datas->{reminderHour} unless param 'ReminderHour';
    %= text_field 'ReminderHour', size => '2'
    % param 'ReminderMin' => $bac_datas->{reminderMin} unless param 'ReminderMin';
    %= text_field 'ReminderMin', size => '2'
    </span>
    <!--span class="">
    %=l 'AM/PM:'
    <!--/span-->
    <span class="">
    % param 'ReminderAMPM' => $bac_datas->{reminderAMPM} unless param 'ReminderAMPM';
    %= select_field 'ReminderAMPM' => ['AM', 'PM'], class => ""
    </span>
    </p><br>

    %= hidden_field 'Function' => $bac_datas->{'function'}
    %= submit_button $c->l('bac_UPDATE_CONF'), class => ""

    % end
</div>
% end