dhatu 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -16,6 +16,10 @@ class Dhatu::Offer < Dhatu::ApplicationRecord
16
16
  belongs_to :category, optional: true
17
17
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
18
18
  has_many :gallery_images, :as => :imageable, :dependent => :destroy, :class_name => "Image::GalleryImage"
19
+
20
+ # Meta Tag Associations
21
+ has_one :og_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::OgImage"
22
+ has_many :meta_tags, :as => :meta_taggable, :dependent => :destroy, :class_name => "Dhatu::MetaTag"
19
23
 
20
24
  # ------------------
21
25
  # Class Methods
@@ -0,0 +1,50 @@
1
+ class Dhatu::Page < Dhatu::ApplicationRecord
2
+
3
+ # Set Table Name
4
+ self.table_name = "pages"
5
+
6
+ # Including the State Machine Methods
7
+ include Publishable
8
+
9
+ # Validations
10
+ validates :name, presence: true, length: {minimum: 3, maximum: 64}, allow_blank: false
11
+ validates :code, presence: true, length: {minimum: 3, maximum: 64}, allow_blank: false
12
+
13
+ # Associations
14
+ belongs_to :feature, optional: true
15
+
16
+ # Meta Tag Associations
17
+ has_one :og_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::OgImage"
18
+ has_many :meta_tags, :as => :meta_taggable, :dependent => :destroy, :class_name => "Dhatu::MetaTag"
19
+ has_many :sections, class_name: "Dhatu::Section"
20
+
21
+ # ------------------
22
+ # Class Methods
23
+ # ------------------
24
+
25
+ scope :search, lambda { |query| where("LOWER(name) LIKE LOWER('%#{query}%') OR LOWER(code) LIKE LOWER('%#{query}%')") }
26
+
27
+ # ------------------
28
+ # Instance Methods
29
+ # ------------------
30
+
31
+ # Generic Methods
32
+ # ---------------
33
+
34
+ def display_name
35
+ "#{self.name_was} - #{self.code}"
36
+ end
37
+
38
+ # Permission Methods
39
+ # ------------------
40
+
41
+ def can_be_edited?
42
+ status?(:published) or status?(:unpublished)
43
+ end
44
+
45
+ def can_be_deleted?
46
+ return false if self.sections.count > 0
47
+ status?(:removed)
48
+ end
49
+
50
+ end
@@ -9,7 +9,7 @@ class Dhatu::Project < Dhatu::ApplicationRecord
9
9
 
10
10
  # Validations
11
11
  validate_string :name, mandatory: true, min_length: 2, format: /.*/i
12
- validate_string :meta_description, mandatory: false, format: /.*/i
12
+ validate_string :short_description, mandatory: false, format: /.*/i
13
13
  validate_string :permalink, mandatory: true, format: /.*/i, min_length: 4, max_length: 128
14
14
 
15
15
  # Associations
@@ -17,12 +17,16 @@ class Dhatu::Project < Dhatu::ApplicationRecord
17
17
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
18
18
  has_many :gallery_images, :as => :imageable, :dependent => :destroy, :class_name => "Image::GalleryImage"
19
19
 
20
+ # Meta Tag Associations
21
+ has_one :og_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::OgImage"
22
+ has_many :meta_tags, :as => :meta_taggable, :dependent => :destroy, :class_name => "Dhatu::MetaTag"
23
+
20
24
  # ------------------
21
25
  # Class Methods
22
26
  # ------------------
23
27
 
24
28
  scope :search, lambda {|query| where("LOWER(name) LIKE LOWER('%#{query}%') OR\
25
- LOWER(meta_description) LIKE LOWER('%#{query}%') OR\
29
+ LOWER(short_description) LIKE LOWER('%#{query}%') OR\
26
30
  LOWER(permalink) LIKE LOWER('%#{query}%') OR\
27
31
  LOWER(description) LIKE LOWER('%#{query}%')")
28
32
  }
@@ -40,7 +44,7 @@ class Dhatu::Project < Dhatu::ApplicationRecord
40
44
 
41
45
  project = Dhatu::Project.find_by_name(hsh[:name].to_s.strip) || Dhatu::Project.new
42
46
  project.name = hsh[:name].to_s.strip
43
- project.meta_description = hsh[:meta_description].to_s.strip
47
+ project.short_description = hsh[:short_description].to_s.strip
44
48
  project.description = hsh[:description].to_s.strip
45
49
  project.client = hsh[:client].to_s.strip
46
50
  project.category = Dhatu::Category.find_by_name(hsh[:category].to_s.strip)
@@ -14,6 +14,7 @@ class Dhatu::Promotion < Dhatu::ApplicationRecord
14
14
 
15
15
  # Associations
16
16
  has_many :promotion_attributes
17
+ has_many :promotion_enquiries
17
18
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
18
19
 
19
20
  # Callbacks
@@ -7,6 +7,8 @@ class Dhatu::Section < Dhatu::ApplicationRecord
7
7
  include Publishable
8
8
 
9
9
  # Validations
10
+ validates :name, presence: true, length: {minimum: 3, maximum: 64}, allow_blank: false
11
+ validates :code, presence: true, length: {minimum: 3, maximum: 64}, allow_blank: false
10
12
  validates :title, presence: true, length: {minimum: 3, maximum: 256}, allow_blank: false
11
13
  validates :sub_title, length: {minimum: 3, maximum: 256}, allow_blank: true
12
14
  validates :short_description, length: {minimum: 10, maximum: 1048}, allow_blank: true
@@ -17,7 +19,8 @@ class Dhatu::Section < Dhatu::ApplicationRecord
17
19
  validates :button_two_link, length: {maximum: 512}, allow_blank: true
18
20
 
19
21
  # Associations
20
- belongs_to :section_type, :class_name => "Dhatu::SectionType"
22
+ belongs_to :section_type, :class_name => "Dhatu::SectionType", optional: true
23
+ belongs_to :page, :class_name => "Dhatu::Page", optional: true
21
24
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
22
25
  has_many :gallery_images, :as => :imageable, :dependent => :destroy, :class_name => "Image::GalleryImage"
23
26
 
@@ -36,24 +39,18 @@ class Dhatu::Section < Dhatu::ApplicationRecord
36
39
 
37
40
  scope :upcoming, lambda { where("created_at >= ?", Time.now) }
38
41
  scope :past, lambda { where("created_at < ?", Time.now) }
39
- scope :find_by_section_type, lambda {|section_code| joins(:section_type).where("code = ?", section_code) }
42
+ scope :find_by_code, lambda {|c| where("code = ?", c) }
40
43
 
41
44
  def self.save_row_data(hsh)
42
45
  # Initializing error hash for displaying all errors altogether
43
46
  error_object = Kuppayam::Importer::ErrorHash.new
44
47
 
45
- return error_object if hsh[:title].to_s.strip.blank?
48
+ return error_object if hsh[:code].to_s.strip.blank?
46
49
 
47
- section_type = Dhatu::SectionType.find_by_code(hsh[:section_type].to_s.strip)
48
-
49
- unless section_type
50
- puts "Section Type '#{hsh[:section_type].to_s.strip}' not found".red
51
- return
52
- end
53
-
54
- section = Dhatu::Section.where("title = ? AND section_type_id = ?", hsh[:title].to_s.strip, section_type.id).first || Dhatu::Section.new
50
+ section = Dhatu::Section.where("code = ?", hsh[:code].to_s.strip).first || Dhatu::Section.new
55
51
 
56
52
  section.title = hsh[:title].to_s.strip
53
+ section.code = hsh[:code].to_s.strip
57
54
  section.sub_title = hsh[:sub_title].to_s.strip
58
55
  section.short_description = hsh[:short_description].to_s.strip
59
56
  section.long_description = hsh[:long_description].to_s.strip
@@ -62,7 +59,6 @@ class Dhatu::Section < Dhatu::ApplicationRecord
62
59
  section.button_one_link = hsh[:button_one_link].to_s.strip
63
60
  section.button_two_link = hsh[:button_two_link].to_s.strip
64
61
 
65
- section.section_type = section_type
66
62
  section.status = hsh[:status].to_s.strip || PUBLISHED
67
63
 
68
64
  if section.valid?
@@ -9,7 +9,7 @@ class Dhatu::Service < Dhatu::ApplicationRecord
9
9
 
10
10
  # Validations
11
11
  validate_string :name, mandatory: true, min_length: 2, format: /.*/i
12
- validate_string :meta_description, mandatory: false, format: /.*/i
12
+ validate_string :short_description, mandatory: false, format: /.*/i
13
13
  validate_string :permalink, mandatory: true, format: /.*/i, min_length: 4, max_length: 128
14
14
 
15
15
  # Associations
@@ -17,12 +17,16 @@ class Dhatu::Service < Dhatu::ApplicationRecord
17
17
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
18
18
  has_many :gallery_images, :as => :imageable, :dependent => :destroy, :class_name => "Image::GalleryImage"
19
19
 
20
+ # Meta Tag Associations
21
+ has_one :og_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::OgImage"
22
+ has_many :meta_tags, :as => :meta_taggable, :dependent => :destroy, :class_name => "Dhatu::MetaTag"
23
+
20
24
  # ------------------
21
25
  # Class Methods
22
26
  # ------------------
23
27
 
24
28
  scope :search, lambda {|query| where("LOWER(name) LIKE LOWER('%#{query}%') OR\
25
- LOWER(meta_description) LIKE LOWER('%#{query}%') OR\
29
+ LOWER(short_description) LIKE LOWER('%#{query}%') OR\
26
30
  LOWER(permalink) LIKE LOWER('%#{query}%') OR\
27
31
  LOWER(description) LIKE LOWER('%#{query}%')")
28
32
  }
@@ -40,7 +44,7 @@ class Dhatu::Service < Dhatu::ApplicationRecord
40
44
 
41
45
  service = Dhatu::Service.find_by_name(hsh[:name].to_s.strip) || Dhatu::Service.new
42
46
  service.name = hsh[:name].to_s.strip
43
- service.meta_description = hsh[:meta_description].to_s.strip
47
+ service.short_description = hsh[:short_description].to_s.strip
44
48
  service.generate_permalink
45
49
  service.description = hsh[:description].to_s.strip
46
50
  service.price = hsh[:price].to_s.strip
@@ -0,0 +1,3 @@
1
+ class Image::OgImage < Image::Base
2
+ mount_uploader :image, OgImageUploader
3
+ end
@@ -0,0 +1,15 @@
1
+ class OgImageUploader < ImageUploader
2
+
3
+ def store_dir
4
+ "uploads/og_images/#{model.id}"
5
+ end
6
+
7
+ version :large do
8
+ process :resize_to_fill => [1200, 630]
9
+ end
10
+
11
+ version :small do
12
+ process :resize_to_fill => [240, 126]
13
+ end
14
+
15
+ end
@@ -22,7 +22,7 @@
22
22
  </div>
23
23
  </div>
24
24
 
25
- <%= theme_form_field(@blog_post, :meta_description, required: true, html_options: {type: :textarea, class: "form-control", style: "height: 80px;"}, form_style: "top-bottom") %>
25
+ <%= theme_form_field(@blog_post, :short_description, required: true, html_options: {type: :textarea, class: "form-control", style: "height: 80px;"}, form_style: "top-bottom") %>
26
26
 
27
27
  <%= theme_form_field(@blog_post, :description, required: true, html_options: {type: :textarea, class: "form-control wysihtml5", "data-stylesheet-url": "assets/wysiwyg-color.css"}, form_style: "top-bottom") %>
28
28
 
@@ -21,7 +21,7 @@
21
21
  </th>
22
22
 
23
23
  <td class="display-image">
24
- <%= display_thumbnail_small(blog_post) %>
24
+ <%= display_thumbnail(blog_post) %>
25
25
  </td>
26
26
 
27
27
  <td class="display-link">
@@ -5,7 +5,7 @@
5
5
  </th>
6
6
 
7
7
  <td class="display-image">
8
- <%= display_thumbnail_small(blog_post) %>
8
+ <%= display_thumbnail(blog_post) %>
9
9
  </td>
10
10
 
11
11
  <td class="display-link">
@@ -31,7 +31,7 @@
31
31
  <%= clear_tag(10) %>
32
32
 
33
33
  <div class="well">
34
- <%= raw(@blog_post.meta_description) %>
34
+ <%= raw(@blog_post.short_description) %>
35
35
  </div>
36
36
 
37
37
  <%= clear_tag(10) %>
@@ -1,11 +1,10 @@
1
- <div class="table-responsive">
1
+ <div class="table-responsive1">
2
2
  <table class="table table-hover members-table middle-align">
3
3
  <thead>
4
4
  <tr>
5
- <th style="text-align: center;width:8%">#</th>
6
- <th style="width:200px">Name</th>
7
- <th style="width:50%;" >Message</th>
8
- <!-- <th style="width:100px;" class="hidden-sm hidden-xs">Status</th> -->
5
+ <th style="text-align: center;width:8%" class="hidden-sm hidden-xs">#</th>
6
+ <th>Name</th>
7
+ <th class="hidden-sm hidden-xs">Message</th>
9
8
  <% if display_manage_links? %>
10
9
  <th style="text-align: center;" class="" >Actions</th>
11
10
  <% end %>
@@ -16,7 +15,7 @@
16
15
  <% @bookings.each_with_index do |booking, i| %>
17
16
  <tr id="tr_booking_<%= booking.id %>">
18
17
 
19
- <th scope="row" style="text-align: center;">
18
+ <th scope="row" style="text-align: center;" class="hidden-sm hidden-xs">
20
19
  <%= serial_number(i) %>
21
20
  </th>
22
21
 
@@ -26,11 +25,11 @@
26
25
  <% else %>
27
26
  <%= link_to booking.name, booking_path(booking), remote: true %>
28
27
  <% end %>
29
- &nbsp;<%= display_readable_status(booking) %><br>
30
28
  <%= link_to time_ago_in_words(booking.created_at) + " ago", booking_path(booking), remote: true, style: "color:chocolate;font-size:10px;" %>
29
+ <%= display_readable_status(booking) %>
31
30
  </td>
32
31
 
33
- <td class=""><%= truncate booking.message, length: 30 %></td>
32
+ <td class="hidden-sm hidden-xs"><%= truncate booking.message, length: 30 %></td>
34
33
 
35
34
  <% if display_manage_links? %>
36
35
  <td class="action-links" style="width:15%"><%= display_readable_links(booking) %></td>
@@ -1,18 +1,22 @@
1
1
  <tr id="tr_booking_<%= booking.id %>">
2
- <th scope="row" style="text-align: center;">
2
+
3
+ <th scope="row" style="text-align: center;" class="hidden-sm hidden-xs">
3
4
  <%= serial_number(i) %>
4
5
  </th>
5
6
 
6
7
  <td class="display-link">
7
- <%= link_to booking.name, booking_path(booking), remote: true %><br>
8
- <%#= link_to booking.category.try(:display_name), booking_path(booking), remote: true, style: "color:chocolate" %>
8
+ <% if booking.new? || booking.unread? %>
9
+ <%= link_to booking.name, booking_path(booking), remote: true, style: "font-weight:800;" %><br>
10
+ <% else %>
11
+ <%= link_to booking.name, booking_path(booking), remote: true %>
12
+ <% end %>
13
+ <%= link_to time_ago_in_words(booking.created_at) + " ago", booking_path(booking), remote: true, style: "color:chocolate;font-size:10px;" %>
14
+ <%= display_readable_status(booking) %>
9
15
  </td>
10
16
 
11
- <td class=""><%= truncate booking.message, length: 30 %></td>
12
-
13
- <td class="hidden-sm hidden-xs"><%= display_readable_status(booking) %></td>
17
+ <td class="hidden-sm hidden-xs"><%= truncate booking.message, length: 30 %></td>
14
18
 
15
19
  <% if display_manage_links? %>
16
- <td class="action-links hidden-sm hidden-xs" style="width:15%"><%= display_readable_links(booking) %></td>
20
+ <td class="action-links" style="width:15%"><%= display_readable_links(booking) %></td>
17
21
  <% end %>
18
22
  </tr>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <div class="tabs-vertical-env">
6
6
 
7
- <ul id="div_category_types" class="nav tabs-vertical">
7
+ <ul id="div_category_types" class="nav tabs-vertical hidden-sm hidden-xs">
8
8
  <% Readable::STATUS_REVERSE.keys.each do |st| %>
9
9
  <% count_hsh = { "new" => @new_bookings_count, "unread" => @unread_bookings_count, "read" => @read_bookings_count, "removed" => 0, "archived" => 0 } %>
10
10
  <% badge_hsh = { "new" => "success", "unread" => "info", "read" => "default", "removed" => "", "archived" => "" } %>
@@ -20,17 +20,6 @@
20
20
  <% end %>
21
21
  </ul>
22
22
 
23
- <!-- <ul class="nav nav-tabs nav-tabs-justified">
24
- <%# Dhatu::Booking::STATUS.each do |key, value| %>
25
- <li class="<%#= @status == value ? 'active' : '' %>">
26
- <%#= link_to dhatu.bookings_path(st: value), "aria-expanded" => "#{ @status == value ? 'true' : 'false' }" do %>
27
- <span class="visible-xs"><i class="fa-gift"></i></span>
28
- <span class="hidden-xs"><%#= key %></span>
29
- <%# end %>
30
- </li>
31
- <%# end %>
32
- </ul> -->
33
-
34
23
  <div class="tab-content">
35
24
  <div class="tab-pane active">
36
25
 
@@ -45,6 +34,25 @@
45
34
  </div>
46
35
 
47
36
  </div>
37
+
38
+ <div class="row">
39
+ <div class="col-md-12 visible-sm visible-xs mt-10">
40
+ </div>
41
+ <div class="col-md-12">
42
+ <% @filter_ui_settings.each do |filter_name, options| %>
43
+ <% if options[:object_filter] == true %>
44
+ <%= report_object_filter(filter_name, options) %>
45
+ <% end %>
46
+ <% end %>
47
+ </div>
48
+ <div class="col-md-12 visible-sm visible-xs">
49
+ <% @filter_ui_settings.each do |filter_name, options| %>
50
+ <% if options[:object_filter] == false %>
51
+ <%= report_filter(filter_name, options) %>
52
+ <% end %>
53
+ <% end %>
54
+ </div>
55
+ </div>
48
56
  <%= clear_tag(10) %>
49
57
 
50
58
  <div id="div_booking_index">
@@ -2,10 +2,8 @@
2
2
  <table class="table table-hover members-table middle-align">
3
3
  <thead>
4
4
  <tr>
5
- <th style="text-align: center;width:5%">#</th>
5
+ <th style="text-align: center;width:5%" class="hidden-sm hidden-xs">#</th>
6
6
  <th>Title</th>
7
- <th style="width:100px;" class="hidden-sm hidden-xs">Featured</th>
8
- <th style="width:100px;" class="hidden-sm hidden-xs">Status</th>
9
7
  <% if display_manage_links? %>
10
8
  <th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th>
11
9
  <% end %>
@@ -16,21 +14,19 @@
16
14
  <% @branches.each_with_index do |branch, i| %>
17
15
  <tr id="tr_branch_<%= branch.id %>">
18
16
 
19
- <th scope="row" style="text-align: center;">
17
+ <th scope="row" style="text-align: center;" class="hidden-sm hidden-xs">
20
18
  <%= serial_number(i) %>
21
19
  </th>
22
20
 
23
21
  <td class="display-link">
24
- <%= link_to branch.title, branch_path(branch), remote: true %><br>
25
- <%= content_tag(:span, "Main Branch", class: "label label-success") if branch.main_branch? %><br>
26
- <%= branch.display_address %>
22
+ <%= link_to branch.title, branch_path(branch), remote: true, style: "color: chocolate;font-size:16px;" %>
23
+ <%= content_tag(:span, raw("<i class='fa fa-star ml-10' style='color:#ffba00'></i> (Main Branch)")) if branch.main_branch? %><br>
24
+ <%= branch.display_address %><br>
25
+ <%= display_publishable_status(branch) %>
26
+ <%= display_featured(branch) %>
27
27
  </td>
28
28
 
29
- <td class="hidden-sm hidden-xs"><%= display_featured(branch) %></td>
30
-
31
- <td class="hidden-sm hidden-xs"><%= display_publishable_status(branch) %></td>
32
-
33
- <td class="action-links hidden-sm hidden-xs" style="width:10%">
29
+ <td class="action-links hidden-sm hidden-xs" style="width:10%">
34
30
  <%= display_publishable_links(branch) %>
35
31
  </td>
36
32
 
@@ -11,13 +11,41 @@
11
11
  <%= display_featured(@branch) %>
12
12
  <%= clear_tag(20) %>
13
13
 
14
+ </div>
15
+
16
+ <% if display_manage_links? %>
17
+ <div class="col-md-3 col-sm-12 col-xs-12">
18
+ <%= display_manage_buttons(@branch) %>
19
+ <%= display_publishable_buttons(@branch) %>
20
+ <%= display_featurable_buttons(@branch) %>
21
+ <% if display_edit_links? %>
22
+ <% if @branch.main_branch? %>
23
+ <!-- Remove Branch -->
24
+ <%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Remove Main Branch"), remove_main_branch_path(:id =>@branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-danger btn-only-hover" %>
25
+ <% else %>
26
+ <!-- Main Branch -->
27
+ <%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Make this Main Branch"), make_main_branch_path(:id =>@branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-success btn-only-hover" %>
28
+ <% end %>
29
+ <% end %>
30
+ </div>
31
+ <% end %>
32
+
33
+ </div>
34
+
35
+ <%= clear_tag(40) %>
36
+ <div><strong class="fs-18">Branch Details</strong></div>
37
+ <hr>
38
+
39
+ <div class="row">
40
+ <div class="col-md-6">
14
41
  <div class="table-responsive">
15
42
  <table class="table table-striped table-condensed table-bordered">
16
43
  <tbody>
17
44
  <tr>
18
45
  <th style="width:25%">Main Branch?</th>
19
46
  <td style="width:25%"><%= @branch.main_branch? ? "Yes" : "No" %></td>
20
-
47
+ </tr>
48
+ <tr>
21
49
  <th style="width:25%">Address 1</th>
22
50
  <td style="width:25%"><%= @branch.address_1 if @branch.address_1 %></td>
23
51
  </tr>
@@ -25,7 +53,8 @@
25
53
  <tr>
26
54
  <th style="width:25%">Address 2</th>
27
55
  <td style="width:25%"><%= @branch.address_2 if @branch.address_2 %></td>
28
-
56
+ </tr>
57
+ <tr>
29
58
  <th style="width:25%">Address 3</th>
30
59
  <td style="width:25%"><%= @branch.address_3 if @branch.address_3 %></td>
31
60
  </tr>
@@ -33,7 +62,8 @@
33
62
  <tr>
34
63
  <th style="width:25%">Email</th>
35
64
  <td style="width:25%"><%= @branch.email if @branch.email %></td>
36
-
65
+ </tr>
66
+ <tr>
37
67
  <th style="width:25%">Landline</th>
38
68
  <td style="width:25%"><%= @branch.landline if @branch.landline %></td>
39
69
  </tr>
@@ -41,15 +71,25 @@
41
71
  <tr>
42
72
  <th style="width:25%">Fax</th>
43
73
  <td style="width:25%"><%= @branch.fax if @branch.fax %></td>
44
-
74
+ </tr>
75
+ <tr>
45
76
  <th style="width:25%">Mobile</th>
46
77
  <td style="width:25%"><%= @branch.mobile if @branch.mobile %></td>
47
78
  </tr>
48
-
79
+
80
+ </tbody>
81
+ </table>
82
+ </div>
83
+ </div>
84
+ <div class="col-md-6">
85
+ <div class="table-responsive">
86
+ <table class="table table-striped table-condensed table-bordered">
87
+ <tbody>
49
88
  <tr>
50
89
  <th style="width:25%">Facebook</th>
51
90
  <td style="width:25%"><%= @branch.facebook if @branch.facebook %></td>
52
-
91
+ </tr>
92
+ <tr>
53
93
  <th style="width:25%">Twitter</th>
54
94
  <td style="width:25%"><%= @branch.twitter if @branch.twitter %></td>
55
95
  </tr>
@@ -57,7 +97,8 @@
57
97
  <tr>
58
98
  <th style="width:25%">Google +</th>
59
99
  <td style="width:25%"><%= @branch.google_plus if @branch.google_plus %></td>
60
-
100
+ </tr>
101
+ <tr>
61
102
  <th style="width:25%">LinkedIn</th>
62
103
  <td style="width:25%"><%= @branch.linked_in if @branch.linked_in %></td>
63
104
  </tr>
@@ -65,7 +106,8 @@
65
106
  <tr>
66
107
  <th style="width:25%">Youtube</th>
67
108
  <td style="width:25%"><%= @branch.youtube if @branch.youtube %></td>
68
-
109
+ </tr>
110
+ <tr>
69
111
  <th style="width:25%">Instagram</th>
70
112
  <td style="width:25%"><%= @branch.instagram if @branch.instagram %></td>
71
113
  </tr>
@@ -73,7 +115,8 @@
73
115
  <tr>
74
116
  <th style="width:25%">Tumblr</th>
75
117
  <td style="width:25%"><%= @branch.tumblr if @branch.tumblr %></td>
76
-
118
+ </tr>
119
+ <tr>
77
120
  <th style="width:25%">Instagram</th>
78
121
  <td style="width:25%"><%= @branch.pinterest if @branch.pinterest %></td>
79
122
  </tr>
@@ -81,76 +124,39 @@
81
124
  <tr>
82
125
  <th style="width:25%">Blog</th>
83
126
  <td style="width:25%"><%= @branch.blog if @branch.blog %></td>
84
-
85
- <th style="width:25%"></th>
86
- <td style="width:25%"></td>
87
127
  </tr>
88
128
  </tbody>
89
129
  </table>
90
130
  </div>
91
-
92
- <%= clear_tag(20) %>
93
-
94
- </div>
95
-
96
- <% if display_manage_links? %>
97
- <div class="col-md-3 col-sm-12 col-xs-12">
98
- <%= display_manage_buttons(@branch) %>
99
- <%= display_publishable_buttons(@branch) %>
100
- <%= display_featurable_buttons(@branch) %>
101
- <% if display_edit_links? %>
102
- <% if @branch.main_branch? %>
103
- <!-- Remove Branch -->
104
- <%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Remove Main Branch"), remove_main_branch_path(:id =>@branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-danger btn-only-hover" %>
105
- <% else %>
106
- <!-- Main Branch -->
107
- <%= link_to raw("<i class=\"fa fa-check mr-5\"></i> Make this Main Branch"), make_main_branch_path(:id =>@branch.id), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"btn btn-block btn-success btn-only-hover" %>
108
- <% end %>
109
- <% end %>
110
131
  </div>
111
- <% end %>
112
-
113
132
  </div>
114
133
 
115
- <%= clear_tag(10) %>
134
+ <% if @current_user.super_admin? %>
135
+ <%= clear_tag(40) %>
136
+ <div><strong class="fs-18">Technical Details</strong></div>
137
+ <hr>
116
138
 
117
- <ul class="nav nav-pills">
118
- <li class="active">
119
- <a href="#technical_details" data-toggle="tab" aria-expanded="false">
120
- <span class="visible-xs"><i class="fa-database"></i></span>
121
- <span class="hidden-xs">Technical Details</span>
122
- </a>
123
- </li>
124
- </ul>
125
-
126
- <div class="tab-content">
127
- <div class="tab-pane active" id="technical_details" style="border: 1px solid #000;min-height:200px;padding:20px;margin-bottom:20px;max-height: 400px;overflow-y: auto;">
128
-
129
- <%= clear_tag(20) %>
130
-
131
- <div class="table-responsive">
132
- <table class="table table-striped table-condensed table-bordered mb-60">
133
- <tbody>
134
-
135
- <tr>
136
- <th>ID</th><td><%= @branch.id %></td>
137
- <th>Permalink</th><td><%#= @branch.to_param %></td>
138
- </tr>
139
- <tr>
140
- <th>Featured</th><td><%#= @branch.featured %></td>
141
- <th>Status</th><td><%= @branch.status %></td>
142
- </tr>
143
- <tr>
144
- <th>Created At</th><td><%= @branch.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @branch.created_at %></td>
145
- <th>Updated At</th><td><%= @branch.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @branch.updated_at %></td>
146
- </tr>
147
-
148
- </tbody>
149
- </table>
150
- </div>
139
+ <div class="table-responsive">
140
+ <table class="table table-striped table-condensed table-bordered mb-60">
141
+ <tbody>
151
142
 
152
- </div>
143
+ <tr>
144
+ <th>ID</th><td><%= @branch.id %></td>
145
+ <th>Permalink</th><td><%= @branch.to_param %></td>
146
+ </tr>
147
+ <tr>
148
+ <th>Featured</th><td><%= @branch.featured %></td>
149
+ <th>Status</th><td><%= @branch.status %></td>
150
+ </tr>
151
+ <tr>
152
+ <th>Created At</th><td><%= @branch.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @branch.created_at %></td>
153
+ <th>Updated At</th><td><%= @branch.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @branch.updated_at %></td>
154
+ </tr>
155
+
156
+ </tbody>
157
+ </table>
153
158
  </div>
159
+ <% end %>
154
160
 
155
161
  <%= link_to "Close", "#", onclick: "closeLargeModal();", class: "btn btn-primary pull-right" %>
156
162