admin.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {% extends "base.html" %}
  2. {% block title %}Admin Panel - Dewy Oracle{% endblock %}
  3. {% block content %}
  4. <header>
  5. <h1>Admin Panel</h1>
  6. <p class="subtitle">Manage users and application settings</p>
  7. </header>
  8. <div id="message" class="message hidden"></div>
  9. <!-- Settings Section -->
  10. <section class="section">
  11. <h2>Application Settings</h2>
  12. <div class="settings-grid">
  13. <div class="setting-item">
  14. <label for="allow-registration">
  15. <input type="checkbox" id="allow-registration" onchange="toggleRegistration(this)">
  16. Allow user registration from login page
  17. </label>
  18. </div>
  19. </div>
  20. </section>
  21. <!-- User Management Section -->
  22. <section class="section">
  23. <h2>User Management</h2>
  24. <div class="section-actions">
  25. <button onclick="loadUsers()" class="btn btn-secondary">Refresh Users</button>
  26. </div>
  27. <div id="users-loading" class="loading">Loading users...</div>
  28. <div id="users-container" class="hidden">
  29. <table class="users-table">
  30. <thead>
  31. <tr>
  32. <th>Username</th>
  33. <th>Email</th>
  34. <th>Display Name</th>
  35. <th>Admin</th>
  36. <th>Active</th>
  37. <th>Created</th>
  38. <th>Last Login</th>
  39. <th>Actions</th>
  40. </tr>
  41. </thead>
  42. <tbody id="users-list">
  43. </tbody>
  44. </table>
  45. </div>
  46. </section>
  47. {% endblock %}
  48. {% block extra_scripts %}
  49. <script src="/static/js/admin.js"></script>
  50. <script>
  51. // Initialize admin panel on page load
  52. document.addEventListener('DOMContentLoaded', () => {
  53. loadSettings();
  54. loadUsers();
  55. });
  56. </script>
  57. {% endblock %}