<div>

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

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

    %= hidden_field 'trt' => 'ADD'

    <br>

    <div>
        <button type="submit" class="btn btn-primary"><%= $btn %> </button>
    </div>
	
    % end    

    <br>
	<h2><%=l 'grp_CURRENT_LIST' %></h2>
	<br><br>
    % 	my $numGroups = @$groups;
    %	if ($numGroups == 0){
        %=l 'ACCOUNT_GROUP_NONE'
    %	} else {
	<table class="table table-bordered user-table-max-wdith">
	<thead>
	<tr>
    	    <th class="col-sm">
    	        %=l 'GROUP'
    	    </th>
    	    <th class="col-sm">
    	        %=l 'DESCRIPTION'
    	    </th>
    	    <th class="user-valign-center col-sm" colspan="2">
	            %=l 'ACTION'
    	    </th>
    	</tr>
    	</thead>
    	<tbody>

    %    foreach my $group ( @$groups )
    %    {
        <tr>
            <td><%= $group->key %></td>
            <td><%= $group->prop('Description') %></td>

				%my $modify_text = l('MODIFY');  # Localized text
				%my $csrf_token = "TOKEN";  # CSRF token for security
				%my $group_name = $group->key;  # group name extracted from the data structure
				%my $actionModify = qq{
                    %<a href="groups2?CsrfDef=$csrf_token&trt=UPD&group=$group_name">
				    %	<button type='button' class="btn btn-primary" title='$modify_text' >
				    %		$modify_text
				    %	</button>
                    %</a>
				%};
				%my $remove_text = l('REMOVE');  # Localized text
				%my $csrf_token = "TOKEN";  # CSRF token for security
				%my $group_name = $group->key;  # group name extracted from the data structure
				%my $actionRemove = qq{
                %<a href="groups2?CsrfDef=$csrf_token&trt=DEL&group=$group_name">
				%	<button type='button' class="btn btn-primary" title='$remove_text' > 
				%		$remove_text
				%	</button>
                %</a>
				%};

			<td class="user-valign-center"><%= $c->render_to_string(inline => $actionModify) %></td>
			<td class="user-valign-center"><%= $c->render_to_string(inline => $actionRemove) %></td>
    	</tr>
    %    }
    	</tbody>
    	</table>
	<%} %>



</div>
