diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 58af08af..da2de827 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -39,9 +39,8 @@ class Admin::PagePartsController < ApplicationController when 'announcement' @categories = BulletinCategory.all @tags = AnnouncementTag.all - when 'news' - @categories = NewsBulletinCategory.all - @tags = NewsTag.all + when 'gallery' + @albums = GalleryAlbum.all when 'web_resource' @categories = WebLinkCategory.all @tags = WebResourceTag.all @@ -102,9 +101,8 @@ class Admin::PagePartsController < ApplicationController when 'announcement' @categories = BulletinCategory.all @tags = AnnouncementTag.all - when 'news' - @categories = NewsBulletinCategory.all - @tags = NewsTag.all + when 'gallery' + @albums = GalleryAlbum.all when 'web_resource' @categories = WebLinkCategory.all @tags = WebResourceTag.all diff --git a/app/controllers/orbit_widget_controller.rb b/app/controllers/orbit_widget_controller.rb index 8f4b25da..47e24fe0 100644 --- a/app/controllers/orbit_widget_controller.rb +++ b/app/controllers/orbit_widget_controller.rb @@ -1,10 +1,3 @@ class OrbitWidgetController< OrbitFrontendComponentController -before_filter :get_wiget_options - def get_wiget_options - @wiget_options = {} - if params[:widget_options] - @wiget_options = (eval('{'+ params[:widget_options] +'}') rescue {}) - end - end end \ No newline at end of file diff --git a/app/models/page_part.rb b/app/models/page_part.rb index a36c498a..ebaac684 100644 --- a/app/models/page_part.rb +++ b/app/models/page_part.rb @@ -23,10 +23,6 @@ class PagePart before_save :delete_empty_widget_field after_save :update_parent - def widget_options_uri - self.widget_options.map{|t| "#{t[0]}: #{t[1]}"}.join(',') rescue '' - end - protected diff --git a/app/views/admin/page_parts/_widget_options.html.erb b/app/views/admin/page_parts/_widget_options.html.erb index 731fdc38..f3438058 100644 --- a/app/views/admin/page_parts/_widget_options.html.erb +++ b/app/views/admin/page_parts/_widget_options.html.erb @@ -1,5 +1,9 @@ <% if (@module_app && @module_app.widget_options) %> <%= label_tag('widget_options') %> + <% if @module_app.key.eql?('gallery') %> + <%= t('gallery.gallery') %> + <%= select_tag "page_part[widget_options][album_id]", options_from_collection_for_select(@albums, :id, :name, :selected => (@part.widget_options[key] rescue nil)) %> + <% end %> <% if @module_app.widget_options.has_key? @part.widget_path%> <% @module_app.widget_options[@part.widget_path].each do |key,options| %> <%= label_tag(t(@module_app.widget_options_fields_i18n[@part.widget_path][key]))%> diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index c0a8315d..1f996cec 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -210,7 +210,7 @@ module ParserCommon when 'default_widget' "/panel/orbit_app/widget/#{part.widget_style}?inner=true" else - "/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true&widget_options=#{part.widget_options_uri}" + "/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 << "
" diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 1175c527..246e6c20 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -114,7 +114,7 @@ module ParserFrontEnd when 'default_widget' "/panel/orbit_app/widget/\#{part.widget_style}?inner=true" else - "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true&widget_options=\#{part.widget_options_uri}" + "/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 << "