Remove bottom padding if no footer in mobile
Add a method in routes Copy mobile routes under the scope 'app' for app usage
This commit is contained in:
parent
91d1487a04
commit
4e2cbac027
|
@ -2,6 +2,8 @@ class MobileController < ApplicationController
|
||||||
|
|
||||||
layout 'mobile'
|
layout 'mobile'
|
||||||
|
|
||||||
|
before_filter :no_footer_for_app
|
||||||
|
|
||||||
def index
|
def index
|
||||||
date_now = Time.now
|
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)
|
@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
|
@page_title = @page_context.page.title
|
||||||
end
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def no_footer_for_app
|
||||||
|
@no_footer = true if request.path.starts_with?("/app")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,7 +44,13 @@
|
||||||
|
|
||||||
<!-- iPad icon (Retina) -->
|
<!-- iPad icon (Retina) -->
|
||||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%= asset_path 'mobile/apple-touch-icon-ipad@2x.png' %>">
|
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%= asset_path 'mobile/apple-touch-icon-ipad@2x.png' %>">
|
||||||
|
<% if @no_footer %>
|
||||||
|
<style type="text/css">
|
||||||
|
.global {
|
||||||
|
padding-bottom: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<% end %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div data-role="page" data-url="<%= request.fullpath %>" id="<%= params[:action] %>" data-add-back-btn="<%= params[:action].eql?('index')? nil : 'true' %>">
|
<div data-role="page" data-url="<%= request.fullpath %>" id="<%= params[:action] %>" data-add-back-btn="<%= params[:action].eql?('index')? nil : 'true' %>">
|
||||||
|
|
|
@ -231,26 +231,21 @@ Orbit::Application.routes.draw do
|
||||||
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal'
|
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal'
|
||||||
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'
|
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'
|
||||||
|
|
||||||
|
def controller_paths(controller, actions)
|
||||||
scope '/front' do
|
actions.each do |action|
|
||||||
match 'show_banner/:id' => 'front#show_banner', :as => :front_show_banner
|
if action.eql? 'index'
|
||||||
match 'show_footer' => 'front#show_footer', :as => :front_show_footer
|
match "#{controller}" => "#{controller}##{action}", :as => "#{controller}"
|
||||||
match 'show_menu/:id' => 'front#show_menu', :as => :front_show_menu
|
else
|
||||||
match 'show_page_sub_menu' => 'front#show_page_sub_menu', :as => :front_show_page_sub_menu
|
match "#{controller}/#{action}(/:id)" => "#{controller}##{action}", :as => "#{controller}_#{action}"
|
||||||
match 'show_site_sub_menu' => 'front#show_site_sub_menu', :as => :front_show_site_sub_menu
|
end
|
||||||
match 'show_sitemap' => 'front#show_sitemap', :as => :front_show_sitemap
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scope '/mobile' do
|
controller_paths :front, %w[show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap]
|
||||||
match 'announcement' => 'mobile#announcement', :as => 'mobile_announcement'
|
controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
|
||||||
match 'announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content'
|
|
||||||
match 'dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact'
|
scope 'app' do
|
||||||
match 'dialog_copyright' => 'mobile#dialog_copyright', :as => 'mobile_dialog_copyright'
|
controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
|
||||||
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'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue