<div>

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


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

        %= l('dom_FORM_DESCRIPTION');
        
        <p>
        <br>
        %= submit_button "$btn", class => ""
        </p>

        %= hidden_field 'trt' => 'ADD'
    
    % end

    <h2>
        %=l 'dom_CURRENT_DOMAINS'
    </h2>
    <table class="table table-bordered">
    <thead>
    <tr>
        <th class="">
            %=l 'DOMAIN_NAME'
        </th>
        <th class="">
            %=l 'DESCRIPTION_BRIEF'
        </th>
        <th class="">
            %=l 'dom_CONTENT'
        </th>
        <th class="">
            %=l 'dom_LABEL_NAMESERVERS'
        </th>
        <th class="">
            %=l 'ACTION'
        </th>
    </tr>
    </thead>
    <tbody>

    % foreach my $domain ( @$domains ) {
        <tr>
            %= t td => (class => "") => $domain->{Domain}
            %= t td => (class => "") => $domain->{'Description'}
            %= t td => (class => "") => $domain->{'Content'}
            %= t td => (class => "") => l('dom_' . $domain->{'Nameservers'})

        %#  my $actionModify = "<a href='domains2?CsrfDef=TOKEN&trt=UPD&Domain=" . $domain->{Domain} . "'>" . "<button class="" title=".l('MODIFY').">".l('MODIFY')."</button>" . "</a>"; 
            %my $modify_text = l('MODIFY');  # Localized text
            %my $csrf_token = "TOKEN";  # CSRF token for security
            %my $domain_name = $domain->{Domain};  # Domain name extracted from the data structure
            %my $actionModify = qq{
                        %       <a href="domains2?CsrfDef=$csrf_token&trt=UPD&Domain=$domain_name">
            %   <button type='button' class="" title='$modify_text' >
            %       $modify_text
            %   </button>
                        %       </a>
            %};
            %my $removable = ($domain->{Removable} || 'yes');
            %my $actionRemove = '&nbsp;';
            %if ($removable eq 'yes')  { 
                    %my $remove_text = l('REMOVE');  # Localized text
                    %my $csrf_token = "TOKEN";  # CSRF token for security
                    %my $domain_name = $domain->{Domain};  # Domain name extracted from the data structure
                    %$actionRemove = qq{
                                                %       <a href="domains2?CsrfDef=$csrf_token&trt=DEL&Domain=$domain_name">
                        %   <button type='button' class="" title='$remove_text' >
                        %       $remove_text
                        %   </button>
                                                %       </a>
                    %};
                %#      $actionRemove = "<a href='domains2?CsrfDef=TOKEN&trt=DEL&Domain=" . $domain->{Domain} . "'>" . "<button class="" title=".l('REMOVE').">".l('REMOVE')."</button>" . "</a>"; 
            %};
            <td class="" style="min-width:15em">
                <%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionRemove) %>
            </td>
        </tr>
    %   }

    </tbody>
    </table>

    %= hidden_field 'trt' => 'ADD'

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

        <!-- <HR class="">-->
        <br>

        % my $btn2 = l('dom_DOMAINS_PAGE_CORPORATE_DNS');

        <h3>
            %= l 'dom_DESC_CORPORATE_DNS_CURRENT'
            </h3>

        <p>
        <span class="">
        %=l 'dom_LABEL_CORPORATE_DNS_PRIMARY'
        </span>
        <span class="">
        %= $dom_datas->{forwarder}
        </span>
        </p>

        % if ($dom_datas->{forwarder2}) {
        <p>
        <span class="">
        %=l 'dom_LABEL_CORPORATE_DNS_SECONDARY'
        </span>
        <span class="">
        %= $dom_datas->{forwarder2}
        </span>
        </p>
        % }

        <p>
        %= submit_button "$btn2", class => ""
        </p>
        %= hidden_field 'trt' => 'UP2'
    % end



</div>