Merge branch 'development' of github.com:Rulingcom/orbit into development

Conflicts:
	lib/tasks/migrate.rake
This commit is contained in:
chris 2013-02-27 11:03:52 +08:00
commit ca946fc881
1 changed files with 5 additions and 3 deletions

View File

@ -32,11 +32,11 @@ class DefaultWidgetController< OrbitWidgetController
end end
def default_widget def default_widget
if !params[:id].blank? if !params[:id].blank?
redirect_to eval("#{@page_part.module_app.widget_fields_link_method['title']['method']}('#{params[:id]}', {inner: #{params[:inner] || true}})") redirect_to eval("#{@page_part.module_app.widget_fields_link_method['title']['method']}('#{params[:id]}', {inner: #{params[:inner] || true}})")
else else
@tag_class = nil @tag_class = nil
@default_widget = @page_part.module_app.get_default_widget @default_widget = @page_part.module_app.get_default_widget
@widget_image_field = @default_widget["image"] || @default_widget[:image] @widget_image_field = @default_widget["image"] || @default_widget[:image]
case @page_part case @page_part
@ -50,9 +50,11 @@ class DefaultWidgetController< OrbitWidgetController
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3) @data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
end end
if @paginate if @paginate
@data = eval(@default_widget["query"]).includes(@widget_image_field).page(params[:page_main]).per(@data_limit).desc(:created_at) @data = query_for_default_widget.includes(@widget_image_field).page(params[:page_main]).per(@data_limit)
# @data = query_for_default_widget.limit(@data_limit).includes(@widget_image_field)
else else
@data = eval(@default_widget["query"]).limit(@data_limit).includes(@widget_image_field).desc(:created_at) @data = eval(@default_widget["query"]).includes(@widget_image_field).page(params[:page_main]).per(@data_limit).desc(:created_at)
# @data = eval(@default_widget["query"]).limit(@data_limit).includes(@widget_image_field).desc(:created_at)
end end
case params[:type] case params[:type]
when "typeA" when "typeA"