Compare commits
2 Commits
1016_ntue_
...
master
Author | SHA1 | Date |
---|---|---|
chris | f8bb0bba56 | |
Spen | 47b8b3e277 |
|
@ -43,7 +43,7 @@ class MobileController < ApplicationController
|
|||
|
||||
def page
|
||||
@page_title = t('mobile.page')
|
||||
@page_contexts = PageContext.where(:archived => false).page(params[:page_main]).per(15)
|
||||
@page_contexts = get_sorted_page_from_structure
|
||||
end
|
||||
|
||||
def page_content
|
||||
|
@ -57,4 +57,12 @@ class MobileController < ApplicationController
|
|||
@no_footer = true if request.path =~ /app/
|
||||
end
|
||||
|
||||
def get_sorted_page_from_structure
|
||||
page_contexts = Item.structure_ordered_items.inject([]){ |pages, page|
|
||||
pages << page.page_contexts.where(archived: false).limit(1)[0] if page.is_a?(Page) && !page.page_contexts.blank?
|
||||
pages
|
||||
}
|
||||
Kaminari.paginate_array(page_contexts).page(params[:page]).per(15)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ module Announcement
|
|||
|
||||
widgets do
|
||||
default_widget do
|
||||
sorting 'desc(:postdate)'
|
||||
sorting 'desc(:is_top, :postdate)'
|
||||
query 'Bulletin.can_display.available_for_lang(I18n.locale).any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
|
||||
enable ["typeA","typeB_style3","typeC"]
|
||||
image :image
|
||||
|
|
Loading…
Reference in New Issue