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 58e48d0 commit 7e40b51
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 150 deletions.
11 changes: 0 additions & 11 deletions views/admin/autoresponder/create.vue

This file was deleted.

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

This file was deleted.

62 changes: 28 additions & 34 deletions views/admin/autoresponder/list.vue
Original file line number Diff line number Diff line change
@@ -1,46 +1,40 @@

<template>
<table-render title="Autoresponder Mail Masses" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mailmass', 'autoresponder']" title="Autoresponder Mail Masses"
:table_fields="table_fields">

<template #header>
<th-render>Subject</th-render>
<th-render>Wait Period</th-render>
<th-render>Table Name</th-render>
<th-render>Email Field</th-render>
<th-render>Date Field</th-render>
<th-render>Start Date</th-render>
<th-render>End Date</th-render>
<th-render>Published</th-render>
</template>

<template #body="{ item }">
<td>{{ item.subject }}</td>
<td>{{ item.wait_period }}</td>
<td>{{ item.table_name }}</td>
<td>{{ item.email_field }}</td>
<td>{{ item.date_field }}</td>
<td>{{ item.start_date }}</td>
<td>{{ item.end_date }}</td>
<td>{{ item.published }}</td>
</template>


</table-render>
</template>

<script>
export default {
data() {
return {
path_param: ["mailmass", "autoresponder"],
model: {
id: "",
subject: "",
body: "",
wait_period: "",
table_name: "",
email_field: "",
start_date: "",
end_date: "",
published: "",
},
search_fields: [
{ type: "text", name: "subject", label: "Subject", ope: "", },
{ type: "text", name: "wait_period", label: "Wait Period", ope: "", },
{ type: "text", name: "table_name", label: "Table Name", ope: "", },
{ type: "text", name: "email_field", label: "Email Field", ope: "", },
{ type: "text", name: "date_field", label: "Date Field", ope: "", },
{ type: "text", name: "start_date", label: "Start Date", ope: "", },
{ type: "text", name: "end_date", label: "End Date", ope: "", },
{ type: "text", name: "published", label: "Published", ope: "", },
],
table_fields: [
{ text: "Subject", prop: "subject", name: "subject", },
{ text: "Wait Period", prop: "wait_period", name: "wait_period", },
{ text: "Table Name", prop: "table_name", name: "table_name", },
{ text: "Email Field", prop: "email_field", name: "email_field", },
{ text: "Date Field", prop: "date_field", name: "date_field", },
{ text: "Start Date", prop: "start_date", name: "start_date", },
{ text: "End Date", prop: "end_date", name: "end_date", },
{ text: "Published", prop: "published", name: "published", },
],
table_fields: ['subject', 'wait_period', 'table_name', 'email_field', 'date_field', 'start_date', 'end_date', 'published'],
};
}
};
Expand Down
11 changes: 0 additions & 11 deletions views/admin/campaign/create.vue

This file was deleted.

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

This file was deleted.

49 changes: 23 additions & 26 deletions views/admin/campaign/list.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@

<template>
<table-render title="Mail Masses Campaign" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mailmass', 'campaign']" title="Mail Masses Campaign" :table_fields="table_fields">

<template #header>
<th-render>Subject</th-render>
<th-render>Body</th-render>
<th-render>Send Date</th-render>
<th-render>Is Sent</th-render>
<th-render>Published</th-render>
</template>

<template #body="{ item }">
<td>{{ item.subject }}</td>
<td>{{ item.body }}</td>
<td>{{ item.send_date }}</td>
<td>{{ item.is_sent }}</td>
<td>{{ item.published }}</td>
</template>


</table-render>
</template>

<script>
export default {
data () {
data() {
return {
path_param: ["mailmass", "campaign"],
model: {
id: "",
subject: "",
body: "",
send_date: "",
is_sent: "",
published: "",
},
search_fields: [
{ type: "text", name: "subject", label: "Subject", ope: "", },
{ type: "text", name: "body", label: "Body", ope: "", },
{ type: "text", name: "send_date", label: "Send Date", ope: "", },
{ type: "text", name: "is_sent", label: "Is Sent", ope: "", },
{ type: "text", name: "published", label: "Published", ope: "", },
],
table_fields: [
{ text: "Subject", prop: "subject", name: "subject", },
{ text: "Body", prop: "body", name: "body", },
{ text: "Send Date", prop: "send_date", name: "send_date", },
{ text: "Is Sent", prop: "is_sent", name: "is_sent", },
{ text: "Published", prop: "published", name: "published", },
],
table_fields: ['subject', 'body', 'send_date', 'is_sent', 'published'],
};
}
};
Expand Down
11 changes: 0 additions & 11 deletions views/admin/group/create.vue

This file was deleted.

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

This file was deleted.

44 changes: 20 additions & 24 deletions views/admin/group/list.vue
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@

<template>
<table-render title="Mail Mass Group" :path_param="path_param" :search_fields="search_fields" :model="model"
:table_fields="table_fields"></table-render>
<table-render :path_param="['mailmass', 'group']" title="Mail Mass Group" :table_fields="table_fields">

<template #header>
<th-render>Name</th-render>
<th-render>Description</th-render>
<th-render>Ordering</th-render>
<th-render>Published</th-render>
</template>

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


</table-render>
</template>

<script>
export default {
data () {
data() {
return {
path_param: ["mailmass", "group"],
model: {
id: "",
name: "",
description: "",
ordering: "",
published: "",
},
search_fields: [
{ type: "text", name: "name", label: "Name", ope: "", },
{ type: "text", name: "description", label: "Description", ope: "", },
{ type: "text", name: "ordering", label: "Ordering", ope: "", },
{ type: "text", name: "published", label: "Published", ope: "", },
],
table_fields: [
{ text: "Name", prop: "name", name: "name", },
{ text: "Description", prop: "description", name: "description", },
{ text: "Ordering", prop: "ordering", name: "ordering", },
{ text: "Published", prop: "published", name: "published", },
],
table_fields: ['name', 'description', 'ordering', 'published'],
};
}
};
Expand Down

0 comments on commit 7e40b51

Please sign in to comment.