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

253 lines
12 KiB
Plaintext

<% 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 %>
<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>
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "form-horizontal main-forms"} do |f| %>
<fieldset>
<!-- Input Area -->
<div class="input-area">
<div class="nav-name"><strong>Classification</strong></div>
<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>
<a href="#orbitBar-them" data-toggle="tab">OrbitBar Theme</a>
</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 -->
<%= f.fields_for :site_settings, @site['site_settings'] do |f| %>
<div id="system-email" class="tab-pane fade">
<div class="control-group">
<label class="control-label muted"><%= t 'mail.address' %></label>
<div class="controls">
<%= f.text_field :address, :value => (@site['site_settings']['address'] rescue nil), :class=>"input-large", :placeholder=>"Email Address" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'mail.domain' %></label>
<div class="controls">
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'mail.authentication' %></label>
<div class="controls">
<%= f.text_field :authentication, :value => (@site['site_settings']['authentication'] rescue nil), :class=>"input-large", :placeholder =>"Authentication" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'mail.user_name' %></label>
<div class="controls">
<%= f.text_field :user_name, :value => (@site['site_settings']['user_name'] rescue nil), :class=>"input-large", :placeholder=>"User Name" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'mail.password' %></label>
<div class="controls">
<%= f.text_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'mail.port' %></label>
<div class="controls">
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil),:placeholder=>"Port", :class=>"input-mini" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'mail.tls' %></label>
<div class="controls">
<%= f.check_box :tls, :checked => (@site['site_settings']['tls'].eql?('1') rescue false),:class=>"toggle-check" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'mail.enable_starttls_auto' %></label>
<div class="controls">
<%= f.check_box 'enable_starttls_auto', :checked => (@site['site_settings']['enable_starttls_auto'].eql?('1') rescue false), :class=>"toggle-check" %>
</div>
</div>
</div>
<% end %>
<!-- Openness -->
<div id="openness" class="tab-pane fade">
<div class="control-group">
<label class="control-label muted"><%= I18n.t('site.frontend_open')%></label>
<div class="controls">
<%= f.check_box :frontend_open , :class=>"toggle-check"%>
<span class="help-block">If Checked, the frontend will be open for all users.</span>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= I18n.t('site.backend_openness_on') %></label>
<div class="controls">
<%= f.check_box :backend_openness_on , :class=>"toggle-check" %>
<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>
<div class="controls">
<%= f.check_box :desktop_closed , :class=>"toggle-check" %>
</div>
</div>
</div>
<!-- Language -->
<div id="language-set" class="tab-pane fade">
<!-- <div class="control-group">
<label class="control-label muted">Enable User Language Detection</label>
<div class="controls">
<input type="checkbox" class="toggle-check" data-disabled="true">
</div>
</div> -->
<!-- Terms of Use -->
<div class="control-group">
<label class="control-label muted">Enable User Language Detection
</label>
<div class="controls">
<%= f.check_box :enable_language_detection, :class => "toggle-check" %>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Enable Language</label>
<div class="controls">
<% @site_valid_locales.each do |valid_locale| %>
<%= 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)}" } %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label muted">Default Language</label>
<div class="controls">
<% @site_in_use_locales.each do |locale| %>
<%= radio_button_tag "site[default_locale]", locale, @locale == locale ,:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}" } %>
<% end %>
</div>
</div>
</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 %>
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
<% else %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<% if @site.default_image.file.present?%>
<%= f.file_field :default_image, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
<%else%>
<%= f.file_field :default_image, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
<%end%>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
</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 %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<% if @site.favicon.file.present?%>
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Change
<%else%>
<%= f.file_field :favicon, :id => "input-upload", :class => 'fileupload-new', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>Select Image
<%end%>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
</div>
</div>
</div>
</div>
</div>
</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%>
<script type="text/javascript">
var locales = <%= @site.in_use_locales.to_json.html_safe %>;
$(document).ready(function(){
$( ".in_use_locales" ).each( function(){
$( 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" );
}
})
})
delete locales;
</script>