dhatu 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b44d66d46f512e9310e9b7ee907df3e6611179f7
4
- data.tar.gz: b785eb69e6d6d2178cb6bfcb4fa64c0b51ee1978
3
+ metadata.gz: 36759d01bacfbc0a7baa19da61d564470b1cd677
4
+ data.tar.gz: f373bfbc5d1523cb583eeea9789c6d202f193745
5
5
  SHA512:
6
- metadata.gz: 76b6e80ed6f7665296fcd71553ce4857cd2f99b3cc4c23d45f0596be1587b90546156eb6bb2eae42f9a7a276d4d6e883129693052dc60d5da5b94b0389544942
7
- data.tar.gz: ebfa076bd05c6ffecada3221aca343c93deecba065124c4ab8b87c44fc0da2883f913bd34802600d89a678002795116b18434ed72e46c1d03546dca23a728663
6
+ metadata.gz: ae2b6c44eb5d2f2bbad11ca05405670e6171485f86ebeecb482d567443a8516ce8c83659b2e46f3ddf32cb0a101b8e36501bcb58fb4e07c845825749a4b3e1c3
7
+ data.tar.gz: 4eb5eef76c579bff8b8efc122c3ed30817e81254c1e4e6357590f6a2531bebfec298815be8dce23b309752fe9955ce807f0e66ef93bc9ca3807ef4601f9dc8c9
@@ -56,18 +56,20 @@ class Dhatu::Category < Dhatu::ApplicationRecord
56
56
  # Initializing error hash for displaying all errors altogether
57
57
  error_object = Kuppayam::Importer::ErrorHash.new
58
58
 
59
- return error_object if hsh[:name].blank?
59
+ return error_object if hsh[:name].to_s.strip.blank?
60
60
 
61
- category = Dhatu::Category.find_by_name(hsh[:name]) || Dhatu::Category.new
62
- category.name = hsh[:name]
63
- category.one_liner = hsh[:one_liner]
64
- category.description = hsh[:description]
65
- category.priority = hsh[:priority]
61
+ category = Dhatu::Category.find_by_name(hsh[:name].to_s.strip) || Dhatu::Category.new
62
+ category.name = hsh[:name].to_s.strip
63
+ category.category_type = hsh[:category_type].to_s.strip
64
+ category.one_liner = hsh[:one_liner].to_s.strip
65
+ category.description = hsh[:description].to_s.strip
66
66
 
67
- parent = Dhatu::Category.find_by_name(hsh[:parent])
67
+ parent = Dhatu::Category.find_by_name(hsh[:parent].to_s.strip)
68
68
  category.parent = parent
69
69
  category.top_parent = parent && parent.top_parent ? parent.top_parent : parent
70
- category.status = PUBLISHED
70
+
71
+ category.status = hsh[:status].to_s.strip || PUBLISHED
72
+ category.priority = hsh[:priority].to_s.strip || 1
71
73
 
72
74
  # Initializing error hash for displaying all errors altogether
73
75
  error_object = Kuppayam::Importer::ErrorHash.new
@@ -13,7 +13,7 @@ class Dhatu::Event < Dhatu::ApplicationRecord
13
13
  validates :description, presence: true
14
14
 
15
15
  # Associations
16
- belongs_to :category
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
19
 
@@ -28,6 +28,41 @@ class Dhatu::Event < Dhatu::ApplicationRecord
28
28
  scope :upcoming, lambda { where("starts_at >= ?", Time.now) }
29
29
  scope :past, lambda { where("starts_at < ?", Time.now) }
30
30
 
31
+ def self.save_row_data(hsh)
32
+ # Initializing error hash for displaying all errors altogether
33
+ error_object = Kuppayam::Importer::ErrorHash.new
34
+
35
+ return error_object if hsh[:title].to_s.strip.blank?
36
+
37
+ event = Dhatu::Event.find_by_title(hsh[:title].to_s.strip) || Dhatu::Event.new
38
+ event.title = hsh[:title].to_s.strip
39
+ event.venue = hsh[:venue].to_s.strip
40
+ event.description = hsh[:description].to_s.strip
41
+ event.date = hsh[:date].to_s.strip
42
+ event.starts_at = hsh[:starts_at].to_s.strip
43
+ event.ends_at = hsh[:ends_at].to_s.strip
44
+
45
+ # event.category = Dhatu::Category.find_by_name(hsh[:category])
46
+ event.status = hsh[:status].to_s.strip || PUBLISHED
47
+ event.featured = hsh[:featured].to_s.strip == "true"
48
+ event.priority = hsh[:priority].to_s.strip || 1
49
+
50
+ if event.valid?
51
+ begin
52
+ event.save!
53
+ rescue Exception => e
54
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
55
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
56
+ error_object.errors << { summary: summary, details: details }
57
+ end
58
+ else
59
+ summary = "Error while saving event: #{event.title}"
60
+ details = "Error! #{event.errors.full_messages.to_sentence}"
61
+ error_object.errors << { summary: summary, details: details }
62
+ end
63
+ return error_object
64
+ end
65
+
31
66
  # ------------------
32
67
  # Instance Methods
33
68
  # ------------------
@@ -13,7 +13,7 @@ class Dhatu::Offer < Dhatu::ApplicationRecord
13
13
  validates :description, presence: true
14
14
 
15
15
  # Associations
16
- belongs_to :category
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
19
 
@@ -28,6 +28,40 @@ class Dhatu::Offer < Dhatu::ApplicationRecord
28
28
  scope :upcoming, lambda { where("starts_at >= ?", Time.now) }
29
29
  scope :past, lambda { where("starts_at < ?", Time.now) }
30
30
 
31
+ def self.save_row_data(hsh)
32
+ # Initializing error hash for displaying all errors altogether
33
+ error_object = Kuppayam::Importer::ErrorHash.new
34
+
35
+ return error_object if hsh[:title].to_s.strip.blank?
36
+
37
+ offer = Dhatu::Offer.find_by_title(hsh[:title].to_s.strip) || Dhatu::Offer.new
38
+ offer.title = hsh[:title].to_s.strip
39
+ offer.offer_text = hsh[:offer_text].to_s.strip
40
+ offer.description = hsh[:description].to_s.strip
41
+ offer.starts_at = hsh[:starts_at].to_s.strip
42
+ offer.ends_at = hsh[:ends_at].to_s.strip
43
+
44
+ offer.category = Dhatu::Category.find_by_name(hsh[:category].to_s.strip)
45
+ offer.status = hsh[:status].to_s.strip || PUBLISHED
46
+ offer.featured = hsh[:featured].to_s.strip == "true"
47
+ offer.priority = hsh[:priority].to_s.strip || 1
48
+
49
+ if offer.valid?
50
+ begin
51
+ offer.save!
52
+ rescue Exception => e
53
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
54
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
55
+ error_object.errors << { summary: summary, details: details }
56
+ end
57
+ else
58
+ summary = "Error while saving offer: #{offer.title}"
59
+ details = "Error! #{offer.errors.full_messages.to_sentence}"
60
+ error_object.errors << { summary: summary, details: details }
61
+ end
62
+ return error_object
63
+ end
64
+
31
65
  # ------------------
32
66
  # Instance variables
33
67
  # ------------------
@@ -15,7 +15,7 @@ class Dhatu::Price < Dhatu::ApplicationRecord
15
15
  validates :category, presence: true
16
16
 
17
17
  # Associations
18
- belongs_to :category
18
+ belongs_to :category, optional: true
19
19
  has_one :cover_image, :as => :imageable, :dependent => :destroy, :class_name => "Image::CoverImage"
20
20
 
21
21
  # ------------------
@@ -31,6 +31,38 @@ class Dhatu::Price < Dhatu::ApplicationRecord
31
31
  scope :upcoming, lambda { where("created_at >= ?", Time.now) }
32
32
  scope :past, lambda { where("created_at < ?", Time.now) }
33
33
 
34
+ def self.save_row_data(hsh)
35
+ # Initializing error hash for displaying all errors altogether
36
+ error_object = Kuppayam::Importer::ErrorHash.new
37
+
38
+ return error_object if hsh[:title].to_s.strip.blank?
39
+
40
+ price = Dhatu::Price.find_by_title(hsh[:title].to_s.strip) || Dhatu::Price.new
41
+ price.title = hsh[:title].to_s.strip
42
+ price.sub_title = hsh[:sub_title].to_s.strip
43
+ price.price = hsh[:price].to_s.strip
44
+
45
+ price.category = Dhatu::Category.find_by_name(hsh[:category].to_s.strip)
46
+ price.status = hsh[:status].to_s.strip || PUBLISHED
47
+ price.featured = hsh[:featured].to_s.strip == "true"
48
+ price.priority = hsh[:priority].to_s.strip || 1
49
+
50
+ if price.valid?
51
+ begin
52
+ price.save!
53
+ rescue Exception => e
54
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
55
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
56
+ error_object.errors << { summary: summary, details: details }
57
+ end
58
+ else
59
+ summary = "Error while saving price: #{price.title}"
60
+ details = "Error! #{price.errors.full_messages.to_sentence}"
61
+ error_object.errors << { summary: summary, details: details }
62
+ end
63
+ return error_object
64
+ end
65
+
34
66
  # ------------------
35
67
  # Instance variables
36
68
  # ------------------
@@ -38,6 +38,42 @@ class Dhatu::Section < Dhatu::ApplicationRecord
38
38
  scope :past, lambda { where("created_at < ?", Time.now) }
39
39
  scope :find_by_section_type, lambda {|section_code| joins(:section_type).where("code = ?", section_code) }
40
40
 
41
+ def self.save_row_data(hsh)
42
+ # Initializing error hash for displaying all errors altogether
43
+ error_object = Kuppayam::Importer::ErrorHash.new
44
+
45
+ return error_object if hsh[:title].to_s.strip.blank?
46
+
47
+ service = Dhatu::Section.find_by_title(hsh[:title].to_s.strip) || Dhatu::Section.new
48
+
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?
62
+ begin
63
+ service.save!
64
+ rescue Exception => e
65
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
66
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
67
+ error_object.errors << { summary: summary, details: details }
68
+ end
69
+ else
70
+ summary = "Error while saving service: #{service.title}"
71
+ details = "Error! #{service.errors.full_messages.to_sentence}"
72
+ error_object.errors << { summary: summary, details: details }
73
+ end
74
+ return error_object
75
+ end
76
+
41
77
  # ------------------
42
78
  # Instance variables
43
79
  # ------------------
@@ -20,19 +20,15 @@ class Dhatu::SectionType < Dhatu::ApplicationRecord
20
20
  # Associations
21
21
  has_many :sections, :class_name => "Dhatu::Section"
22
22
 
23
- # ------------------
24
- # Class variables
25
- # ------------------
26
-
27
23
  def self.save_row_data(hsh)
28
24
  # Initializing error hash for displaying all errors altogether
29
25
  error_object = Kuppayam::Importer::ErrorHash.new
30
26
 
31
- return error_object if hsh[:name].blank?
27
+ return error_object if hsh[:name].to_s.strip.blank?
32
28
 
33
- section_type = Dhatu::SectionType.find_by_name(hsh[:name]) || Dhatu::SectionType.new
34
- section_type.name = hsh[:name]
35
- section_type.code = hsh[:code]
29
+ section_type = Dhatu::SectionType.find_by_name(hsh[:name].to_s.strip) || Dhatu::SectionType.new
30
+ section_type.name = hsh[:name].to_s.strip
31
+ section_type.code = hsh[:code].to_s.strip
36
32
 
37
33
  if section_type.valid?
38
34
  begin
@@ -34,6 +34,40 @@ class Dhatu::Service < Dhatu::ApplicationRecord
34
34
  scope :upcoming, lambda { where("created_at >= ?", Time.now) }
35
35
  scope :past, lambda { where("created_at < ?", Time.now) }
36
36
 
37
+ def self.save_row_data(hsh)
38
+ # Initializing error hash for displaying all errors altogether
39
+ error_object = Kuppayam::Importer::ErrorHash.new
40
+
41
+ return error_object if hsh[:name].to_s.strip.blank?
42
+
43
+ service = Dhatu::Service.find_by_name(hsh[:name].to_s.strip) || Dhatu::Service.new
44
+ service.name = hsh[:name].to_s.strip
45
+ service.one_liner = hsh[:one_liner].to_s.strip
46
+ service.generate_permalink
47
+ service.description = hsh[:description].to_s.strip
48
+ service.price = hsh[:price].to_s.strip
49
+ service.duration = hsh[:duration].to_s.strip
50
+ service.category = Dhatu::Category.find_by_name(hsh[:category].to_s.strip)
51
+ service.status = hsh[:status].to_s.strip || PUBLISHED
52
+ service.featured = hsh[:featured].to_s.strip || true
53
+ service.priority = hsh[:priority].to_s.strip || 1
54
+
55
+ if service.valid?
56
+ begin
57
+ service.save!
58
+ rescue Exception => e
59
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
60
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
61
+ error_object.errors << { summary: summary, details: details }
62
+ end
63
+ else
64
+ summary = "Error while saving service: #{service.name}"
65
+ details = "Error! #{service.errors.full_messages.to_sentence}"
66
+ error_object.errors << { summary: summary, details: details }
67
+ end
68
+ return error_object
69
+ end
70
+
37
71
  # ------------------
38
72
  # Instance variables
39
73
  # ------------------
@@ -44,6 +78,10 @@ class Dhatu::Service < Dhatu::ApplicationRecord
44
78
  "#{id}-#{name.parameterize[0..32]}"
45
79
  end
46
80
 
81
+ def generate_permalink
82
+ self.permalink = self.name.parameterize[0..32]
83
+ end
84
+
47
85
  def display_name
48
86
  "#{name_was}"
49
87
  end
@@ -31,6 +31,43 @@ class Dhatu::TeamMember < Dhatu::ApplicationRecord
31
31
  scope :upcoming, lambda { where("created_at >= ?", Time.now) }
32
32
  scope :past, lambda { where("created_at < ?", Time.now) }
33
33
 
34
+ def self.save_row_data(hsh)
35
+ # Initializing error hash for displaying all errors altogether
36
+ error_object = Kuppayam::Importer::ErrorHash.new
37
+
38
+ return error_object if hsh[:name].to_s.strip.blank?
39
+
40
+ team_member = Dhatu::TeamMember.find_by_name(hsh[:name].to_s.strip) || Dhatu::TeamMember.new
41
+ team_member.name = hsh[:name].to_s.strip
42
+ team_member.designation = hsh[:designation].to_s.strip
43
+ team_member.description = hsh[:description].to_s.strip
44
+
45
+ team_member.linked_in_url = hsh[:linked_in_url].to_s.strip
46
+ team_member.google_plus_url = hsh[:google_plus_url].to_s.strip
47
+ team_member.facebook_url = hsh[:facebook_url].to_s.strip
48
+ team_member.twitter_url = hsh[:twitter_url].to_s.strip
49
+
50
+ # team_member.category = Dhatu::Category.find_by_name(hsh[:category])
51
+ team_member.status = hsh[:status].to_s.strip || PUBLISHED
52
+ team_member.featured = hsh[:featured].to_s.strip || true
53
+ team_member.priority = hsh[:priority].to_s.strip || 1
54
+
55
+ if team_member.valid?
56
+ begin
57
+ team_member.save!
58
+ rescue Exception => e
59
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
60
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
61
+ error_object.errors << { summary: summary, details: details }
62
+ end
63
+ else
64
+ summary = "Error while saving team_member: #{team_member.name}"
65
+ details = "Error! #{team_member.errors.full_messages.to_sentence}"
66
+ error_object.errors << { summary: summary, details: details }
67
+ end
68
+ return error_object
69
+ end
70
+
34
71
  # ------------------
35
72
  # Instance variables
36
73
  # ------------------
@@ -29,6 +29,39 @@ class Dhatu::Testimonial < Dhatu::ApplicationRecord
29
29
  scope :upcoming, lambda { where("created_at >= ?", Time.now) }
30
30
  scope :past, lambda { where("created_at < ?", Time.now) }
31
31
 
32
+ def self.save_row_data(hsh)
33
+ # Initializing error hash for displaying all errors altogether
34
+ error_object = Kuppayam::Importer::ErrorHash.new
35
+
36
+ return error_object if hsh[:name].to_s.strip.blank?
37
+
38
+ testimonial = Dhatu::Testimonial.find_by_name(hsh[:name].to_s.strip) || Dhatu::Testimonial.new
39
+ testimonial.name = hsh[:name].to_s.strip
40
+ testimonial.designation = hsh[:designation].to_s.strip
41
+ testimonial.organisation = hsh[:organisation].to_s.strip
42
+ testimonial.description = hsh[:description].to_s.strip
43
+
44
+ # testimonial.category = Dhatu::Category.find_by_name(hsh[:category])
45
+ testimonial.status = hsh[:status].to_s.strip || PUBLISHED
46
+ testimonial.featured = hsh[:featured].to_s.strip || true
47
+ testimonial.priority = hsh[:priority].to_s.strip || 1
48
+
49
+ if testimonial.valid?
50
+ begin
51
+ testimonial.save!
52
+ rescue Exception => e
53
+ summary = "uncaught #{e} exception while handling connection: #{e.message}"
54
+ details = "Stack trace: #{e.backtrace.map {|l| " #{l}\n"}.join}"
55
+ error_object.errors << { summary: summary, details: details }
56
+ end
57
+ else
58
+ summary = "Error while saving testimonial: #{testimonial.name}"
59
+ details = "Error! #{testimonial.errors.full_messages.to_sentence}"
60
+ error_object.errors << { summary: summary, details: details }
61
+ end
62
+ return error_object
63
+ end
64
+
32
65
  # ------------------
33
66
  # Instance variables
34
67
  # ------------------
@@ -4,8 +4,7 @@
4
4
  <tr>
5
5
  <th style="text-align: center;width:5%">#</th>
6
6
  <!-- <th style="text-align: center;width:100px"><i class="fa fa-photo"></i></th> -->
7
- <th>Title</th>
8
- <th style="width:200px">Type</th>
7
+ <th>Section Type</th>
9
8
  <th style="width:100px;" class="hidden-sm hidden-xs">Status</th>
10
9
  <% if display_manage_links? %>
11
10
  <th style="text-align: center;" colspan="2" class="hidden-sm hidden-xs">Actions</th>
@@ -26,8 +25,6 @@
26
25
  <%#= display_thumbnail_small(section) %>
27
26
  </td> -->
28
27
 
29
- <td class="display-link"><%= link_to section.title, section_path(section), remote: true %></td>
30
-
31
28
  <td class="display-link"><%= link_to section.section_type.try(:name), section_path(section), remote: true %></td>
32
29
 
33
30
  <td class="hidden-sm hidden-xs"><%= display_publishable_status(section) %></td>
@@ -16,10 +16,8 @@
16
16
 
17
17
  <div class="col-md-6 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
18
18
 
19
- <%= theme_panel_heading(@section.title) %>
19
+ <%= theme_panel_heading(@section.section_type.try(:name)) %>
20
20
 
21
- <%= theme_panel_sub_heading(@section.sub_title, "#") if @section.sub_title %>
22
-
23
21
  <%= clear_tag(10) %>
24
22
 
25
23
  <%= display_publishable_status(@section) %>
@@ -31,6 +29,16 @@
31
29
  <table class="table table-condensed table-bordered mb-20">
32
30
  <tbody>
33
31
 
32
+ <tr>
33
+ <th style="width:25%" colspan="2">Title</th>
34
+ <td style="width:25%" colspan="2"><%=@section.title %></td>
35
+ </tr>
36
+
37
+ <tr>
38
+ <th style="width:25%" colspan="2">Sub Title</th>
39
+ <td style="width:25%" colspan="2"><%=@section.sub_title %></td>
40
+ </tr>
41
+
34
42
  <tr>
35
43
  <th style="width:25%">Button Text One</th>
36
44
  <td style="width:25%"><%=@section.button_one_text %></td>
@@ -133,6 +141,14 @@
133
141
  <th>ID</th><td><%= @section.id %></td>
134
142
  <th>Status</th><td><%= @section.status %></td>
135
143
  </tr>
144
+
145
+ <tr>
146
+ <th style="width:25%">Section Code</th>
147
+ <td style="width:25%"><%=@section.section_type.try(:code) %></td>
148
+ <th></th><td></td>
149
+ <th></th><td></td>
150
+ </tr>
151
+
136
152
  <tr>
137
153
  <th>Created At</th><td><%= @section.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @section.created_at %></td>
138
154
  <th>Updated At</th><td><%= @section.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @section.updated_at %></td>
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
  <div class="col-md-4 pr-20">
30
30
  <!-- Priority (integer) -->
31
- <%= theme_form_field(@team_member, :priority, required: false, html_options: {type: :number, style: "width:70px;"}, form_style: "top-bottom") %>
31
+ <%= theme_form_field(@testimonial, :priority, required: false, html_options: {type: :number, style: "width:70px;"}, form_style: "top-bottom") %>
32
32
  </div>
33
33
  </div>
34
34
 
@@ -163,10 +163,11 @@
163
163
  </li>
164
164
  <% else %>
165
165
  <li class="<%= nav_active?('profile/dashboard') ? 'active' : '' %>">
166
- <%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Dashboard</span>"), dhatu.my_account_url %>
166
+ <%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Dashboard</span>"), usman.my_account_url %>
167
167
  </li>
168
168
  <% end %>
169
-
169
+
170
+ <% if dhatu_items.map{|x,y| x if y[:has_permission] }.compact.any? %>
170
171
  <li class="">
171
172
  <a href="#">
172
173
  <i class="fa-trello"></i>
@@ -181,7 +182,9 @@
181
182
  <% end %>
182
183
  </ul>
183
184
  </li>
185
+ <% end %>
184
186
 
187
+ <% if user_items.map{|x,y| x if y[:has_permission] }.compact.any? %>
185
188
  <li class="">
186
189
  <a href="#">
187
190
  <i class="fa-group"></i>
@@ -196,7 +199,9 @@
196
199
  <% end %>
197
200
  </ul>
198
201
  </li>
199
-
202
+ <% end %>
203
+
204
+ <% if configuration_items.map{|x,y| x if y[:has_permission] }.compact.any? %>
200
205
  <li class="">
201
206
  <a href="#">
202
207
  <i class="linecons-params"></i>
@@ -211,7 +216,9 @@
211
216
  <% end %>
212
217
  </ul>
213
218
  </li>
219
+ <% end %>
214
220
 
221
+ <% if pattana_items.map{|x,y| x if y[:has_permission] }.compact.any? %>
215
222
  <li class="">
216
223
  <a href="#">
217
224
  <i class="fa-globe"></i>
@@ -226,6 +233,7 @@
226
233
  <% end %>
227
234
  </ul>
228
235
  </li>
236
+ <% end %>
229
237
 
230
238
  <li class="<%= nav_active?('profile/profile') ? 'active' : '' %>">
231
239
  <a href="#"><i class="linecons-user"></i><span class="title">My Account</span></a>
@@ -1,16 +1,16 @@
1
- name,status
2
- User,published
3
- Registration,unpublished
4
- Role,published
5
- Permission,published
6
- Country,published
7
- Region,published
8
- City,published
9
- Locality,published
10
- Dhatu::Section,published
11
- Dhatu::BlogPost,published
12
- Dhatu::Branch,published
13
- Dhatu::Offer,published
14
- Dhatu::Event,published
15
- Dhatu::Testimonial,published
16
- Dhatu::TeamMember,published
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,3 +1,3 @@
1
1
  module Dhatu
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
3
3
  end
@@ -25,7 +25,7 @@ namespace 'dhatu' do
25
25
  puts " "
26
26
  end
27
27
 
28
- ["Feature", "Dhatu::SectionType"].each do |cls_name|
28
+ ["Dhatu::Category", "Dhatu::Service", "Dhatu::Section", "Dhatu::SectionType", "Dhatu::Event", "Dhatu::Offer", "Dhatu::Price", "Dhatu::Testimonial", "Dhatu::TeamMember"].each do |cls_name|
29
29
  name = cls_name.underscore.pluralize
30
30
  desc "Import #{cls_name.pluralize}"
31
31
  task name => :environment do
@@ -49,7 +49,7 @@ namespace 'dhatu' do
49
49
  desc "Import all dummy data in sequence"
50
50
  task 'all' => :environment do
51
51
 
52
- import_list = ["features", "section_types"]
52
+ import_list = ["dhatu/services", "dhatu/sections", "dhatu/section_types", "dhatu/categories", "dhatu/events", "dhatu/offers", "dhatu/prices", "dhatu/testimonials", "dhatu/team_members"]
53
53
 
54
54
  import_list.each do |item|
55
55
  print "Loading #{item.split(':').last.titleize} \t".yellow
@@ -65,7 +65,7 @@ namespace 'dhatu' do
65
65
  puts " "
66
66
  end
67
67
 
68
- ["Feature", "Dhatu::SectionType"].each do |cls_name|
68
+ ["Dhatu::Category", "Dhatu::Service", "Dhatu::Section", "Dhatu::SectionType", "Dhatu::Event", "Dhatu::Offer", "Dhatu::Price", "Dhatu::Testimonial", "Dhatu::TeamMember"].each do |cls_name|
69
69
  name = cls_name.underscore.pluralize
70
70
  desc "Load Dummy #{cls_name.pluralize}"
71
71
  task name => :environment do
@@ -25,7 +25,7 @@ namespace 'dhatu' do
25
25
  puts " "
26
26
  end
27
27
 
28
- ["Feature", "Dhatu::SectionType"].each do |cls_name|
28
+ ["Feature"].each do |cls_name|
29
29
  name = cls_name.underscore.pluralize
30
30
  desc "Import #{cls_name.pluralize}"
31
31
  task name => :environment do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhatu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-01 00:00:00.000000000 Z
11
+ date: 2017-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -107,7 +107,7 @@ dependencies:
107
107
  version: '0.1'
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.1.23
110
+ version: 0.1.27
111
111
  type: :runtime
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,7 +117,7 @@ dependencies:
117
117
  version: '0.1'
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 0.1.23
120
+ version: 0.1.27
121
121
  - !ruby/object:Gem::Dependency
122
122
  name: pattana
123
123
  requirement: !ruby/object:Gem::Requirement
@@ -127,7 +127,7 @@ dependencies:
127
127
  version: '0.1'
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: 0.1.18
130
+ version: 0.1.20
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ dependencies:
137
137
  version: '0.1'
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: 0.1.18
140
+ version: 0.1.20
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: usman
143
143
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ dependencies:
147
147
  version: '0.3'
148
148
  - - ">="
149
149
  - !ruby/object:Gem::Version
150
- version: 0.3.18
150
+ version: 0.3.26
151
151
  type: :runtime
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
@@ -157,7 +157,7 @@ dependencies:
157
157
  version: '0.3'
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: 0.3.18
160
+ version: 0.3.26
161
161
  - !ruby/object:Gem::Dependency
162
162
  name: bcrypt
163
163
  requirement: !ruby/object:Gem::Requirement