Add mobile version in site settings
This commit is contained in:
1 parent
37740adb24
commit
6c6bda988d
5 files changed
+20
-4
No files matched your search
@@ -250,8 +250,10 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def prepare_for_mobile
|
||||
session[:mobile_param] = params[:mobile] if params[:mobile]
|
||||
request.format = :mobile if mobile_device?
|
||||
if @site.mobile_on
|
||||
session[:mobile_param] = params[:mobile] if params[:mobile]
|
||||
request.format = :mobile if mobile_device?
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -25,6 +25,8 @@ class Site
|
||||
field :title, localize: true
|
||||
field :footer, localize: true
|
||||
field :sub_menu, localize: true
|
||||
|
||||
field :mobile_on, :type => Boolean, :default => false
|
||||
|
||||
belongs_to :design
|
||||
has_many :site_metas, :autosave => true, :dependent => :destroy
|
||||
|
||||
@@ -94,13 +94,23 @@
|
||||
<% end %>
|
||||
<br>
|
||||
<% if @site.default_image.file %>
|
||||
<%= f.check_box :remove_default_image %>
|
||||
<%= t('刪除已上傳檔案') %>
|
||||
<label class="checkbox">
|
||||
<%= check_box_tag 'site[remove_default_image]' %>
|
||||
<%= t('delete') %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% 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>
|
||||
|
||||
Reference in new issue
Block a user