akaunting 3.0 (the last dance)
This commit is contained in:
@ -9,24 +9,44 @@ require('./../../bootstrap');
|
||||
import Vue from 'vue';
|
||||
|
||||
import Form from './../../plugins/form';
|
||||
import Swiper, { Navigation, Pagination, Autoplay } from 'swiper';
|
||||
|
||||
const app = new Vue({
|
||||
const login = new Vue({
|
||||
el: '#app',
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('reset')
|
||||
form: new Form('auth'),
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
Swiper.use([Navigation, Pagination, Autoplay]);
|
||||
|
||||
new Swiper(".swiper-container", {
|
||||
loop: true,
|
||||
speed: 1000,
|
||||
allowTouchMove: true,
|
||||
autoplay: {
|
||||
delay: 3000,
|
||||
},
|
||||
pagination: {
|
||||
el: ".swiper-pagination",
|
||||
clickable: true,
|
||||
},
|
||||
});
|
||||
|
||||
this.checkNotify();
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSubmit() {
|
||||
this.form.submit();
|
||||
},
|
||||
|
||||
// Check Default set notify > store / update action
|
||||
checkNotify: function () {
|
||||
if (!flash_notification) {
|
||||
if (! flash_notification) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -36,15 +56,10 @@ const app = new Vue({
|
||||
this.$notify({
|
||||
message: notify.message,
|
||||
timeout: 5000,
|
||||
icon: 'fas fa-bell',
|
||||
icon: '',
|
||||
type
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// Form Submit
|
||||
onSubmit() {
|
||||
this.form.submit();
|
||||
},
|
||||
}
|
||||
});
|
27
resources/assets/js/views/auth/forgot.js
vendored
27
resources/assets/js/views/auth/forgot.js
vendored
@ -1,27 +0,0 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./../../bootstrap');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
import Form from './../../plugins/form';
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('forgot')
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSubmit() {
|
||||
this.form.submit();
|
||||
},
|
||||
}
|
||||
});
|
27
resources/assets/js/views/auth/login.js
vendored
27
resources/assets/js/views/auth/login.js
vendored
@ -1,27 +0,0 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./../../bootstrap');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
import Form from './../../plugins/form';
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('login')
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSubmit() {
|
||||
this.form.submit();
|
||||
},
|
||||
}
|
||||
});
|
34
resources/assets/js/views/auth/permissions.js
vendored
34
resources/assets/js/views/auth/permissions.js
vendored
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./../../bootstrap');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||
|
||||
import Global from './../../mixins/global';
|
||||
|
||||
import Form from './../../plugins/form';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
|
||||
mixins: [
|
||||
Global
|
||||
],
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('permission'),
|
||||
bulk_action: new BulkAction('permissions')
|
||||
}
|
||||
}
|
||||
});
|
107
resources/assets/js/views/auth/roles.js
vendored
107
resources/assets/js/views/auth/roles.js
vendored
@ -1,107 +0,0 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./../../bootstrap');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||
|
||||
import Global from './../../mixins/global';
|
||||
|
||||
import Form from './../../plugins/form';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
|
||||
mixins: [
|
||||
Global
|
||||
],
|
||||
|
||||
mounted() {
|
||||
if (typeof this.form.permissions !== 'undefined' && !this.form.permissions.length) {
|
||||
this.form.permissions = [];
|
||||
}
|
||||
},
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('role'),
|
||||
bulk_action: new BulkAction('roles'),
|
||||
permissions: {
|
||||
'all': $('input:checkbox').serializeAll().permissions,
|
||||
'read': $('#tab-read input:checkbox').serializeAll(),
|
||||
'create': $('#tab-create input:checkbox').serializeAll(),
|
||||
'update': $('#tab-update input:checkbox').serializeAll(),
|
||||
'delete': $('#tab-delete input:checkbox').serializeAll(),
|
||||
'read_admin_panel': $('#read-admin-panel').val(),
|
||||
'read_client_portal': $('#read-client-portal').val(),
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods:{
|
||||
permissionSelectAll() {
|
||||
if (this.permissions.all.length) {
|
||||
this.permissions.all.forEach(function (value) {
|
||||
this.setFormPermission(value);
|
||||
}, this);
|
||||
}
|
||||
},
|
||||
|
||||
permissionUnselectAll() {
|
||||
this.form.permissions = [];
|
||||
},
|
||||
|
||||
select(type) {
|
||||
let values = this.permissions[type].permissions;
|
||||
|
||||
if (values.length) {
|
||||
values.forEach(function (value) {
|
||||
this.setFormPermission(value);
|
||||
}, this);
|
||||
}
|
||||
},
|
||||
|
||||
unselect(type) {
|
||||
var values = this.permissions[type].permissions;
|
||||
|
||||
if (values.length) {
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
var index = this.form.permissions.indexOf(values[i]);
|
||||
|
||||
if (index > -1) {
|
||||
this.form.permissions.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setFormPermission(permission) {
|
||||
if (this.form.permissions.includes(permission)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((this.permissions.read_admin_panel == permission) || (this.permissions.read_client_portal == permission)) {
|
||||
if (this.permissions.read_admin_panel == permission && this.form.permissions.includes(this.permissions.read_client_portal)) {
|
||||
return;
|
||||
} else if(this.permissions.read_client_portal == permission && this.form.permissions.includes(this.permissions.read_admin_panel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.form.permissions.push(permission);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.form.permissions.push(permission);
|
||||
},
|
||||
}
|
||||
});
|
23
resources/assets/js/views/auth/users.js
vendored
23
resources/assets/js/views/auth/users.js
vendored
@ -28,7 +28,28 @@ const app = new Vue({
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('user'),
|
||||
bulk_action: new BulkAction('users')
|
||||
bulk_action: new BulkAction('users'),
|
||||
show_password: false,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.form.password = '';
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChangePassword(event) {
|
||||
if (this.show_password == false) {
|
||||
event.target.closest('.grid-rows-3').classList.replace('grid-rows-3', 'grid-rows-4');
|
||||
event.target.closest('.grid-rows-4').nextElementSibling.classList.replace('grid-rows-3', 'grid-rows-4');
|
||||
|
||||
this.show_password = true;
|
||||
} else {
|
||||
event.target.closest('.grid-rows-4').classList.replace('grid-rows-4', 'grid-rows-3');
|
||||
event.target.closest('.grid-rows-3').nextElementSibling.classList.replace('grid-rows-4', 'grid-rows-3');
|
||||
|
||||
this.show_password = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user