More checkbox tweaks
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
0d050e4016
commit
b4df9eb586
1 changed files with 27 additions and 10 deletions
|
@ -104,6 +104,7 @@
|
||||||
<!-- Username -->
|
<!-- Username -->
|
||||||
<div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}">
|
<div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}">
|
||||||
<label class="col-md-3 control-label" for="username">{{ trans('admin/users/table.username') }}</label>
|
<label class="col-md-3 control-label" for="username">{{ trans('admin/users/table.username') }}</label>
|
||||||
|
|
||||||
<div class="col-md-6{{ (Helper::checkIfRequired($user, 'username')) ? ' required' : '' }}">
|
<div class="col-md-6{{ (Helper::checkIfRequired($user, 'username')) ? ' required' : '' }}">
|
||||||
@if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone'))
|
@if ($user->ldap_import!='1' || str_contains(Route::currentRouteName(), 'clone'))
|
||||||
<input
|
<input
|
||||||
|
@ -118,17 +119,28 @@
|
||||||
onfocus="this.removeAttribute('readonly');"
|
onfocus="this.removeAttribute('readonly');"
|
||||||
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}
|
{{ ((config('app.lock_passwords') && ($user->id)) ? ' disabled' : '') }}
|
||||||
>
|
>
|
||||||
@if (config('app.lock_passwords') && ($user->id))
|
|
||||||
<p class="help-block">{{ trans('admin/users/table.lock_passwords') }}</p>
|
|
||||||
@endif
|
|
||||||
@else
|
|
||||||
{{ trans('general.managed_ldap') }}
|
|
||||||
<input type="hidden" name="username" value="{{ Request::old('username', $user->username) }}">
|
|
||||||
|
|
||||||
|
@else
|
||||||
|
<!-- insert the old username so we don't break validation -->
|
||||||
|
{{ trans('general.managed_ldap') }}
|
||||||
|
<input type="hidden" name="username" value="{{ Request::old('username', $user->username) }}">
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@if (config('app.lock_passwords') && ($user->id))
|
||||||
|
<!-- disallow changing existing usernames on the demo -->
|
||||||
|
<div class="col-md-8 col-md-offset-3">
|
||||||
|
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($errors->first('username'))
|
||||||
|
<div class="col-md-8 col-md-offset-3">
|
||||||
|
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Password -->
|
<!-- Password -->
|
||||||
|
@ -191,14 +203,15 @@
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<!-- Activation Status -->
|
<!-- Activation Status (Can the user login?) -->
|
||||||
<div class="form-group {{ $errors->has('activated') ? 'has-error' : '' }}">
|
<div class="form-group {{ $errors->has('activated') ? 'has-error' : '' }}">
|
||||||
<div class="col-md-9 col-md-offset-3">
|
<div class="col-md-9 col-md-offset-3">
|
||||||
|
|
||||||
|
<!-- checkbox($name, $value = 1, $checked = null, $options = array() -->
|
||||||
@if (config('app.lock_passwords'))
|
@if (config('app.lock_passwords'))
|
||||||
<!-- demo mode - disallow changes -->
|
<!-- demo mode - disallow changes -->
|
||||||
<label class="form-control form-control--disabled">
|
<label class="form-control form-control--disabled">
|
||||||
{{ Form::checkbox('activated', '1', old('activated'), ['disabled' => true, 'checked'=> 'checked', 'aria-label'=>'update_real_loc']) }}
|
<input type="checkbox" value="1" name="activated" class="disabled" {{ (old('activated', $user->activated)) == '1' ? ' checked="checked"' : '' }} disabled="disabled" aria-label="activated">
|
||||||
{{ trans('admin/users/general.activated_help_text') }}
|
{{ trans('admin/users/general.activated_help_text') }}
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
@ -207,6 +220,7 @@
|
||||||
@elseif ($user->id === Auth::user()->id)
|
@elseif ($user->id === Auth::user()->id)
|
||||||
<!-- disallow the user from editing their own login status -->
|
<!-- disallow the user from editing their own login status -->
|
||||||
<label class="form-control form-control--disabled">
|
<label class="form-control form-control--disabled">
|
||||||
|
<input type="checkbox" value="1" name="activated" class="disabled" {{ (old('activated', $user->activated)) == '1' ? ' checked="checked"' : '' }} disabled="disabled">
|
||||||
{{ Form::checkbox('activated', '1', old('activated'), ['disabled' => true, 'checked'=> 'checked', 'aria-label'=>'update_real_loc']) }}
|
{{ Form::checkbox('activated', '1', old('activated'), ['disabled' => true, 'checked'=> 'checked', 'aria-label'=>'update_real_loc']) }}
|
||||||
{{ trans('admin/users/general.activated_help_text') }}
|
{{ trans('admin/users/general.activated_help_text') }}
|
||||||
</label>
|
</label>
|
||||||
|
@ -602,6 +616,7 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('#email_user_checkbox').prop("disabled", true);
|
$('#email_user_checkbox').prop("disabled", true);
|
||||||
|
|
||||||
$('#activated').on('ifChecked', function(event){
|
$('#activated').on('ifChecked', function(event){
|
||||||
console.log('user activated is checked');
|
console.log('user activated is checked');
|
||||||
$("#email_user_row").show();
|
$("#email_user_row").show();
|
||||||
|
@ -614,12 +629,14 @@ $(document).ready(function() {
|
||||||
$('#email').on('keyup',function(){
|
$('#email').on('keyup',function(){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
@if (!config('app.lock_passwords'))
|
||||||
if(this.value.length > 5){
|
if(this.value.length > 5){
|
||||||
$('#email_user_checkbox').prop("disabled", false);
|
$('#email_user_checkbox').prop("disabled", false);
|
||||||
$("#email_user_checkbox").parent().removeClass("form-control--disabled");
|
$("#email_user_checkbox").parent().removeClass("form-control--disabled");
|
||||||
} else {
|
} else {
|
||||||
$('#email_user_checkbox').prop("disabled", true);
|
$('#email_user_checkbox').prop("disabled", true);
|
||||||
}
|
}
|
||||||
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue