91 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			91 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
{% extends "base.html" %}
 | 
						|
 | 
						|
{% block title %}Управление пользователями{% endblock %}
 | 
						|
 | 
						|
{% block content %}
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
<!--<form action="/users/create" method="post">
 | 
						|
    <label>Логин:</label>
 | 
						|
    <input type="text" name="username" required>
 | 
						|
 | 
						|
    <label>Пароль:</label>
 | 
						|
    <input type="password" name="password" required>
 | 
						|
 | 
						|
    <label>Роль:</label>
 | 
						|
    <select name="role">
 | 
						|
        <option value="user">Пользователь</option>
 | 
						|
        <option value="admin">Администратор</option>
 | 
						|
    </select>
 | 
						|
 | 
						|
    <button type="submit">Создать</button>
 | 
						|
</form>-->
 | 
						|
 | 
						|
 | 
						|
<div class="intro-y box">
 | 
						|
<h2 class="text-lg font-medium mr-auto">Add Users</h2>
 | 
						|
 | 
						|
<form action="/users/create" method="post">
 | 
						|
 <div class="mt-3"> <label>Email</label> <input type="text" class="input w-full border mt-2" name="username" placeholder="username"> </div>
 | 
						|
 <div class="mt-3"> <label>Password</label> <input type="password"   name="password"class="input w-full border mt-2" placeholder="secret"> </div>
 | 
						|
 | 
						|
 <label>Role:</label>
 | 
						|
    <div class="sm:mt-2"> <select class="input input--sm border mr-2" name="role">
 | 
						|
        <option value="user">Users</option>
 | 
						|
        <option value="admin">Admin</option>
 | 
						|
    </select></div>
 | 
						|
 
 | 
						|
 <button type="submit" class="button bg-theme-1 text-white mt-5">Login</button>
 | 
						|
</form> 
 | 
						|
 | 
						|
 | 
						|
<div class="overflow-y-auto mt-3">
 | 
						|
 | 
						|
</div>
 | 
						|
</div>
 | 
						|
 | 
						|
 | 
						|
<div class="intro-y box mt-5">
 | 
						|
 | 
						|
 <div class="overflow-x-auto">
 | 
						|
    <h2 class="text-lg font-medium mr-auto">
 | 
						|
                       User list
 | 
						|
                    </h2>
 | 
						|
     <table class="table">
 | 
						|
         <thead>
 | 
						|
             <tr>
 | 
						|
                 <th class="border-b-2 whitespace-no-wrap">ID</th>
 | 
						|
                 <th class="border-b-2 whitespace-no-wrap">Login</th>
 | 
						|
                 <th class="border-b-2 whitespace-no-wrap">Role</th>
 | 
						|
                 <th class="border-b-2 whitespace-no-wrap">Actions</th>
 | 
						|
             </tr>
 | 
						|
         </thead>
 | 
						|
         <tbody>
 | 
						|
             {% for user in users %}
 | 
						|
             <tr>
 | 
						|
                 <td class="border-b">{{ user.id }}</td>
 | 
						|
                 <td class="border-b">{{ user.username }}</td>
 | 
						|
                 <td class="border-b">{{ user.role }}</td>
 | 
						|
                 <td class="border-b"> 
 | 
						|
                    <form action="/users/update_password" method="post">
 | 
						|
                        <input type="hidden" name="user_id" value="{{ user.id }}">
 | 
						|
                        <input type="password" class="input w-full border mt-2" name="new_password" placeholder="New password" required>
 | 
						|
                        <button type="submit"  class="button bg-theme-1 text-white mt-5" >Refresh password</button>
 | 
						|
                    </form>
 | 
						|
             </tr>
 | 
						|
            
 | 
						|
              {% endfor %}
 | 
						|
         </tbody>
 | 
						|
     </table>
 | 
						|
    
 | 
						|
 </div>
 | 
						|
 | 
						|
 </div>
 | 
						|
 | 
						|
{% endblock %}
 |