reset.blade.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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">Use this form to reset your password.</p>
  17. </div>
  18. @if ($errors)
  19. @foreach($errors as $error)
  20. <span class="invalid-feedback">
  21. <strong>{{ $error }}</strong>
  22. </span>
  23. @endforeach
  24. @endif
  25. <div class="card bg-glass">
  26. <div class="card-header bg-transparent p-3 text-center font-weight-bold" style="border-bottom:1px solid #ffffff20">{{ __('Reset Password') }}</div>
  27. <div class="card-body">
  28. <form id="passwordReset" method="POST" action="{{ route('password.request') }}">
  29. @csrf
  30. <input type="hidden" name="token" value="{{ $token }}">
  31. <input type="hidden" name="email" value="{{ $email ?? old('email') }}">
  32. <div class="form-group row">
  33. <div class="col-md-12">
  34. <label class="font-weight-bold small text-muted">Email</label>
  35. <input
  36. id="email"
  37. type="email"
  38. class="form-control {{ $errors->has('email') ? ' is-invalid' : '' }}"
  39. name="email"
  40. value="{{ $email ?? old('email') }}"
  41. placeholder="{{ __('E-Mail Address') }}"
  42. required
  43. disabled
  44. style="opacity: 20%;">
  45. @if ($errors->has('email'))
  46. <span class="invalid-feedback">
  47. <strong>{{ $errors->first('email') }}</strong>
  48. </span>
  49. @endif
  50. </div>
  51. </div>
  52. <hr class="bg-muted">
  53. <div class="form-group row">
  54. <div class="col-md-12">
  55. <label class="font-weight-bold small text-muted">New Password</label>
  56. <input
  57. id="password"
  58. type="password"
  59. class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}"
  60. name="password"
  61. placeholder="{{ __('Password') }}"
  62. minlength="{{config('pixelfed.min_password_length')}}"
  63. maxlength="72"
  64. autocomplete="new-password"
  65. autofocus
  66. required>
  67. @if ($errors->has('password'))
  68. <span class="invalid-feedback">
  69. <strong>{{ $errors->first('password') }}</strong>
  70. </span>
  71. @else
  72. <p class="help-text small text-muted mb-0 mt-1">Enter a new password between {{config('pixelfed.min_password_length')}}-72 characters long.</p>
  73. @endif
  74. </div>
  75. </div>
  76. <div class="form-group row">
  77. <div class="col-md-12">
  78. <label class="font-weight-bold small text-muted">Confirm New Password</label>
  79. <input
  80. id="password-confirm"
  81. type="password"
  82. class="form-control{{ $errors->has('password_confirmation') ? ' is-invalid' : '' }}"
  83. name="password_confirmation"
  84. placeholder="{{ __('Confirm Password') }}"
  85. minlength="{{config('pixelfed.min_password_length')}}"
  86. autocomplete="new-password"
  87. maxlength="72"
  88. required>
  89. @if ($errors->has('password_confirmation'))
  90. <span class="invalid-feedback">
  91. <strong>{{ $errors->first('password_confirmation') }}</strong>
  92. </span>
  93. @endif
  94. </div>
  95. </div>
  96. @if(config('captcha.enabled'))
  97. <label class="font-weight-bold small pt-3 text-muted">Captcha</label>
  98. <div class="d-flex flex-grow-1">
  99. {!! Captcha::display(['data-theme' => 'dark']) !!}
  100. </div>
  101. @if ($errors->has('h-captcha-response'))
  102. <div class="text-danger small mb-3">
  103. <strong>{{ $errors->first('h-captcha-response') }}</strong>
  104. </div>
  105. @endif
  106. @endif
  107. <div class="form-group row pt-4 mb-0">
  108. <div class="col-md-12">
  109. <button
  110. type="button"
  111. id="sbtn"
  112. class="btn btn-success btn-block rounded-pill font-weight-bold"
  113. onclick="event.preventDefault();handleSubmit()">
  114. {{ __('Reset Password') }}
  115. </button>
  116. </div>
  117. </div>
  118. </form>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. @endsection
  126. @push('scripts')
  127. <script type="text/javascript">
  128. function handleSubmit() {
  129. let btn = document.getElementById('sbtn');
  130. btn.classList.add('disabled');
  131. btn.setAttribute('disabled', 'disabled');
  132. btn.innerHTML = '<div class="spinner-border spinner-border-sm" role="status"><span class="sr-only">Loading...</span></div>';
  133. document.getElementById('passwordReset').submit()
  134. }
  135. </script>
  136. @endpush