Skip to content

Commit

Permalink
Merge pull request #66 from avored/dev
Browse files Browse the repository at this point in the history
merging dev to master
  • Loading branch information
indpurvesh authored Mar 8, 2019
2 parents dcc1c0a + a12da0f commit acb6707
Show file tree
Hide file tree
Showing 93 changed files with 3,994 additions and 1,358 deletions.
18 changes: 18 additions & 0 deletions database/factories/AdminUserFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Models\Database\Role;

$factory->define(AvoRed\Framework\Models\Database\AdminUser::class, function (Faker $faker) {

$role = factory(Role::class)->create();
return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'email' => $faker->email,
'password' => bcrypt($faker->phoneNumber),
'role_id' => $role->id,
'is_super_admin' => rand(0,1),
'image_path' => null
];
});
12 changes: 12 additions & 0 deletions database/factories/LanguageFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use Faker\Generator as Faker;

$factory->define(AvoRed\Framework\Models\Database\Language::class, function (Faker $faker) {
$name = $faker->text(5);
return [
'name' => $name,
'code' => str_slug($name),
'is_default' => 0
];
});
31 changes: 29 additions & 2 deletions database/migrations/2017_03_29_000000_avored_framework_schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ class AvoredFrameworkSchema extends Migration
*/
public function up()
{
Schema::create('languages', function(Blueprint $table) {
$table->increments('id');
$table->string('name')->nullable()->default(null);
$table->string('code')->nullable()->default(null);
$table->tinyInteger('is_default')->default(0);
$table->timestamps();
});

Schema::create('categories', function(Blueprint $table) {
$table->increments('id');
$table->integer('parent_id')->nullable()->default(null);
Expand All @@ -31,6 +39,21 @@ public function up()
$table->timestamps();
});

Schema::create('category_translations', function(Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('category_id')->nullable()->default(null);
$table->unsignedInteger('language_id')->nullable()->default(null);
$table->string('name');
$table->string('slug');
$table->string('meta_title')->nullable()->default(null);
$table->string('meta_description')->nullable()->default(null);

$table->timestamps();

$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->foreign('language_id')->references('id')->on('languages')->onDelete('cascade');
});

Schema::create('category_filters', function(Blueprint $table) {
$table->increments('id');
$table->integer('category_id')->unsigned()->nullable()->default(null);
Expand Down Expand Up @@ -409,12 +432,15 @@ public function up()
$table->string('image_path')->nullable();
$table->string('company_name')->nullable();
$table->string('phone')->nullable();
$table->enum('status', ['GUEST', 'LIVE'])->default('LIVE');
$table->enum('status', ['GUEST', 'LIVE', 'DELETE_IN_PROGRESS'])->default('LIVE');
$table->string('tax_no')->nullable()->default(null);
$table->timestamp('email_verified_at')->nullable();
$table->timestamp('delete_due_date')->nullable()->default(null);
$table->enum('registered_channel', ['WEBSITE', 'FACEBOOK', 'TWITTER', 'GOOGLE'])->default('WEBSITE');
$table->rememberToken();
$table->timestamps();
$table->softDeletes();

});

Schema::create('user_groups', function(Blueprint $table) {
Expand Down Expand Up @@ -632,7 +658,6 @@ public function up()
$table->timestamps();
});


$countryModel = Country::whereCode('nz')->first();
$countryModel->update(['is_active' => 1]);
$siteCurrency = SiteCurrency::create([
Expand Down Expand Up @@ -776,6 +801,7 @@ public function down()
Schema::dropIfExists('product_images');
Schema::dropIfExists('product_prices');
Schema::dropIfExists('products');
Schema::dropIfExists('category_translations');
Schema::dropIfExists('categories');

Schema::dropIfExists('attributes');
Expand Down Expand Up @@ -805,5 +831,6 @@ public function down()
Schema::dropIfExists('roles');
Schema::dropIfExists('states');
Schema::dropIfExists('countries');
Schema::dropIfExists('languages');
}
}
47 changes: 47 additions & 0 deletions resources/components/datagrid/DataGrid.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<template>
<div class="d-table w-100">
<div class="d-flex text-white bg-dark flex-row ">
<div
class="flex-shrink-1 font-weight-bold align-self-start pt-3 pr-3 pb-3 pl-3"
v-for="column in columns" :key="column.key">
{{ column.label }}
</div>
</div>
<div class="d-flex flex-row" v-for="item in items" :key="item.id">
<div
class="flex-shrink-1 align-self-start pt-2 pr-3 pb-2 pl-3"
v-for="col in columns" :key="col.key"
>
{{ render(item, col.key) }}

</div>
</div>
</div>
</template>

<script>
export default {
props: {
'columns': {required : true, type : Array},
'actions': { required: false },
'items': {required : true, type : Array}
},
data() {
return {
}
},
methods: {
render(item, key) {
//return "test";
return item[key];
}
},
created() {
//this.items = JSON.parse(this.data);
//this.columnsData = JSON.parse(this.columns);
}
}
</script>
14 changes: 14 additions & 0 deletions resources/components/layout/SideBarDropdown.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script>
export default {
data() {
return {
menuActive: false
}
},
methods: {
dropdownSidebarNav() {
this.menuActive = !this.menuActive;
}
}
}
</script>
69 changes: 69 additions & 0 deletions resources/components/product/category/CategoryFieldPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<script>
import isNil from 'lodash/isNil';
export default {
props: ['category'],
data() {
return {
name: '',
meta_title: '',
meta_description: '',
categoryData: {},
cardBody: {
basic: true,
seo: true
},
linkTitle: {
basic: false,
seo: false
}
}
},
methods: {
sanitizeName: function(name) {
return name.toLowerCase().replace(/\s*$/g, '').replace(/\s+/g, '-');
},
toggleCard(type) {
for (var cardId in this.linkTitle) {
if(!this.linkTitle.hasOwnProperty(cardId)) continue;
this.linkTitle[cardId] = false;
this.cardBody[cardId] = false;
}
this.cardBody[type] = !this.cardBody[type];
this.linkTitle[type] = !this.linkTitle[type];
},
openAllCardLink() {
for (var cardId in this.linkTitle) {
if(!this.linkTitle.hasOwnProperty(cardId)) continue;
this.linkTitle[cardId] = false;
this.cardBody[cardId] = true;
}
},
changeLanguage(event) {
window.location = event.target.selectedOptions[0].getAttribute('data-url');
}
},
computed: {
slug() {
return this.sanitizeName(this.name);
},
openAllCard() {
if (this.linkTitle.basic === true || this.linkTitle.seo === true) {
return false;
}
return true;
}
},
mounted () {
this.categoryData = JSON.parse(this.category);
this.name = isNil(this.categoryData.name) ? '' : this.categoryData.name;
this.meta_title = this.categoryData.meta_title;
this.meta_description = this.categoryData.meta_description;
}
}
</script>
19 changes: 19 additions & 0 deletions resources/components/user/auth/LoginPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script>
export default {
data() {
return {
email: '',
password: ''
}
},
computed: {
isLoginDisbled: function() {
if(this.email != "" && this.password != "") {
return false;
}
return true;
}
}
}
</script>
18 changes: 18 additions & 0 deletions resources/components/user/auth/PasswordResetPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
export default {
data() {
return {
email: ''
}
},
computed: {
isSubmitButtonDisbled: function() {
if(this.email != "") {
return false;
}
return true;
}
}
}
</script>
21 changes: 21 additions & 0 deletions resources/components/user/auth/SetNewPasswordPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script>
export default {
data() {
return {
email: '',
password: '',
confirm_password: ''
}
},
computed: {
isSubmitDisbled: function() {
if(this.email != "" && this.password != "" && this.confirm_password != ''
&& (this.password == this.confirm_password)) {
return false;
}
return true;
}
}
}
</script>
6 changes: 3 additions & 3 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ if (token) {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

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

require('./bootstrap');

Expand Down
65 changes: 65 additions & 0 deletions resources/js/vue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

/**
* 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.
*/

//window._ = require('lodash');
//require('popper.js');

try {
//window.$ = window.jQuery = require('jquery');
//require('bootstrap');

} catch (e) {}

//require('select2');
//require('pc-bootstrap4-datetimepicker');
//require('chartjs');
//require('sweetalert');
//require('jquery-sortable');

//window.SimpleMDE = require('simplemde');


window.Vue = require('vue');
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
}

Vue.component('datagrid', require('../components/datagrid/DataGrid.vue').default);
Vue.component('sidebar-dropdown', require('../components/layout/SideBarDropdown.vue').default);
Vue.component('login-page', require('../components/user/auth/LoginPage.vue').default);
Vue.component('password-reset-page', require('../components/user/auth/PasswordResetPage.vue').default);
Vue.component('set-new-password-page', require('../components/user/auth/SetNewPasswordPage.vue').default);
Vue.component('category-field-page', require('../components/product/category/CategoryFieldPage.vue').default);

//require('./bootstrap');

/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/

// Vue.component('example-component', require('./components/ExampleComponent.vue'));
const app = new Vue({
el: '#app',
data: {
toggleSideBarData: true,
displayProfileHeaderMenu: false
},
methods: {
toggleSidebar() {
this.toggleSideBarData = !this.toggleSideBarData;
},
clickOnProfileHeaderLink() {
this.displayProfileHeaderMenu = !this.displayProfileHeaderMenu;
}
}
});
Loading

0 comments on commit acb6707

Please sign in to comment.