This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/controllers/mobile_controller.rb

61 lines
1.7 KiB
Ruby

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)
@ad_banner = AdBanner.where(title: "Banner")[0]
end
def announcement
@page_title = t('mobile.bulletin')
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)
end
def announcement_content
@bulletin = Bulletin.find(params[:id]) rescue nil
@page_title = @bulletin.title
end
def dialog_contact
@no_menu = @no_footer = true
@page_title = t('mobile.contact')
end
def dialog_copyright
@no_menu = @no_footer = true
@page_title = t('mobile.copyright')
end
def dialog_language
@no_menu = @no_footer = true
@page_title = t('mobile.language')
end
def map
@no_menu = @no_footer = true
@page_title = t('mobile.location')
end
def page
@page_title = t('mobile.page')
@page_contexts = PageContext.where(:archived => false).page(params[:page_main]).per(15)
end
def page_content
@page_context = PageContext.first(conditions: { id: params[:id], :archived => false }) rescue nil
@page_title = @page_context.page.title
end
protected
def no_footer_for_app
@no_footer = true if request.path.starts_with?("/app")
end
end