Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.

Commit

Permalink
added some repository and updated controller
Browse files Browse the repository at this point in the history
  • Loading branch information
indpurvesh committed Jun 5, 2018
1 parent e8bf47f commit 89ebf97
Show file tree
Hide file tree
Showing 18 changed files with 635 additions and 178 deletions.
3 changes: 2 additions & 1 deletion resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require('summernote');
require('pc-bootstrap4-datetimepicker');
require('chartjs');
require('jquery-sortable');

window.Vue = require('vue/dist/vue');
window.axios = require('axios');

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
Expand All @@ -34,3 +34,4 @@ if (token) {
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

119 changes: 57 additions & 62 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,82 +22,77 @@
?>
</script>
</head>
<body>
<div class="container-fluid">
<body >
<div id="login-page" class="container-fluid">
<div class="row justify-content-center align-items-center" style="height: 100vh;" >
<div class="col-8" style="max-width: 650px">
<div class="card">

<div class="card-header bg-primary text-white">
{{ __('avored-ecommerce::lang.admin-login-card-title') }}
</div>
<div class="card-body" >

<form method="post" action="{{ route('admin.login') }}" >
{{ csrf_field() }}

@include('avored-ecommerce::forms.text',
['name' => 'email',
'label' => __('avored-ecommerce::lang.admin-email-label')
])
@include('avored-ecommerce::forms.password',[
'name' => 'password',
'label' => __('avored-ecommerce::lang.admin-password-label')
])

<div class="form-group">

<button type="submit" class="btn btn-primary">
{{ __('avored-ecommerce::lang.admin-login-button-title') }}
</button>

<a href="{{ route('admin.password.reset') }}">
{{ __('avored-ecommerce::lang.admin-login-forget-password-link') }}
</a>
</div>

</form>
<div class="col-6">
<div class="offset-1 col-md-10">
<div class="card">

<div class="card-header bg-primary text-white">
{{ __('avored-ecommerce::lang.admin-login-card-title') }}
</div>
<div class="card-body" >

<form method="post" action="{{ route('admin.login') }}" >
@csrf


<div class="form-group">
<label for="email" class="control-label">
{{ __('avored-ecommerce::lang.admin-email-label') }}
</label>

<input id="email" name="email" type="email" v-model='email' class="form-control" />
</div>
<div class="form-group">
<label>Password</label>
<input name="password" type="password" v-model='password' class="form-control" />
</div>

<div class="form-group">

<button type="submit" :disabled='isLoginDisbled' class="btn btn-primary">
{{ __('avored-ecommerce::lang.admin-login-button-title') }}
</button>

<a href="{{ route('admin.password.reset') }}">
{{ __('avored-ecommerce::lang.admin-login-forget-password-link') }}
</a>
</div>

</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-6" style="border-left:1px solid;height:100vh;background-color:brown">

</div>
</div>
<!-- Scripts -->
<!-- JQuery -->
<script type="text/javascript" src="{{ asset('vendor/avored-admin/js/app.js') }}"></script>

<script>
$(function() {
var timeoutFlag;
function checkFields() {
clearTimeout(timeoutFlag);
var emailFieldValue = jQuery('#email').val();
var passwordFieldValue = jQuery('#password').val();
var app = new Vue({
el: '#login-page',
data : {
email: '',
password: ''
},
computed: {
isLoginDisbled: function() {
if(this.email != "" && this.password != "") {
return false;
}
var emailValidationRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return true;
if(emailFieldValue != "" && emailValidationRegex.test(emailFieldValue) && passwordFieldValue != "") {
jQuery('.login-button').attr('disabled', false);
jQuery('.login-button').addClass('btn-primary');
} else {
jQuery('.login-button').attr('disabled', true);
jQuery('.login-button').removeClass('btn-primary');
}
}
jQuery(document).on('keyup', '#email , #password', function(e){
checkFields();
});
jQuery(document).on('change', '#email, #password', function(e){
checkFields();
});
timeoutFlag = setTimeout(function(){ checkFields(); }, 100);
jQuery('.login-button').attr('disabled',true);
jQuery('#email').focus();
});
</script>

</body>
</html>
40 changes: 31 additions & 9 deletions resources/views/auth/passwords/email.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
</script>
</head>
<body>
<div class="container-fluid">
<div class="row justify-content-center align-items-center" style="height: 100vh;">
<div class="col-8" style="max-width: 650px">
<div id="reset-password-page" class="container-fluid">
<div class="row justify-content-center align-items-center" style="height: 100vh;" >
<div class="col-6">
<div class="offset-1 col-md-10">
<div class="card">
<div class="card-header">Reset Password</div>
<div class="card-body">
Expand All @@ -37,14 +38,12 @@
<div class="col-12">

<form class="form-horizontal" role="form" method="POST"
action="{{ url('/admin/password/email') }}">
{{ csrf_field() }}
action="{{ route('admin.password.reset.token') }}">
@csrf

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" >E-Mail Address</label>


<input id="email" type="email" class="form-control" name="email"
<input v-model="email" id="email" type="email" class="form-control" name="email"
value="{{ old('email') }}" required>

@if ($errors->has('email'))
Expand All @@ -57,7 +56,7 @@

<div class="form-group">

<button type="submit" class="btn btn-primary">
<button type="submit" :disabled="isLoginDisbled" class="btn btn-primary">
Send Password Reset Link
</button>

Expand All @@ -68,11 +67,34 @@
</div>
</div>
</div>
<div class="col-6" style="border-left:1px solid;height:100vh;background-color:brown">

</div>
</div>

</div>
<!-- Scripts -->
<!-- JQuery -->
<script type="text/javascript" src="{{ asset('vendor/avored-admin/js/app.js') }}"></script>
<script>
var app = new Vue({
el: '#reset-password-page',
data : {
email: ''
},
computed: {
isLoginDisbled: function() {
if(this.email != "") {
return false;
}
return true;
}
}
});
</script>

</body>
</html>
152 changes: 86 additions & 66 deletions resources/views/auth/passwords/reset.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,79 +22,99 @@
?>
</script>
</head>
<body>
<div class="container-fluid">
<div class="row justify-content-center align-items-center" style="height: 100vh;">
<div class="col-8" style="max-width: 650px">
<div class="card">
<div class="card-header">Reset Password</div>

<div class="card-body">
<div class="col-md-12">
<form class="form-horizontal" role="form" method="POST"
action="{{ url('/admin/password/reset') }}">
{{ csrf_field() }}

<input type="hidden" name="token" value="{{ $token }}">

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email">E-Mail Address</label>


<input id="email" type="email" class="form-control" name="email"
value="{{ $email or old('email') }}" required autofocus>

@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif

</div>

<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password">Password</label>


<input id="password" type="password" class="form-control" name="password" required>

@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif

</div>

<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm">Confirm Password</label>

<input id="password-confirm" type="password" class="form-control"
name="password_confirmation" required>

@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif

</div>

<div class="form-group">

<button type="submit" class="btn btn-primary">
Reset Password
</button>

</div>
</form>
<body >
<div id="admin-password-reset-page" class="container-fluid">
<div class="row justify-content-center align-items-center" style="height: 100vh;" >
<div class="col-6">
<div class="offset-1 col-10">
<div class="card">
<div class="card-header">Reset Password</div>

<div class="card-body">
<div class="col-md-12">
<form class="form-horizontal" role="form" method="POST"
action="{{ route('admin.password.email.post') }}">
@csrf

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email">E-Mail Address</label>
<input v-model="email" id="email" type="email" class="form-control" name="email"
value="{{ $email or old('email') }}" required autofocus>

@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif

</div>

<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password">Password</label>
<input v-model="password" id="password" type="password" class="form-control" name="password" required>

@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif

</div>

<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm">Confirm Password</label>
<input v-model="password_confirmation" id="password-confirm"
type="password" class="form-control"
name="password_confirmation" required>

@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif

</div>

<div class="form-group">
<button :disabled='isLoginDisbled' type="submit" class="btn btn-primary">
Reset Password
</button>

</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="col-6" style="border-left:1px solid;height:100vh;background-color:brown">

</div>
</div>
</div>
<script type="text/javascript" src="{{ asset('vendor/avored-admin/js/app.js') }}"></script>
<script>
var app = new Vue({
el: '#admin-password-reset-page',
data : {
email: '',
password: '',
password_confirmation: ''
},
computed: {
isLoginDisbled: function() {
if(this.email != "" && this.password != "" && this.password_confirmation != "" && this.password == this.password_confirmation) {
return false;
}
return true;
}
}
});
</script>

</body>

</html>
Loading

0 comments on commit 89ebf97

Please sign in to comment.