gallery versioning added.. and also the models changed for gallery now more R4 compatible. urls for gallery working fine now..
This commit is contained in:
1 parent
16b695200a
commit
91d5ab6352
13 files changed
+55
-54
No files matched your search
@@ -238,7 +238,7 @@ class ApplicationController < ActionController::Base
|
||||
redirect_to ret
|
||||
end
|
||||
|
||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil)
|
||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil, pagination = true)
|
||||
if params[:filter] || params[:sort] || params[:new_filter]
|
||||
@filter = params[:filter]
|
||||
new_filter = params[:new_filter]
|
||||
@@ -345,7 +345,12 @@ class ApplicationController < ActionController::Base
|
||||
if (!user_signed_in? && object_class == "bulletin")
|
||||
objects = get_bulletins_for_open_backend(objects)
|
||||
end
|
||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||
|
||||
if pagination
|
||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||
else
|
||||
filter_authorized_objects(objects)
|
||||
end
|
||||
end
|
||||
|
||||
def get_bulletins_for_open_backend(objects)
|
||||
|
||||
@@ -99,7 +99,7 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
end
|
||||
|
||||
def get_filter_data
|
||||
model = eval(@default_widget["query"])
|
||||
model = @default_widget["query"].classify.constantize
|
||||
if params[:filter_category_id].is_a? Array
|
||||
data = model.where(:category_id.in => params[:filter_category_id])
|
||||
elsif params[:filter_category_id].is_a? String
|
||||
|
||||
@@ -96,6 +96,7 @@ class PagesController < ApplicationController
|
||||
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}image_id=#{params[:image_id]}" unless params[:image_id].blank?
|
||||
redirect_to(url + options) unless save_from_no_lang_for_page
|
||||
end
|
||||
|
||||
@@ -187,12 +188,9 @@ class PagesController < ApplicationController
|
||||
@item = Item.where(:category => category_ids).first
|
||||
else
|
||||
if params[:action] && params[:action] == "show_from_link"
|
||||
default_widget = module_app.get_default_widget
|
||||
if !default_widget.blank?
|
||||
model = eval(params[:app_action].classify.constantize)
|
||||
model = params[:app_action].classify.constantize
|
||||
item = model.find(params[:id])
|
||||
@item = Item.where(:category => [item.category_id.to_s]).first
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user