diff --git a/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss b/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss index 8761880..b8523a0 100644 --- a/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss +++ b/app/assets/stylesheets/lib/orbit_bar/orbit-bar.scss @@ -46,6 +46,7 @@ body { top: 0; right: 0; left: 0; + z-index: 999; font-family: 'Chivo'; #open-orbit-nav, #open-orbit-login { diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 5f6fe2f..5a3db86 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -182,6 +182,7 @@ class PagesController < ApplicationController 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 custom_value = subpart.custom_string_field || subpart.custom_array_field rescue nil if !custom_value.nil? OrbitHelper.set_widget_custom_value custom_value diff --git a/app/helpers/orbit_helper.rb b/app/helpers/orbit_helper.rb index fc600b8..06bb95f 100644 --- a/app/helpers/orbit_helper.rb +++ b/app/helpers/orbit_helper.rb @@ -56,6 +56,47 @@ module OrbitHelper end end + def self.set_widget_item_url(widget) + @url_widget_for_show = "" + module_app = widget.module + pages = Page.where(:module => module_app) + widget_categories = widget.categories + finalpage = nil + pages.each do |p| + Rails.logger.info "*********************************" + p.name + if p.categories == widget_categories + finalpage = p + end + end + if finalpage.nil? + pages.each do |p| + if self.array_include(p.categories, widget_categories) + finalpage = p + end + end + end + finalpage = pages.first if finalpage.nil? + if !finalpage.nil? + @url_widget_for_show = "/#{@site_locale.to_s}#{finalpage.url}" + end + end + + def self.array_include(arr1,arr2) + final = [] + arr2.each do |el| + final.push(arr1.include?el) + end + !final.include?false + end + + def self.widget_item_url(obj) + @url_widget_for_show + "/" + obj + end + + def self.widget_more_url + @url_widget_for_show + end + def page_url(url) "#{request.host_with_port}/#{locale}#{url}" end diff --git a/app/templates/orbit_bootstrap/modules/announcement/_widget1.html.erb b/app/templates/orbit_bootstrap/modules/announcement/_widget1.html.erb index 794462a..63b11e1 100644 --- a/app/templates/orbit_bootstrap/modules/announcement/_widget1.html.erb +++ b/app/templates/orbit_bootstrap/modules/announcement/_widget1.html.erb @@ -6,7 +6,7 @@