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.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/dhatu/blog_posts_controller.rb +81 -14
  3. data/app/controllers/dhatu/bookings_controller.rb +51 -5
  4. data/app/controllers/dhatu/branches_controller.rb +42 -8
  5. data/app/controllers/dhatu/categories_controller.rb +86 -47
  6. data/app/controllers/dhatu/events_controller.rb +79 -9
  7. data/app/controllers/dhatu/meta_tags_controller.rb +96 -0
  8. data/app/controllers/dhatu/offers_controller.rb +83 -10
  9. data/app/controllers/dhatu/pages_controller.rb +130 -0
  10. data/app/controllers/dhatu/prices_controller.rb +78 -12
  11. data/app/controllers/dhatu/projects_controller.rb +78 -22
  12. data/app/controllers/dhatu/promotion_enquiries_controller.rb +69 -7
  13. data/app/controllers/dhatu/promotions_controller.rb +46 -2
  14. data/app/controllers/dhatu/resource_controller.rb +4 -0
  15. data/app/controllers/dhatu/sections_controller.rb +41 -8
  16. data/app/controllers/dhatu/services_controller.rb +78 -18
  17. data/app/controllers/dhatu/team_members_controller.rb +41 -8
  18. data/app/controllers/dhatu/testimonials_controller.rb +41 -9
  19. data/app/models/dhatu/blog_post.rb +6 -2
  20. data/app/models/dhatu/category.rb +3 -3
  21. data/app/models/dhatu/event.rb +4 -0
  22. data/app/models/dhatu/meta_tag.rb +48 -0
  23. data/app/models/dhatu/offer.rb +4 -0
  24. data/app/models/dhatu/page.rb +50 -0
  25. data/app/models/dhatu/project.rb +7 -3
  26. data/app/models/dhatu/promotion.rb +1 -0
  27. data/app/models/dhatu/section.rb +8 -12
  28. data/app/models/dhatu/service.rb +7 -3
  29. data/app/models/image/og_image.rb +3 -0
  30. data/app/uploaders/og_image_uploader.rb +15 -0
  31. data/app/views/dhatu/blog_posts/_form.html.erb +1 -1
  32. data/app/views/dhatu/blog_posts/_index.html.erb +1 -1
  33. data/app/views/dhatu/blog_posts/_row.html.erb +1 -1
  34. data/app/views/dhatu/blog_posts/_show.html.erb +1 -1
  35. data/app/views/dhatu/bookings/_index.html.erb +7 -8
  36. data/app/views/dhatu/bookings/_row.html.erb +11 -7
  37. data/app/views/dhatu/bookings/index.html.erb +20 -12
  38. data/app/views/dhatu/branches/_index.html.erb +8 -12
  39. data/app/views/dhatu/branches/_show.html.erb +75 -69
  40. data/app/views/dhatu/branches/index.html.erb +13 -8
  41. data/app/views/dhatu/categories/_category_types.html.erb +27 -0
  42. data/app/views/dhatu/categories/_form.html.erb +2 -2
  43. data/app/views/dhatu/categories/_index.html.erb +114 -89
  44. data/app/views/dhatu/categories/_index_list.html.erb +118 -0
  45. data/app/views/dhatu/categories/_row.html.erb +27 -31
  46. data/app/views/dhatu/categories/_row_list.html.erb +34 -0
  47. data/app/views/dhatu/categories/_show.html.erb +101 -74
  48. data/app/views/dhatu/categories/choose_category_type.html.erb +20 -0
  49. data/app/views/dhatu/categories/index.html.erb +1 -19
  50. data/app/views/dhatu/dashboard/_index.html.erb +53 -42
  51. data/app/views/dhatu/events/_index.html.erb +1 -1
  52. data/app/views/dhatu/events/_row.html.erb +1 -1
  53. data/app/views/dhatu/events/_show.html.erb +99 -75
  54. data/app/views/dhatu/events/index.html.erb +14 -9
  55. data/app/views/dhatu/meta_tags/_form.html.erb +48 -0
  56. data/app/views/dhatu/meta_tags/_index.html.erb +59 -0
  57. data/app/views/dhatu/meta_tags/_row.html.erb +32 -0
  58. data/app/views/dhatu/meta_tags/create.js.erb +29 -0
  59. data/app/views/dhatu/offers/_index.html.erb +8 -8
  60. data/app/views/dhatu/offers/_row.html.erb +1 -1
  61. data/app/views/dhatu/offers/_show.html.erb +85 -81
  62. data/app/views/dhatu/offers/index.html.erb +14 -8
  63. data/app/views/dhatu/pages/_form.html.erb +44 -0
  64. data/app/views/dhatu/pages/_index.html.erb +57 -0
  65. data/app/views/dhatu/pages/_row.html.erb +47 -0
  66. data/app/views/dhatu/pages/_show.html.erb +99 -0
  67. data/app/views/dhatu/pages/index.html.erb +59 -0
  68. data/app/views/dhatu/pages/show.html.erb +12 -0
  69. data/app/views/dhatu/prices/_index.html.erb +6 -6
  70. data/app/views/dhatu/prices/_row.html.erb +3 -2
  71. data/app/views/dhatu/prices/_show.html.erb +34 -45
  72. data/app/views/dhatu/prices/index.html.erb +14 -25
  73. data/app/views/dhatu/projects/_form.html.erb +15 -16
  74. data/app/views/dhatu/projects/_index.html.erb +6 -7
  75. data/app/views/dhatu/projects/_row.html.erb +4 -4
  76. data/app/views/dhatu/projects/_show.html.erb +108 -97
  77. data/app/views/dhatu/projects/index.html.erb +13 -19
  78. data/app/views/dhatu/projects/show.html.erb +12 -0
  79. data/app/views/dhatu/promotion_attributes/_index.html.erb +1 -7
  80. data/app/views/dhatu/promotion_attributes/_row.html.erb +1 -4
  81. data/app/views/dhatu/promotion_enquiries/_index.html.erb +11 -11
  82. data/app/views/dhatu/promotion_enquiries/_row.html.erb +7 -5
  83. data/app/views/dhatu/promotion_enquiries/_show.html.erb +35 -43
  84. data/app/views/dhatu/promotion_enquiries/index.html.erb +20 -12
  85. data/app/views/dhatu/promotions/_index.html.erb +13 -15
  86. data/app/views/dhatu/promotions/_row.html.erb +10 -9
  87. data/app/views/dhatu/promotions/_show.html.erb +190 -93
  88. data/app/views/dhatu/promotions/index.html.erb +0 -8
  89. data/app/views/dhatu/{section_types → section_types1}/_form.html.erb +0 -0
  90. data/app/views/dhatu/{section_types → section_types1}/_index.html.erb +0 -0
  91. data/app/views/dhatu/{section_types → section_types1}/_row.html.erb +0 -0
  92. data/app/views/dhatu/{section_types → section_types1}/_show.html.erb +0 -0
  93. data/app/views/dhatu/{section_types → section_types1}/index.html.erb +0 -0
  94. data/app/views/dhatu/sections/_form.html.erb +116 -11
  95. data/app/views/dhatu/sections/_index.html.erb +6 -3
  96. data/app/views/dhatu/sections/_row.html.erb +5 -2
  97. data/app/views/dhatu/sections/_show.html.erb +168 -132
  98. data/app/views/dhatu/sections/index.html.erb +10 -2
  99. data/app/views/dhatu/services/_form.html.erb +16 -17
  100. data/app/views/dhatu/services/_index.html.erb +6 -7
  101. data/app/views/dhatu/services/_row.html.erb +4 -4
  102. data/app/views/dhatu/services/_show.html.erb +107 -96
  103. data/app/views/dhatu/services/index.html.erb +13 -19
  104. data/app/views/dhatu/team_members/_index.html.erb +5 -6
  105. data/app/views/dhatu/team_members/_row.html.erb +3 -3
  106. data/app/views/dhatu/team_members/_show.html.erb +70 -58
  107. data/app/views/dhatu/team_members/index.html.erb +13 -8
  108. data/app/views/dhatu/testimonials/_index.html.erb +3 -6
  109. data/app/views/dhatu/testimonials/_row.html.erb +2 -3
  110. data/app/views/dhatu/testimonials/_show.html.erb +63 -93
  111. data/app/views/dhatu/testimonials/index.html.erb +13 -8
  112. data/app/views/layouts/kuppayam/_sidebar.html.erb +63 -48
  113. data/app/views/usman/dashboard/_super_admin_index.html.erb +22 -0
  114. data/config/routes.rb +12 -1
  115. data/db/data/dummy/services.csv +1 -1
  116. data/db/migrate/20180101093435_create_pages.rb +14 -0
  117. data/db/migrate/20180101093436_create_meta_tags.rb +19 -0
  118. data/db/migrate/20180101093437_add_page_id_to_sections.rb +5 -0
  119. data/db/migrate/20180101093438_add_priority_to_pages_and_sections.rb +6 -0
  120. data/db/migrate/20180101093439_add_a_ton_of_boolean_fields_to_sections.rb +34 -0
  121. data/db/migrate/20180101093440_add_code_to_sections.rb +19 -0
  122. data/db/migrate/20180101093441_rename_meta_description_all_over.rb +7 -0
  123. data/db/migrate/20180101093442_add_name_to_sections.rb +19 -0
  124. data/lib/dhatu/version.rb +1 -1
  125. metadata +43 -14
  126. data/db/migrate/20171203114529_add_meta_description_to_services.rb +0 -7
@@ -7,9 +7,17 @@ module Dhatu
7
7
  params.require("dhatu/event").permit(:title, :venue, :description, :date, :starts_at, :ends_at, :priority, :category_id)
8
8
  end
9
9
 
10
+ def load_nested_categories
11
+ category_ids = Dhatu::Event.distinct.pluck(:category_id)
12
+ @categories = Dhatu::Category.where(id: category_ids).to_a
13
+ @categories.unshift(Dhatu::Category.new(id: -1, name: "All"))
14
+ end
15
+
10
16
  def get_collections
17
+ # Checkout the method get_category_filters before using this method
18
+ # load_nested_categories
19
+
11
20
  @relation = Dhatu::Event.includes(:cover_image).where("")
12
- params[:st] = "published" if params[:st].nil?
13
21
  parse_filters
14
22
  apply_filters
15
23
  @events = @r_objects = @relation.page(@current_page).per(@per_page)
@@ -17,6 +25,20 @@ module Dhatu
17
25
  end
18
26
 
19
27
  def apply_filters
28
+ if @category.is_a?(String)
29
+ @category = Dhatu::Category.new(id: -2, name: "IS NOT SET")
30
+ elsif @category.blank?
31
+ @category = Dhatu::Category.new(id: -1, name: "All")
32
+ end
33
+
34
+ if @category
35
+ if @category.persisted?
36
+ @relation = @relation.where("category_id = ?", @category.id)
37
+ elsif @category.id == -2
38
+ @relation = @relation.where("category_id IS NULL")
39
+ end
40
+ end
41
+
20
42
  @relation = @relation.search(@query) if @query
21
43
  @relation = @relation.status(@status) if @status
22
44
  @relation = @relation.order("priority ASC, title ASC")
@@ -31,7 +53,9 @@ module Dhatu
31
53
 
32
54
  boolean_filters: [],
33
55
 
34
- reference_filters: [],
56
+ reference_filters: [
57
+ # { filter_name: :category, filter_class: Dhatu::Category },
58
+ ],
35
59
  variable_filters: [],
36
60
  }
37
61
  end
@@ -40,27 +64,73 @@ module Dhatu
40
64
  @filter_ui_settings = {
41
65
  status: {
42
66
  object_filter: false,
43
- select_label: "Select Status",
44
- display_hash: Dhatu::Event::STATUS,
67
+ select_label: "Filter by Status",
68
+ display_hash: Dhatu::Event::STATUS_REVERSE,
45
69
  current_value: @status,
46
- values: Dhatu::Event::STATUS_REVERSE,
70
+ values: Dhatu::Event::STATUS,
47
71
  current_filters: @filters,
48
72
  filters_to_remove: [],
49
73
  filters_to_add: {},
50
74
  url_method_name: 'events_url',
51
75
  show_all_filter_on_top: true
52
76
  }
77
+ # category: {
78
+ # object_filter: true,
79
+ # select_label: 'Select Category Type',
80
+ # current_value: @category,
81
+ # values: Dhatu::Category.filter_by_category_type("Dhatu::Event").published.order("priority ASC, name ASC").all,
82
+ # current_filters: @filters,
83
+ # url_method_name: 'events_url',
84
+ # filters_to_remove: [],
85
+ # filters_to_add: {},
86
+ # show_null_filter_on_top: true,
87
+ # show_all_filter_on_top: true
88
+ # }
53
89
  }
54
90
  end
55
91
 
56
92
  def resource_controller_configuration
57
93
  {
58
- page_title: "Events",
59
- js_view_path: "/kuppayam/workflows/peacock",
60
- view_path: "dhatu/events",
94
+ page_title: "Manage Events",
95
+ current_nav: "dhatu/events",
96
+
97
+ # Resource Names
98
+ class: Dhatu::Event,
61
99
  collection_name: :events,
62
100
  item_name: :event,
63
- class: Dhatu::Event
101
+
102
+ # Conditions
103
+ get_collections_after_save_resource: false,
104
+ show_modal_after_create: true,
105
+ show_modal_after_update: true,
106
+
107
+ # Model Size can be large or generic
108
+ form_model_size: :large,
109
+ show_model_size: :large,
110
+
111
+ # Layout can be table or feed
112
+ # table uses html tables and feed uses div based boxes
113
+ layout: :table,
114
+
115
+ # "/kuppayam/workflows/default"
116
+ #
117
+ # Default partial opens show and form partial according to the model_size configuration
118
+ # It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
119
+
120
+ # "/kuppayam/workflows/peacock"
121
+ # "/kuppayam/workflows/parrot"
122
+ #
123
+ # Peacock & Parrot are old ways of doing things and it respects certail configurations
124
+ # Peacock opens show and form partials in large popup where as Parrot opens it in small
125
+ # Both Peacock and Parrot expect table based layout and will reload a single row after create / update
126
+
127
+ # Rendering Paths
128
+ view_path: "dhatu/events",
129
+ js_view_path: "/kuppayam/workflows/default",
130
+
131
+ # Additional Configurations
132
+ load_wysihtml5: true,
133
+ tagsinput: false
64
134
  }
65
135
  end
66
136
 
@@ -0,0 +1,96 @@
1
+ module Dhatu
2
+ class MetaTagsController < ResourceController
3
+
4
+ before_action :require_site_admin
5
+ before_action :initialize_row_partial_locals, :get_meta_taggable
6
+
7
+ def create
8
+ @meta_tag = @r_object = Dhatu::MetaTag.new
9
+ @meta_tag.assign_attributes(permitted_params)
10
+ @meta_tag.meta_taggable = @meta_taggable
11
+ save_resource
12
+ end
13
+
14
+ private
15
+
16
+ def initialize_row_partial_locals
17
+ @row_partial_locals = {}
18
+ end
19
+
20
+ def get_meta_taggable
21
+ if params[:meta_taggable_type] && params[:meta_taggable_id]
22
+ @meta_taggable = params[:meta_taggable_type].constantize.find_by_id(params[:meta_taggable_id])
23
+ @row_partial_locals[:meta_taggable] = @meta_taggable
24
+ end
25
+ end
26
+
27
+ def get_collections
28
+ @relation = @meta_taggable.meta_tags.where("")
29
+
30
+ parse_filters
31
+ apply_filters
32
+
33
+ @meta_tags = @r_objects = @relation.page(@current_page).per(@per_page)
34
+ @row_partial_locals[:meta_tags] = @meta_tags
35
+
36
+ return true
37
+ end
38
+
39
+ def apply_filters
40
+ @relation = @relation.search(@query) if @query
41
+
42
+ @order_by = "meta_key ASC" unless @order_by
43
+ @relation = @relation.order(@order_by)
44
+ end
45
+
46
+ def configure_filter_settings
47
+ @filter_settings = {
48
+ string_filters: [
49
+ { filter_name: :query }
50
+ ],
51
+ boolean_filters: [],
52
+ reference_filters: [],
53
+ variable_filters: [],
54
+ }
55
+ end
56
+
57
+ def configure_filter_ui_settings
58
+ @filter_ui_settings = {}
59
+ end
60
+
61
+ def resource_url(obj)
62
+ url_for(obj)
63
+ end
64
+
65
+ def resource_controller_configuration
66
+ {
67
+ collection_name: :meta_tags,
68
+ item_name: :meta_tag,
69
+ class: Dhatu::MetaTag,
70
+ feature_class: Dhatu::Page,
71
+ show_modal_after_create: false,
72
+ show_modal_after_update: false,
73
+ page_title: "Manage Meta Tags",
74
+ js_view_path: "/kuppayam/workflows/parrot",
75
+ view_path: "/dhatu/meta_tags"
76
+ }
77
+ end
78
+
79
+ def breadcrumbs_configuration
80
+ {
81
+ heading: "Manage Meta Tags",
82
+ description: "Listing Meta Tags for the Page",
83
+ links: [{name: "Home", link: breadcrumb_home_path, icon: 'fa-home'}]
84
+ }
85
+ end
86
+
87
+ def permitted_params
88
+ params.require("dhatu/meta_tag").permit(:meta_type, :meta_key, :meta_value)
89
+ end
90
+
91
+ def set_navs
92
+ set_nav("admin/meta_tags")
93
+ end
94
+
95
+ end
96
+ end
@@ -7,16 +7,41 @@ module Dhatu
7
7
  params.require("dhatu/offer").permit(:title, :offer_text, :description, :starts_at, :ends_at, :priority, :category_id)
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::Offer.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
11
- @relation = Dhatu::Offer.includes(:cover_image).where("")
12
- params[:st] = "published" if params[:st].nil?
18
+ # Checkout the method get_category_filters before using this method
19
+ # load_nested_categories
20
+
21
+ @relation = Dhatu::Offer.includes(:cover_image, :category).where("")
22
+
13
23
  parse_filters
14
24
  apply_filters
25
+
15
26
  @offers = @r_objects = @relation.page(@current_page).per(@per_page)
16
27
  return true
17
28
  end
18
29
 
19
30
  def apply_filters
31
+ if @category.is_a?(String)
32
+ @category = Dhatu::Category.new(id: -2, name: "IS NOT SET")
33
+ elsif @category.blank?
34
+ @category = Dhatu::Category.new(id: -1, name: "All")
35
+ end
36
+
37
+ if @category
38
+ if @category.persisted?
39
+ @relation = @relation.where("category_id = ?", @category.id)
40
+ elsif @category.id == -2
41
+ @relation = @relation.where("category_id IS NULL")
42
+ end
43
+ end
44
+
20
45
  @relation = @relation.search(@query) if @query
21
46
  @relation = @relation.status(@status) if @status
22
47
  @relation = @relation.order("priority ASC, title ASC")
@@ -31,7 +56,9 @@ module Dhatu
31
56
 
32
57
  boolean_filters: [],
33
58
 
34
- reference_filters: [],
59
+ reference_filters: [
60
+ # { filter_name: :category, filter_class: Dhatu::Category },
61
+ ],
35
62
  variable_filters: [],
36
63
  }
37
64
  end
@@ -40,27 +67,73 @@ module Dhatu
40
67
  @filter_ui_settings = {
41
68
  status: {
42
69
  object_filter: false,
43
- select_label: "Select Status",
44
- display_hash: Dhatu::Offer::STATUS,
70
+ select_label: "Filter by Status",
71
+ display_hash: Dhatu::Offer::STATUS_REVERSE,
45
72
  current_value: @status,
46
- values: Dhatu::Offer::STATUS_REVERSE,
73
+ values: Dhatu::Offer::STATUS,
47
74
  current_filters: @filters,
48
75
  filters_to_remove: [],
49
76
  filters_to_add: {},
50
77
  url_method_name: 'offers_url',
51
78
  show_all_filter_on_top: true
52
79
  }
80
+ # category: {
81
+ # object_filter: true,
82
+ # select_label: 'Select Category Type',
83
+ # current_value: @category,
84
+ # values: [], #Dhatu::Category.filter_by_category_type("Dhatu::Offer").published.order("priority ASC, name ASC").all,
85
+ # current_filters: @filters,
86
+ # url_method_name: 'offers_url',
87
+ # filters_to_remove: [],
88
+ # filters_to_add: {},
89
+ # show_null_filter_on_top: true,
90
+ # show_all_filter_on_top: true
91
+ # }
53
92
  }
54
93
  end
55
94
 
56
95
  def resource_controller_configuration
57
96
  {
58
- page_title: "Offers",
59
- js_view_path: "/kuppayam/workflows/peacock",
60
- view_path: "dhatu/offers",
97
+ page_title: "Manage Offers",
98
+ current_nav: "dhatu/offers",
99
+
100
+ # Resource Names
101
+ class: Dhatu::Offer,
61
102
  collection_name: :offers,
62
103
  item_name: :offer,
63
- class: Dhatu::Offer
104
+
105
+ # Conditions
106
+ get_collections_after_save_resource: false,
107
+ show_modal_after_create: true,
108
+ show_modal_after_update: true,
109
+
110
+ # Model Size can be large or generic
111
+ form_model_size: :large,
112
+ show_model_size: :large,
113
+
114
+ # Layout can be table or feed
115
+ # table uses html tables and feed uses div based boxes
116
+ layout: :table,
117
+
118
+ # "/kuppayam/workflows/default"
119
+ #
120
+ # Default partial opens show and form partial according to the model_size configuration
121
+ # It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
122
+
123
+ # "/kuppayam/workflows/peacock"
124
+ # "/kuppayam/workflows/parrot"
125
+ #
126
+ # Peacock & Parrot are old ways of doing things and it respects certail configurations
127
+ # Peacock opens show and form partials in large popup where as Parrot opens it in small
128
+ # Both Peacock and Parrot expect table based layout and will reload a single row after create / update
129
+
130
+ # Rendering Paths
131
+ view_path: "dhatu/offers",
132
+ js_view_path: "/kuppayam/workflows/default",
133
+
134
+ # Additional Configurations
135
+ load_wysihtml5: true,
136
+ tagsinput: false
64
137
  }
65
138
  end
66
139
 
@@ -0,0 +1,130 @@
1
+ module Dhatu
2
+ class PagesController < ResourceController
3
+
4
+ def new
5
+ @r_object = @page = Dhatu::Page.new
6
+ render_accordingly
7
+ end
8
+
9
+ private
10
+
11
+ def permitted_params
12
+ params.require("dhatu/page").permit(:name, :code, :feature_id, :priority)
13
+ end
14
+
15
+ def get_collections
16
+ @relation = Dhatu::Page.includes(:og_image).where("")
17
+ parse_filters
18
+ apply_filters
19
+ @pages = @r_objects = @relation.page(@current_page).per(@per_page)
20
+ return true
21
+ end
22
+
23
+ def apply_filters
24
+ @relation = @relation.search(@query) if @query
25
+ @relation = @relation.status(@status) if @status
26
+ @relation = @relation.where("feature_id = ?", @feature.id) if @feature
27
+ @order_by = "priority ASC, created_at desc" unless @order_by
28
+ @relation = @relation.order(@order_by)
29
+ end
30
+
31
+ def configure_filter_settings
32
+ @filter_settings = {
33
+ string_filters: [
34
+ { filter_name: :query },
35
+ { filter_name: :status }
36
+ ],
37
+ boolean_filters: [],
38
+ reference_filters: [
39
+ { filter_name: :feature, filter_class: Feature },
40
+ ],
41
+ variable_filters: [],
42
+ }
43
+ end
44
+
45
+ def configure_filter_ui_settings
46
+ @filter_ui_settings = {
47
+ status: {
48
+ object_filter: false,
49
+ select_label: "Filter by Status",
50
+ display_hash: Dhatu::Page::STATUS,
51
+ current_value: @status,
52
+ values: Dhatu::Page::STATUS_REVERSE,
53
+ current_filters: @filters,
54
+ filters_to_remove: [],
55
+ filters_to_add: {},
56
+ url_method_name: 'pages_url',
57
+ show_all_filter_on_top: true
58
+ },
59
+ feature: {
60
+ object_filter: true,
61
+ select_label: 'Select Feature',
62
+ current_value: @feature,
63
+ values: Feature.published.order(:name).all,
64
+ current_filters: @filters,
65
+ url_method_name: 'permissions_url',
66
+ filters_to_remove: [:feature],
67
+ filters_to_add: { user: @user.try(:id) },
68
+ show_null_filter_on_top: false,
69
+ show_all_filter_on_top: true
70
+ }
71
+ }
72
+ end
73
+
74
+ def resource_controller_configuration
75
+ {
76
+ page_title: "Manage Pages",
77
+ current_nav: "dhatu/pages",
78
+
79
+ # Resource Names
80
+ class: Dhatu::Page,
81
+ collection_name: :pages,
82
+ item_name: :page,
83
+
84
+ # Conditions
85
+ get_collections_after_save_resource: false,
86
+ show_modal_after_create: false,
87
+ show_modal_after_update: false,
88
+
89
+ # Model Size can be large or generic
90
+ form_model_size: :generic,
91
+ show_model_size: :large,
92
+
93
+ # Layout can be table or feed
94
+ # table uses html tables and feed uses div based boxes
95
+ layout: :feed,
96
+
97
+ # "/kuppayam/workflows/default"
98
+ #
99
+ # Default partial opens show and form partial according to the model_size configuration
100
+ # It also respect the configuration layout and refresh the page element on both cases - i.e layout is table or feed
101
+
102
+ # "/kuppayam/workflows/peacock"
103
+ # "/kuppayam/workflows/parrot"
104
+ #
105
+ # Peacock & Parrot are old ways of doing things and it respects certail configurations
106
+ # Peacock opens show and form partials in large popup where as Parrot opens it in small
107
+ # Both Peacock and Parrot expect table based layout and will reload a single row after create / update
108
+
109
+ # Rendering Paths
110
+ view_path: "dhatu/pages",
111
+ js_view_path: "/kuppayam/workflows/default",
112
+
113
+ # Additional Configurations
114
+ load_wysihtml5: false,
115
+ tagsinput: false
116
+ }
117
+ end
118
+
119
+ def breadcrumbs_configuration
120
+ {
121
+ heading: "Manage Pages",
122
+ icon: "fa-file",
123
+ description: "Listing all Pages",
124
+ links: [{name: "Dashboard", link: breadcrumb_home_path, icon: 'fa-dashboard'},
125
+ {name: "Manage Pages", link: dhatu.pages_path, icon: 'fa-file', active: true}]
126
+ }
127
+ end
128
+
129
+ end
130
+ end