Skip to content

Commit acb6707

Browse files
authored
Merge pull request #66 from avored/dev
merging dev to master
2 parents dcc1c0a + a12da0f commit acb6707

File tree

93 files changed

+3994
-1358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3994
-1358
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
use Faker\Generator as Faker;
4+
use AvoRed\Framework\Models\Database\Role;
5+
6+
$factory->define(AvoRed\Framework\Models\Database\AdminUser::class, function (Faker $faker) {
7+
8+
$role = factory(Role::class)->create();
9+
return [
10+
'first_name' => $faker->firstName,
11+
'last_name' => $faker->lastName,
12+
'email' => $faker->email,
13+
'password' => bcrypt($faker->phoneNumber),
14+
'role_id' => $role->id,
15+
'is_super_admin' => rand(0,1),
16+
'image_path' => null
17+
];
18+
});
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Faker\Generator as Faker;
4+
5+
$factory->define(AvoRed\Framework\Models\Database\Language::class, function (Faker $faker) {
6+
$name = $faker->text(5);
7+
return [
8+
'name' => $name,
9+
'code' => str_slug($name),
10+
'is_default' => 0
11+
];
12+
});

database/migrations/2017_03_29_000000_avored_framework_schema.php

+29-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ class AvoredFrameworkSchema extends Migration
2020
*/
2121
public function up()
2222
{
23+
Schema::create('languages', function(Blueprint $table) {
24+
$table->increments('id');
25+
$table->string('name')->nullable()->default(null);
26+
$table->string('code')->nullable()->default(null);
27+
$table->tinyInteger('is_default')->default(0);
28+
$table->timestamps();
29+
});
30+
2331
Schema::create('categories', function(Blueprint $table) {
2432
$table->increments('id');
2533
$table->integer('parent_id')->nullable()->default(null);
@@ -31,6 +39,21 @@ public function up()
3139
$table->timestamps();
3240
});
3341

42+
Schema::create('category_translations', function(Blueprint $table) {
43+
$table->increments('id');
44+
$table->unsignedInteger('category_id')->nullable()->default(null);
45+
$table->unsignedInteger('language_id')->nullable()->default(null);
46+
$table->string('name');
47+
$table->string('slug');
48+
$table->string('meta_title')->nullable()->default(null);
49+
$table->string('meta_description')->nullable()->default(null);
50+
51+
$table->timestamps();
52+
53+
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
54+
$table->foreign('language_id')->references('id')->on('languages')->onDelete('cascade');
55+
});
56+
3457
Schema::create('category_filters', function(Blueprint $table) {
3558
$table->increments('id');
3659
$table->integer('category_id')->unsigned()->nullable()->default(null);
@@ -409,12 +432,15 @@ public function up()
409432
$table->string('image_path')->nullable();
410433
$table->string('company_name')->nullable();
411434
$table->string('phone')->nullable();
412-
$table->enum('status', ['GUEST', 'LIVE'])->default('LIVE');
435+
$table->enum('status', ['GUEST', 'LIVE', 'DELETE_IN_PROGRESS'])->default('LIVE');
413436
$table->string('tax_no')->nullable()->default(null);
414437
$table->timestamp('email_verified_at')->nullable();
438+
$table->timestamp('delete_due_date')->nullable()->default(null);
415439
$table->enum('registered_channel', ['WEBSITE', 'FACEBOOK', 'TWITTER', 'GOOGLE'])->default('WEBSITE');
416440
$table->rememberToken();
417441
$table->timestamps();
442+
$table->softDeletes();
443+
418444
});
419445

420446
Schema::create('user_groups', function(Blueprint $table) {
@@ -632,7 +658,6 @@ public function up()
632658
$table->timestamps();
633659
});
634660

635-
636661
$countryModel = Country::whereCode('nz')->first();
637662
$countryModel->update(['is_active' => 1]);
638663
$siteCurrency = SiteCurrency::create([
@@ -776,6 +801,7 @@ public function down()
776801
Schema::dropIfExists('product_images');
777802
Schema::dropIfExists('product_prices');
778803
Schema::dropIfExists('products');
804+
Schema::dropIfExists('category_translations');
779805
Schema::dropIfExists('categories');
780806

781807
Schema::dropIfExists('attributes');
@@ -805,5 +831,6 @@ public function down()
805831
Schema::dropIfExists('roles');
806832
Schema::dropIfExists('states');
807833
Schema::dropIfExists('countries');
834+
Schema::dropIfExists('languages');
808835
}
809836
}
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<template>
2+
<div class="d-table w-100">
3+
<div class="d-flex text-white bg-dark flex-row ">
4+
<div
5+
class="flex-shrink-1 font-weight-bold align-self-start pt-3 pr-3 pb-3 pl-3"
6+
v-for="column in columns" :key="column.key">
7+
{{ column.label }}
8+
</div>
9+
</div>
10+
<div class="d-flex flex-row" v-for="item in items" :key="item.id">
11+
<div
12+
class="flex-shrink-1 align-self-start pt-2 pr-3 pb-2 pl-3"
13+
v-for="col in columns" :key="col.key"
14+
>
15+
{{ render(item, col.key) }}
16+
17+
</div>
18+
</div>
19+
</div>
20+
</template>
21+
22+
<script>
23+
24+
export default {
25+
props: {
26+
'columns': {required : true, type : Array},
27+
'actions': { required: false },
28+
'items': {required : true, type : Array}
29+
},
30+
data() {
31+
return {
32+
33+
}
34+
},
35+
methods: {
36+
37+
render(item, key) {
38+
//return "test";
39+
return item[key];
40+
}
41+
},
42+
created() {
43+
//this.items = JSON.parse(this.data);
44+
//this.columnsData = JSON.parse(this.columns);
45+
}
46+
}
47+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script>
2+
export default {
3+
data() {
4+
return {
5+
menuActive: false
6+
}
7+
},
8+
methods: {
9+
dropdownSidebarNav() {
10+
this.menuActive = !this.menuActive;
11+
}
12+
}
13+
}
14+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['category'],
7+
data() {
8+
return {
9+
name: '',
10+
meta_title: '',
11+
meta_description: '',
12+
categoryData: {},
13+
cardBody: {
14+
basic: true,
15+
seo: true
16+
},
17+
linkTitle: {
18+
basic: false,
19+
seo: false
20+
}
21+
}
22+
},
23+
methods: {
24+
sanitizeName: function(name) {
25+
return name.toLowerCase().replace(/\s*$/g, '').replace(/\s+/g, '-');
26+
},
27+
toggleCard(type) {
28+
29+
for (var cardId in this.linkTitle) {
30+
if(!this.linkTitle.hasOwnProperty(cardId)) continue;
31+
this.linkTitle[cardId] = false;
32+
this.cardBody[cardId] = false;
33+
}
34+
35+
this.cardBody[type] = !this.cardBody[type];
36+
this.linkTitle[type] = !this.linkTitle[type];
37+
},
38+
openAllCardLink() {
39+
for (var cardId in this.linkTitle) {
40+
if(!this.linkTitle.hasOwnProperty(cardId)) continue;
41+
42+
this.linkTitle[cardId] = false;
43+
this.cardBody[cardId] = true;
44+
}
45+
},
46+
changeLanguage(event) {
47+
window.location = event.target.selectedOptions[0].getAttribute('data-url');
48+
}
49+
},
50+
computed: {
51+
slug() {
52+
return this.sanitizeName(this.name);
53+
},
54+
openAllCard() {
55+
if (this.linkTitle.basic === true || this.linkTitle.seo === true) {
56+
return false;
57+
}
58+
return true;
59+
}
60+
},
61+
mounted () {
62+
this.categoryData = JSON.parse(this.category);
63+
64+
this.name = isNil(this.categoryData.name) ? '' : this.categoryData.name;
65+
this.meta_title = this.categoryData.meta_title;
66+
this.meta_description = this.categoryData.meta_description;
67+
}
68+
}
69+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script>
2+
export default {
3+
4+
data() {
5+
return {
6+
email: '',
7+
password: ''
8+
}
9+
},
10+
computed: {
11+
isLoginDisbled: function() {
12+
if(this.email != "" && this.password != "") {
13+
return false;
14+
}
15+
return true;
16+
}
17+
}
18+
}
19+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script>
2+
export default {
3+
4+
data() {
5+
return {
6+
email: ''
7+
}
8+
},
9+
computed: {
10+
isSubmitButtonDisbled: function() {
11+
if(this.email != "") {
12+
return false;
13+
}
14+
return true;
15+
}
16+
}
17+
}
18+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script>
2+
export default {
3+
4+
data() {
5+
return {
6+
email: '',
7+
password: '',
8+
confirm_password: ''
9+
}
10+
},
11+
computed: {
12+
isSubmitDisbled: function() {
13+
if(this.email != "" && this.password != "" && this.confirm_password != ''
14+
&& (this.password == this.confirm_password)) {
15+
return false;
16+
}
17+
return true;
18+
}
19+
}
20+
}
21+
</script>

resources/js/app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ if (token) {
3232
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
3333
}
3434

35-
Vue.component('avored-form-input', require('../components/forms/avored-form-input.vue'));
36-
Vue.component('avored-form-select', require('../components/forms/avored-form-select.vue'));
37-
Vue.component('avored-form-textarea', require('../components/forms/avored-form-textarea.vue'));
35+
Vue.component('avored-form-input', require('../components/forms/avored-form-input.vue').default);
36+
Vue.component('avored-form-select', require('../components/forms/avored-form-select.vue').default);
37+
Vue.component('avored-form-textarea', require('../components/forms/avored-form-textarea.vue').default);
3838

3939
require('./bootstrap');
4040

resources/js/vue.js

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
/**
3+
* First we will load all of this project's JavaScript dependencies which
4+
* includes Vue and other libraries. It is a great starting point when
5+
* building robust, powerful web applications using Vue and Laravel.
6+
*/
7+
8+
//window._ = require('lodash');
9+
//require('popper.js');
10+
11+
try {
12+
//window.$ = window.jQuery = require('jquery');
13+
//require('bootstrap');
14+
15+
} catch (e) {}
16+
17+
//require('select2');
18+
//require('pc-bootstrap4-datetimepicker');
19+
//require('chartjs');
20+
//require('sweetalert');
21+
//require('jquery-sortable');
22+
23+
//window.SimpleMDE = require('simplemde');
24+
25+
26+
window.Vue = require('vue');
27+
window.axios = require('axios');
28+
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
29+
30+
let token = document.head.querySelector('meta[name="csrf-token"]');
31+
if (token) {
32+
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
33+
}
34+
35+
Vue.component('datagrid', require('../components/datagrid/DataGrid.vue').default);
36+
Vue.component('sidebar-dropdown', require('../components/layout/SideBarDropdown.vue').default);
37+
Vue.component('login-page', require('../components/user/auth/LoginPage.vue').default);
38+
Vue.component('password-reset-page', require('../components/user/auth/PasswordResetPage.vue').default);
39+
Vue.component('set-new-password-page', require('../components/user/auth/SetNewPasswordPage.vue').default);
40+
Vue.component('category-field-page', require('../components/product/category/CategoryFieldPage.vue').default);
41+
42+
//require('./bootstrap');
43+
44+
/**
45+
* Next, we will create a fresh Vue application instance and attach it to
46+
* the page. Then, you may begin adding components to this application
47+
* or customize the JavaScript scaffolding to fit your unique needs.
48+
*/
49+
50+
// Vue.component('example-component', require('./components/ExampleComponent.vue'));
51+
const app = new Vue({
52+
el: '#app',
53+
data: {
54+
toggleSideBarData: true,
55+
displayProfileHeaderMenu: false
56+
},
57+
methods: {
58+
toggleSidebar() {
59+
this.toggleSideBarData = !this.toggleSideBarData;
60+
},
61+
clickOnProfileHeaderLink() {
62+
this.displayProfileHeaderMenu = !this.displayProfileHeaderMenu;
63+
}
64+
}
65+
});

0 commit comments

Comments
 (0)