Merge branch 'development' of github.com:Rulingcom/orbit into development
Conflicts: app/controllers/default_widget_controller.rb lib/tasks/migrate.rake
This commit is contained in:
commit
9fec7beb47
319 files changed
+3012
-4094
No files matched your search
@@ -88,7 +88,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||
|
||||
def delete
|
||||
if params[:ids]
|
||||
asset = Asset.any_in(:_id => params[:ids]).delete_all
|
||||
asset = Asset.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to assets_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
||||
@@ -114,7 +114,7 @@ class Admin::DesignsController < OrbitBackendController
|
||||
|
||||
def delete
|
||||
if params[:ids]
|
||||
designs = Design.any_in(:_id => params[:ids]).delete_all
|
||||
designs = Design.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to admin_designs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
||||
@@ -36,12 +36,11 @@ helper Admin::PagePartsHelper
|
||||
|
||||
if @item.module_app
|
||||
@module_app = @item.module_app
|
||||
|
||||
@frontend_path = @item.app_frontend_url ? @item.app_frontend_url : @module_app.widgets.keys[0]
|
||||
@frontend_path = @item.app_frontend_url
|
||||
|
||||
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
|
||||
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
|
||||
end
|
||||
if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array}
|
||||
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
|
||||
end
|
||||
|
||||
case @item.module_app.key
|
||||
when 'announcement'
|
||||
@@ -59,7 +58,7 @@ helper Admin::PagePartsHelper
|
||||
end
|
||||
else
|
||||
@categories = nil
|
||||
@module_app = @module_apps[0]
|
||||
@module_app = @module_apps[0]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -4,10 +4,20 @@ class Admin::PluginsController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
@plugins = OrbitApp::Module::Registration.all
|
||||
@plugins = OrbitApp::Plugin::Registration.all
|
||||
|
||||
if(!params[:show_plugin_profile].nil?)
|
||||
@right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary'
|
||||
|
||||
@right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).admin_partial_path
|
||||
|
||||
if !@right_partial.blank?
|
||||
respond_to do |format|
|
||||
format.html { redirect_to( @right_partial ) }
|
||||
end
|
||||
else
|
||||
@right_partial = "admin/users_new_interface/plugin_summary"
|
||||
end
|
||||
|
||||
else
|
||||
@right_partial = "admin/users_new_interface/plugin_summary"
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Admin::SubRolesController < RolesController
|
||||
class Admin::SubRolesController < Admin::RolesController
|
||||
|
||||
|
||||
end
|
||||
@@ -32,7 +32,11 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
end
|
||||
|
||||
def default_widget
|
||||
@tag_class = nil
|
||||
|
||||
if !params[:id].blank?
|
||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method['title']['method']}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||
else
|
||||
@tag_class = nil
|
||||
@default_widget = @page_part.module_app.get_default_widget
|
||||
@widget_image_field = @default_widget["image"] || @default_widget[:image]
|
||||
case @page_part
|
||||
@@ -47,8 +51,10 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
end
|
||||
if @paginate
|
||||
@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
|
||||
@data = query_for_default_widget.limit(@data_limit).includes(@widget_image_field)
|
||||
@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
|
||||
case params[:type]
|
||||
when "typeA"
|
||||
@@ -64,7 +70,7 @@ class DefaultWidgetController< OrbitWidgetController
|
||||
@partial = "typeC"
|
||||
render "typeC"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -2,6 +2,11 @@ class FrontController < ApplicationController
|
||||
|
||||
layout false
|
||||
|
||||
def show_breadcrumb
|
||||
@ancestors = Page.find(params[:id]).ancestors_and_self
|
||||
@ancestors = nil if @ancestors.size == 1
|
||||
end
|
||||
|
||||
def show_banner
|
||||
@ad_banner = AdBanner.find(params[:id]) rescue nil
|
||||
end
|
||||
|
||||
@@ -64,17 +64,23 @@ class PagesController < ApplicationController
|
||||
protected
|
||||
|
||||
def get_item
|
||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
if !params[:category_id].blank? && !params[:tag_id].blank?
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]})
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item
|
||||
elsif !params[:category_id].blank?
|
||||
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],category: params[:category_id]).any_in(tag: [nil,'']).first
|
||||
elsif !params[:tag_id].blank?
|
||||
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],tag: params[:tag_id]).any_in(category: [nil,'']).first
|
||||
if params[:same_page_id]
|
||||
@item = Item.find(params[:same_page_id])
|
||||
else
|
||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||
if !params[:category_id].blank? && !params[:tag_id].blank?
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]})
|
||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item
|
||||
elsif !params[:category_id].blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], category: params[:category_id]).any_in(tag: [nil,'']).first
|
||||
elsif !params[:tag_id].blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], tag: params[:tag_id]).any_in(category: [nil,'']).first
|
||||
end
|
||||
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first unless @item
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
||||
end
|
||||
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action]).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first unless @item
|
||||
@item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action]).first unless @item
|
||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user