Skip to content

Commit c72de6e

Browse files
authored
Merge pull request #67 from avored/dev
Dev
2 parents acb6707 + 877e010 commit c72de6e

33 files changed

+776
-673
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['page'],
7+
data() {
8+
return {
9+
pageData: {}
10+
}
11+
},
12+
methods: {
13+
sanitizeName: function(name) {
14+
return name.toLowerCase().replace(/\s*$/g, '').replace(/\s+/g, '-');
15+
},
16+
},
17+
computed: {
18+
slug() {
19+
this.pageData.slug = this.sanitizeName(this.pageData.name ? this.pageData.name : '');
20+
return this.pageData.slug;
21+
},
22+
},
23+
mounted() {
24+
if (!isNil(this.page)) {
25+
this.pageData = this.page;
26+
}
27+
}
28+
29+
}
30+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['model'],
7+
data() {
8+
return {
9+
modelData: {}
10+
}
11+
},
12+
methods: {
13+
},
14+
15+
mounted() {
16+
if (!isNil(this.model)) {
17+
this.modelData = this.model;
18+
}
19+
}
20+
}
21+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['model'],
7+
data() {
8+
return {
9+
modelData: {}
10+
}
11+
},
12+
methods: {
13+
sanitizeName: function(name) {
14+
return name.toLowerCase().replace(/\s*$/g, '').replace(/\s+/g, '-');
15+
},
16+
},
17+
computed: {
18+
identifier() {
19+
this.modelData.identifier = this.sanitizeName(this.modelData.name ? this.modelData.name : '');
20+
return this.modelData.identifier;
21+
},
22+
},
23+
mounted() {
24+
if (!isNil(this.model)) {
25+
this.modelData = this.model;
26+
}
27+
}
28+
}
29+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['model'],
7+
data() {
8+
return {
9+
modelData: {}
10+
}
11+
},
12+
methods: {
13+
},
14+
mounted() {
15+
if (!isNil(this.model)) {
16+
this.modelData = this.model;
17+
}
18+
}
19+
}
20+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['model'],
7+
data() {
8+
return {
9+
modelData: {}
10+
}
11+
},
12+
methods: {
13+
},
14+
mounted() {
15+
if (!isNil(this.model)) {
16+
this.modelData = this.model;
17+
}
18+
}
19+
}
20+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['model'],
7+
data() {
8+
return {
9+
modelData: {}
10+
}
11+
},
12+
methods: {
13+
},
14+
mounted() {
15+
if (!isNil(this.model)) {
16+
this.modelData = this.model;
17+
}
18+
}
19+
}
20+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script>
2+
3+
import isNil from 'lodash/isNil';
4+
5+
export default {
6+
props: ['model'],
7+
data() {
8+
return {
9+
modelData: {}
10+
}
11+
},
12+
methods: {
13+
},
14+
mounted() {
15+
if (!isNil(this.model)) {
16+
this.modelData = this.model;
17+
}
18+
}
19+
}
20+
</script>

resources/js/vue.js

+14
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,26 @@ if (token) {
3232
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
3333
}
3434

35+
36+
3537
Vue.component('datagrid', require('../components/datagrid/DataGrid.vue').default);
3638
Vue.component('sidebar-dropdown', require('../components/layout/SideBarDropdown.vue').default);
39+
40+
3741
Vue.component('login-page', require('../components/user/auth/LoginPage.vue').default);
3842
Vue.component('password-reset-page', require('../components/user/auth/PasswordResetPage.vue').default);
3943
Vue.component('set-new-password-page', require('../components/user/auth/SetNewPasswordPage.vue').default);
44+
Vue.component('admin-user-field-page', require('../components/user/admin-user/AdminUserFieldPage.vue').default);
45+
46+
Vue.component('country-field-page', require('../components/system/country/CountryFieldPage.vue').default);
47+
Vue.component('state-field-page', require('../components/system/state/StateFieldPage.vue').default);
48+
Vue.component('site-currency-field-page', require('../components/system/site-currency/SiteCurrencyFieldPage.vue').default);
49+
4050
Vue.component('category-field-page', require('../components/product/category/CategoryFieldPage.vue').default);
51+
Vue.component('attribute-field-page', require('../components/product/attribute/AttributeFieldPage.vue').default);
52+
53+
Vue.component('cms-page-field-page', require('../components/cms/page/CmsPageFieldPage.vue').default);
54+
Vue.component('order-status-field-page', require('../components/order/order-status/OrderStatusFieldPage.vue').default);
4155

4256
//require('./bootstrap');
4357

resources/lang/en/product.php

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'edit_title' => 'Edit Category',
2828
'edit_button' => 'Edit Category',
2929
'category_all' => 'Category All',
30+
'title' => 'Category List'
3031

3132
]
3233
];
+64-89
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,70 @@
1-
2-
<avored-form-input
3-
field-name="name"
4-
label="{{ __('avored-framework::attribute.name') }}"
5-
field-value="{!! $model->name ?? "" !!}"
6-
error-text="{!! $errors->first('name') !!}"
7-
v-on:change="changeModelValue"
8-
autofocus="autofocus"
9-
>
10-
</avored-form-input>
11-
12-
13-
14-
<avored-form-input
15-
field-name="slug"
16-
label="{{ __('Slug') }}"
17-
field-value="{!! $model->slug ?? "" !!}"
18-
error-text="{!! $errors->first('slug') !!}"
19-
v-on:change="changeModelValue"
20-
21-
>
22-
</avored-form-input>
23-
@php
24-
$content = (isset($model)) ? $model->getContent() : "";
25-
@endphp
261
<div class="form-group">
27-
<label for="content">Content</label>
28-
<textarea id="content" name="content"
29-
class="summernote form-control"
30-
>{{ $content }}</textarea>
31-
</div>
2+
<label for="name">Name</label>
3+
<input type="text"
4+
name="name"
5+
v-model="pageData.name"
6+
class="form-control {{ $errors->has('name') ? ' is-invalid' : '' }}"
7+
id="name" />
8+
@if ($errors->has('name'))
9+
<span class='invalid-feedback'>
10+
<strong>{{ $errors->first('name') }}</strong>
11+
</span>
12+
@endif
13+
</div>
14+
15+
<div class="form-group">
16+
<label for="slug">Slug</label>
17+
<input type="text"
18+
name="slug"
19+
v-model="slug"
20+
class="form-control {{ $errors->has('slug') ? ' is-invalid' : '' }}"
21+
id="slug" />
22+
@if ($errors->has('slug'))
23+
<span class='invalid-feedback'>
24+
<strong>{{ $errors->first('slug') }}</strong>
25+
</span>
26+
@endif
27+
</div>
3228

33-
<avored-form-input
34-
field-name="meta_title"
35-
label="{{ __('Meta Title') }}"
36-
field-value="{!! $model->meta_title ?? "" !!}"
37-
error-text="{!! $errors->first('meta_title') !!}"
38-
v-on:change="changeModelValue"
39-
40-
>
41-
</avored-form-input>
4229

43-
<avored-form-input
44-
field-name="meta_description"
45-
label="{{ __('Meta Description') }}"
46-
field-value="{!! $model->meta_description ?? "" !!}"
47-
error-text="{!! $errors->first('meta_description') !!}"
48-
v-on:change="changeModelValue"
49-
50-
>
51-
</avored-form-input>
30+
@php
31+
$content = (isset($model)) ? $model->getContent() : "";
32+
@endphp
33+
<div class="form-group">
34+
<label for="content">Content</label>
35+
<textarea
36+
id="content"
37+
name="content"
38+
v-model="pageData.content"
39+
class="summernote form-control"
40+
>{{ $content }}</textarea>
41+
</div>
5242

43+
<div class="form-group">
44+
<label for="meta_title">Meta Title</label>
45+
<input type="text"
46+
name="meta_title"
47+
v-model="pageData.meta_title"
48+
class="form-control {{ $errors->has('meta_title') ? ' is-invalid' : '' }}"
49+
id="meta_title" />
50+
@if ($errors->has('meta_title'))
51+
<span class='invalid-feedback'>
52+
<strong>{{ $errors->first('meta_title') }}</strong>
53+
</span>
54+
@endif
55+
</div>
5356

54-
<div class="modal" id="widget-list-modal" tabindex="-1" role="dialog">
55-
<div class="modal-dialog" role="document">
56-
<div class="modal-content">
57-
<div class="modal-header">
58-
<h5 class="modal-title">Widget Selection</h5>
59-
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
60-
<span aria-hidden="true">&times;</span>
61-
</button>
62-
</div>
63-
<div class="modal-body">
64-
@include('avored-framework::forms.select',
65-
['name' => 'widget_list',
66-
'label' => 'Widget List',
67-
'options' => $widgetOptions
68-
])
69-
</div>
70-
<div class="modal-footer">
71-
<button type="button"
72-
id="widget-insert-button"
73-
data-dismiss="modal"
74-
class="btn btn-primary">
75-
Insert Widget
76-
</button>
77-
<button type="button"
78-
id="widget-close-button"
79-
data-dismiss="modal"
80-
class="btn btn-default">
81-
Close
82-
</button>
83-
</div>
84-
</div>
85-
</div>
86-
</div>
8757

88-
@push('scripts')
89-
<script>
90-
jQuery(document).ready(function() {
91-
92-
93-
});
94-
</script>
95-
@endpush
58+
<div class="form-group">
59+
<label for="meta_description">Meta Description</label>
60+
<input type="text"
61+
name="meta_description"
62+
v-model="pageData.meta_description"
63+
class="form-control {{ $errors->has('meta_description') ? ' is-invalid' : '' }}"
64+
id="meta_description" />
65+
@if ($errors->has('meta_description'))
66+
<span class='invalid-feedback'>
67+
<strong>{{ $errors->first('meta_description') }}</strong>
68+
</span>
69+
@endif
70+
</div>

0 commit comments

Comments
 (0)