<div>

    % my $btn = l('dom_ADD_DOMAIN');
    <%= l('dom_FORM_DESCRIPTION'); %>

    <form action="/smanager/domains" method="POST">
        <br>
        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary"><%= $btn %> </button>
            </div>
        </div>
        <%= hidden_field 'trt' => 'ADD' %>
    </form>

    <br>

    <div>
        <h2><%=l 'dom_CURRENT_DOMAINS' %></h2>
    </div>

    <br>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th class="col-sm"><%=l 'DOMAIN_NAME' %></th>
                <th class="col-sm"><%=l 'DESCRIPTION_BRIEF' %></th>
                <th class="col-sm"><%=l 'dom_CONTENT' %></th>
                <th class="col-sm"><%=l 'dom_LABEL_NAMESERVERS'%></th>
                <th class="col-sm user-valign-center" colspan="2"><%=l 'ACTION' %></th>
            </tr>
        </thead>

        <tbody>

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

                    %#  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="btn btn-primary" 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="btn btn-primary" 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="col-auto user-valign-center"><%= $c->render_to_string(inline => $actionRemove) %></td>
                    <td class="col-auto user-valign-center"><%= $c->render_to_string(inline => $actionModify) %></td>
                </tr>
            % }

        </tbody>
    </table>

    <%= hidden_field 'trt' => 'ADD' %>

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

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

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

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

        % if ($dom_datas->{forwarder}) {
        <div class="row g-3 align-items-center">
            <div class="col-md-3">
                <%=l 'dom_LABEL_CORPORATE_DNS_PRIMARY' %>
            </div>
            <div class="col-auto">
                <%= $dom_datas->{forwarder} %>
            </div>
        </div>
        % }

        % if ($dom_datas->{forwarder2}) {
            <div class="row g-3 align-items-center">
                <div class="col-md-3">
                     <%=l 'dom_LABEL_CORPORATE_DNS_SECONDARY' %>
                </div>
                <div class="col-auto">
                     <%= $dom_datas->{forwarder2} %>
                </div>
            </div>
        % }

        <br>

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

        <%= hidden_field 'trt' => 'UP2' %>

    </form>

</div>