dhatu 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/dhatu/blog_posts_controller.rb +81 -14
- data/app/controllers/dhatu/bookings_controller.rb +51 -5
- data/app/controllers/dhatu/branches_controller.rb +42 -8
- data/app/controllers/dhatu/categories_controller.rb +86 -47
- data/app/controllers/dhatu/events_controller.rb +79 -9
- data/app/controllers/dhatu/meta_tags_controller.rb +96 -0
- data/app/controllers/dhatu/offers_controller.rb +83 -10
- data/app/controllers/dhatu/pages_controller.rb +130 -0
- data/app/controllers/dhatu/prices_controller.rb +78 -12
- data/app/controllers/dhatu/projects_controller.rb +78 -22
- data/app/controllers/dhatu/promotion_enquiries_controller.rb +69 -7
- data/app/controllers/dhatu/promotions_controller.rb +46 -2
- data/app/controllers/dhatu/resource_controller.rb +4 -0
- data/app/controllers/dhatu/sections_controller.rb +41 -8
- data/app/controllers/dhatu/services_controller.rb +78 -18
- data/app/controllers/dhatu/team_members_controller.rb +41 -8
- data/app/controllers/dhatu/testimonials_controller.rb +41 -9
- data/app/models/dhatu/blog_post.rb +6 -2
- data/app/models/dhatu/category.rb +3 -3
- data/app/models/dhatu/event.rb +4 -0
- data/app/models/dhatu/meta_tag.rb +48 -0
- data/app/models/dhatu/offer.rb +4 -0
- data/app/models/dhatu/page.rb +50 -0
- data/app/models/dhatu/project.rb +7 -3
- data/app/models/dhatu/promotion.rb +1 -0
- data/app/models/dhatu/section.rb +8 -12
- data/app/models/dhatu/service.rb +7 -3
- data/app/models/image/og_image.rb +3 -0
- data/app/uploaders/og_image_uploader.rb +15 -0
- data/app/views/dhatu/blog_posts/_form.html.erb +1 -1
- data/app/views/dhatu/blog_posts/_index.html.erb +1 -1
- data/app/views/dhatu/blog_posts/_row.html.erb +1 -1
- data/app/views/dhatu/blog_posts/_show.html.erb +1 -1
- data/app/views/dhatu/bookings/_index.html.erb +7 -8
- data/app/views/dhatu/bookings/_row.html.erb +11 -7
- data/app/views/dhatu/bookings/index.html.erb +20 -12
- data/app/views/dhatu/branches/_index.html.erb +8 -12
- data/app/views/dhatu/branches/_show.html.erb +75 -69
- data/app/views/dhatu/branches/index.html.erb +13 -8
- data/app/views/dhatu/categories/_category_types.html.erb +27 -0
- data/app/views/dhatu/categories/_form.html.erb +2 -2
- data/app/views/dhatu/categories/_index.html.erb +114 -89
- data/app/views/dhatu/categories/_index_list.html.erb +118 -0
- data/app/views/dhatu/categories/_row.html.erb +27 -31
- data/app/views/dhatu/categories/_row_list.html.erb +34 -0
- data/app/views/dhatu/categories/_show.html.erb +101 -74
- data/app/views/dhatu/categories/choose_category_type.html.erb +20 -0
- data/app/views/dhatu/categories/index.html.erb +1 -19
- data/app/views/dhatu/dashboard/_index.html.erb +53 -42
- data/app/views/dhatu/events/_index.html.erb +1 -1
- data/app/views/dhatu/events/_row.html.erb +1 -1
- data/app/views/dhatu/events/_show.html.erb +99 -75
- data/app/views/dhatu/events/index.html.erb +14 -9
- data/app/views/dhatu/meta_tags/_form.html.erb +48 -0
- data/app/views/dhatu/meta_tags/_index.html.erb +59 -0
- data/app/views/dhatu/meta_tags/_row.html.erb +32 -0
- data/app/views/dhatu/meta_tags/create.js.erb +29 -0
- data/app/views/dhatu/offers/_index.html.erb +8 -8
- data/app/views/dhatu/offers/_row.html.erb +1 -1
- data/app/views/dhatu/offers/_show.html.erb +85 -81
- data/app/views/dhatu/offers/index.html.erb +14 -8
- data/app/views/dhatu/pages/_form.html.erb +44 -0
- data/app/views/dhatu/pages/_index.html.erb +57 -0
- data/app/views/dhatu/pages/_row.html.erb +47 -0
- data/app/views/dhatu/pages/_show.html.erb +99 -0
- data/app/views/dhatu/pages/index.html.erb +59 -0
- data/app/views/dhatu/pages/show.html.erb +12 -0
- data/app/views/dhatu/prices/_index.html.erb +6 -6
- data/app/views/dhatu/prices/_row.html.erb +3 -2
- data/app/views/dhatu/prices/_show.html.erb +34 -45
- data/app/views/dhatu/prices/index.html.erb +14 -25
- data/app/views/dhatu/projects/_form.html.erb +15 -16
- data/app/views/dhatu/projects/_index.html.erb +6 -7
- data/app/views/dhatu/projects/_row.html.erb +4 -4
- data/app/views/dhatu/projects/_show.html.erb +108 -97
- data/app/views/dhatu/projects/index.html.erb +13 -19
- data/app/views/dhatu/projects/show.html.erb +12 -0
- data/app/views/dhatu/promotion_attributes/_index.html.erb +1 -7
- data/app/views/dhatu/promotion_attributes/_row.html.erb +1 -4
- data/app/views/dhatu/promotion_enquiries/_index.html.erb +11 -11
- data/app/views/dhatu/promotion_enquiries/_row.html.erb +7 -5
- data/app/views/dhatu/promotion_enquiries/_show.html.erb +35 -43
- data/app/views/dhatu/promotion_enquiries/index.html.erb +20 -12
- data/app/views/dhatu/promotions/_index.html.erb +13 -15
- data/app/views/dhatu/promotions/_row.html.erb +10 -9
- data/app/views/dhatu/promotions/_show.html.erb +190 -93
- data/app/views/dhatu/promotions/index.html.erb +0 -8
- data/app/views/dhatu/{section_types → section_types1}/_form.html.erb +0 -0
- data/app/views/dhatu/{section_types → section_types1}/_index.html.erb +0 -0
- data/app/views/dhatu/{section_types → section_types1}/_row.html.erb +0 -0
- data/app/views/dhatu/{section_types → section_types1}/_show.html.erb +0 -0
- data/app/views/dhatu/{section_types → section_types1}/index.html.erb +0 -0
- data/app/views/dhatu/sections/_form.html.erb +116 -11
- data/app/views/dhatu/sections/_index.html.erb +6 -3
- data/app/views/dhatu/sections/_row.html.erb +5 -2
- data/app/views/dhatu/sections/_show.html.erb +168 -132
- data/app/views/dhatu/sections/index.html.erb +10 -2
- data/app/views/dhatu/services/_form.html.erb +16 -17
- data/app/views/dhatu/services/_index.html.erb +6 -7
- data/app/views/dhatu/services/_row.html.erb +4 -4
- data/app/views/dhatu/services/_show.html.erb +107 -96
- data/app/views/dhatu/services/index.html.erb +13 -19
- data/app/views/dhatu/team_members/_index.html.erb +5 -6
- data/app/views/dhatu/team_members/_row.html.erb +3 -3
- data/app/views/dhatu/team_members/_show.html.erb +70 -58
- data/app/views/dhatu/team_members/index.html.erb +13 -8
- data/app/views/dhatu/testimonials/_index.html.erb +3 -6
- data/app/views/dhatu/testimonials/_row.html.erb +2 -3
- data/app/views/dhatu/testimonials/_show.html.erb +63 -93
- data/app/views/dhatu/testimonials/index.html.erb +13 -8
- data/app/views/layouts/kuppayam/_sidebar.html.erb +63 -48
- data/app/views/usman/dashboard/_super_admin_index.html.erb +22 -0
- data/config/routes.rb +12 -1
- data/db/data/dummy/services.csv +1 -1
- data/db/migrate/20180101093435_create_pages.rb +14 -0
- data/db/migrate/20180101093436_create_meta_tags.rb +19 -0
- data/db/migrate/20180101093437_add_page_id_to_sections.rb +5 -0
- data/db/migrate/20180101093438_add_priority_to_pages_and_sections.rb +6 -0
- data/db/migrate/20180101093439_add_a_ton_of_boolean_fields_to_sections.rb +34 -0
- data/db/migrate/20180101093440_add_code_to_sections.rb +19 -0
- data/db/migrate/20180101093441_rename_meta_description_all_over.rb +7 -0
- data/db/migrate/20180101093442_add_name_to_sections.rb +19 -0
- data/lib/dhatu/version.rb +1 -1
- metadata +43 -14
- data/db/migrate/20171203114529_add_meta_description_to_services.rb +0 -7
|
@@ -7,21 +7,39 @@ module Dhatu
|
|
|
7
7
|
params.require("dhatu/price").permit(:title, :sub_title, :price, :category_id, :priority)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
+
def load_nested_categories
|
|
11
|
+
# Checkout the method get_category_filters before using this method
|
|
12
|
+
category_ids = Dhatu::Price.distinct.pluck(:category_id)
|
|
13
|
+
@categories = Dhatu::Category.where(id: category_ids).to_a
|
|
14
|
+
@categories.unshift(Dhatu::Category.new(id: -1, name: "All"))
|
|
15
|
+
end
|
|
16
|
+
|
|
10
17
|
def get_collections
|
|
18
|
+
# Checkout the method get_category_filters before using this method
|
|
19
|
+
# load_nested_categories
|
|
20
|
+
|
|
11
21
|
get_category_filters("Dhatu::Price")
|
|
12
22
|
@relation = Dhatu::Price.where("")
|
|
23
|
+
|
|
13
24
|
parse_filters
|
|
14
25
|
apply_filters
|
|
26
|
+
|
|
15
27
|
@prices = @r_objects = @relation.page(@current_page).per(@per_page)
|
|
16
28
|
return true
|
|
17
29
|
end
|
|
18
30
|
|
|
19
31
|
def apply_filters
|
|
20
|
-
if @category
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
if @category.is_a?(String)
|
|
33
|
+
@category = Dhatu::Category.new(id: -2, name: "IS NOT SET")
|
|
34
|
+
elsif @category.blank?
|
|
35
|
+
@category = Dhatu::Category.new(id: -1, name: "All")
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
if @category
|
|
39
|
+
if @category.persisted?
|
|
24
40
|
@relation = @relation.where("category_id = ?", @category.id)
|
|
41
|
+
elsif @category.id == -2
|
|
42
|
+
@relation = @relation.where("category_id IS NULL")
|
|
25
43
|
end
|
|
26
44
|
end
|
|
27
45
|
|
|
@@ -39,7 +57,9 @@ module Dhatu
|
|
|
39
57
|
],
|
|
40
58
|
|
|
41
59
|
boolean_filters: [],
|
|
42
|
-
reference_filters: [
|
|
60
|
+
reference_filters: [
|
|
61
|
+
{ filter_name: :category, filter_class: Dhatu::Category },
|
|
62
|
+
],
|
|
43
63
|
variable_filters: [],
|
|
44
64
|
}
|
|
45
65
|
end
|
|
@@ -48,27 +68,73 @@ module Dhatu
|
|
|
48
68
|
@filter_ui_settings = {
|
|
49
69
|
status: {
|
|
50
70
|
object_filter: false,
|
|
51
|
-
select_label: "
|
|
52
|
-
display_hash: Dhatu::Price::
|
|
71
|
+
select_label: "Filter by Status",
|
|
72
|
+
display_hash: Dhatu::Price::STATUS_REVERSE,
|
|
53
73
|
current_value: @status,
|
|
54
|
-
values: Dhatu::Price::
|
|
74
|
+
values: Dhatu::Price::STATUS,
|
|
55
75
|
current_filters: @filters,
|
|
56
76
|
filters_to_remove: [],
|
|
57
77
|
filters_to_add: {},
|
|
58
78
|
url_method_name: 'prices_url',
|
|
59
79
|
show_all_filter_on_top: true
|
|
80
|
+
},
|
|
81
|
+
category: {
|
|
82
|
+
object_filter: true,
|
|
83
|
+
select_label: 'Select Category Type',
|
|
84
|
+
current_value: @category,
|
|
85
|
+
values: Dhatu::Category.filter_by_category_type("Dhatu::Price").published.order("priority ASC, name ASC").all,
|
|
86
|
+
current_filters: @filters,
|
|
87
|
+
url_method_name: 'prices_url',
|
|
88
|
+
filters_to_remove: [],
|
|
89
|
+
filters_to_add: {},
|
|
90
|
+
show_null_filter_on_top: true,
|
|
91
|
+
show_all_filter_on_top: true
|
|
60
92
|
}
|
|
61
93
|
}
|
|
62
94
|
end
|
|
63
95
|
|
|
64
96
|
def resource_controller_configuration
|
|
65
97
|
{
|
|
66
|
-
page_title: "Prices",
|
|
67
|
-
|
|
68
|
-
|
|
98
|
+
page_title: "Manage Prices",
|
|
99
|
+
current_nav: "dhatu/prices",
|
|
100
|
+
|
|
101
|
+
# Resource Names
|
|
102
|
+
class: Dhatu::Price,
|
|
69
103
|
collection_name: :prices,
|
|
70
104
|
item_name: :price,
|
|
71
|
-
|
|
105
|
+
|
|
106
|
+
# Conditions
|
|
107
|
+
get_collections_after_save_resource: false,
|
|
108
|
+
show_modal_after_create: true,
|
|
109
|
+
show_modal_after_update: true,
|
|
110
|
+
|
|
111
|
+
# Model Size can be large or generic
|
|
112
|
+
form_model_size: :generic,
|
|
113
|
+
show_model_size: :generic,
|
|
114
|
+
|
|
115
|
+
# Layout can be table or feed
|
|
116
|
+
# table uses html tables and feed uses div based boxes
|
|
117
|
+
layout: :table,
|
|
118
|
+
|
|
119
|
+
# "/kuppayam/workflows/default"
|
|
120
|
+
#
|
|
121
|
+
# Default partial opens show and form partial according to the model_size configuration
|
|
122
|
+
# It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
|
|
123
|
+
|
|
124
|
+
# "/kuppayam/workflows/peacock"
|
|
125
|
+
# "/kuppayam/workflows/parrot"
|
|
126
|
+
#
|
|
127
|
+
# Peacock & Parrot are old ways of doing things and it respects certail configurations
|
|
128
|
+
# Peacock opens show and form partials in large popup where as Parrot opens it in small
|
|
129
|
+
# Both Peacock and Parrot expect table based layout and will reload a single row after create / update
|
|
130
|
+
|
|
131
|
+
# Rendering Paths
|
|
132
|
+
view_path: "dhatu/prices",
|
|
133
|
+
js_view_path: "/kuppayam/workflows/default",
|
|
134
|
+
|
|
135
|
+
# Additional Configurations
|
|
136
|
+
load_wysihtml5: true,
|
|
137
|
+
tagsinput: false
|
|
72
138
|
}
|
|
73
139
|
end
|
|
74
140
|
|
|
@@ -4,17 +4,21 @@ module Dhatu
|
|
|
4
4
|
private
|
|
5
5
|
|
|
6
6
|
def permitted_params
|
|
7
|
-
params.require("dhatu/project").permit(:name, :
|
|
7
|
+
params.require("dhatu/project").permit(:name, :short_description, :permalink, :description, :client, :category_id, :priority)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def load_nested_categories
|
|
11
|
+
# Checkout the method get_category_filters before using this method
|
|
11
12
|
category_ids = Dhatu::Project.distinct.pluck(:category_id)
|
|
12
13
|
@categories = Dhatu::Category.where(id: category_ids).to_a
|
|
13
14
|
@categories.unshift(Dhatu::Category.new(id: -1, name: "All"))
|
|
15
|
+
end
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
#
|
|
17
|
-
|
|
17
|
+
def get_collections
|
|
18
|
+
# Checkout the method get_category_filters before using this method
|
|
19
|
+
# load_nested_categories
|
|
20
|
+
@relation = Dhatu::Project.includes(:cover_image, :category).where("")
|
|
21
|
+
|
|
18
22
|
parse_filters
|
|
19
23
|
apply_filters
|
|
20
24
|
|
|
@@ -23,10 +27,18 @@ module Dhatu
|
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
def apply_filters
|
|
26
|
-
@category
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
@
|
|
30
|
+
if @category.is_a?(String)
|
|
31
|
+
@category = Dhatu::Category.new(id: -2, name: "IS NOT SET")
|
|
32
|
+
elsif @category.blank?
|
|
33
|
+
@category = Dhatu::Category.new(id: -1, name: "All")
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
if @category
|
|
37
|
+
if @category.persisted?
|
|
38
|
+
@relation = @relation.where("category_id = ?", @category.id)
|
|
39
|
+
elsif @category.id == -2
|
|
40
|
+
@relation = @relation.where("category_id IS NULL")
|
|
41
|
+
end
|
|
30
42
|
end
|
|
31
43
|
|
|
32
44
|
@relation = @relation.search(@query) if @query
|
|
@@ -42,8 +54,9 @@ module Dhatu
|
|
|
42
54
|
],
|
|
43
55
|
|
|
44
56
|
boolean_filters: [],
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
reference_filters: [
|
|
58
|
+
{ filter_name: :category, filter_class: Dhatu::Category },
|
|
59
|
+
],
|
|
47
60
|
variable_filters: [],
|
|
48
61
|
}
|
|
49
62
|
end
|
|
@@ -52,27 +65,73 @@ module Dhatu
|
|
|
52
65
|
@filter_ui_settings = {
|
|
53
66
|
status: {
|
|
54
67
|
object_filter: false,
|
|
55
|
-
select_label: "
|
|
56
|
-
display_hash: Dhatu::Project::
|
|
68
|
+
select_label: "Filter by Status",
|
|
69
|
+
display_hash: Dhatu::Project::STATUS_REVERSE,
|
|
57
70
|
current_value: @status,
|
|
58
|
-
values: Dhatu::Project::
|
|
71
|
+
values: Dhatu::Project::STATUS,
|
|
59
72
|
current_filters: @filters,
|
|
60
73
|
filters_to_remove: [],
|
|
61
74
|
filters_to_add: {},
|
|
62
75
|
url_method_name: 'projects_url',
|
|
63
76
|
show_all_filter_on_top: true
|
|
77
|
+
},
|
|
78
|
+
category: {
|
|
79
|
+
object_filter: true,
|
|
80
|
+
select_label: 'Select Category Type',
|
|
81
|
+
current_value: @category,
|
|
82
|
+
values: Dhatu::Category.filter_by_category_type("Dhatu::Project").published.order("priority ASC, name ASC").all,
|
|
83
|
+
current_filters: @filters,
|
|
84
|
+
url_method_name: 'projects_url',
|
|
85
|
+
filters_to_remove: [],
|
|
86
|
+
filters_to_add: {},
|
|
87
|
+
show_null_filter_on_top: true,
|
|
88
|
+
show_all_filter_on_top: true
|
|
64
89
|
}
|
|
65
90
|
}
|
|
66
91
|
end
|
|
67
92
|
|
|
68
93
|
def resource_controller_configuration
|
|
69
94
|
{
|
|
70
|
-
page_title: "Projects",
|
|
71
|
-
|
|
72
|
-
|
|
95
|
+
page_title: "Manage Projects",
|
|
96
|
+
current_nav: "dhatu/projects",
|
|
97
|
+
|
|
98
|
+
# Resource Names
|
|
99
|
+
class: Dhatu::Project,
|
|
73
100
|
collection_name: :projects,
|
|
74
101
|
item_name: :project,
|
|
75
|
-
|
|
102
|
+
|
|
103
|
+
# Conditions
|
|
104
|
+
get_collections_after_save_resource: false,
|
|
105
|
+
show_modal_after_create: true,
|
|
106
|
+
show_modal_after_update: true,
|
|
107
|
+
|
|
108
|
+
# Model Size can be large or generic
|
|
109
|
+
form_model_size: :large,
|
|
110
|
+
show_model_size: :large,
|
|
111
|
+
|
|
112
|
+
# Layout can be table or feed
|
|
113
|
+
# table uses html tables and feed uses div based boxes
|
|
114
|
+
layout: :table,
|
|
115
|
+
|
|
116
|
+
# "/kuppayam/workflows/default"
|
|
117
|
+
#
|
|
118
|
+
# Default partial opens show and form partial according to the model_size configuration
|
|
119
|
+
# It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
|
|
120
|
+
|
|
121
|
+
# "/kuppayam/workflows/peacock"
|
|
122
|
+
# "/kuppayam/workflows/parrot"
|
|
123
|
+
#
|
|
124
|
+
# Peacock & Parrot are old ways of doing things and it respects certail configurations
|
|
125
|
+
# Peacock opens show and form partials in large popup where as Parrot opens it in small
|
|
126
|
+
# Both Peacock and Parrot expect table based layout and will reload a single row after create / update
|
|
127
|
+
|
|
128
|
+
# Rendering Paths
|
|
129
|
+
view_path: "dhatu/projects",
|
|
130
|
+
js_view_path: "/kuppayam/workflows/default",
|
|
131
|
+
|
|
132
|
+
# Additional Configurations
|
|
133
|
+
load_wysihtml5: true,
|
|
134
|
+
tagsinput: false
|
|
76
135
|
}
|
|
77
136
|
end
|
|
78
137
|
|
|
@@ -85,9 +144,6 @@ module Dhatu
|
|
|
85
144
|
{name: "Manage Projects", link: dhatu.projects_path, icon: 'fa-rocket', active: true}]
|
|
86
145
|
}
|
|
87
146
|
end
|
|
88
|
-
|
|
89
|
-
def set_navs
|
|
90
|
-
set_nav("project")
|
|
91
|
-
end
|
|
147
|
+
|
|
92
148
|
end
|
|
93
149
|
end
|
|
@@ -25,6 +25,9 @@ module Dhatu
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def apply_filters
|
|
28
|
+
if @promotion
|
|
29
|
+
@relation = @relation.where("promotion_id = ?", @promotion.id)
|
|
30
|
+
end
|
|
28
31
|
@relation = @relation.search(@query) if @query
|
|
29
32
|
@relation = @relation.status(@status) if @status
|
|
30
33
|
@relation = @relation.order("created_at DESC")
|
|
@@ -36,26 +39,85 @@ module Dhatu
|
|
|
36
39
|
{ filter_name: :query },
|
|
37
40
|
{ filter_name: :status }
|
|
38
41
|
],
|
|
39
|
-
|
|
40
42
|
boolean_filters: [],
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
reference_filters: [
|
|
44
|
+
{ filter_name: :promotion, filter_class: Dhatu::Promotion },
|
|
45
|
+
],
|
|
43
46
|
variable_filters: [],
|
|
44
47
|
}
|
|
45
48
|
end
|
|
46
49
|
|
|
47
50
|
def configure_filter_ui_settings
|
|
48
|
-
@filter_ui_settings = {
|
|
51
|
+
@filter_ui_settings = {
|
|
52
|
+
status: {
|
|
53
|
+
object_filter: false,
|
|
54
|
+
select_label: "Filter by Status",
|
|
55
|
+
display_hash: Dhatu::PromotionEnquiry::STATUS_REVERSE,
|
|
56
|
+
current_value: @status,
|
|
57
|
+
values: Dhatu::PromotionEnquiry::STATUS,
|
|
58
|
+
current_filters: @filters,
|
|
59
|
+
filters_to_remove: [],
|
|
60
|
+
filters_to_add: {},
|
|
61
|
+
url_method_name: 'promotion_enquiries_url',
|
|
62
|
+
show_all_filter_on_top: false
|
|
63
|
+
},
|
|
64
|
+
promotion: {
|
|
65
|
+
object_filter: true,
|
|
66
|
+
select_label: 'Filter by Promotion',
|
|
67
|
+
current_value: @promotion,
|
|
68
|
+
values: Dhatu::Promotion.order("priority ASC, title ASC").all,
|
|
69
|
+
current_filters: @filters,
|
|
70
|
+
url_method_name: 'promotion_enquiries_url',
|
|
71
|
+
filters_to_remove: [],
|
|
72
|
+
filters_to_add: {},
|
|
73
|
+
show_null_filter_on_top: false,
|
|
74
|
+
show_all_filter_on_top: true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
49
77
|
end
|
|
50
78
|
|
|
51
79
|
def resource_controller_configuration
|
|
52
80
|
{
|
|
53
81
|
page_title: "Promotional Enquiries",
|
|
54
|
-
|
|
55
|
-
|
|
82
|
+
current_nav: "dhatu/promotion_enquiries",
|
|
83
|
+
|
|
84
|
+
# Resource Names
|
|
85
|
+
class: Dhatu::PromotionEnquiry,
|
|
56
86
|
collection_name: :promotion_enquiries,
|
|
57
87
|
item_name: :promotion_enquiry,
|
|
58
|
-
|
|
88
|
+
|
|
89
|
+
# Conditions
|
|
90
|
+
get_collections_after_save_resource: false,
|
|
91
|
+
show_modal_after_create: false,
|
|
92
|
+
show_modal_after_update: false,
|
|
93
|
+
|
|
94
|
+
# Model Size can be large or generic
|
|
95
|
+
form_model_size: :generic,
|
|
96
|
+
show_model_size: :generic,
|
|
97
|
+
|
|
98
|
+
# Layout can be table or feed
|
|
99
|
+
# table uses html tables and feed uses div based boxes
|
|
100
|
+
layout: :table,
|
|
101
|
+
|
|
102
|
+
# "/kuppayam/workflows/default"
|
|
103
|
+
#
|
|
104
|
+
# Default partial opens show and form partial according to the model_size configuration
|
|
105
|
+
# It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
|
|
106
|
+
|
|
107
|
+
# "/kuppayam/workflows/peacock"
|
|
108
|
+
# "/kuppayam/workflows/parrot"
|
|
109
|
+
#
|
|
110
|
+
# Peacock & Parrot are old ways of doing things and it respects certail configurations
|
|
111
|
+
# Peacock opens show and form partials in large popup where as Parrot opens it in small
|
|
112
|
+
# Both Peacock and Parrot expect table based layout and will reload a single row after create / update
|
|
113
|
+
|
|
114
|
+
# Rendering Paths
|
|
115
|
+
view_path: "dhatu/promotion_enquiries",
|
|
116
|
+
js_view_path: "/kuppayam/workflows/default",
|
|
117
|
+
|
|
118
|
+
# Additional Configurations
|
|
119
|
+
load_wysihtml5: false,
|
|
120
|
+
tagsinput: false
|
|
59
121
|
}
|
|
60
122
|
end
|
|
61
123
|
|
|
@@ -45,7 +45,7 @@ module Dhatu
|
|
|
45
45
|
@filter_ui_settings = {
|
|
46
46
|
status: {
|
|
47
47
|
object_filter: false,
|
|
48
|
-
select_label: "
|
|
48
|
+
select_label: "Filter by Status",
|
|
49
49
|
display_hash: Dhatu::Promotion::STATUS,
|
|
50
50
|
current_value: @status,
|
|
51
51
|
values: Dhatu::Promotion::STATUS_REVERSE,
|
|
@@ -65,9 +65,53 @@ module Dhatu
|
|
|
65
65
|
view_path: "dhatu/promotions",
|
|
66
66
|
collection_name: :promotions,
|
|
67
67
|
item_name: :promotion,
|
|
68
|
-
checkbox_fields: [:name_mandatory, :email_mandatory, :phone_mandatory, :show_popup, :show_only_on_homepage],
|
|
69
68
|
class: Dhatu::Promotion,
|
|
70
69
|
}
|
|
70
|
+
{
|
|
71
|
+
page_title: "Manage Promotions",
|
|
72
|
+
current_nav: "dhatu/promotions",
|
|
73
|
+
|
|
74
|
+
# Resource Names
|
|
75
|
+
class: Dhatu::Promotion,
|
|
76
|
+
collection_name: :promotions,
|
|
77
|
+
item_name: :promotion,
|
|
78
|
+
|
|
79
|
+
# Conditions
|
|
80
|
+
get_collections_after_save_resource: false,
|
|
81
|
+
show_modal_after_create: true,
|
|
82
|
+
show_modal_after_update: true,
|
|
83
|
+
|
|
84
|
+
# Model Size can be large or generic
|
|
85
|
+
form_model_size: :large,
|
|
86
|
+
show_model_size: :large,
|
|
87
|
+
|
|
88
|
+
# Layout can be table or feed
|
|
89
|
+
# table uses html tables and feed uses div based boxes
|
|
90
|
+
layout: :table,
|
|
91
|
+
|
|
92
|
+
# "/kuppayam/workflows/default"
|
|
93
|
+
#
|
|
94
|
+
# Default partial opens show and form partial according to the model_size configuration
|
|
95
|
+
# It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
|
|
96
|
+
|
|
97
|
+
# "/kuppayam/workflows/peacock"
|
|
98
|
+
# "/kuppayam/workflows/parrot"
|
|
99
|
+
#
|
|
100
|
+
# Peacock & Parrot are old ways of doing things and it respects certail configurations
|
|
101
|
+
# Peacock opens show and form partials in large popup where as Parrot opens it in small
|
|
102
|
+
# Both Peacock and Parrot expect table based layout and will reload a single row after create / update
|
|
103
|
+
|
|
104
|
+
#
|
|
105
|
+
checkbox_fields: [:name_mandatory, :email_mandatory, :phone_mandatory, :show_popup, :show_only_on_homepage],
|
|
106
|
+
|
|
107
|
+
# Rendering Paths
|
|
108
|
+
view_path: "dhatu/promotions",
|
|
109
|
+
js_view_path: "/kuppayam/workflows/default",
|
|
110
|
+
|
|
111
|
+
# Additional Configurations
|
|
112
|
+
load_wysihtml5: true,
|
|
113
|
+
tagsinput: false
|
|
114
|
+
}
|
|
71
115
|
end
|
|
72
116
|
|
|
73
117
|
def breadcrumbs_configuration
|