Add mobile version in site settings
This commit is contained in:
parent
37740adb24
commit
6c6bda988d
|
@ -250,8 +250,10 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def prepare_for_mobile
|
def prepare_for_mobile
|
||||||
session[:mobile_param] = params[:mobile] if params[:mobile]
|
if @site.mobile_on
|
||||||
request.format = :mobile if mobile_device?
|
session[:mobile_param] = params[:mobile] if params[:mobile]
|
||||||
|
request.format = :mobile if mobile_device?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,6 +25,8 @@ class Site
|
||||||
field :title, localize: true
|
field :title, localize: true
|
||||||
field :footer, localize: true
|
field :footer, localize: true
|
||||||
field :sub_menu, localize: true
|
field :sub_menu, localize: true
|
||||||
|
|
||||||
|
field :mobile_on, :type => Boolean, :default => false
|
||||||
|
|
||||||
belongs_to :design
|
belongs_to :design
|
||||||
has_many :site_metas, :autosave => true, :dependent => :destroy
|
has_many :site_metas, :autosave => true, :dependent => :destroy
|
||||||
|
|
|
@ -94,13 +94,23 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<br>
|
<br>
|
||||||
<% if @site.default_image.file %>
|
<% if @site.default_image.file %>
|
||||||
<%= f.check_box :remove_default_image %>
|
<label class="checkbox">
|
||||||
<%= t('刪除已上傳檔案') %>
|
<%= check_box_tag 'site[remove_default_image]' %>
|
||||||
|
<%= t('delete') %>
|
||||||
|
</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="control-group" style="margin-bottom: 0;">
|
||||||
|
<label class="control-label"><%= t 'site.mobile_version' %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<label class="checkbox">
|
||||||
|
<%= f.check_box :mobile_on %>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -333,6 +333,7 @@ en:
|
||||||
keywords: Site keywords
|
keywords: Site keywords
|
||||||
keywords_help: ''
|
keywords_help: ''
|
||||||
language: Site language
|
language: Site language
|
||||||
|
mobile_version: Mobile version
|
||||||
search: Site Search
|
search: Site Search
|
||||||
search_help: Please Enter the search argument for Google search.
|
search_help: Please Enter the search argument for Google search.
|
||||||
settings: Site setting
|
settings: Site setting
|
||||||
|
|
|
@ -333,6 +333,7 @@ zh_tw:
|
||||||
keywords: 搜尋關鍵字
|
keywords: 搜尋關鍵字
|
||||||
keywords_help: ''
|
keywords_help: ''
|
||||||
language: 網站語言
|
language: 網站語言
|
||||||
|
mobile_version: 手機版
|
||||||
search: 網站搜尋
|
search: 網站搜尋
|
||||||
search_help: 請輸入送交Google搜尋的參數
|
search_help: 請輸入送交Google搜尋的參數
|
||||||
settings: 基本設定
|
settings: 基本設定
|
||||||
|
|
Loading…
Reference in New Issue