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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4332cb6da0a238d179e6741a58052d4c3980f979
4
- data.tar.gz: feb098e4645175e51091757febd1870741cad2ea
3
+ metadata.gz: 8a31c4186a8a046b6b45aedbc0e8b051b2e3ca94
4
+ data.tar.gz: 7828c199d77737380d93a7703eb6f3c6bfce9de3
5
5
  SHA512:
6
- metadata.gz: 21a8f24d8cccea2de937779133a064253512e1829588978285c29505409968bf9f8d48e559258299826c7ff71c0c5b5b13f0a209d6a04177696c6f6a5263042b
7
- data.tar.gz: 4931a0d76494a9c5eec283299ddb10f11c524766202e3feb54463f97730ccbab0b9fd7fb7d98e76cc0218fdb56d86dca9b7a253b034394de46be615f11a924be
6
+ metadata.gz: c2d5692673467bb172246ded35e8ee5d12cdd33e8333b2018c04eb2f78e04901e55ad65fffa86114a345a791d3ce9e3460f1ec6a08ef734d6460483ace234d1b
7
+ data.tar.gz: d69aa7af35ac67bd1149b00f2b535dd0f0dc20f62c61d79814f757942f7a5a90e73bc63f5138834b79ebfce5a98388447cdae18cf8c6c068f775073ae34bd0db
@@ -59,7 +59,7 @@ module Dhatu
59
59
  end
60
60
 
61
61
  def get_features
62
- @features = Feature.categorisable.published.order("priority ASC, name ASC").all
62
+ @features = Feature.categorisable.published.order("name ASC").all
63
63
  end
64
64
 
65
65
  def permitted_params
@@ -97,6 +97,8 @@ module Dhatu
97
97
  case @category_type
98
98
  when "none"
99
99
  @relation = @relation.joins("LEFT JOIN features f on f.name = categories.category_type").where("f.name is NULL")
100
+ when "all_including_children"
101
+ @relation = Dhatu::Category.where("")
100
102
  when "All"
101
103
  @relation = @relation.where("")
102
104
  else
@@ -35,6 +35,49 @@ class Dhatu::BlogPost < Dhatu::ApplicationRecord
35
35
 
36
36
  scope :upcoming, lambda { where("starts_at >= ?", Time.now) }
37
37
  scope :past, lambda { where("starts_at < ?", Time.now) }
38
+
39
+ def self.save_row_data(hsh)
40
+ # Initializing error hash for displaying all errors altogether
41
+ error_object = Kuppayam::Importer::ErrorHash.new
42
+
43
+ return error_object if hsh[:title].to_s.strip.blank?
44
+
45
+ category = Dhatu::Category.find_by_name(hsh[:category].to_s.strip)
46
+
47
+ unless category
48
+ puts "Category '#{hsh[:category].to_s.strip}' not found".red
49
+ return
50
+ end
51
+
52
+ blog_post = Dhatu::BlogPost.where("title = ? AND category_id = ?", hsh[:title].to_s.strip, category.id).first || Dhatu::BlogPost.new
53
+
54
+ blog_post.title = hsh[:title].to_s.strip
55
+ blog_post.slug = blog_post.title.parameterize[0..64] if blog_post.title
56
+ blog_post.author = hsh[:author].to_s.strip
57
+ blog_post.meta_description = hsh[:meta_description].to_s.strip
58
+ blog_post.description = hsh[:description].to_s.strip
59
+ blog_post.posted_at = hsh[:posted_at].to_s.strip
60
+
61
+ blog_post.category = category
62
+
63
+ blog_post.featured = ["true", "t","1","yes","y"].include?(hsh[:featured].to_s.strip)
64
+ blog_post.status = hsh[:status].to_s.strip.blank? ? PUBLISHED : hsh[:status].to_s.strip
65
+
66
+ if blog_post.valid?
67
+ begin
68
+ blog_post.save!
69
+ rescue Exception => e
70
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
71
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
72
+ error_object.errors << { summary: summary, details: details }
73
+ end
74
+ else
75
+ summary = "Error while saving blog_post: #{blog_post.title}"
76
+ details = "Error! #{blog_post.errors.full_messages.to_sentence}"
77
+ error_object.errors << { summary: summary, details: details }
78
+ end
79
+ return error_object
80
+ end
38
81
 
39
82
  # ------------------
40
83
  # Instance Methods
@@ -28,7 +28,7 @@ class Dhatu::Booking < Dhatu::ApplicationRecord
28
28
  scope :past, lambda { where("created_at < ?", Time.now) }
29
29
 
30
30
  # ------------------
31
- # Instance variables
31
+ # Instance Methods
32
32
  # ------------------
33
33
 
34
34
  # Generic Methods
@@ -57,8 +57,55 @@ class Dhatu::Branch < Dhatu::ApplicationRecord
57
57
  scope :past, lambda { where("created_at < ?", Time.now) }
58
58
  scope :main_branch, lambda { where("main_branch is TRUE")}
59
59
 
60
+ def self.save_row_data(hsh)
61
+ # Initializing error hash for displaying all errors altogether
62
+ error_object = Kuppayam::Importer::ErrorHash.new
63
+
64
+ return error_object if hsh[:title].to_s.strip.blank?
65
+
66
+ branch = Dhatu::Branch.find_by_title(hsh[:title].to_s.strip) || Dhatu::Branch.new
67
+
68
+ branch.title = hsh[:title].to_s.strip
69
+ branch.address_1 = hsh[:address_1].to_s.strip
70
+ branch.address_2 = hsh[:address_2].to_s.strip
71
+ branch.address_3 = hsh[:address_3].to_s.strip
72
+ branch.email = hsh[:email].to_s.strip
73
+ branch.landline = hsh[:landline].to_s.strip
74
+ branch.fax = hsh[:fax].to_s.strip
75
+ branch.mobile = hsh[:mobile].to_s.strip
76
+
77
+ branch.facebook = hsh[:facebook].to_s.strip
78
+ branch.twitter = hsh[:twitter].to_s.strip
79
+ branch.google_plus = hsh[:google_plus].to_s.strip
80
+ branch.linked_in = hsh[:linked_in].to_s.strip
81
+ branch.youtube = hsh[:youtube].to_s.strip
82
+ branch.instagram = hsh[:instagram].to_s.strip
83
+ branch.tumblr = hsh[:tumblr].to_s.strip
84
+ branch.pinterest = hsh[:pinterest].to_s.strip
85
+ branch.blog = hsh[:blog].to_s.strip
86
+ branch.status = hsh[:status].to_s.strip.blank? ? PUBLISHED : hsh[:status].to_s.strip
87
+
88
+ branch.featured = ["true", "t","1","yes","y"].include?(hsh[:featured].to_s.strip)
89
+ branch.main_branch = ["true", "t","1","yes","y"].include?(hsh[:main_branch].to_s.strip)
90
+
91
+ if branch.valid?
92
+ begin
93
+ branch.save!
94
+ rescue Exception => e
95
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
96
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
97
+ error_object.errors << { summary: summary, details: details }
98
+ end
99
+ else
100
+ summary = "Error while saving branch: #{branch.title}"
101
+ details = "Error! #{branch.errors.full_messages.to_sentence}"
102
+ error_object.errors << { summary: summary, details: details }
103
+ end
104
+ return error_object
105
+ end
106
+
60
107
  # ------------------
61
- # Instance variables
108
+ # Instance Methods
62
109
  # ------------------
63
110
 
64
111
  # Generic Methods
@@ -92,7 +92,7 @@ class Dhatu::Category < Dhatu::ApplicationRecord
92
92
  end
93
93
 
94
94
  # ------------------
95
- # Instance methods
95
+ # Instance Methods
96
96
  # ------------------
97
97
 
98
98
  # Other Methods
@@ -63,7 +63,7 @@ class Dhatu::Offer < Dhatu::ApplicationRecord
63
63
  end
64
64
 
65
65
  # ------------------
66
- # Instance variables
66
+ # Instance Methods
67
67
  # ------------------
68
68
 
69
69
  # Generic Methods
@@ -64,7 +64,7 @@ class Dhatu::Price < Dhatu::ApplicationRecord
64
64
  end
65
65
 
66
66
  # ------------------
67
- # Instance variables
67
+ # Instance Methods
68
68
  # ------------------
69
69
 
70
70
  # Generic Methods
@@ -30,8 +30,48 @@ class Dhatu::Promotion < Dhatu::ApplicationRecord
30
30
  scope :upcoming, lambda { where("starts_at >= ?", Time.now) }
31
31
  scope :past, lambda { where("starts_at < ?", Time.now) }
32
32
 
33
+ def self.save_row_data(hsh)
34
+ # Initializing error hash for displaying all errors altogether
35
+ error_object = Kuppayam::Importer::ErrorHash.new
36
+
37
+ return error_object if hsh[:title].to_s.strip.blank?
38
+
39
+ promotion = Dhatu::Promotion.find_by_title(hsh[:title].to_s.strip) || Dhatu::Promotion.new
40
+
41
+ promotion.title = hsh[:title].to_s.strip
42
+ promotion.code = hsh[:code].to_s.strip
43
+ promotion.short_description = hsh[:short_description].to_s.strip
44
+
45
+ promotion.display_name = ["true", "t","1","yes","y"].include?(hsh[:display_name].to_s.strip)
46
+ promotion.display_email = ["true", "t","1","yes","y"].include?(hsh[:display_email].to_s.strip)
47
+ promotion.display_phone = ["true", "t","1","yes","y"].include?(hsh[:display_phone].to_s.strip)
48
+
49
+ promotion.name_mandatory = ["true", "t","1","yes","y"].include?(hsh[:name_mandatory].to_s.strip)
50
+ promotion.email_mandatory = ["true", "t","1","yes","y"].include?(hsh[:email_mandatory].to_s.strip)
51
+ promotion.phone_mandatory = ["true", "t","1","yes","y"].include?(hsh[:phone_mandatory].to_s.strip)
52
+
53
+ promotion.featured = ["true", "t","1","yes","y"].include?(hsh[:featured].to_s.strip)
54
+ promotion.status = hsh[:status].to_s.strip.blank? ? PUBLISHED : hsh[:status].to_s.strip
55
+ promotion.priority = hsh[:priority].to_s.strip.blank? ? 1000 : hsh[:priority].to_s.strip
56
+
57
+ if promotion.valid?
58
+ begin
59
+ promotion.save!
60
+ rescue Exception => e
61
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
62
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
63
+ error_object.errors << { summary: summary, details: details }
64
+ end
65
+ else
66
+ summary = "Error while saving promotion: #{promotion.title}"
67
+ details = "Error! #{promotion.errors.full_messages.to_sentence}"
68
+ error_object.errors << { summary: summary, details: details }
69
+ end
70
+ return error_object
71
+ end
72
+
33
73
  # ------------------
34
- # Instance variables
74
+ # Instance Methods
35
75
  # ------------------
36
76
 
37
77
  # Generic Methods
@@ -46,7 +86,7 @@ class Dhatu::Promotion < Dhatu::ApplicationRecord
46
86
 
47
87
  def promotion_attributes_with_values
48
88
  hsh = {}
49
- self.promotion_attributes.each do |pa|
89
+ self.promotion_attributes.published.where("mandatory is TRUE").order("priority ASC, name ASC").each do |pa|
50
90
  hsh[pa.name] = { values: pa.values, selected: "selected", data_type: pa.data_type, mandatory: pa.mandatory}
51
91
  end
52
92
  hsh
@@ -69,5 +109,27 @@ class Dhatu::Promotion < Dhatu::ApplicationRecord
69
109
  def generate_and_save_code
70
110
  self.update_attribute(:code, SecureRandom.hex(4))
71
111
  end
112
+
113
+ # Image Configuration
114
+ # -------------
115
+ def self.image_configuration
116
+ {
117
+ "Image::CoverImage" => {
118
+ max_upload_limit: 10485760,
119
+ min_upload_limit: 1,
120
+ resolutions: [1000, 500],
121
+ form_upload_image_label: "Upload a new Image",
122
+ form_title: "Upload an Image",
123
+ form_sub_title: "Please read the instructions below:",
124
+ form_instructions: [
125
+ "the filename should be in .jpg / .jpeg or .png format",
126
+ "the image resolutions should be <strong>1000 x 500 Pixels</strong>",
127
+ "the file size should be greater than 100 Kb and or lesser than <strong>10 MB</strong>",
128
+ "Note: most cameras and camera phones will produce images bigger than this"
129
+ ]
130
+ }
131
+ }
132
+
133
+ end
72
134
 
73
135
  end
@@ -26,7 +26,7 @@ class Dhatu::PromotionAttribute < Dhatu::ApplicationRecord
26
26
  before_validation :convert_string_values_to_array
27
27
 
28
28
  # ------------------
29
- # Instance variables
29
+ # Instance Methods
30
30
  # ------------------
31
31
 
32
32
  # Other Methods
@@ -29,7 +29,7 @@ class Dhatu::PromotionEnquiry < Dhatu::ApplicationRecord
29
29
  scope :past, lambda { where("created_at < ?", Time.now) }
30
30
 
31
31
  # ------------------
32
- # Instance variables
32
+ # Instance Methods
33
33
  # ------------------
34
34
 
35
35
  # Generic Methods
@@ -44,38 +44,45 @@ class Dhatu::Section < Dhatu::ApplicationRecord
44
44
 
45
45
  return error_object if hsh[:title].to_s.strip.blank?
46
46
 
47
- service = Dhatu::Section.find_by_title(hsh[:title].to_s.strip) || Dhatu::Section.new
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
48
55
 
49
- service.title = hsh[:title].to_s.strip
50
- service.sub_title = hsh[:sub_title].to_s.strip
51
- service.short_description = hsh[:short_description].to_s.strip
52
- service.long_description = hsh[:long_description].to_s.strip
53
- service.button_one_text = hsh[:button_one_text].to_s.strip
54
- service.button_two_text = hsh[:button_two_text].to_s.strip
55
- service.button_one_link = hsh[:button_one_link].to_s.strip
56
- service.button_two_link = hsh[:button_two_link].to_s.strip
57
-
58
- service.section_type = Dhatu::SectionType.find_by_code(hsh[:section_type].to_s.strip)
59
- service.status = hsh[:status].to_s.strip || PUBLISHED
60
-
61
- if service.valid?
56
+ section.title = hsh[:title].to_s.strip
57
+ section.sub_title = hsh[:sub_title].to_s.strip
58
+ section.short_description = hsh[:short_description].to_s.strip
59
+ section.long_description = hsh[:long_description].to_s.strip
60
+ section.button_one_text = hsh[:button_one_text].to_s.strip
61
+ section.button_two_text = hsh[:button_two_text].to_s.strip
62
+ section.button_one_link = hsh[:button_one_link].to_s.strip
63
+ section.button_two_link = hsh[:button_two_link].to_s.strip
64
+
65
+ section.section_type = section_type
66
+ section.status = hsh[:status].to_s.strip || PUBLISHED
67
+
68
+ if section.valid?
62
69
  begin
63
- service.save!
70
+ section.save!
64
71
  rescue Exception => e
65
72
  summary = "uncaught #{e} exception while handling connection: #{e.message}"
66
73
  details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
67
74
  error_object.errors << { summary: summary, details: details }
68
75
  end
69
76
  else
70
- summary = "Error while saving service: #{service.title}"
71
- details = "Error! #{service.errors.full_messages.to_sentence}"
77
+ summary = "Error while saving section: #{section.title}"
78
+ details = "Error! #{section.errors.full_messages.to_sentence}"
72
79
  error_object.errors << { summary: summary, details: details }
73
80
  end
74
81
  return error_object
75
82
  end
76
83
 
77
84
  # ------------------
78
- # Instance variables
85
+ # Instance Methods
79
86
  # ------------------
80
87
 
81
88
  # Generic Methods
@@ -47,7 +47,7 @@ class Dhatu::SectionType < Dhatu::ApplicationRecord
47
47
  end
48
48
 
49
49
  # ------------------
50
- # Instance variables
50
+ # Instance Methods
51
51
  # ------------------
52
52
 
53
53
  # Generic Methods
@@ -69,7 +69,7 @@ class Dhatu::Service < Dhatu::ApplicationRecord
69
69
  end
70
70
 
71
71
  # ------------------
72
- # Instance variables
72
+ # Instance Methods
73
73
  # ------------------
74
74
 
75
75
  # Generic Methods
@@ -69,7 +69,7 @@ class Dhatu::TeamMember < Dhatu::ApplicationRecord
69
69
  end
70
70
 
71
71
  # ------------------
72
- # Instance variables
72
+ # Instance Methods
73
73
  # ------------------
74
74
 
75
75
  # Generic Methods
@@ -63,7 +63,7 @@ class Dhatu::Testimonial < Dhatu::ApplicationRecord
63
63
  end
64
64
 
65
65
  # ------------------
66
- # Instance variables
66
+ # Instance Methods
67
67
  # ------------------
68
68
 
69
69
  # Generic Methods
@@ -12,9 +12,14 @@
12
12
  <%= link_to feature.display_name, categories_path(category_type: feature.name) %>
13
13
  </li>
14
14
  <% end %>
15
+ <% if @current_user.super_admin? %>
15
16
  <li class="<%= @category_type == "none" ? 'active' : '' %>">
16
17
  <%= link_to "None", categories_path(category_type: :none) %>
17
18
  </li>
19
+ <li class="<%= @category_type == "all_including_children" ? 'active' : '' %>">
20
+ <%= link_to "All Including Children", categories_path(category_type: :all_including_children) %>
21
+ </li>
22
+ <% end %>
18
23
  </ul>
19
24
 
20
25
  <div class="tab-content">
@@ -1,53 +1,51 @@
1
- <div class="table-responsive">
2
- <table class="table table-hover members-table middle-align">
3
- <thead>
4
- <tr>
5
- <th style="text-align: center;width:5%">#</th>
6
- <th style="text-align: center;width:100px"><i class="fa fa-photo"></i></th>
7
- <th>Offer Title</th>
8
- <th>Offer Text</th>
9
- <th style="width:100px;" class="hidden-sm hidden-xs">Featured</th>
10
- <th style="width:100px;" class="hidden-sm hidden-xs">Status</th>
11
- <% if display_manage_links? %>
12
- <th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th>
1
+ <table class="table table-hover members-table middle-align">
2
+ <thead>
3
+ <tr>
4
+ <th style="text-align: center;width:5%" class="hidden-sm hidden-xs">#</th>
5
+ <th style="text-align: center;width:100px" class="hidden-sm hidden-xs"><i class="fa fa-photo"></i></th>
6
+ <th>Offer Title</th>
7
+ <th class="hidden-sm hidden-xs">Offer Text</th>
8
+ <th style="width:100px;" class="hidden-sm hidden-xs">Featured</th>
9
+ <th style="width:100px;" class="hidden-sm hidden-xs">Status</th>
10
+ <% if display_manage_links? %>
11
+ <th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th>
12
+ <% end %>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr id="tr_offer_0"></tr>
17
+ <% @offers.each_with_index do |offer, i| %>
18
+ <tr id="tr_offer_<%= offer.id %>">
19
+
20
+ <th scope="row" style="text-align: center;" class="hidden-sm hidden-xs">
21
+ <%= serial_number(i) %>
22
+ </th>
23
+
24
+ <td class="display-image hidden-sm hidden-xs">
25
+ <%= display_thumbnail_small(offer) %>
26
+ </td>
27
+
28
+ <td class="display-link"><%= link_to offer.title, offer_path(offer), remote: true %></td>
29
+
30
+ <td class="display-link hidden-sm hidden-xs"><%= link_to offer.offer_text, offer_path(offer), remote: true %></td>
31
+
32
+ <td class="hidden-sm hidden-xs"><%= display_featured(offer) %></td>
33
+
34
+ <td class="hidden-sm hidden-xs"><%= display_publishable_status(offer) %></td>
35
+
36
+ <% if display_manage_links? %>
37
+ <td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(offer) %></td>
38
+
39
+ <td class="action-links hidden-sm hidden-xs" style="width:10%">
40
+ <%= display_featurable_links(offer) %>
41
+ <%= display_manage_links(offer, @current_user) %>
42
+ </td>
13
43
  <% end %>
14
- </tr>
15
- </thead>
16
- <tbody>
17
- <tr id="tr_offer_0"></tr>
18
- <% @offers.each_with_index do |offer, i| %>
19
- <tr id="tr_offer_<%= offer.id %>">
20
-
21
- <th scope="row" style="text-align: center;">
22
- <%= serial_number(i) %>
23
- </th>
24
-
25
- <td class="display-image">
26
- <%= display_thumbnail_small(offer) %>
27
- </td>
28
-
29
- <td class="display-link"><%= link_to offer.title, offer_path(offer), remote: true %></td>
30
-
31
- <td class="display-link"><%= link_to offer.offer_text, offer_path(offer), remote: true %></td>
32
-
33
- <td class="hidden-sm hidden-xs"><%= display_featured(offer) %></td>
34
-
35
- <td class="hidden-sm hidden-xs"><%= display_publishable_status(offer) %></td>
36
-
37
- <% if display_manage_links? %>
38
- <td class="action-links hidden-sm hidden-xs" style="width:10%"><%= display_publishable_links(offer) %></td>
39
-
40
- <td class="action-links hidden-sm hidden-xs" style="width:10%">
41
- <%= display_featurable_links(offer) %>
42
- <%= display_manage_links(offer, @current_user) %>
43
- </td>
44
- <% end %>
45
-
46
- </tr>
47
- <% end %>
48
- </tbody>
49
- </table>
50
- </div>
44
+
45
+ </tr>
46
+ <% end %>
47
+ </tbody>
48
+ </table>
51
49
 
52
50
  <div class="row">
53
51
  <div class="col-sm-12">