summaryrefslogblamecommitdiffstats
path: root/modules-available/permissionmanager/templates/rolestable.html
blob: e50dffc743e67fb3405af50c747d05d1d11ecfd6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                            
                                                              
 

                                                                                                                                                          
              


                                       
                                                                                     

                                            
                                                                                          
                                                                                                







                                                                                      
                                                                                                         




                                             

                                                                                      
                                                                                                                                                     
                                                                        
                                                                                                                                                                                                                   
                                                     
                                                                        

                                                                                                                                                                            

                                                                                                               



                                                                                                         






                                                     

       
                        
                                                                                                                                                                                     

      
        
                                        



                                                                                
                                
                                                             
                         
                   
         
        
<form method="post" action="?do=permissionmanager">
	<input type="hidden" name="token" value="{{token}}">
	<input type="hidden" name="action" value="deleteRole">

	<div>
		<input type="text" class="form-control" id="roleNameSearchField" onkeyup="searchFieldFunction()" placeholder="{{lang_searchPlaceholder}}">
	</div>

	<div class="row">
		<div class="col-md-12">
			<table class="table table-condensed table-hover stupidtable">
				<thead>
					<tr>
						<th data-sort="string">{{lang_roles}}</th>
						<th data-sort="string">{{lang_description}}</th>
						<th class="text-center slx-smallcol">
							{{#perms.roles.edit.disabled}}
							{{lang_view}}
							{{/perms.roles.edit.disabled}}
							{{^perms.roles.edit.disabled}}
							{{lang_edit}}
							{{/perms.roles.edit.disabled}}
						</th>
						<th class="text-center slx-smallcol">{{lang_delete}}</th>
					</tr>
				</thead>

				<tbody>
				{{#roles}}
					<tr>
						<td class="rolename">{{rolename}}</td>
						<td class="text-muted"><table class="slx-ellipsis"><tr><td>{{roledescription}}</td></tr></table></td>
						<td class="text-center">
							<a class="btn btn-xs btn-primary" href="?do=permissionmanager&amp;show=roleEditor&amp;roleid={{roleid}}"><span class="glyphicon glyphicon-edit"></span></a>
						</td>
						<td class="text-center">
							<button type="submit" name="deleteId" value="{{roleid}}" class="btn btn-xs btn-danger" {{perms.roles.edit.disabled}}
									data-confirm="#confirm-role-{{roleid}}" data-title="{{rolename}}">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
							<div class="hidden" id="confirm-role-{{roleid}}">
								<p>{{lang_roleDeleteConfirm}}</p>
								{{lang_numAssignedUsers}}: {{users}}
							</div>
						</td>
					</tr>
				{{/roles}}
				</tbody>
			</table>
		</div>
	</div>
</form>

<div class="text-right">
	<a href="?do=permissionmanager&amp;show=roleEditor" class="btn btn-success {{perms.roles.edit.disabled}}"><span class="glyphicon glyphicon-plus"></span> {{lang_newRole}}</a>
</div>

<script>
	function searchFieldFunction() {
		var filter = $("#roleNameSearchField").val().toLowerCase();
		$(".rolename").each(function() {
			if ($(this).text().toLowerCase().indexOf(filter) >= 0) {
				$(this).closest("tr").show();
			} else {
				$(this).closest("tr").hide();
			}
		});
	}
</script>