Compare commits
1 Commits
master
...
1007_annou
Author | SHA1 | Date |
---|---|---|
Spen | 0b14da0fd8 |
|
@ -43,7 +43,7 @@ class MobileController < ApplicationController
|
|||
|
||||
def page
|
||||
@page_title = t('mobile.page')
|
||||
@page_contexts = get_sorted_page_from_structure
|
||||
@page_contexts = PageContext.where(:archived => false).page(params[:page_main]).per(15)
|
||||
end
|
||||
|
||||
def page_content
|
||||
|
@ -57,12 +57,4 @@ 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
|
||||
|
|
Loading…
Reference in New Issue