Changed modal IDs so manager creation modal works on user creation main page

This commit is contained in:
snipe 2020-08-04 20:59:54 -07:00
parent 24c43056ba
commit df17a859bf
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC

View file

@ -1,29 +1,34 @@
{{-- See snipeit_modals.js for what powers this --}}
<script src="/js/pGenerator.jquery.js"></script>
<script nonce="{{ csrf_token() }}">
$(document).ready(function () {
console.log('Fart');
$('#genPassword').pGenerator({
window.setTimeout(function () {
console.log('Dom is ready');
$('#modal-genPassword').pGenerator({
'bind': 'click',
'passwordElement': '#modal-password',
'displayElement': '#generated-password',
'displayElement': '#modal-generated-password',
'passwordLength': 16,
'uppercase': true,
'lowercase': true,
'numbers': true,
'specialChars': true,
'onPasswordGenerated': function (generatedPassword) {
console.log('WTF?');
$('#modal-password_confirmation').val($('#modal-password').val());
}
});
});
}, 1000);
</script>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h2 class="modal-title">{{ trans('admin/users/table.createuser') }}</h4>
<h2 class="modal-title">{{ trans('admin/users/table.createuser') }}</h2>
</div>
<div class="modal-body">
<form action="{{ route('api.users.store') }}" onsubmit="return false">
@ -47,14 +52,14 @@
<div class="dynamic-form-row">
<div class="col-md-4 col-xs-12"><label for="modal-password">{{ trans('admin/users/table.password') }}:</label></div>
<div class="col-md-8 col-xs-12 required"><input type='password' name="password" id='modal-password' class="form-control">
<a href="#" class="left" id="genPassword">Generate</a>
<a href="#" class="left" id="modal-genPassword">Generate</a>
</div>
</div>
<div class="dynamic-form-row">
<div class="col-md-4 col-xs-12"><label for="modal-password_confirmation">{{ trans('admin/users/table.password_confirm') }}:</label></div>
<div class="col-md-8 col-xs-12 required"><input type='password' name="password_confirmation" id='modal-password_confirmation' class="form-control">
<div id="generated-password"></div>
<div id="modal-generated-password"></div>
</div>
</div>
</form>