Orbit/app/views/admin/sites/preference.html.erb

217 lines
10 KiB
Plaintext
Raw Permalink 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>
<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-09-05 10:05:32 +00:00
<%= f.check_box :tls, :checked => (@site['site_settings']['tls'].eql?('1') rescue false),:class=>"toggle-check" %>
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-09-05 10:05:32 +00:00
<%= f.check_box 'enable_starttls_auto', :checked => (@site['site_settings']['enable_starttls_auto'].eql?('1') rescue false), :class=>"toggle-check" %>
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-09-05 10:05:32 +00:00
<label class="control-label muted"><%= I18n.t('site.frontend_closed')%></label>
2013-09-05 04:49:59 +00:00
<div class="controls">
2013-09-05 10:05:32 +00:00
<%= f.check_box :frontend_closed , :class=>"toggle-check"%>
2013-09-05 04:49:59 +00:00
<span class="help-block">Only can be viewed by users logged in</span>
</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">
2013-09-05 10:05:32 +00:00
<%= f.check_box :backend_openness_on , :class=>"toggle-check" %>
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">Disable personal desktop</label>
<div class="controls">
2013-09-09 02:17:24 +00:00
<%= f.check_box :desktop_closed , :class=>"toggle-check" %>
2013-09-05 04:49:59 +00:00
</div>
</div>
</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> -->
2013-09-05 04:49:59 +00:00
<div class="control-group">
<label class="control-label muted">Default Language</label>
<div class="controls">
2013-09-06 08:41:02 +00:00
<% @site_in_use_locales.each do |locale| %>
2013-09-09 02:54:18 +00:00
<%= check_box_tag :default_locale, locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
<%= I18nVariable.from_locale(locale) %>
<% end %>
2013-09-05 04:49:59 +00:00
</div>
</div>
<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| %>
<%= check_box_tag 'site[enabled_for][]', valid_locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
<%= I18nVariable.from_locale(valid_locale) %>
<% end %>
<%= hidden_field_tag 'site[enabled_for][]', '' %>
2013-09-05 04:49:59 +00:00
</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">
2013-09-05 10:05:32 +00:00
<% 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 %>
2013-09-05 04:49:59 +00:00
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
2013-09-09 03:27:18 +00:00
<% if @site.default_image.file.present?%>
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
2013-09-09 03:27:18 +00:00
<%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
2013-09-05 10:05:32 +00:00
<%end%>
2013-09-05 04:49:59 +00:00
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
2013-09-05 10:05:32 +00:00
<% if @site.default_image.file %>
<label class="checkbox">
<%= check_box_tag 'site[remove_default_image]' %>
<%= t(:delete_) %>
</label>
<% end %>
2013-09-05 04:49:59 +00:00
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</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>
2013-09-05 10:05:32 +00:00
<%end%>