Mobile-friendly UI: hamburger nav, responsive layouts, restyle login/admin pages, fix iOS upload
This commit is contained in:
+51
-49
@@ -3,62 +3,64 @@
|
||||
{% block title %}إدارة المستخدمين - سجل العقارات اللبناني{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="users-container" style="max-width: 800px; margin: 20px auto; padding: 20px;">
|
||||
<h2>إدارة النظام والمستخدمين</h2>
|
||||
|
||||
{% if backup_msg %}
|
||||
<div style="padding: 10px; background-color: #d4edda; color: #155724; border-radius: 4px; margin-bottom: 15px;">
|
||||
{{ backup_msg }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div style="margin-bottom: 30px; padding: 15px; border: 1px solid #ddd; border-radius: 8px;">
|
||||
<h3>نسخ احتياطي لقاعدة البيانات</h3>
|
||||
<p>قم بإنشاء نسخة احتياطية من قاعدة البيانات الحالية.</p>
|
||||
<a href="/auth/backup" style="display: inline-block; padding: 8px 15px; background-color: #28a745; color: white; text-decoration: none; border-radius: 4px;">إنشاء نسخة احتياطية</a>
|
||||
<div class="admin-container">
|
||||
<div class="page-header">
|
||||
<h1>إدارة النظام والمستخدمين</h1>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px; padding: 15px; border: 1px solid #ddd; border-radius: 8px;">
|
||||
<h3>إضافة مستخدم جديد</h3>
|
||||
<form method="post" action="/auth/users/create" style="display: flex; gap: 10px; align-items: flex-end;">
|
||||
<div>
|
||||
<label for="username" style="display: block; margin-bottom: 5px;">اسم المستخدم</label>
|
||||
<input type="text" id="username" name="username" required style="padding: 8px;">
|
||||
{% if backup_msg %}
|
||||
<div class="success-banner">{{ backup_msg }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="admin-section">
|
||||
<h3>💾 نسخ احتياطي لقاعدة البيانات</h3>
|
||||
<p>قم بإنشاء نسخة احتياطية من قاعدة البيانات الحالية.</p>
|
||||
<a href="/auth/backup" class="btn btn-success">إنشاء نسخة احتياطية</a>
|
||||
</div>
|
||||
|
||||
<div class="admin-section">
|
||||
<h3>➕ إضافة مستخدم جديد</h3>
|
||||
<form method="post" action="/auth/users/create" class="add-user-form">
|
||||
<div class="form-group">
|
||||
<label for="username">اسم المستخدم</label>
|
||||
<input type="text" id="username" name="username" required>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password" style="display: block; margin-bottom: 5px;">كلمة المرور</label>
|
||||
<input type="password" id="password" name="password" required style="padding: 8px;">
|
||||
<div class="form-group">
|
||||
<label for="password">كلمة المرور</label>
|
||||
<input type="password" id="password" name="password" required>
|
||||
</div>
|
||||
<button type="submit" style="padding: 9px 15px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer;">إضافة</button>
|
||||
<button type="submit" class="btn btn-primary">إضافة</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div style="padding: 15px; border: 1px solid #ddd; border-radius: 8px;">
|
||||
<h3>المستخدمين</h3>
|
||||
<table style="width: 100%; border-collapse: collapse; margin-top: 10px;">
|
||||
<thead>
|
||||
<tr style="background-color: #f8f9fa;">
|
||||
<th style="padding: 10px; border-bottom: 2px solid #dee2e6; text-align: right;">الرقم</th>
|
||||
<th style="padding: 10px; border-bottom: 2px solid #dee2e6; text-align: right;">اسم المستخدم</th>
|
||||
<th style="padding: 10px; border-bottom: 2px solid #dee2e6; text-align: right;">تاريخ الإنشاء</th>
|
||||
<th style="padding: 10px; border-bottom: 2px solid #dee2e6; text-align: right;">إجراءات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td style="padding: 10px; border-bottom: 1px solid #dee2e6;">{{ user.id }}</td>
|
||||
<td style="padding: 10px; border-bottom: 1px solid #dee2e6;">{{ user.username }}</td>
|
||||
<td style="padding: 10px; border-bottom: 1px solid #dee2e6;">{{ user.created_at }}</td>
|
||||
<td style="padding: 10px; border-bottom: 1px solid #dee2e6;">
|
||||
<form method="post" action="/auth/users/delete/{{ user.id }}" onsubmit="return confirm('هل أنت متأكد من حذف هذا المستخدم؟');" style="display: inline;">
|
||||
<button type="submit" style="padding: 5px 10px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">حذف</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="admin-section">
|
||||
<h3>👥 المستخدمين</h3>
|
||||
<div class="table-wrapper">
|
||||
<table class="results-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>الرقم</th>
|
||||
<th>اسم المستخدم</th>
|
||||
<th>تاريخ الإنشاء</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.id }}</td>
|
||||
<td>{{ user.username }}</td>
|
||||
<td>{{ user.created_at }}</td>
|
||||
<td>
|
||||
<form method="post" action="/auth/users/delete/{{ user.id }}" onsubmit="return confirm('هل أنت متأكد من حذف هذا المستخدم؟');" style="display:inline;">
|
||||
<button type="submit" class="btn btn-sm btn-danger">حذف</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user