From 71fc85c24e5bbfceeabc938aeeb7c3d91e509b4c Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 25 Dec 2012 10:45:08 +0800 Subject: [PATCH 01/64] fix widget. --- lib/parsers/parser_front_end.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 1cf2bc23..119c2706 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -102,9 +102,19 @@ module ParserFrontEnd when 'text' ret << part.content_translations[locale.to_s] rescue '' when 'module_widget' - url = "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true" + # url = "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true" + # options = "&part_id=\#{part.id}&category_id=\#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=\#{!part[:tag].blank? ? part[:tag] : tag}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}" + # ret << "" + url = case part.widget_path + when 'default_widget' + "/panel/orbit_app/widget/\#{part.widget_style}?inner=true" + else + "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true" + end + options = "&part_id=\#{part.id}&category_id=\#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=\#{!part[:tag].blank? ? part[:tag] : tag}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}" - ret << "" + ret << "" + when 'public_r_tag' ret << send("generate_#{part.public_r_tag}s", part.public_r_tag_object_id, page) else From cfb65dd05610e0c934af4c4a7a02aae9c7508ba0 Mon Sep 17 00:00:00 2001 From: Fu Matthew Date: Thu, 27 Dec 2012 10:20:37 +0800 Subject: [PATCH 02/64] Preventing site default design being deleted. --- app/controllers/admin/designs_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/designs_controller.rb b/app/controllers/admin/designs_controller.rb index 913520fa..a661a5c1 100644 --- a/app/controllers/admin/designs_controller.rb +++ b/app/controllers/admin/designs_controller.rb @@ -94,7 +94,12 @@ class Admin::DesignsController < OrbitBackendController def destroy @design = Design.find(params[:id]) - @design.destroy + if @site.design == @design + flash[:error] = "Failed! You can not delete a design that used by default " + else + @design.destroy + flash[:notice] = "Successfully deleted design." + end redirect_to admin_designs_url end From 81b0e3c38f4bbbcc511e81792547fce1ccf4ac01 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Thu, 27 Dec 2012 12:14:59 +0800 Subject: [PATCH 03/64] change ActiveSupport::SecureRandom to SecureRandom in orbit core --- app/helpers/admin/ad_banners_helper.rb | 2 +- lib/orbit_core_lib.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/admin/ad_banners_helper.rb b/app/helpers/admin/ad_banners_helper.rb index df0d3e73..b97f49cd 100644 --- a/app/helpers/admin/ad_banners_helper.rb +++ b/app/helpers/admin/ad_banners_helper.rb @@ -28,4 +28,4 @@ module Admin::AdBannersHelper -end \ No newline at end of file +end diff --git a/lib/orbit_core_lib.rb b/lib/orbit_core_lib.rb index 3abeeddd..4f1e6fd2 100644 --- a/lib/orbit_core_lib.rb +++ b/lib/orbit_core_lib.rb @@ -140,7 +140,7 @@ module OrbitCoreLib protected def generate_token - self.s_token = ActiveSupport::SecureRandom.hex(16) + self.s_token = SecureRandom.hex(16) self.save! end end From 177a409508d53bc8e61512584dc68aecfa2adf60 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Thu, 27 Dec 2012 10:38:27 +0800 Subject: [PATCH 04/64] fixed search_bar placeholder --- app/views/layouts/_orbit_bar.html.erb | 156 +++++++++++++------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/app/views/layouts/_orbit_bar.html.erb b/app/views/layouts/_orbit_bar.html.erb index e7de0ebc..d14a3d5d 100644 --- a/app/views/layouts/_orbit_bar.html.erb +++ b/app/views/layouts/_orbit_bar.html.erb @@ -1,83 +1,83 @@