remove ReCaptcha from views if it is disabled

This commit is contained in:
Jakob Schrettenbrunner 2017-03-31 12:26:57 +02:00
parent 207e0131fc
commit a51cf1ff47
2 changed files with 18 additions and 14 deletions

View File

@ -62,7 +62,7 @@
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
{!! csrf_field() !!} {!! csrf_field() !!}
<button type="submit" class="btn btn-primary btn-block btn-flat g-recaptcha" data-sitekey="{{ config('recaptcha.website_key') }}" data-callback='onSubmit'>@lang('auth.sign_in')</button> <button type="submit" class="btn btn-primary btn-block btn-flat g-recaptcha" @if(config('recaptcha.enabled')) data-sitekey="{{ config('recaptcha.website_key') }}" data-callback='onSubmit' @endif>@lang('auth.sign_in')</button>
</div> </div>
</div> </div>
</form> </form>
@ -72,10 +72,12 @@
@section('scripts') @section('scripts')
@parent @parent
@if(config('recaptcha.enabled'))
<script src="https://www.google.com/recaptcha/api.js" async defer></script> <script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script> <script>
function onSubmit(token) { function onSubmit(token) {
document.getElementById("loginForm").submit(); document.getElementById("loginForm").submit();
} }
</script> </script>
@endif
@endsection @endsection

View File

@ -58,7 +58,7 @@
</div> </div>
<div class="col-xs-8"> <div class="col-xs-8">
{!! csrf_field() !!} {!! csrf_field() !!}
<button type="submit" class="btn btn-primary btn-block btn-flat g-recaptcha" data-sitekey="{{ config('recaptcha.website_key') }}" data-callback='onSubmit'>@lang('auth.request_reset')</button> <button type="submit" class="btn btn-primary btn-block btn-flat g-recaptcha" @if(config('recaptcha.enabled')) data-sitekey="{{ config('recaptcha.website_key') }}" data-callback='onSubmit' @endif>@lang('auth.request_reset')</button>
</div> </div>
</div> </div>
</form> </form>
@ -67,10 +67,12 @@
@section('scripts') @section('scripts')
@parent @parent
@if(config('recaptcha.enabled'))
<script src="https://www.google.com/recaptcha/api.js" async defer></script> <script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script> <script>
function onSubmit(token) { function onSubmit(token) {
document.getElementById("resetForm").submit(); document.getElementById("resetForm").submit();
} }
</script> </script>
@endif
@endsection @endsection