From a0478f2a8fb70a37e39eb60d5b1acd6f4777c950 Mon Sep 17 00:00:00 2001 From: "Matt K. Fu" Date: Thu, 25 Apr 2013 12:19:25 +0800 Subject: [PATCH] fix page name repeated error when page creating --- app/controllers/admin/pages_controller.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 837994e99..3c0a9997b 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -148,7 +148,22 @@ include Admin::FrontendWidgetInterface else flash.now[:error] = t('create.error.page') @designs = Design.all.entries - @design = Design.first + @design = Design.find(params[:page][:design]) || Design.first + @themes = @design.themes + @module_apps = ModuleApp.for_frontend_select + @selected={ + :design => params[:page][:design], + :theme=> (Theme.find(params[:page][:theme_id]) rescue nil), + :module_app=> (ModuleApp.find(params[:page][:module_app_id]) rescue nil) ,#@module_apps.first + :app_frontend_url=> params[:page][:app_frontend_url], #@module_apps.first + :category=>params[:page][:category], + :tag=>params[:page][:tag], + :page_frontend_data_count=>params[:page][:page_frontend_data_count], + :frontend_style => params[:page][:frontend_style] + } + @app_frontend_urls = @item.module_app ? select_array_for_app_frontend_urls(@item.module_app.app_pages) : nil + get_categories_and_tags + get_frontend_data_count render :action => "new" end end