forked from saurabh/orbit4-5
add function : redirect to homepage
This commit is contained in:
parent
927b08edeb
commit
d386174c97
|
@ -118,9 +118,13 @@ class PagesController < ApplicationController
|
|||
page.inc(view_count: 1)
|
||||
end
|
||||
render :html => render_final_page("#{module_app}/#{params[:target_action]}",page,layout).html_safe
|
||||
else
|
||||
if Site.first.enable_redirect_index
|
||||
redirect_to root_url
|
||||
else
|
||||
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => :not_found
|
||||
end
|
||||
end
|
||||
else
|
||||
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => :not_found
|
||||
end
|
||||
|
|
|
@ -23,6 +23,7 @@ class Site
|
|||
field :mobile_api_openness_on, :type => Boolean, :default => false
|
||||
field :desktop_closed, :type => Boolean, :default => false
|
||||
field :enable_language_detection, :type => Boolean, :default => false
|
||||
field :enable_redirect_index, :type => Boolean, :default => false
|
||||
field :enable_zh_cn, :type => Boolean, :default => true
|
||||
field :default_locale, :default => "zh_tw"
|
||||
field :mobile_on, :type => Boolean, :default => false
|
||||
|
|
|
@ -185,6 +185,14 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t('preferences.redirect_index') %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :enable_redirect_index, :class => "toggle-check reset_default_locale", data: {disabled: true} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- OrbitBar Them -->
|
||||
|
|
|
@ -422,6 +422,7 @@ en:
|
|||
lang_enabled: Enable Language
|
||||
lang_default: Default Language
|
||||
lang_detection: Enable User Language Detection
|
||||
redirect_index: Redirect to home if page not found
|
||||
nav_enabled: Enable Sidebar Sub Nav
|
||||
openness: Openness
|
||||
orbitbar_theme: OrbitBar Theme
|
||||
|
|
|
@ -429,6 +429,7 @@ zh_tw:
|
|||
icon: 圖示
|
||||
language: 語系設定
|
||||
lang_detection: 開啟使用者語系偵測
|
||||
redirect_index: 切換語系倒回首頁
|
||||
lang_enabled: 開啟語系
|
||||
lang_default: 預設語系
|
||||
nav_enabled: 開啟側欄導引
|
||||
|
|
Loading…
Reference in New Issue