Sorting settings adjustment includes the judgment when TOP.
This commit is contained in:
parent
a53073bd3d
commit
ea22538efd
|
|
@ -19,7 +19,7 @@ class AdBannersController < ApplicationController
|
|||
|
||||
def image_widget(adbanner)
|
||||
images = []
|
||||
adbanner.ad_images.can_display.asc(:sort_number,:created_at).each.with_index do |b,i|
|
||||
adbanner.ad_images.can_display.order_by(is_top: -1, sort_number: 1, created_at: 1).each.with_index do |b,i|
|
||||
if b.language_enabled.include?(I18n.locale.to_s)
|
||||
image_link = OrbitHelper.is_mobile_view ? b.file.mobile.url : b.file.url
|
||||
klass = i == 0 ? "active" : ""
|
||||
|
|
@ -78,7 +78,7 @@ class AdBannersController < ApplicationController
|
|||
@hide_video_tools = (custom_data_field[:hide_video_tools] == "1" rescue false)
|
||||
images = []
|
||||
has_jplayer = false
|
||||
adbanner.ad_images.can_display.asc(:sort_number).each_with_index do |ad_b,i|
|
||||
adbanner.ad_images.can_display.order_by(is_top: -1, sort_number: 1).each_with_index do |ad_b,i|
|
||||
if ad_b.language_enabled.include?(I18n.locale.to_s)
|
||||
image_link = OrbitHelper.is_mobile_view ? ad_b.file.mobile.url : ad_b.file.url
|
||||
caption = i == 0 ? '<div class="cycle-overlay"></div><div class="cycle-pager"></div>' : ""
|
||||
|
|
|
|||
Loading…
Reference in New Issue