fix page name repeated error when page creating

This commit is contained in:
Matt K. Fu 2013-04-25 12:19:25 +08:00
parent b198b1a17b
commit a0478f2a8f
1 changed files with 16 additions and 1 deletions

View File

@ -148,7 +148,22 @@ include Admin::FrontendWidgetInterface
else else
flash.now[:error] = t('create.error.page') flash.now[:error] = t('create.error.page')
@designs = Design.all.entries @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" render :action => "new"
end end
end end