Archived
Fix album widget options
This commit is contained in:
1 parent
be00cec4d7
commit
c6111460f5
7 files changed
+18
-28
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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]))%>
|
||||
|
||||
Reference in new issue
Block a user