Ei kuvausta

permissions_group_users.html 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {% extends "admin_frontend/base.html" %}
  2. {% load breadcrumbs %}
  3. {% block title %}{{ group.name|title }} Users{% endblock %}
  4. {% block content %}
  5. {% render_breadcrumbs breadcrumbs %}
  6. <div class="flex items-center justify-between mb-4">
  7. <h1 class="text-2xl font-semibold">Users in {{ group.name|title }}</h1>
  8. <a href="{% url 'orgs_admin:permissions_overview' %}" class="btn-outline">Back</a>
  9. </div>
  10. <div class="bg-white rounded shadow p-4 mb-4">
  11. <form method="get" class="flex flex-wrap items-end gap-3">
  12. <div>
  13. <label class="block text-xs text-gray-600 mb-1">Search</label>
  14. <input type="text" name="q" value="{{ q }}" placeholder="Username or email" class="border rounded px-3 py-2">
  15. </div>
  16. <div>
  17. <label class="block text-xs text-gray-600 mb-1">Role</label>
  18. <select name="role" class="border rounded px-3 py-2">
  19. <option value="">All</option>
  20. {% for val,label in role_choices %}
  21. <option value="{{ val }}" {% if role == val %}selected{% endif %}>{{ label }}</option>
  22. {% endfor %}
  23. </select>
  24. </div>
  25. <div>
  26. <button class="px-3 py-2 bg-blue-600 text-white rounded">Filter</button>
  27. <a href="{% url 'orgs_admin:permissions_group_users' group.id %}" class="btn-outline">Reset</a>
  28. </div>
  29. </form>
  30. {% if page_obj %}
  31. <p class="text-sm text-gray-500 mt-2">Showing {{ page_obj.object_list|length }} of {{ page_obj.paginator.count }} users</p>
  32. {% endif %}
  33. </div>
  34. <div class="bg-white rounded shadow overflow-hidden">
  35. <table class="min-w-full divide-y divide-gray-200">
  36. <thead class="bg-gray-50">
  37. <tr>
  38. <th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Username</th>
  39. <th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Email</th>
  40. <th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Organization</th>
  41. <th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Role</th>
  42. <th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Actions</th>
  43. </tr>
  44. </thead>
  45. <tbody class="divide-y divide-gray-200">
  46. {% for u in users %}
  47. <tr>
  48. <td class="px-4 py-2">{{ u.username }}</td>
  49. <td class="px-4 py-2 text-gray-600">{{ u.email|default:"-" }}</td>
  50. <td class="px-4 py-2 text-gray-600">{{ u.recycle_profile.organization.name|default:"-" }}</td>
  51. <td class="px-4 py-2 text-gray-600">{{ u.recycle_profile.role|title|default:"-" }}</td>
  52. <td class="px-4 py-2">
  53. <a href="{% url 'recycle_core:org_user_edit' u.id %}" class="btn-outline btn-xs">Edit</a>
  54. </td>
  55. </tr>
  56. {% empty %}
  57. <tr><td colspan="5" class="px-4 py-4 text-center text-gray-500">No users in this group.</td></tr>
  58. {% endfor %}
  59. </tbody>
  60. </table>
  61. </div>
  62. {% include 'admin_frontend/_pagination.html' %}
  63. {% endblock %}