login.html 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!DOCTYPE html>
  2. <html lang="{{ get_locale() }}">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="csrf-token" content="{{ csrf_token() }}">
  7. <meta name="description" content="{{ _('Portal cautivo de acceso a la red.') }}">
  8. <title>{{ settings.portal_title }}</title>
  9. <link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon"/>
  10. <script src="{{ url_for('static', filename='src/tailwind.min.js') }}"></script>
  11. <link rel="stylesheet" href="{{ url_for('static', filename='all.min.css') }}">
  12. <style>
  13. .login-bg {
  14. background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #1e40af 100%);
  15. }
  16. .glass-card {
  17. background: rgba(255, 255, 255, 0.95);
  18. backdrop-filter: blur(10px);
  19. }
  20. </style>
  21. </head>
  22. <body class="login-bg min-h-screen flex items-center justify-center p-4">
  23. <div class="glass-card rounded-2xl shadow-2xl w-full max-w-md p-8 relative z-10">
  24. <div class="text-center mb-8">
  25. <div class="inline-flex items-center justify-center w-20 h-20 mb-4">
  26. <img src="{{ url_for('static', filename='squidstats-128.webp') }}" alt="{{ _("SquidStats") }}" width="80" height="80" class="w-full h-full object-contain drop-shadow-lg">
  27. </div>
  28. <h1 class="text-2xl font-bold text-gray-800">{{ settings.portal_title }}</h1>
  29. <p class="text-gray-500 mt-1">{{ _("Inicia sesión para acceder a Internet") }}</p>
  30. </div>
  31. {% if error %}
  32. <div class="bg-red-50 border-l-4 border-red-500 p-4 mb-6 rounded-r-lg">
  33. <div class="flex items-center">
  34. <i class="fas fa-exclamation-circle text-red-500 mr-3"></i>
  35. <p class="text-red-700 text-sm">{{ error }}</p>
  36. </div>
  37. </div>
  38. {% endif %}
  39. {% with messages = get_flashed_messages(with_categories=true) %}
  40. {% if messages %}
  41. {% for category, message in messages %}
  42. <div class="{% if category == 'success' %}bg-green-50 border-l-4 border-green-500{% else %}bg-red-50 border-l-4 border-red-500{% endif %} p-4 mb-6 rounded-r-lg">
  43. <p class="{% if category == 'success' %}text-green-700{% else %}text-red-700{% endif %} text-sm">{{ message }}</p>
  44. </div>
  45. {% endfor %}
  46. {% endif %}
  47. {% endwith %}
  48. <form method="POST" action="{{ url_for('captive_portal.login') }}" class="space-y-6">
  49. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
  50. <div>
  51. <label for="username" class="block text-sm font-medium text-gray-700 mb-2">
  52. <i class="fas fa-user mr-2 text-gray-400"></i>{{ _("Usuario") }}
  53. </label>
  54. <input type="text" id="username" name="username" required autocomplete="username"
  55. class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
  56. placeholder="{{ _("Ingresa tu usuario") }}">
  57. </div>
  58. <div>
  59. <label for="password" class="block text-sm font-medium text-gray-700 mb-2">
  60. <i class="fas fa-lock mr-2 text-gray-400"></i>{{ _("Contraseña") }}
  61. </label>
  62. <input type="password" id="password" name="password" required autocomplete="current-password"
  63. class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
  64. placeholder="{{ _("Ingresa tu contraseña") }}">
  65. </div>
  66. <button type="submit"
  67. class="w-full py-3 px-4 text-white font-semibold rounded-lg shadow-lg bg-blue-600 hover:bg-blue-700 transition-colors duration-200 flex items-center justify-center">
  68. <i class="fas fa-sign-in-alt mr-2"></i>{{ _("Conectarme a Internet") }}
  69. </button>
  70. </form>
  71. </div>
  72. </body>
  73. </html>