diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 1c6b9c56..a6e3314f 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -26,6 +26,7 @@ class Admin::PagePartsController < ApplicationController @module_app = @part.module_app ? @part.module_app : @module_apps[0] @r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag @tag_objects = @r_tag.classify.constantize.all + @categories = BulletinCategory.all end def create diff --git a/app/views/admin/page_parts/_module_widget.html.erb b/app/views/admin/page_parts/_module_widget.html.erb index 532cff53..fd481172 100644 --- a/app/views/admin/page_parts/_module_widget.html.erb +++ b/app/views/admin/page_parts/_module_widget.html.erb @@ -4,4 +4,9 @@ <%= f.select :widget_path, @module_app.widgets.collect{|widget| [widget.humanize, widget]}, :selected => @part.widget_path %> + + + + + <%= select 'page_part', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @part[:category] %> \ No newline at end of file diff --git a/app/views/admin/pages/_form.html.erb b/app/views/admin/pages/_form.html.erb index a45dbbd2..9722413c 100644 --- a/app/views/admin/pages/_form.html.erb +++ b/app/views/admin/pages/_form.html.erb @@ -26,8 +26,8 @@
<%= t('admin.module_app') %> <%= render :partial => "admin/module_apps/app_selector", :locals => { :f => f } %> - <%= select('page','app_frontend_url', @app_frontend_urls ) rescue ''%> - <%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]} ) rescue ''%> + <%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> + <%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category] ) rescue ''%>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %> diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb index c2de9804..4b8fbd27 100644 --- a/lib/parsers/parser_back_end.rb +++ b/lib/parsers/parser_back_end.rb @@ -111,7 +111,11 @@ module ParserBackEnd when 'text' ret << part.i18n_variable[I18n.locale] rescue '' when 'module_widget' - ret << "
" + if part[:category] + ret << "" + else + ret << "" + end when 'public_r_tag' ret << "