first commit
This commit is contained in:
104
templates/users/login-form.php
Normal file
104
templates/users/login-form.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<div class="container">
|
||||
<div class="box box-login">
|
||||
<div class="title"><span>crmPRO</span> | logowanie</div>
|
||||
<div class="alert login"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form method="POST" class="login-form">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-user-circle-o"></i>
|
||||
</span>
|
||||
<div class="form-line">
|
||||
<input type="text" class="form-control" name="email" id="email" placeholder="Email" autofocus="" >
|
||||
<p class="form-error hide">Uzupełnij adres email.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
||||
<div class="form-line">
|
||||
<input type="password" class="form-control" id="password" name="password" placeholder="Hasło" >
|
||||
<p class="form-error hide">Uzupełnij hasło.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="form-line checkbox">
|
||||
<input type="checkbox" id="remeber" name="remeber">Zapamiętaj mnie
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn login">Zaloguj się</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<link rel="stylesheet" type="text/css" href="/layout/style/login-form.css" />
|
||||
<script type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( 'keypress', '.login-form input', function(e)
|
||||
{
|
||||
if ( e.which === 13 )
|
||||
submit_login_form();
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'click', '.login-form .btn.login', function()
|
||||
{
|
||||
submit_login_form();
|
||||
});
|
||||
|
||||
function submit_login_form()
|
||||
{
|
||||
var email = $( '#email' ).val();
|
||||
if ( $.trim( email ) === '' )
|
||||
{
|
||||
$( '#email' ).parents( '.form-line' ).children( 'p' ).removeClass( 'hide' );
|
||||
$( '#email' ).focus();
|
||||
return false;
|
||||
} else
|
||||
$( '#email' ).parents( '.form-line' ).children( 'p' ).addClass( 'hide' );
|
||||
|
||||
var password = $( '#password' ).val();
|
||||
if ( $.trim( password ) === '' )
|
||||
{
|
||||
$( '#password' ).parents( '.form-line' ).children( 'p' ).removeClass( 'hide' );
|
||||
$( '#password' ).focus();
|
||||
return false;
|
||||
} else
|
||||
$( '#password' ).parents( '.form-line' ).children( 'p' ).addClass( 'hide' );
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/users/login/',
|
||||
data:
|
||||
{
|
||||
email: email,
|
||||
password: password,
|
||||
remember: $( '#remeber' ).is( ':checked' )
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
$( '.login-form .btn.login' ).html( '<i class="fa fa-spinner spin"></i>' ).addClass( 'disabled' );
|
||||
},
|
||||
success: function( response )
|
||||
{
|
||||
$( '.login-form .btn.login' ).html( 'Zaloguj się' ).removeClass( 'disabled' );
|
||||
|
||||
data = jQuery.parseJSON( response );
|
||||
$( '.alert' ).html( data.msg );
|
||||
|
||||
if ( data.result === 'false' )
|
||||
$( '.alert' ).removeClass( 'alert-success' ).addClass( 'alert-danger' ).show();
|
||||
else
|
||||
{
|
||||
$( '.alert' ).removeClass( 'alert-danger' ).addClass( 'alert-success' ).show();
|
||||
document.location.href = '/projects/tasks/project_id=' + ( data.default_project != null ? data.default_project : 'all' );
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
84
templates/users/settings.php
Normal file
84
templates/users/settings.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="g-container">
|
||||
<div class="block-header">
|
||||
<h2>pushover <strong>API</strong></h2>
|
||||
<small class="text-muted">uzupełnił dane potrzebne do wysyłania powiadomień PUSH</small>
|
||||
</div>
|
||||
<div id="g-form-container">
|
||||
<form method="POST" id="pushover-settings" class="g-form form-horizontal" action="/users/settings_save/">
|
||||
<?= \Html::input( [
|
||||
'label' => 'Pushover API',
|
||||
'name' => 'pushover_api',
|
||||
'value' => $this -> user['pushover_api'],
|
||||
'inline' => false
|
||||
]
|
||||
);?>
|
||||
<?= \Html::input( [
|
||||
'label' => 'Pushover User',
|
||||
'name' => 'pushover_user',
|
||||
'value' => $this -> user['pushover_user'],
|
||||
'inline' => false
|
||||
]
|
||||
);?>
|
||||
<?= \Html::button( [
|
||||
'class' => 'btn-success',
|
||||
'text' => 'Zapisz ustawienia',
|
||||
'icon' => 'fa-check',
|
||||
'js' => '$( "#pushover-settings" ).submit();'
|
||||
]
|
||||
);?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="g-container">
|
||||
<div class="block-header">
|
||||
<h2>zmiana <strong>hasła</strong></h2>
|
||||
<small class="text-muted">zmień swoje stare hasło na nowe</small>
|
||||
</div>
|
||||
<div id="g-form-container">
|
||||
<form method="POST" id="password-settings" class="g-form form-horizontal" action="/users/password_change/">
|
||||
<?= \Html::input_icon( [
|
||||
'label' => 'Stare hasło',
|
||||
'name' => 'password_old',
|
||||
'type' => 'password',
|
||||
'inline' => false,
|
||||
'required' => true,
|
||||
'icon_content' => '<i class="fa fa-eye"></i>',
|
||||
'icon_js' => 'password_toggle( $( this ).children( "i" ), "password_old" ); return false;'
|
||||
]
|
||||
);?>
|
||||
<?= \Html::input_icon( [
|
||||
'label' => 'Nowe hasło',
|
||||
'name' => 'password_new',
|
||||
'type' => 'password',
|
||||
'inline' => false,
|
||||
'required' => true,
|
||||
'icon_content' => '<i class="fa fa-eye"></i>',
|
||||
'icon_js' => 'password_toggle( $( this ).children( "i" ), "password_new" ); return false;'
|
||||
]
|
||||
);?>
|
||||
<?= \Html::button( [
|
||||
'class' => 'btn-success',
|
||||
'type' => 'submit',
|
||||
'text' => 'Zmień hasło',
|
||||
'icon' => 'fa-check'
|
||||
]
|
||||
);?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function password_toggle( input, id )
|
||||
{
|
||||
$( input ).toggleClass( 'fa-eye' ).toggleClass( 'fa-eye-slash' );
|
||||
if ( $( '#' + id ).attr( 'type' ) === 'password' )
|
||||
$( '#' + id ).attr( 'type', 'text' );
|
||||
else
|
||||
$( '#' + id ).attr( 'type', 'password' );
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user