email.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. @extends('layouts.blank')
  2. @push('styles')
  3. <link href="{{ mix('css/landing.css') }}" rel="stylesheet">
  4. <link rel="preload" as="image" href="{{ url('/_landing/bg.jpg')}}" />
  5. @endpush
  6. @section('content')
  7. <div class="page-wrapper">
  8. <div class="container mt-4">
  9. <div class="row justify-content-center">
  10. <div class="col-lg-5">
  11. <div class="text-center">
  12. <a href="/">
  13. <img src="/img/pixelfed-icon-white.svg" height="60px">
  14. </a>
  15. <h1 class="pt-4 pb-1">Reset Password</h1>
  16. <p class="font-weight-light pb-2">Send a password reset mail to reset your password</p>
  17. </div>
  18. @if(session('status') || $errors->has('email'))
  19. <div class="alert alert-info small">
  20. <div class="d-flex align-items-center font-weight-bold" style="gap:0.5rem;">
  21. <i class="far fa-exclamation-triangle fa-lg" style="opacity:20%"></i>
  22. {{ session('status') ?? $errors->first('email') }}
  23. </div>
  24. </div>
  25. @endif
  26. <div class="card bg-glass">
  27. <div class="card-header bg-transparent p-3 text-center font-weight-bold" style="border-bottom:1px solid #ffffff20">{{ __('Reset Password') }}</div>
  28. <div class="card-body">
  29. <form id="passwordReset" method="POST" action="{{ route('password.email') }}">
  30. @csrf
  31. <div class="form-group row">
  32. <div class="col-md-12">
  33. <label class="font-weight-bold small text-muted">Email</label>
  34. <input id="email" type="email" class="form-control" name="email" placeholder="{{ __('E-Mail Address') }}" required>
  35. @if ($errors->has('email') && $errors->first('email') === 'The email must be a valid email address.')
  36. <span class="text-danger small mb-3">
  37. <strong>{{ $errors->first('email') }}</strong>
  38. </span>
  39. @endif
  40. </div>
  41. </div>
  42. @if(config('captcha.enabled'))
  43. <label class="font-weight-bold small text-muted">Captcha</label>
  44. <div class="d-flex flex-grow-1">
  45. {!! Captcha::display(['data-theme' => 'dark']) !!}
  46. </div>
  47. @if ($errors->has('h-captcha-response'))
  48. <div class="text-danger small mb-3">
  49. <strong>{{ $errors->first('h-captcha-response') }}</strong>
  50. </div>
  51. @endif
  52. @endif
  53. <div class="form-group row pt-4 mb-0">
  54. <div class="col-md-12">
  55. <button type="button" id="sbtn" class="btn btn-primary btn-block rounded-pill font-weight-bold" onclick="event.preventDefault();handleSubmit()">
  56. {{ __('Send Password Reset Link') }}
  57. </button>
  58. </div>
  59. </div>
  60. </form>
  61. </div>
  62. </div>
  63. <div class="mt-3 d-flex justify-content-between align-items-center">
  64. <a class="btn btn-link text-white font-weight-bold text-decoration-none" href="{{ route('login') }}">
  65. <i class="far fa-long-arrow-left fa-lg mr-1"></i> {{ __('Back to Login') }}
  66. </a>
  67. <a href="#" class="text-white font-weight-bold text-decoration-none" onclick="event.preventDefault();forgotUsername()">Forgot email?</a>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. @endsection
  74. @push('scripts')
  75. <script type="text/javascript">
  76. function forgotUsername() {
  77. swal({
  78. title: 'Forgot email?',
  79. text: 'Contact the instance admins to assist you in recovering your account.',
  80. icon: 'info',
  81. buttons: {
  82. contact: {
  83. text: "Contact Admins",
  84. value: "contact",
  85. className: "bg-danger"
  86. },
  87. cancel: "Close",
  88. },
  89. })
  90. .then((value) => {
  91. switch(value) {
  92. case 'contact':
  93. window.location.href = '/site/contact';
  94. break;
  95. }
  96. });
  97. }
  98. function handleSubmit() {
  99. let email = document.getElementById('email');
  100. email.classList.add('disabled');
  101. let btn = document.getElementById('sbtn');
  102. btn.classList.add('disabled');
  103. btn.setAttribute('disabled', 'disabled');
  104. btn.innerHTML = '<div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">Loading...</span></div>';
  105. document.getElementById('passwordReset').submit()
  106. }
  107. </script>
  108. @endpush