From f178fd963aed48e7175c9a5aa8f8751e6bb7799e Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Tue, 1 Apr 2014 23:38:17 +0800 Subject: [PATCH] Slug --- app/controllers/pages_controller.rb | 2 +- app/helpers/orbit_helper.rb | 4 +- app/views/frontend/Admissions_layout.html.erb | 83 ------- app/views/frontend/FAQ2_layout.html.erb | 198 ----------------- app/views/frontend/Faqs_layout.html.erb | 94 -------- app/views/frontend/Focus News_layout.html.erb | 119 ---------- app/views/frontend/News_layout.html.erb | 119 ---------- app/views/frontend/faq_layout.html.erb | 207 ------------------ app/views/frontend/focusnews_layout.html.erb | 202 ----------------- app/views/frontend/home_layout.html.erb | 188 ---------------- 10 files changed, 3 insertions(+), 1213 deletions(-) delete mode 100644 app/views/frontend/Admissions_layout.html.erb delete mode 100644 app/views/frontend/FAQ2_layout.html.erb delete mode 100644 app/views/frontend/Faqs_layout.html.erb delete mode 100644 app/views/frontend/Focus News_layout.html.erb delete mode 100644 app/views/frontend/News_layout.html.erb delete mode 100644 app/views/frontend/faq_layout.html.erb delete mode 100644 app/views/frontend/focusnews_layout.html.erb delete mode 100644 app/views/frontend/home_layout.html.erb diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 964778b..865f57a 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -19,7 +19,7 @@ class PagesController < ApplicationController def show path = request.original_fullpath.split('/') if path.size == 2 - redirect_to '/' + redirect_to root_path else if path.last.include? '-' params[:page_id] = path[-2] diff --git a/app/helpers/orbit_helper.rb b/app/helpers/orbit_helper.rb index 7e351e0..c7c400e 100644 --- a/app/helpers/orbit_helper.rb +++ b/app/helpers/orbit_helper.rb @@ -7,8 +7,8 @@ module OrbitHelper @params end - def self.url_to_show(uid,title) - "/#{self.get_site_locale.to_s}#{@params[:url]}/#{title}--#{uid}" + def self.url_to_show(slug) + "/#{@site_locale}#{@params[:url]}/#{slug}" end def self.set_site_locale(locale) diff --git a/app/views/frontend/Admissions_layout.html.erb b/app/views/frontend/Admissions_layout.html.erb deleted file mode 100644 index da0bdc5..0000000 --- a/app/views/frontend/Admissions_layout.html.erb +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
- -
- -
-
-

This is test title

-
This is test body
-
-
- - - - -
- - -
-

© Company 2014

-
-
- - diff --git a/app/views/frontend/FAQ2_layout.html.erb b/app/views/frontend/FAQ2_layout.html.erb deleted file mode 100644 index 8eca4ee..0000000 --- a/app/views/frontend/FAQ2_layout.html.erb +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
- -
- -
-
-
-

Harry

-
-
-

{{title}}

-

{{subtitle}}

-

Read more

-
-
-
-

More

-
-
- - - - -
- - -
-

© Company 2014

-
-
- - diff --git a/app/views/frontend/Faqs_layout.html.erb b/app/views/frontend/Faqs_layout.html.erb deleted file mode 100644 index 60b65d6..0000000 --- a/app/views/frontend/Faqs_layout.html.erb +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
- -
- -
-
-
-
-

This is test title

-

This is test body

-

More

-
- -
-

Test 2

-

Test 2 body

-

More

-
-
-
-
- - - - -
- - -
-

© Company 2014

-
-
- - diff --git a/app/views/frontend/Focus News_layout.html.erb b/app/views/frontend/Focus News_layout.html.erb deleted file mode 100644 index 0036f37..0000000 --- a/app/views/frontend/Focus News_layout.html.erb +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
- -
- -
-
-
-
-

This is test title

-

This is test body

-

More

-
- -
-

Test 2

-

Test 2 body

-

More

-
-
-
-
- - - - -
- - -
-

© Company 2014

-
-
- - diff --git a/app/views/frontend/News_layout.html.erb b/app/views/frontend/News_layout.html.erb deleted file mode 100644 index dde11c8..0000000 --- a/app/views/frontend/News_layout.html.erb +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
- -
- -
-
- -
-
-
-
-

This is test title

-

This is test body

-

Read more

-
-
-
- -
-
-
-

Test 2

-

Test 2 body

-

Read more

-
-
-
-
-

More

- -
-
-
-

This is test title

-

This is test body

-

More

-
- -
-

Test 2

-

Test 2 body

-

More

-
-
-
-
- - - - -
- - -
-

© Company 2014

-
-
- - diff --git a/app/views/frontend/faq_layout.html.erb b/app/views/frontend/faq_layout.html.erb deleted file mode 100644 index 0b68db2..0000000 --- a/app/views/frontend/faq_layout.html.erb +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
- -
- -
-
-
- - - - -
- - -
-

© Company 2014

-
-
- - diff --git a/app/views/frontend/focusnews_layout.html.erb b/app/views/frontend/focusnews_layout.html.erb deleted file mode 100644 index 03791da..0000000 --- a/app/views/frontend/focusnews_layout.html.erb +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
- -
- -
-
-
-

{{title}}

-

{{subtitle}}

-

More

-
-
-
- - - - -
- - -
-

© Company 2014

-
-
- - diff --git a/app/views/frontend/home_layout.html.erb b/app/views/frontend/home_layout.html.erb deleted file mode 100644 index 1c5fb15..0000000 --- a/app/views/frontend/home_layout.html.erb +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - -Orbit Classic - - - - - - - - - - -
-
-
-
-
-
- - -
- -
- -
- -