This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/admin/sites/preference.html.erb

269 lines
14 KiB
Plaintext
Raw Normal View History

2013-09-02 09:31:34 +00:00
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
2013-09-05 04:49:59 +00:00
<head>
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/main-forms"%>
<%= stylesheet_link_tag "lib/fileupload"%>
<%= stylesheet_link_tag "lib/togglebox"%>
<%= javascript_include_tag 'lib/bootstrap-fileupload' %>
<%= javascript_include_tag 'lib/site_set' %>
</head>
2013-09-05 10:05:32 +00:00
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "form-horizontal main-forms"} do |f| %>
2013-09-05 04:49:59 +00:00
<fieldset>
<!-- Input Area -->
<div class="input-area">
<div class="nav-name"><strong>Classification</strong></div>
2013-09-05 04:49:59 +00:00
<ul class="nav nav-pills language-nav">
<li class="active">
<a href="#sidebar-nav" data-toggle="tab">Sidebar Nav</a>
</li>
<li>
<a href="#system-email" data-toggle="tab">System Email</a>
</li>
<li>
<a href="#openness" data-toggle="tab">Openness</a>
</li>
<li>
<a href="#language-set" data-toggle="tab">Language</a>
</li>
<li>
2013-09-05 10:05:32 +00:00
<a href="#orbitBar-them" data-toggle="tab">OrbitBar Theme</a>
2013-09-05 04:49:59 +00:00
</li>
</ul>
<div class="tab-content">
<!-- Sidebar Nav -->
<div id="sidebar-nav" class="tab-pane fade in active">
<div class="control-group">
<label class="control-label muted">Enable Sidebar Sub Nav</label>
<div class="controls">
<input type="checkbox" class="toggle-check set-sidebar-state" data-disabled="true">
</div>
</div>
</div>
<!-- System Email -->
2013-09-05 10:05:32 +00:00
<%= f.fields_for :site_settings, @site['site_settings'] do |f| %>
2013-09-05 04:49:59 +00:00
<div id="system-email" class="tab-pane fade">
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.address' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-09-05 10:05:32 +00:00
<%= f.text_field :address, :value => (@site['site_settings']['address'] rescue nil), :class=>"input-large", :placeholder=>"Email Address" %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.domain' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-09-05 10:05:32 +00:00
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.authentication' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-09-05 10:05:32 +00:00
<%= f.text_field :authentication, :value => (@site['site_settings']['authentication'] rescue nil), :class=>"input-large", :placeholder =>"Authentication" %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.user_name' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-09-05 10:05:32 +00:00
<%= f.text_field :user_name, :value => (@site['site_settings']['user_name'] rescue nil), :class=>"input-large", :placeholder=>"User Name" %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.password' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-09-05 10:05:32 +00:00
<%= f.text_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.port' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-09-05 10:05:32 +00:00
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil),:placeholder=>"Port", :class=>"input-mini" %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.tls' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-10-30 09:26:31 +00:00
<%= f.check_box :tls, :checked => (@site['site_settings']['tls'].eql?('1') rescue false),:class=>"toggle-check", :data=> { disabled: true } %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= t 'mail.enable_starttls_auto' %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-10-30 09:26:31 +00:00
<%= f.check_box 'enable_starttls_auto', :checked => (@site['site_settings']['enable_starttls_auto'].eql?('1') rescue false), :class=>"toggle-check", :data=> { disabled: true } %>
2013-09-05 04:49:59 +00:00
</div>
</div>
</div>
2013-09-05 10:05:32 +00:00
<% end %>
2013-09-05 04:49:59 +00:00
<!-- Openness -->
<div id="openness" class="tab-pane fade">
<div class="control-group">
2013-10-14 08:47:34 +00:00
<label class="control-label muted"><%= I18n.t('site.frontend_open')%></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-10-30 09:26:31 +00:00
<%= f.check_box :frontend_open , :class=>"toggle-check", :data=> { disabled: true } %>
2013-10-14 08:47:34 +00:00
<span class="help-block">If Checked, the frontend will be open for all users.</span>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
2013-09-05 10:05:32 +00:00
<label class="control-label muted"><%= I18n.t('site.backend_openness_on') %></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
<%= f.check_box :backend_openness_on , :class=>"toggle-check", :data=> { disabled: true } %>
2013-09-05 04:49:59 +00:00
<span class="help-block">All users can visit backend pages</span>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= I18n.t('site.enable_personal_desktop')%></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
<%= f.check_box :desktop_closed , :class=>"toggle-check", :data=> { disabled: true } %>
2013-09-05 04:49:59 +00:00
</div>
</div>
2013-11-19 08:23:30 +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 } %>
2013-11-19 14:16:54 +00:00
<span class="help-block">Make API available for Mobile Apps</span>
2013-11-19 08:23:30 +00:00
</div>
</div>
2013-09-05 04:49:59 +00:00
</div>
<!-- Language -->
<div id="language-set" class="tab-pane fade">
2013-09-06 08:41:02 +00:00
<!-- <div class="control-group">
2013-09-05 04:49:59 +00:00
<label class="control-label muted">Enable User Language Detection</label>
<div class="controls">
<input type="checkbox" class="toggle-check" data-disabled="true">
</div>
2013-09-06 08:41:02 +00:00
</div> -->
<!-- Terms of Use -->
2013-09-05 04:49:59 +00:00
<div class="control-group">
<label class="control-label muted">Enable User Language Detection
</label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-10-30 09:26:31 +00:00
<%= f.check_box :enable_language_detection, :class => "toggle-check", data: {disabled: true} %>
2013-09-05 04:49:59 +00:00
</div>
</div>
2013-09-05 04:49:59 +00:00
<div class="control-group">
<label class="control-label muted">Enable Language</label>
<div class="controls">
2013-09-06 08:41:02 +00:00
<% @site_valid_locales.each do |valid_locale| %>
2013-10-30 09:26:31 +00:00
<%= check_box_tag "site[in_use_locales][]", valid_locale, @site.in_use_locales.include?(valid_locale), :class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(valid_locale)}", disabled: true } %>
<% end %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
<label class="control-label muted">Default Language</label>
<div class="controls">
<% @site_in_use_locales.each do |locale| %>
2013-11-04 01:40:37 +00:00
<%= radio_button_tag "site[default_locale]", locale, @locale == locale,:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %>
<% end %>
</div>
</div>
2013-09-05 04:49:59 +00:00
</div>
<!-- OrbitBar Them -->
<div id="orbitBar-them" class="tab-pane fade">
<div class="control-group">
<label class="control-label muted">OrbitBar Logo 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">
<% if @site.default_image %>
2013-09-05 10:05:32 +00:00
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
<% else %>
2013-10-22 02:33:05 +00:00
<%= image_tag "default-img.png", :class => "pull-left upload-picture"%>
2013-09-05 10:05:32 +00:00
<% end %>
2013-09-05 04:49:59 +00:00
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
2013-09-09 03:27:18 +00:00
<% if @site.default_image.file.present?%>
<span class="btn btn-file">
2013-09-05 10:05:32 +00:00
<%= f.file_field :default_image, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
</span>
<%= f.check_box :remove_default_image %>
2013-10-22 02:33:05 +00:00
Remove OrbitBar Logo
2013-09-09 03:27:18 +00:00
<%else%>
<span class="btn btn-file">
2013-09-09 03:27:18 +00:00
<%= f.file_field :default_image, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
</span>
2013-09-05 10:05:32 +00:00
<%end%>
2013-09-05 04:49:59 +00:00
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
2013-09-05 04:49:59 +00:00
</div>
</div>
<div class="control-group">
<label class="control-label muted">Orbit Favicon</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">
<% if @site.favicon %>
<%= image_tag( @site.favicon, :size=>"120x120") rescue ''%>
<% else %>
2013-10-22 02:33:05 +00:00
<%= image_tag "default-img.png", :class => "pull-left upload-picture"%>
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<% if @site.favicon.file.present?%>
<span class="btn btn-file">
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
</span>
<%= f.check_box :remove_favicon %>
Remove Favicon
<%else%>
<span class="btn btn-file">
<%= f.file_field :favicon, :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>
2013-09-05 04:49:59 +00:00
</div>
</div>
</div>
2013-09-05 04:49:59 +00:00
</div>
<!-- Form Actions -->
<div class="form-actions">
2013-09-05 10:05:32 +00:00
<%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
2013-09-05 04:49:59 +00:00
</div>
</fieldset>
<%end%>
<script type="text/javascript">
2013-10-21 09:46:29 +00:00
var locales = <%= @site.in_use_locales.to_json.html_safe %>;
$(document).ready(function(){
$( ".in_use_locales" ).each( function(){
2013-10-21 09:46:29 +00:00
$( this ).parent( "div.togglebox" ).addClass( "disabled" );
var val = $( this ).val();
if( locales.filter(function(a){ return a == val }).length == 1){
$( this ).parent( "div.togglebox" ).removeClass( "disabled" );
}
})
})
2013-10-21 09:46:29 +00:00
delete locales;
</script>