Compare commits
5 Commits
ntu_ga_111
...
master
Author | SHA1 | Date |
---|---|---|
chris | f8bb0bba56 | |
Spen | 47b8b3e277 | |
chris | ecc3581106 | |
Matthew K. Fu JuYuan | 6d4d3ccfd4 | |
Harry Bomrah | 141b708392 |
|
@ -15,6 +15,11 @@ function load_tinymce() {
|
||||||
theme_advanced_statusbar_location : "bottom",
|
theme_advanced_statusbar_location : "bottom",
|
||||||
theme_advanced_resizing : true,
|
theme_advanced_resizing : true,
|
||||||
|
|
||||||
|
// Domain Absolute URLs
|
||||||
|
relative_urls : false,
|
||||||
|
remove_script_host : false,
|
||||||
|
document_base_url: window.location.protocol + '//' + window.location.host,
|
||||||
|
|
||||||
// Skin options
|
// Skin options
|
||||||
skin : "o2k7",
|
skin : "o2k7",
|
||||||
skin_variant : "silver",
|
skin_variant : "silver",
|
||||||
|
|
|
@ -43,7 +43,7 @@ class MobileController < ApplicationController
|
||||||
|
|
||||||
def page
|
def page
|
||||||
@page_title = t('mobile.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
|
end
|
||||||
|
|
||||||
def page_content
|
def page_content
|
||||||
|
@ -57,4 +57,12 @@ class MobileController < ApplicationController
|
||||||
@no_footer = true if request.path =~ /app/
|
@no_footer = true if request.path =~ /app/
|
||||||
end
|
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
|
end
|
||||||
|
|
|
@ -29,8 +29,8 @@ module Announcement
|
||||||
|
|
||||||
widgets do
|
widgets do
|
||||||
default_widget do
|
default_widget do
|
||||||
sorting 'desc(:postdate)'
|
sorting 'desc(:is_top, :postdate)'
|
||||||
query 'Bulletin.available_for_lang(I18n.locale).any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
|
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"]
|
enable ["typeA","typeB_style3","typeC"]
|
||||||
image :image
|
image :image
|
||||||
field :postdate
|
field :postdate
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -9,17 +9,40 @@ class Panel::Gallery::Widget::AlbumsController < OrbitWidgetController
|
||||||
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
|
@album = GalleryAlbum.find(@part.widget_options['album_id']) rescue nil
|
||||||
@album_images = @album.gallery_images if @album
|
@album_images = @album.gallery_images if @album
|
||||||
|
|
||||||
|
|
||||||
@settings = {"vertical"=>vertical,"horizontal"=>horizontal} #[note] horizontal has it's limitation from 2 to 6
|
@settings = {"vertical"=>vertical,"horizontal"=>horizontal} #[note] horizontal has it's limitation from 2 to 6
|
||||||
@class = "c" + @settings["horizontal"].to_s
|
@class = "c" + @settings["horizontal"].to_s
|
||||||
@total = @settings["vertical"] * @settings["horizontal"]
|
@total = @settings["vertical"] * @settings["horizontal"]
|
||||||
@rnd = Random.new
|
@rnd = Random.new
|
||||||
@images = []
|
@images = []
|
||||||
for i in 0..@total-1
|
|
||||||
image = @album_images[@rnd.rand(0...@album_images.count)]
|
if @album_images.count > @total
|
||||||
|
@randoms = []
|
||||||
|
until @randoms.count == @total do
|
||||||
|
r = @rnd.rand(0...@album_images.count)
|
||||||
|
if !@randoms.include?r
|
||||||
|
@randoms << r
|
||||||
|
image = @album_images[r]
|
||||||
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||||
@images << values
|
@images << values
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elsif @album_images.count == @total
|
||||||
|
@album_images.each do |image|
|
||||||
|
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||||
|
@images << values
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@album_images.each do |image|
|
||||||
|
values = {"show_link"=>theater_panel_gallery_front_end_album_path(image),"thumb"=>image.file.thumb.url}
|
||||||
|
@images << values
|
||||||
|
end
|
||||||
|
until @images.count == @total do
|
||||||
|
values = {"show_link"=>"javascript:void(0);","thumb"=>"assets/gallery/nodata.jpg"}
|
||||||
|
@images << values
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def widget2
|
def widget2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue