Fix bug for mobile app routes
This commit is contained in:
		
							parent
							
								
									c33a723a2a
								
							
						
					
					
						commit
						87a89f81ce
					
				|  | @ -130,7 +130,7 @@ class ApplicationController < ActionController::Base | ||||||
|       respond_to do |format| |       respond_to do |format| | ||||||
|         format.html { render :text => parse_page_content(@item), :layout => 'page_layout' } |         format.html { render :text => parse_page_content(@item), :layout => 'page_layout' } | ||||||
|         format.rss { render_main_rss } |         format.rss { render_main_rss } | ||||||
|         format.mobile { redirect_to mobile_path } |         format.mobile { redirect_to mobile_path(:app => params[:app]) } | ||||||
|       end |       end | ||||||
|     else |     else | ||||||
|       render :text => '404 Not Found' |       render :text => '404 Not Found' | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ class MobileController < ApplicationController | ||||||
|   protected |   protected | ||||||
| 
 | 
 | ||||||
|   def no_footer_for_app |   def no_footer_for_app | ||||||
|     @no_footer = true if request.path.starts_with?("/app") |     @no_footer = true if request.path =~ /app/ | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
| end | end | ||||||
|  |  | ||||||
|  | @ -7,12 +7,12 @@ | ||||||
|         <% end %> |         <% end %> | ||||||
|       </li> |       </li> | ||||||
|       <li> |       <li> | ||||||
|         <%= link_to mobile_map_path, {"data-transition" => "flip"} do %> |         <%= link_to mobile_map_path(:app => params[:app]), {"data-transition" => "flip"} do %> | ||||||
|           <i class="icons-location"></i> |           <i class="icons-location"></i> | ||||||
|         <% end %> |         <% end %> | ||||||
|       </li> |       </li> | ||||||
|       <li> |       <li> | ||||||
|         <%= link_to mobile_dialog_contact_path, {"data-rel" => "dialog"} do %> |         <%= link_to mobile_dialog_contact_path(:app => params[:app]), {"data-rel" => "dialog"} do %> | ||||||
|           <i class="icons-phone"></i> |           <i class="icons-phone"></i> | ||||||
|         <% end %> |         <% end %> | ||||||
|       </li> |       </li> | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
|     <%= image_tag asset_path('mobile/logo.png') %> |     <%= image_tag asset_path('mobile/logo.png') %> | ||||||
|   </h1> |   </h1> | ||||||
|   <i class="openmenu icons-arrow-down-5"></i> |   <i class="openmenu icons-arrow-down-5"></i> | ||||||
|   <%= link_to mobile_dialog_language_path, {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %> |   <%= link_to mobile_dialog_language_path(:app => params[:app]), {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %> | ||||||
|     <i class="icons-earth"></i> |     <i class="icons-earth"></i> | ||||||
|   <% end %> |   <% end %> | ||||||
| </header> | </header> | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <section class="main-menu"> | <section class="main-menu"> | ||||||
|   <ul class="clear"> |   <ul class="clear"> | ||||||
|     <li><%= link_to content_tag(:i, nil, :class => "icons-house") + content_tag(:span, t('mobile.home')), mobile_path %></li> |     <li><%= link_to content_tag(:i, nil, :class => "icons-house") + content_tag(:span, t('mobile.home')), mobile_path(:app => params[:app]) %></li> | ||||||
|     <li><%= link_to content_tag(:i, nil, :class => "icons-megaphone") + content_tag(:span, t('mobile.bulletin')), mobile_announcement_path %></li> |     <li><%= link_to content_tag(:i, nil, :class => "icons-megaphone") + content_tag(:span, t('mobile.bulletin')), mobile_announcement_path(:app => params[:app]) %></li> | ||||||
|     <li><%= link_to content_tag(:i, nil, :class => "icons-newspaper") + content_tag(:span, t('mobile.page')), mobile_page_path %></li> |     <li><%= link_to content_tag(:i, nil, :class => "icons-newspaper") + content_tag(:span, t('mobile.page')), mobile_page_path(:app => params[:app]) %></li> | ||||||
|   </ul> |   </ul> | ||||||
| </section> | </section> | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <ul data-role="listview" class="list"> | <ul data-role="listview" class="list"> | ||||||
|   <% @bulletins.each do |bulletin| %> |   <% @bulletins.each do |bulletin| %> | ||||||
|     <li data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-icon="arrow-r" data-iconpos="right"  data-theme="c"> |     <li data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-icon="arrow-r" data-iconpos="right"  data-theme="c"> | ||||||
|       <%= link_to mobile_announcement_content_path(bulletin), :class => "ui-link-inherit" do %> |       <%= link_to mobile_announcement_content_path(:app => params[:app], :id => bulletin), :class => "ui-link-inherit" do %> | ||||||
|         <%= image_tag bulletin.image.url, :class => "ui-li-thumb" %> |         <%= image_tag bulletin.image.url, :class => "ui-li-thumb" %> | ||||||
|         <h3><%= bulletin.title %></h3> |         <h3><%= bulletin.title %></h3> | ||||||
|         <p class="ui-li-aside ui-li-desc"><%= display_date(bulletin.postdate) %></p> |         <p class="ui-li-aside ui-li-desc"><%= display_date(bulletin.postdate) %></p> | ||||||
|  |  | ||||||
|  | @ -12,7 +12,7 @@ | ||||||
|         <%= image_tag bulletin.image.url %> |         <%= image_tag bulletin.image.url %> | ||||||
|       </div> |       </div> | ||||||
|       <h3 class="newstitle"> |       <h3 class="newstitle"> | ||||||
|         <%= link_to bulletin.title, mobile_announcement_content_path(bulletin) %> |         <%= link_to bulletin.title, mobile_announcement_content_path(:app => params[:app], :id => bulletin) %> | ||||||
|       </h3> |       </h3> | ||||||
|       <p class="newsDate"><%= display_date(bulletin.postdate) %></p> |       <p class="newsDate"><%= display_date(bulletin.postdate) %></p> | ||||||
|       <div class="newsummary"><%= bulletin.subtitle %></div> |       <div class="newsummary"><%= bulletin.subtitle %></div> | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| <ul data-role="listview" class="list"> | <ul data-role="listview" class="list"> | ||||||
|   <% @page_contexts.each do |page_context| %> |   <% @page_contexts.each do |page_context| %> | ||||||
|     <li> |     <li> | ||||||
|       <%= link_to mobile_page_content_path(page_context) do %> |       <%= link_to mobile_page_content_path(:app => params[:app], :id => page_context) do %> | ||||||
|         <h3><%= page_context.page.title %></h3> |         <h3><%= page_context.page.title %></h3> | ||||||
|       <% end %> |       <% end %> | ||||||
|     </li> |     </li> | ||||||
|  |  | ||||||
|  | @ -244,7 +244,7 @@ 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)  |   def controller_paths(controller, actions, scope=nil)  | ||||||
|     actions.each do |action|  |     actions.each do |action|  | ||||||
|       if action.eql? 'index' |       if action.eql? 'index' | ||||||
|         match "#{controller}" => "#{controller}##{action}", :as => "#{controller}" |         match "#{controller}" => "#{controller}##{action}", :as => "#{controller}" | ||||||
|  | @ -255,21 +255,21 @@ Orbit::Application.routes.draw do | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|   controller_paths :front, %w[show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap] |   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] |   # controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content] | ||||||
| 
 | 
 | ||||||
|   scope 'app' do |   # scope 'app' do | ||||||
|     controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content] |   #   controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content] | ||||||
|   end |   # end | ||||||
| 
 | 
 | ||||||
|   scope '/mobile' do |   scope '/mobile(/:app)' do | ||||||
|     match 'announcement' => 'mobile#announcement', :as => 'mobile_announcement' |     match '/announcement' => 'mobile#announcement', :as => 'mobile_announcement' | ||||||
|     match 'announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content' |     match '/announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content' | ||||||
|     match 'dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact' |     match '/dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact' | ||||||
|     match 'dialog_copyright' => 'mobile#dialog_copyright', :as => 'mobile_dialog_copyright' |     match '/dialog_copyright' => 'mobile#dialog_copyright', :as => 'mobile_dialog_copyright' | ||||||
|     match 'dialog_language' => 'mobile#dialog_language', :as => 'mobile_dialog_language' |     match '/dialog_language' => 'mobile#dialog_language', :as => 'mobile_dialog_language' | ||||||
|     match 'map' => 'mobile#map', :as => 'mobile_map' |     match '/map' => 'mobile#map', :as => 'mobile_map' | ||||||
|     match 'page' => 'mobile#page', :as => 'mobile_page' |     match '/page' => 'mobile#page', :as => 'mobile_page' | ||||||
|     match 'page_content/:id' => 'mobile#page_content', :as => 'mobile_page_content' |     match '/page_content/:id' => 'mobile#page_content', :as => 'mobile_page_content' | ||||||
|     root :to => 'mobile#index', :as => 'mobile' |     root :to => 'mobile#index', :as => 'mobile' | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue