dhatu 0.1.16 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/dhatu/categories_controller.rb +3 -1
  3. data/app/models/dhatu/blog_post.rb +43 -0
  4. data/app/models/dhatu/booking.rb +1 -1
  5. data/app/models/dhatu/branch.rb +48 -1
  6. data/app/models/dhatu/category.rb +1 -1
  7. data/app/models/dhatu/offer.rb +1 -1
  8. data/app/models/dhatu/price.rb +1 -1
  9. data/app/models/dhatu/promotion.rb +64 -2
  10. data/app/models/dhatu/promotion_attribute.rb +1 -1
  11. data/app/models/dhatu/promotion_enquiry.rb +1 -1
  12. data/app/models/dhatu/section.rb +25 -18
  13. data/app/models/dhatu/section_type.rb +1 -1
  14. data/app/models/dhatu/service.rb +1 -1
  15. data/app/models/dhatu/team_member.rb +1 -1
  16. data/app/models/dhatu/testimonial.rb +1 -1
  17. data/app/views/dhatu/categories/index.html.erb +5 -0
  18. data/app/views/dhatu/offers/_index.html.erb +47 -49
  19. data/app/views/dhatu/offers/_row.html.erb +3 -3
  20. data/app/views/dhatu/offers/_show.html.erb +7 -7
  21. data/app/views/dhatu/offers/index.html.erb +2 -2
  22. data/app/views/dhatu/promotions/_index.html.erb +47 -49
  23. data/app/views/dhatu/promotions/_row.html.erb +3 -3
  24. data/app/views/dhatu/promotions/index.html.erb +2 -2
  25. data/app/views/dhatu/sections/_row.html.erb +1 -2
  26. data/app/views/layouts/kuppayam/_sidebar.html.erb +1 -1
  27. data/db/data/dummy/categories.csv +28 -0
  28. data/db/data/dummy/events.csv +10 -0
  29. data/db/data/dummy/offers.csv +1 -0
  30. data/db/data/dummy/prices.csv +91 -0
  31. data/db/data/dummy/promotions.csv +7 -0
  32. data/db/data/dummy/section_types.csv +15 -0
  33. data/db/data/dummy/sections.csv +15 -0
  34. data/db/data/dummy/services.csv +117 -0
  35. data/db/data/dummy/team_members.csv +2 -0
  36. data/db/data/dummy/testimonials.csv +1 -0
  37. data/db/data/permissions.csv +34 -0
  38. data/db/data/users.csv +8 -0
  39. data/db/master_data/features.csv +25 -16
  40. data/db/master_data/roles.csv +3 -0
  41. data/db/migrate/20160803045832_create_events.rb +21 -0
  42. data/db/migrate/20160803045832_create_offers.rb +20 -0
  43. data/db/migrate/20171010055102_create_sections.rb +21 -0
  44. data/db/migrate/20171012073510_create_testimonials.rb +17 -0
  45. data/db/migrate/20171012103805_create_team_members.rb +20 -0
  46. data/db/migrate/20171012103806_create_blog_posts.rb +23 -0
  47. data/db/migrate/20171014125053_create_branches.rb +37 -0
  48. data/db/migrate/20171014125054_create_categories.rb +23 -0
  49. data/db/migrate/20171014125055_create_services.rb +24 -0
  50. data/db/migrate/20171104163658_add_category_id_to_blog_posts.rb +5 -0
  51. data/db/migrate/20171104163659_add_priority_to_tables.rb +8 -0
  52. data/db/migrate/20171104163660_create_prices.rb +17 -0
  53. data/db/migrate/20171104163661_create_bookings.rb +22 -0
  54. data/db/migrate/20171104163662_add_category_id_to_tables.rb +7 -0
  55. data/db/migrate/20171120145545_remove_categories_from_section.rb +5 -0
  56. data/db/migrate/20171120145546_create_section_types.rb +9 -0
  57. data/db/migrate/20171120145547_add_section_type_id_to_sections.rb +15 -0
  58. data/db/migrate/20171120145548_create_promotion_and_promotion_enquiries.rb +59 -0
  59. data/db/migrate/20171203114528_change_default_status_of_promotion_enquiries.rb +8 -0
  60. data/db/migrate/20171203114529_add_meta_description_to_services.rb +7 -0
  61. data/db/migrate/20171203114530_add_control_fields_to_promotions.rb +7 -0
  62. data/lib/dhatu/version.rb +1 -1
  63. data/lib/tasks/dhatu/data.rake +2 -2
  64. metadata +36 -2
@@ -0,0 +1,2 @@
1
+ name, designation, description, status, featured, priority
2
+ Krishna, Developer, Some Desc, published, true, 1
@@ -0,0 +1 @@
1
+ name, designation, organisation, description, status, featured, priority
@@ -0,0 +1,34 @@
1
+ user,feature,can_create,can_read,can_update,can_delete
2
+ john.honai,Dhatu::Price,TRUE,TRUE,TRUE,TRUE
3
+ john.honai,Dhatu::Category,TRUE,TRUE,TRUE,TRUE
4
+ john.honai,Dhatu::Section,TRUE,TRUE,TRUE,TRUE
5
+ john.honai,Dhatu::SectionType,TRUE,TRUE,TRUE,FALSE
6
+ john.honai,Dhatu::Branch,TRUE,TRUE,TRUE,TRUE
7
+ john.honai,Dhatu::BlogPost,TRUE,TRUE,TRUE,TRUE
8
+ john.honai,Dhatu::Booking,TRUE,TRUE,TRUE,TRUE
9
+ john.honai,Dhatu::Offer,TRUE,TRUE,TRUE,TRUE
10
+ john.honai,User,TRUE,TRUE,TRUE,TRUE
11
+ john.honai,Role,TRUE,TRUE,TRUE,FALSE
12
+ john.honai,Permission,TRUE,TRUE,TRUE,FALSE
13
+ malavika,Dhatu::Price,TRUE,TRUE,TRUE,TRUE
14
+ malavika,Dhatu::Category,TRUE,TRUE,TRUE,TRUE
15
+ malavika,Dhatu::Section,TRUE,TRUE,TRUE,TRUE
16
+ malavika,Dhatu::SectionType,TRUE,TRUE,TRUE,FALSE
17
+ malavika,Dhatu::Branch,TRUE,TRUE,TRUE,TRUE
18
+ malavika,Dhatu::BlogPost,TRUE,TRUE,TRUE,TRUE
19
+ malavika,Dhatu::Booking,TRUE,TRUE,TRUE,TRUE
20
+ malavika,Dhatu::Offer,TRUE,TRUE,TRUE,TRUE
21
+ malavika,User,TRUE,TRUE,TRUE,TRUE
22
+ malavika,Role,TRUE,TRUE,TRUE,FALSE
23
+ malavika,Permission,TRUE,TRUE,TRUE,FALSE
24
+ anas,Dhatu::Price,TRUE,TRUE,TRUE,TRUE
25
+ anas,Dhatu::Category,TRUE,TRUE,TRUE,TRUE
26
+ anas,Dhatu::Section,TRUE,TRUE,TRUE,TRUE
27
+ anas,Dhatu::SectionType,TRUE,TRUE,TRUE,FALSE
28
+ anas,Dhatu::Branch,TRUE,TRUE,TRUE,TRUE
29
+ anas,Dhatu::BlogPost,TRUE,TRUE,TRUE,TRUE
30
+ anas,Dhatu::Booking,TRUE,TRUE,TRUE,TRUE
31
+ anas,Dhatu::Offer,TRUE,TRUE,TRUE,TRUE
32
+ anas,User,TRUE,TRUE,TRUE,TRUE
33
+ anas,Role,TRUE,TRUE,TRUE,FALSE
34
+ anas,Permission,TRUE,TRUE,TRUE,FALSE
data/db/data/users.csv ADDED
@@ -0,0 +1,8 @@
1
+ name,username,designation,email,phone,super_admin,status
2
+ John Honai,john.honai,Site Admin,john.honai@yopmail.com,,FALSE,approved
3
+ Malavika Agnimitra,malavika,Site Admin,malavika@yopmail.com,,FALSE,approved
4
+ Abdul Anas,anas,Site Admin,anas@rightsolutions.io,,FALSE,approved
5
+ Sanoop S Nair,sanoop,Site Admin,sanoop@rightsolutions.ae,,TRUE,approved
6
+ Krishna Prasad Varma,kpvarma,Site Admin,krishna@rightsolutions.ae,,TRUE,approved
7
+ Vinodh Ellath,vinodh,Site Admin,vinodh@rightsolutions.ae,,TRUE,approved
8
+ Junaid Ramzan,junaid,Site Admin,junaid@rightsolutions.ae,,TRUE,approved
@@ -1,16 +1,25 @@
1
- name,status,categorisable
2
- User,published,FALSE
3
- Registration,unpublished,FALSE
4
- Role,published,FALSE
5
- Permission,published,FALSE
6
- Country,published,FALSE
7
- Region,published,FALSE
8
- City,published,FALSE
9
- Locality,published,FALSE
10
- Dhatu::Section,published,FALSE
11
- Dhatu::BlogPost,published,TRUE
12
- Dhatu::Branch,published,FALSE
13
- Dhatu::Offer,published,TRUE
14
- Dhatu::Event,published,TRUE
15
- Dhatu::Testimonial,published,TRUE
16
- Dhatu::TeamMember,published,TRUE
1
+ name,status,categorisable,priority
2
+ User,published,FALSE,1
3
+ Registration,unpublished,FALSE,1
4
+ Role,published,FALSE,1
5
+ Permission,published,FALSE,1
6
+ Country,published,FALSE,1
7
+ Region,published,FALSE,1
8
+ City,published,FALSE,1
9
+ Locality,published,FALSE,1
10
+ Dhatu::Section,published,FALSE,1
11
+ Dhatu::SectionType,published,FALSE,1
12
+ Dhatu::BlogPost,published,TRUE,1
13
+ Dhatu::Branch,published,FALSE,1
14
+ Dhatu::Offer,published,FALSE,1
15
+ Dhatu::Price,published,TRUE,1
16
+ Dhatu::Event,published,FALSE,1
17
+ Dhatu::Testimonial,published,FALSE,1
18
+ Dhatu::TeamMember,published,FALSE,1
19
+ Dhatu::Category,published,FALSE,1
20
+ Dhatu::Booking,published,FALSE,1
21
+ Dhatu::Promotion,published,FALSE,1
22
+ Dhatu::PromotionAttribute,published,FALSE,1
23
+ Dhatu::PromotionEnquiry,published,FALSE,1
24
+ Dhatu::Service,published,TRUE,1
25
+ Dhatu::Product,published,TRUE,1
@@ -0,0 +1,3 @@
1
+ name
2
+ Site Admin
3
+ Content Manager
@@ -0,0 +1,21 @@
1
+ class CreateEvents < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :events do |t|
4
+
5
+ t.string :title, :null => false, :limit=>256
6
+ t.string :venue, :null => false, :limit=>256
7
+
8
+ t.text :description
9
+
10
+ t.date :date, :null => true
11
+ t.datetime :starts_at, :null => true
12
+ t.datetime :ends_at, :null => true
13
+
14
+ t.boolean :featured, default: false
15
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
16
+
17
+ t.timestamps null: false
18
+ end
19
+ add_index :events, :status
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ class CreateOffers < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :offers do |t|
4
+
5
+ t.string :title, :null => false, :limit=>256
6
+ t.string :offer_text, :null => false, :limit=>64
7
+
8
+ t.text :description
9
+
10
+ t.datetime :starts_at, :null => true
11
+ t.datetime :ends_at, :null => true
12
+
13
+ t.boolean :featured, default: false
14
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
15
+
16
+ t.timestamps null: false
17
+ end
18
+ add_index :offers, :status
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ class CreateSections < ActiveRecord::Migration[5.0]
2
+ def self.up
3
+ create_table :sections do |t|
4
+ t.string :title, :null => false, :limit=>256
5
+ t.string :sub_title, :null => false, :limit=>256
6
+ t.string :short_description, :limit=>1048
7
+ t.text :long_description
8
+ t.string :button_one_text, :limit=>64
9
+ t.string :button_two_text, :limit=>64
10
+ t.string :button_one_link, :limit=>512
11
+ t.string :button_two_link, :limit=>512
12
+ t.string :section_type, :limit=>64
13
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
14
+ t.timestamps null: false
15
+ end
16
+ end
17
+
18
+ def self.down
19
+ drop_table :sections
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ class CreateTestimonials < ActiveRecord::Migration[5.0]
2
+ def self.up
3
+ create_table :testimonials do |t|
4
+ t.string :name, :null => false, :limit=>256
5
+ t.string :designation, :null => true, :limit=>256
6
+ t.string :organisation, :null => true, :limit=>256
7
+ t.string :status, :null => false, :limit=>64
8
+ t.boolean :featured, default: false
9
+ t.text :statement
10
+ t.timestamps null: false
11
+ end
12
+ end
13
+
14
+ def self.down
15
+ drop_table :testimonials
16
+ end
17
+ end
@@ -0,0 +1,20 @@
1
+ class CreateTeamMembers < ActiveRecord::Migration[5.0]
2
+ def self.up
3
+ create_table :team_members do |t|
4
+ t.string :name
5
+ t.string :designation
6
+ t.string :status
7
+ t.boolean :featured
8
+ t.text :description
9
+ t.string :linked_in_url
10
+ t.string :google_plus_url
11
+ t.string :facebook_url
12
+ t.string :twitter_url
13
+ t.timestamps null: false
14
+ end
15
+ end
16
+
17
+ def self.down
18
+ drop_table :team_members
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ class CreateBlogPosts < ActiveRecord::Migration[5.0]
2
+ def change
3
+ create_table :blog_posts do |t|
4
+
5
+ t.string :title, null: false, limit: 256
6
+ t.string :slug, null: true, limit: 64
7
+ t.string :author, null: true, limit: 256
8
+ t.string :meta_description, null: true, limit: 512
9
+
10
+ t.text :description
11
+
12
+ t.datetime :posted_at, null: true
13
+
14
+ t.boolean :featured, default: false
15
+ t.string :status, null: false, :default=>"unpublished", limit: 16
16
+
17
+ t.text :tags
18
+
19
+ t.timestamps null: false
20
+ end
21
+ add_index :blog_posts, :status
22
+ end
23
+ end
@@ -0,0 +1,37 @@
1
+ class CreateBranches < ActiveRecord::Migration[5.0]
2
+ def self.up
3
+ create_table :branches do |t|
4
+
5
+ t.string :title, null: false, limit: 256
6
+
7
+ t.string :address_1, null: true, limit: 256
8
+ t.string :address_2, null: true, limit: 256
9
+ t.string :address_3, null: true, limit: 256
10
+
11
+ t.string :email, null: true, limit: 256
12
+ t.string :landline, null: true, limit: 16
13
+ t.string :fax, null: true, limit: 16
14
+ t.string :mobile, null: true, limit: 16
15
+
16
+ t.string :facebook, null: true, limit: 256
17
+ t.string :twitter, null: true, limit: 256
18
+ t.string :google_plus, null: true, limit: 256
19
+ t.string :linked_in, null: true, limit: 256
20
+ t.string :youtube, null: true, limit: 256
21
+ t.string :instagram, null: true, limit: 256
22
+ t.string :tumblr, null: true, limit: 256
23
+ t.string :pinterest, null: true, limit: 256
24
+ t.string :blog, null: true, limit: 256
25
+
26
+ t.string :status, null: false, limit: 16
27
+ t.boolean :featured, default: false
28
+ t.boolean :main_branch, default: false
29
+
30
+ t.timestamps null: false
31
+ end
32
+ end
33
+
34
+ def self.down
35
+ drop_table :branches
36
+ end
37
+ end
@@ -0,0 +1,23 @@
1
+ class CreateCategories < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :categories do |t|
4
+ t.string :name, :null => false, limit: 128
5
+ t.string :category_type, :null => false, limit: 64
6
+ t.string :one_liner
7
+ t.string :permalink, :null => false, limit: 128
8
+ t.text :description
9
+ t.references :parent, references: :category
10
+ t.references :top_parent, references: :category
11
+
12
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
13
+ t.boolean :featured, default: false
14
+ t.boolean :end_node, default: true
15
+ t.integer :priority, default: 1, null: false
16
+
17
+ t.timestamps null: false
18
+ end
19
+
20
+ add_index :categories, :permalink, :unique => true
21
+ add_index :categories, :status
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ class CreateServices < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :services do |t|
4
+ t.string :name, :null => false, limit: 128
5
+ t.string :one_liner
6
+ t.string :permalink, :null => false, limit: 128
7
+ t.text :description
8
+
9
+ t.text :price
10
+ t.text :duration
11
+
12
+ t.references :category
13
+
14
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
15
+ t.boolean :featured, default: false
16
+ t.integer :priority, default: 1, null: false
17
+
18
+ t.timestamps null: false
19
+ end
20
+
21
+ add_index :services, :permalink, :unique => true
22
+ add_index :services, :status
23
+ end
24
+ end
@@ -0,0 +1,5 @@
1
+ class AddCategoryIdToBlogPosts < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :blog_posts, :category, index: true
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ class AddPriorityToTables < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :events, :priority, :integer, default: 1000
4
+ add_column :offers, :priority, :integer, default: 1000
5
+ add_column :testimonials, :priority, :integer, default: 1000
6
+ add_column :team_members, :priority, :integer, default: 1000
7
+ end
8
+ end
@@ -0,0 +1,17 @@
1
+ class CreatePrices < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :prices do |t|
4
+ t.string :title, :null => false, limit: 128
5
+ t.string :sub_title
6
+ t.text :price
7
+ t.references :category, index: true
8
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
9
+ t.boolean :featured, default: false
10
+ t.integer :priority, default: 1, null: false
11
+
12
+ t.timestamps null: false
13
+ end
14
+
15
+ add_index :prices, :status
16
+ end
17
+ end
@@ -0,0 +1,22 @@
1
+ class CreateBookings < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :bookings do |t|
4
+ t.string :name, :null => false, limit: 256
5
+ t.references :service, index: true
6
+
7
+ t.string :email, null: true, limit: 256
8
+ t.string :mobile, null: true, limit: 16
9
+
10
+ t.date :date, :null => true
11
+ t.string :time, null: true, limit: 16
12
+
13
+ t.string :message, :limit=>1048
14
+
15
+ t.boolean :featured, default: false
16
+ t.string :status, :null => false, :default=>"new", :limit=>16
17
+ t.timestamps null: false
18
+ end
19
+
20
+ add_index :bookings, :status
21
+ end
22
+ end
@@ -0,0 +1,7 @@
1
+ class AddCategoryIdToTables < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :events, :category, index: true
4
+ add_reference :offers, :category, index: true
5
+ add_reference :sections, :category, index: true
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class RemoveCategoriesFromSection < ActiveRecord::Migration[5.1]
2
+ def change
3
+ remove_reference :sections, :category, index: true
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class CreateSectionTypes < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :section_types do |t|
4
+ t.string :name, :null => false, limit: 64
5
+ t.string :code, :null => false, limit: 64
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ class AddSectionTypeIdToSections < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :sections, :section_type, index: true
4
+
5
+ begin
6
+ Dhatu::Section.all.each do |section|
7
+ section_type = Dhatu::SectionType.find_by_code(section.section_type) || Dhatu::SectionType.create(title: section.section_type.titleize, code: section.section_type)
8
+ section.update_attribute(section_type_id: section_type.id)
9
+ end
10
+ rescue
11
+ end
12
+
13
+ remove_column :sections, :section_type
14
+ end
15
+ end
@@ -0,0 +1,59 @@
1
+ class CreatePromotionAndPromotionEnquiries < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :promotions do |t|
4
+
5
+ t.string :title, :null => false, limit: 256
6
+ t.string :short_description, :null => true, limit: 512
7
+ t.string :code, :null => true, limit: 64
8
+
9
+ t.boolean :display_name, default: true, null: false
10
+ t.boolean :display_email, default: true, null: false
11
+ t.boolean :display_phone, default: true, null: false
12
+
13
+ t.boolean :name_mandatory, default: true, null: false
14
+ t.boolean :email_mandatory, default: false, null: false
15
+ t.boolean :phone_mandatory, default: false, null: false
16
+
17
+ t.boolean :featured, default: false
18
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
19
+ t.integer :priority, default: 1, null: false
20
+
21
+ t.timestamps null: false
22
+ end
23
+
24
+ create_table :promotion_attributes do |t|
25
+
26
+ t.string :name, :null => false, limit: 64
27
+ # Data Type could be text, integer, date, list_drop_down (Select from a List), list_radio_button (Choose one) & boolean (Checkbox)
28
+ t.string :data_type, :null => false, default: :text, limit: 24
29
+ # This column is applicable for list_drop_down and list_radio_button data types
30
+
31
+ t.text :values
32
+
33
+ t.boolean :mandatory, :null => false, default: false
34
+ t.boolean :display, :null => false, default: false
35
+
36
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
37
+ t.integer :priority, default: 1, null: false
38
+
39
+ t.references :promotion, index: true
40
+
41
+ t.timestamps null: false
42
+ end
43
+
44
+ create_table :promotion_enquiries do |t|
45
+
46
+ t.string :name, :null => false, limit: 256
47
+ t.string :email, :null => true, limit: 256
48
+ t.string :phone, :null => true, limit: 24
49
+
50
+ t.references :promotion, index: true
51
+ t.string :status, :null => false, :default=>"unpublished", :limit=>16
52
+
53
+ # Additional Details
54
+ t.text :additional_attributes
55
+
56
+ t.timestamps null: false
57
+ end
58
+ end
59
+ end