diff --git a/app/controllers/mobile_controller.rb b/app/controllers/mobile_controller.rb
index 5b05214e..d07e9a87 100644
--- a/app/controllers/mobile_controller.rb
+++ b/app/controllers/mobile_controller.rb
@@ -2,6 +2,8 @@ class MobileController < ApplicationController
layout 'mobile'
+ before_filter :no_footer_for_app
+
def index
date_now = Time.now
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15)
@@ -49,4 +51,10 @@ class MobileController < ApplicationController
@page_title = @page_context.page.title
end
+ protected
+
+ def no_footer_for_app
+ @no_footer = true if request.path.starts_with?("/app")
+ end
+
end
diff --git a/app/views/layouts/mobile.mobile.erb b/app/views/layouts/mobile.mobile.erb
index 8c337c4e..f21850c5 100644
--- a/app/views/layouts/mobile.mobile.erb
+++ b/app/views/layouts/mobile.mobile.erb
@@ -44,7 +44,13 @@
-
+ <% if @no_footer %>
+
+ <% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 74130c07..8c3d9285 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -231,26 +231,21 @@ Orbit::Application.routes.draw do
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal'
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'
-
- scope '/front' do
- match 'show_banner/:id' => 'front#show_banner', :as => :front_show_banner
- match 'show_footer' => 'front#show_footer', :as => :front_show_footer
- match 'show_menu/:id' => 'front#show_menu', :as => :front_show_menu
- match 'show_page_sub_menu' => 'front#show_page_sub_menu', :as => :front_show_page_sub_menu
- match 'show_site_sub_menu' => 'front#show_site_sub_menu', :as => :front_show_site_sub_menu
- match 'show_sitemap' => 'front#show_sitemap', :as => :front_show_sitemap
+ def controller_paths(controller, actions)
+ actions.each do |action|
+ if action.eql? 'index'
+ match "#{controller}" => "#{controller}##{action}", :as => "#{controller}"
+ else
+ match "#{controller}/#{action}(/:id)" => "#{controller}##{action}", :as => "#{controller}_#{action}"
+ end
+ end
end
- scope '/mobile' do
- match 'announcement' => 'mobile#announcement', :as => 'mobile_announcement'
- match 'announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content'
- match 'dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact'
- match 'dialog_copyright' => 'mobile#dialog_copyright', :as => 'mobile_dialog_copyright'
- match 'dialog_language' => 'mobile#dialog_language', :as => 'mobile_dialog_language'
- match 'map' => 'mobile#map', :as => 'mobile_map'
- match 'page' => 'mobile#page', :as => 'mobile_page'
- match 'page_content/:id' => 'mobile#page_content', :as => 'mobile_page_content'
- root :to => 'mobile#index', :as => 'mobile'
+ controller_paths :front, %w[show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap]
+ controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
+
+ scope 'app' do
+ controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
end