diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 2b5bba7..b70eafb 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -74,10 +74,11 @@ class PagesController < ApplicationController params[:layout_type] = params[:method] || page.layout || "index" end params[:url] = page.url - - categories = page.categories.collect do |c| - if !c.disable - return c + categories = [] + page.categories.each do |c| + category = Category.find(c) rescue nil + if !category.nil? && !category.disable + categories << c end end categories = ["all"] if categories.blank? @@ -289,13 +290,20 @@ class PagesController < ApplicationController partials = [] subparts.each do |subpart| if subpart.kind == "module_widget" + subpart_categories = [] + subpart.categories.each do |c| + category = Category.find(c) rescue nil + if !category.nil? && !category.disable + subpart_categories << c + end + end + subpart_categories = ["all"] if subpart_categories.blank? OrbitHelper.set_current_widget subpart OrbitHelper.set_widget_data_count subpart.data_count - OrbitHelper.set_widget_categories subpart.categories OrbitHelper.set_widget_module_app subpart.module OrbitHelper.set_widget_item_url subpart OrbitHelper.set_widget_title subpart.title - OrbitHelper.set_widget_categories subpart.categories || [] + OrbitHelper.set_widget_categories subpart_categories || ["all"] OrbitHelper.set_widget_tags subpart.tags || [] custom_value = subpart.custom_string_field || subpart.custom_array_field rescue nil if !custom_value.nil? diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 18ef7ed..a794839 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -246,7 +246,7 @@ module ApplicationHelper end html.html_safe else - return "
It seems we have a problem with the module at this point of time, we will try to fix it as soon as possible. Sorry for the inconvenience!! :(
".html_safe + return "
No content to show.
".html_safe end else f = File.join(Rails.root, 'app', 'templates', "#{@key}", 'modules', params[:target_controller].singularize, "#{params[:target_action]}.html.erb") @@ -257,7 +257,7 @@ module ApplicationHelper controller = "#{params[:target_controller].capitalize}_controller".classify.constantize.new data = controller.send("#{params[:target_action]}") rescue nil if data.nil? - return "
It seems we have a problem with the module at this point of time, we will try to fix it as soon as possible. Sorry for the inconvenience!! :(
".html_safe + return "
No content to show.
".html_safe end if data.blank? || data.empty? diff --git a/app/helpers/pages_helper.rb b/app/helpers/pages_helper.rb index 472d3d5..7403cda 100644 --- a/app/helpers/pages_helper.rb +++ b/app/helpers/pages_helper.rb @@ -87,7 +87,7 @@ module PagesHelper end html.html_safe else - return "
It seems we have a problem with the module at this point of time, we will try to fix it as soon as possible. Sorry for the inconvenience!! :(
".html_safe + return "
No content to show.
".html_safe end end diff --git a/app/views/admin/categories/_select_form.html.erb b/app/views/admin/categories/_select_form.html.erb index af6914a..b3573d3 100644 --- a/app/views/admin/categories/_select_form.html.erb +++ b/app/views/admin/categories/_select_form.html.erb @@ -24,6 +24,7 @@ <% end %> +
Category once created, cannot be deleted.
<% end %> <% end %> +
Category once created, cannot be deleted.
<%= label_tag "disable" do %> <%= f.check_box :disable %> <%= t(:disable) %>