orbit-basic/app/views/admin/sites/responsive_setting.html.erb

182 lines
9.0 KiB
Plaintext
Raw Permalink Normal View History

2013-11-25 04:41:32 +00:00
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_responsive_setting_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
<head>
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/main-forms"%>
<%= stylesheet_link_tag "lib/fileupload"%>
<%= stylesheet_link_tag "lib/togglebox"%>
<%= stylesheet_link_tag "jquery.miniColors" %>
<%= javascript_include_tag "jquery.miniColors.min" %>
2013-11-25 04:41:32 +00:00
<%= javascript_include_tag 'lib/bootstrap-fileupload' %>
<%= javascript_include_tag 'lib/site_set' %>
</head>
<!-- Forms -->
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "form-horizontal main-forms"} do |f| %>
<fieldset>
<!-- Input Area -->
<div class="input-area">
<!-- Enable Mobile Web -->
<div class="control-group">
<label class="control-label muted"><%= I18n.t('site.mobile_version')%></label>
2013-12-03 07:50:27 +00:00
<div id="mobile-site" class="controls">
2013-11-25 04:41:32 +00:00
<%= f.check_box :mobile_on , :class=>"toggle-check", :data=> { disabled: true } %>
<span class="help-block">Enable Mobile Website</span>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Select Announcement Categories</label>
<div class="controls">
<% @module.categories.each do |category| %>
<%= check_box_tag "site[announcement_category][]", category.id.to_s, (@site.announcement_category.include?(category) rescue false), :class=>"toggle-check", :data => { :title => "#{category.title}", disabled: true }, "data-deploy"=>"inline", :checked => (@site.announcement_category.include?(category.id.to_s)) %>
<% end %>
</div>
</div>
2013-12-09 06:54:36 +00:00
<div class="control-group">
<label class="control-label muted">Mobile Site Icon</label>
<div class="controls">
<!-- if this page editing please add class "fileupload-edit" -->
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left" style="background:black;">
<% if @site.mobile_icon.file.present? %>
<%= image_tag( @site.mobile_icon, :size=>"120x120") rescue ''%>
<% else %>
2013-12-09 07:18:11 +00:00
<%= image_tag asset_path('mobile/logo.png'),:class => "pull-left upload-picture"%>
2013-12-09 06:54:36 +00:00
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<% if @site.mobile_icon.present?%>
<span class="btn btn-file">
<%= f.file_field :mobile_icon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
</span>
<%= f.check_box :remove_mobile_icon %>
Remove Icon
<%else%>
<span class="btn btn-file">
<%= f.file_field :mobile_icon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
</span>
<%end%>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Select Orbit Bar Color</label>
<div class="controls">
<input type="text" value="<%= (@site.mobile_bar_color.nil? ? '#FFFFF' : @site.mobile_bar_color[0]) %>" class="color-picker" name="site[mobile_bar_color][]" <%= (@site.mobile_bar_color.nil? ? "disabled='disabled'" : "") %> />
<input type="text" value="<%= (@site.mobile_bar_color.nil? ? '#FFFFF' : @site.mobile_bar_color[1]) %>" class="color-picker" name="site[mobile_bar_color][]" <%= (@site.mobile_bar_color.nil? ? "disabled='disabled'" : "") %> />
OR
<input type="checkbox" <%= (@site.mobile_bar_color.nil? ? "checked='checked'" : "") %> name="site[default_bar_color]" id="default_bar_color" style="margin:0 0 3px 10px;" /> Default Color
</div>
</div>
<div class="control-group">
<label class="control-label muted">Phone Number</label>
<div class="controls">
<div id="phone_number_wrap" style="line-height: 40px;">
<% @site.phone_number.each_with_index do |phone,i| %>
<span>
<input type="text" name="site[phone_number][<%= i %>][title]" value="<%= phone['title'] %>">
<input type="text" name="site[phone_number][<%= i %>][number]" value="<%= phone['number'] %>">
<a class="btn btn-small btn-danger delete_phone_number" href="#" onclick="$(this).parent().remove();"><i class="icon-trash"></i> <%= t(:delete) %></a>
</span>
<% end %>
</div>
<div class='btn btn-small btn-success' id='add_phone_number_btn'>
<i class="icon-plus"></i>
<%= t(:add) %>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Address</label>
<div class="controls">
<div class="textarea">
<%= f.text_area :address, :class => "ckeditor input-block-level", :value => (@site.address rescue nil) %>
</div>
</div>
</div>
2013-11-25 04:41:32 +00:00
<div class="control-group">
<label class="control-label muted"><%= I18n.t('site.mobile_api_openness_on') %></label>
<div class="controls">
<%= f.check_box :mobile_api_openness_on , :class=>"toggle-check", :data=> { disabled: true } %>
<span class="help-block">Make API available for Mobile Apps</span>
</div>
2013-12-09 06:54:36 +00:00
</div>
2013-11-25 04:41:32 +00:00
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</div>
</fieldset>
<%end%>
<div id="phone_number_template" style="display:none">
<span style='line-height: 40px; display: block;'>
<input id="site_phone_number_title" name="site[phone_number][][title]" placeholder="<%= t(:name) %>" size="30" type="text" value="">
<input id="site_phone_number_number" name="site[phone_number][][number]" placeholder="<%= t(:phone_number) %>" size="30" type="text" value="">
<a class="btn btn-small btn-danger delete_phone_number" href="#" onclick="$(this).parent().remove();"><i class="icon-trash"></i> <%= t(:delete) %></a>
</span>
</script>
<% content_for :page_specific_javascript do %>
<script type="text/javascript">
$(".language-nav li a").click(function(){window.location.hash = $(this).attr("href")});
$(document).ready(function(){
// Disable default language if language detection enbaled
$("#site_enable_language_detection").change(function(){
if ( !$(this).parent().hasClass("disable") ){
$.each($( "input[name='site[default_locale]']" ),function(){
if ( !$(this).parent().hasClass("disable") ) $(this).parent().toggleClass('disable');
$(this).toggleClass('disable');
});
}
});
// Disable language detection if default language enbaled
$.each($( "input[name='site[default_locale]']" ),function(){
$(this).click(function(){
$("#site_enable_language_detection").parent().addClass('disable');
});
});
if($('.color-picker').length > 0){
$('.color-picker').miniColors(); // just in category view
}
$("#default_bar_color").bind(clickEvent,function(){
var colorboxes = $( this ).parent().find( "input[type=text]" );
if( $( this ).is(":checked") ){
colorboxes.attr("disabled","disabled");
}else{
colorboxes.removeAttr('disabled');
}
});
// Number of phones
var num = $("#phone_number_wrap input").length/2;
$('#add_phone_number_btn').click(function(){
var template = $("#phone_number_template").html();
template = template.replace(/\[]/g,"["+num+"]");
$("#phone_number_wrap").append(template);
num++;
});
});
</script>
<% end %>