Use key not title for module_app in parser.

Modify announcement routes.
This commit is contained in:
Christophe Vilayphiou 2012-02-06 16:58:19 +08:00
parent e02c675595
commit 8f885e8bb7
4 changed files with 6 additions and 8 deletions

View File

@ -103,7 +103,7 @@ module ParserBackEnd
c.define_tag 'content' do |tag|
ret = ''
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.title}/front_end/#{page.app_frontend_url}?inner=true'></div>"
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true'></div>"
else
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
ret << "<div id='#{tag.attr['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>"

View File

@ -127,7 +127,7 @@ module ParserFrontEnd
c.define_tag 'content' do |tag|
ret = ''
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.title}/front_end/#{page.app_frontend_url}"
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
ret << "/#{id}" if id
ret << "?inner=true'></div>"
else

View File

@ -6,6 +6,6 @@
"intro": "A simple blog……",
"update_info": "Some info",
"create_date": "11-11-2011",
"app_pages": ["/panel/announcement/front_end/"],
"app_pages": ["bulletins"],
"enable_frontend": true
}

View File

@ -12,12 +12,10 @@ Rails.application.routes.draw do
namespace :front_end do
root :to => "bulletins#index"
resources :bulletins
match "show/:id" => "bulletins#show" ,:as => :bulletin
end
namespace :widget do
root :to => "bulletins#index"
end
end
end
match "/appfront/*path" => redirect("/panel/*path")
end