Skip to content

Commit

Permalink
Improvement to table listing
Browse files Browse the repository at this point in the history
  • Loading branch information
dedanirungu committed Feb 23, 2023
1 parent 0573b35 commit 1844b6d
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 217 deletions.
11 changes: 0 additions & 11 deletions views/admin/blacklist/create.vue

This file was deleted.

11 changes: 0 additions & 11 deletions views/admin/blacklist/edit.vue

This file was deleted.

32 changes: 13 additions & 19 deletions views/admin/blacklist/list.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@

<template>
<table-render title="mail Blacklist" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mail', 'blacklist']" title="mail Blacklist" :table_fields="table_fields">

<template #header>
<th-render>Contact</th-render>
</template>

<template #body="{ item }">
<td>{{ item.partner_id__mail_contact__name }} {{ item.partner_id__mail_contact__email }}</td>
</template>

</table-render>
</template>

<script>
export default {
data () {
data() {
return {
path_param: ["mail", "blacklist"],
model: {
id: "",
contact_id: "",
},
search_fields: [
{ type: "select", name: "contact_id", label: "Contact", ope: "", },
],
table_fields: [
{
text: "Contact",
prop: "[mail_contact__name] [mail_contact__email]",
name: "partner_id",
foreign: ['mail_contact__name','mail_contact__email',]
},
],
table_fields: ['partner_id__mail_contact__name', 'partner_id__mail_contact__email',],
};
}
};
Expand Down
11 changes: 0 additions & 11 deletions views/admin/contact/create.vue

This file was deleted.

11 changes: 0 additions & 11 deletions views/admin/contact/edit.vue

This file was deleted.

42 changes: 19 additions & 23 deletions views/admin/contact/list.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@

<template>
<table-render title="Mail Contact" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mail', 'contact']" title="Mail Contact" :table_fields="table_fields">
<template #header>
<th-render>Name</th-render>
<th-render>Email</th-render>
<th-render>Ordering</th-render>
<th-render>Published</th-render>
</template>

<template #body="{ item }">
<td>{{ item.name }}</td>
<td>{{ item.email }}</td>
<td>{{ item.ordering }}</td>
<td>{{ item.published }}</td>
</template>


</table-render>
</template>

<script>
export default {
data () {
data() {
return {
path_param: ["mail", "contact"],
model: {
id: "",
name: "",
email: "",
ordering: "",
published: "",
},
search_fields: [
{ type: "text", name: "name", label: "Name", ope: "", },
{ type: "text", name: "email", label: "Email", ope: "", },
{ type: "text", name: "ordering", label: "Ordering", ope: "", },
{ type: "text", name: "published", label: "Published", ope: "", },
],
table_fields: [
{ text: "Name", prop: "name", name: "name", },
{ text: "Email", prop: "email", name: "email", },
{ text: "Ordering", prop: "ordering", name: "ordering", },
{ text: "Published", prop: "published", name: "published", },
],
table_fields: ['name', 'email', 'ordering', 'published'],
};
}
};
Expand Down
11 changes: 0 additions & 11 deletions views/admin/signature/create.vue

This file was deleted.

11 changes: 0 additions & 11 deletions views/admin/signature/edit.vue

This file was deleted.

42 changes: 19 additions & 23 deletions views/admin/signature/list.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@

<template>
<table-render title="Mail Contact" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mail', 'signature']" title="Mail Contact" :table_fields="table_fields">

<template #header>
<th-render>Title</th-render>
<th-render>Signature</th-render>
<th-render>Ordering</th-render>
<th-render>Published</th-render>
</template>

<template #body="{ item }">
<td>{{ item.title }}</td>
<td>{{ item.signature }}</td>
<td>{{ item.ordering }}</td>
<td>{{ item.published }}</td>
</template>

</table-render>
</template>

<script>
export default {
data () {
data() {
return {
path_param: ["mail", "signature"],
model: {
id: "",
title: "",
signature: "",
ordering: "",
published: "",
},
search_fields: [
{ type: "text", name: "title", label: "Title", ope: "", },
{ type: "text", name: "signature", label: "Signature", ope: "", },
{ type: "text", name: "ordering", label: "Ordering", ope: "", },
{ type: "text", name: "published", label: "Published", ope: "", },
],
table_fields: [
{ text: "Title", prop: "title", name: "title", },
{ text: "Signature", prop: "signature", name: "signature", },
{ text: "Ordering", prop: "ordering", name: "ordering", },
{ text: "Published", prop: "published", name: "published", },
],
table_fields: ['title','signature','ordering','published'],
};
}
};
Expand Down
11 changes: 0 additions & 11 deletions views/admin/theme/create.vue

This file was deleted.

11 changes: 0 additions & 11 deletions views/admin/theme/edit.vue

This file was deleted.

43 changes: 19 additions & 24 deletions views/admin/theme/list.vue
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@

<template>
<table-render title="Mail Theme" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mail', 'theme']" title="Mail Theme" :table_fields="table_fields">
<template #header>
<th-render>Title</th-render>
<th-render>File Name</th-render>
<th-render>Is File</th-render>
<th-render>Is Default</th-render>
</template>

<template #body="{ item }">
<td>{{ item.title }}</td>
<td>{{ item.file_name }}</td>
<td>{{ item.is_file }}</td>
<td>{{ item.is_default }}</td>
</template>


</table-render>
</template>

<script>
export default {
data () {
data() {
return {
path_param: ["mail", "theme"],
model: {
id: "",
title: "",
file_name: "",
body: "",
is_file: "",
is_default: "",
},
search_fields: [
{ type: "text", name: "title", label: "Title", ope: "", },
{ type: "text", name: "file_name", label: "File Name", ope: "", },
{ type: "text", name: "is_file", label: "Is File", ope: "", },
{ type: "text", name: "is_default", label: "Is Default", ope: "", },
],
table_fields: [
{ text: "Title", prop: "title", name: "title", },
{ text: "File Name", prop: "file_name", name: "file_name", },
{ text: "Is File", prop: "is_file", name: "is_file", },
{ text: "Is Default", prop: "is_default", name: "is_default", },
],
table_fields: ['title', 'file_name', 'is_file', 'is_default'],
};
}
};
Expand Down
11 changes: 0 additions & 11 deletions views/admin/whitelist/create.vue

This file was deleted.

11 changes: 0 additions & 11 deletions views/admin/whitelist/edit.vue

This file was deleted.

30 changes: 12 additions & 18 deletions views/admin/whitelist/list.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@

<template>
<table-render title="Mail Whitelist" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mail', 'whitelist']" title="Mail Whitelist" :table_fields="table_fields">

<template #header>
<th-render>Contact</th-render>
</template>

<template #body="{ item }">
<td>{{ item.partner_id__mail_contact__name }} {{ item.partner_id__mail_contact__phone }}</td>
</template>

</table-render>
</template>

<script>
export default {
data() {
return {
path_param: ["mail", "whitelist"],
model: {
id: "",
contact_id: "",
},
search_fields: [
{ type: "select", name: "contact_id", label: "Contact", ope: "", },
],
table_fields: [
{
text: "Contact",
prop: "[mail_contact__name] [mail_contact__email]",
name: "partner_id",
foreign: ['mail_contact__name', 'mail_contact__email',]
},
],
table_fields: ['partner_id__mail_contact__name', 'partner_id__mail_contact__email'],
};
}
};
Expand Down

0 comments on commit 1844b6d

Please sign in to comment.