From ce8e9c0a5fc218def62c62dcd20b07e8c20bc9a0 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 15 Nov 2013 16:58:27 +0800 Subject: [PATCH] Revert "more button fix and also new way to select more page." This reverts commit e129b25554cb2e43bf6f826c8813428f7fe0b864. --- app/controllers/admin/page_parts_controller.rb | 8 -------- app/controllers/default_widget_controller.rb | 3 --- app/controllers/pages_controller.rb | 4 ++-- app/models/page_part.rb | 1 - app/views/admin/page_parts/_custom_widget.html.erb | 8 +------- app/views/admin/page_parts/_default_widget.html.erb | 6 ------ app/views/admin/page_parts/_more_link.html.erb | 6 ------ app/views/default_widget/default_widget.html.erb | 6 +----- config/mongoid.yml | 4 ++-- lib/orbit_app/helper/default_widget_tag_helper.rb | 9 +-------- .../panel/web_resource/widget/web_links_controller.rb | 3 ++- .../panel/web_resource/widget/web_links/_index.html.erb | 6 +++++- 12 files changed, 14 insertions(+), 50 deletions(-) delete mode 100644 app/views/admin/page_parts/_more_link.html.erb diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 49cd459b..2b670b93 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -12,8 +12,6 @@ class Admin::PagePartsController < OrbitBackendController @module_app_categories = @module_app.categories @module_app_tags = @module_app.tags @widget_paths = ModuleApp.find(@module_app.id).widgets.map{|name, data| [t(data["i18n"]), name]} rescue [] - @pages = Page.where(:module_app_id => @module_app.id) - if @part.widget_path.present? if @part.widget_path.eql?("default_widget") @checked_style = @part.widget_style @@ -29,10 +27,7 @@ class Admin::PagePartsController < OrbitBackendController # @frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil @frontend_styles = @module_app.widgets[@part.widget_path]["style"] rescue nil @partial = 'custom_widget' if @frontend_styles.present? - end - @partial = 'more_link' unless @partial - end @data_count = @module_app.get_registration.get_data_count.to_a rescue [] @no_orbit_bar = @side_bar = @no_header = true @@ -79,7 +74,6 @@ class Admin::PagePartsController < OrbitBackendController def get_display_style @part = PagePart.find(params[:id]) rescue nil @module_app = ModuleApp.find(params[:module_id]) rescue nil - @pages = Page.where(:module_app_id => @module_app.id) if @module_app if params[:val].eql?("default_widget") @checked_style = @part.widget_path.present? ? @part.widget_style : nil if @part && @part.widget_path.eql?("default_widget") @@ -94,8 +88,6 @@ class Admin::PagePartsController < OrbitBackendController @frontend_styles = @module_app.widgets[params[:val]]["style"] rescue nil @partial = 'custom_widget' if @frontend_styles.present? end - @partial = 'more_link' unless @partial - end end diff --git a/app/controllers/default_widget_controller.rb b/app/controllers/default_widget_controller.rb index e836a149..63314529 100644 --- a/app/controllers/default_widget_controller.rb +++ b/app/controllers/default_widget_controller.rb @@ -39,7 +39,6 @@ class DefaultWidgetController< OrbitWidgetController end def default_widget - @search = params["search_query"].blank? ? false : true if !params[:id].blank? and !params["clicked_field_name"].blank? clicked_field_name = params["clicked_field_name"].to_sym @@ -92,8 +91,6 @@ class DefaultWidgetController< OrbitWidgetController @tag_class = 'default_widget_typeC' @partial = "typeC" end - @more_url = Page.find(@page_part.more_link).path rescue nil - # debugger end end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index a3405c17..fab2acef 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -70,6 +70,7 @@ class PagesController < ApplicationController elsif params[:category_id].is_a? String options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank? end + if params[:tag_id].is_a? Array options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id',params[:tag_id])}" unless params[:tag_id].blank? elsif params[:category_id].is_a? String @@ -80,7 +81,7 @@ class PagesController < ApplicationController options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank? options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank? uri = URI::escape(url + options) - # uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&')) + #uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&')) redirect_to(uri)unless save_from_no_lang_for_page end @@ -104,7 +105,6 @@ class PagesController < ApplicationController protected def get_item - if params[:page_id] @item = Item.find(params[:page_id]) elsif params[:same_page_id] diff --git a/app/models/page_part.rb b/app/models/page_part.rb index 6373c698..64347fab 100644 --- a/app/models/page_part.rb +++ b/app/models/page_part.rb @@ -12,7 +12,6 @@ class PagePart field :widget_path field :category,type: Array, :default => [] field :tag, type: Array,:default => [] - field :more_link_page_id field :widget_style field :widget_field , :type => Array,:default => [] diff --git a/app/views/admin/page_parts/_custom_widget.html.erb b/app/views/admin/page_parts/_custom_widget.html.erb index 3c215514..1e898e39 100644 --- a/app/views/admin/page_parts/_custom_widget.html.erb +++ b/app/views/admin/page_parts/_custom_widget.html.erb @@ -4,12 +4,6 @@ <%= select 'page_part', 'widget_style', @frontend_styles, {:selected => (@part && @part[:widget_style])}, class: "input-xlarge" %> -
- -
- <%= select 'page_part', 'more_link_page_id', options_for_select(@pages.collect{|page|[page.title,page.id]},(@part.more_link_page_id rescue nil)), class: "input-xlarge" %> -
-
<% @module_app.widget_options.tap { |widget|%> @@ -25,8 +19,8 @@ <% else%>
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)), class: "input-xlarge" %> -
<% end %> +
<% end %> <% } %> <% } %> diff --git a/app/views/admin/page_parts/_default_widget.html.erb b/app/views/admin/page_parts/_default_widget.html.erb index 93348fb4..a1d552c6 100644 --- a/app/views/admin/page_parts/_default_widget.html.erb +++ b/app/views/admin/page_parts/_default_widget.html.erb @@ -74,12 +74,6 @@ -
- -
- <%= select 'page_part', 'more_link_page_id', options_for_select(@pages.collect{|page|[page.title,page.id]},(@part.more_link_page_id rescue nil)), class: "input-xlarge" %> -
-