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

% content_for 'module' => begin

<div class="card-body">

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

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

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

    <br>

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

    <br>

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

    <br>

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

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
            <%=l 'bac_SELECT_FILES_TO_RESTORE' %>
            </div>
            <div class="col-auto">
                <%= select_field 'Restorefiles' => $c->get_Restorefiles_options($bac_datas->{'filterexp'},$bac_datas->{'backupset'}), class => "form-select", multiple => 1, size => 15 %>
            </div>
        </div>

        <br><br>

        <div class="row g-3 align-items-center">
            <div class="col-md-1">
                <label for="inputSelectDate" class="col-form-label"><%=l 'bac_SELECT_DATE_BEFORE' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="Seldatebefore" id="inputSelectDate" class="form-control" aria-describedby="Restore most recent">
            </div>
        </div>

        <br><br>

        %= hidden_field 'Function' => $bac_datas->{'function'}
        %= hidden_field 'Backupset' => $bac_datas->{'backupset'}
        %= hidden_field 'Filterexp' => $bac_datas->{'filterexp'}


        % my $btn = l('PERFORM');

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary btn-sm" value="<%=$c->l('bac_RESTORE_FROM_TAPE')%>"><%= $btn %></button>
            </div>
        </div>

    <form>

</div>
% end