orbit4-5/app/views/admin/sites/site_info.html.erb

131 lines
5.9 KiB
Plaintext

<% # encoding: utf-8 %>
<head>
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/main-forms"%>
<%= stylesheet_link_tag "lib/togglebox"%>
<%#= javascript_include_tag 'lib/ckeditor/ckeditor' %>
<%#= javascript_include_tag 'lib/ckeditor/replace/site_info' %>
<%= javascript_include_tag 'lib/site_set' %>
</head>
<%= form_for @site, :url => admin_site_path(@site.id), :html => {:class => "form-horizontal main-forms"} do |f| %>
<fieldset>
<!-- Input Area -->
<div class="input-area">
<!-- Language Tabs -->
<div class="nav-name"><strong>Language</strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each do |locale|%>
<%= content_tag :li, link_to(t(locale.to_s), ".#{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% I18n.available_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group input-title">
<label class="control-label muted"><%= t 'site.title' %></label>
<div class="controls">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-xxlarge", :value => (@site.title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<% end %>
<% end %>
<!-- Always show in the title bar -->
<div class="control-group">
<label class="control-label muted"><%= t :always_display_title %>
</label>
<div class="controls">
<input type="checkbox" class="toggle-check" name="site[title_always_on]" data-disabled="true" <%= @site.title_always_on ? "checked='checked" : "" %> data-title="<%= t('site_title_always_display') %>" />
</div>
</div>
<hr>
<!-- CKeditor Site Header -->
<% I18n.available_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted"><%= t('site.header')%></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :sub_menu_translations do |f| %>
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.sub_menu_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<%end%>
<%end%>
<!-- Sitemap menu in Header -->
<div class="control-group">
<label class="control-label muted"><%= t :sitemap_menu_in_header %>
</label>
<div class="controls">
<input type="checkbox" class="toggle-check" name="site[sitemap_menu_in_header]" data-disabled="true" <%= @site.sitemap_menu_in_header ? "checked='checked" : "" %> />
</div>
</div>
<hr>
<!-- CKeditor Site Footer -->
<% I18n.available_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted"><%= t('site.footer')%></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :footer_translations do |f| %>
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.footer_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<%end%>
<%end%>
<hr>
<!-- Terms of Use -->
<div class="control-group">
<label class="control-label muted"><%= t('site.terms_of_use')%></label>
<div class="controls">
<input type="checkbox" class="toggle-check for_tou" name="site[enable_terms_of_use]" data-disabled="true" <%= @site.enable_terms_of_use ? "checked='checked'" : "" %> data-title="Display in footer" />
</div>
</div>
<!-- CKeditor Site Footer -->
<div class="control-group <%= @site.enable_terms_of_use ? "" : "hide" %>" id="link_select">
<label class="control-label muted">Select Page</label>
<div class="controls">
<%= f.select(:terms_of_use_link, @pages.map{|p| [p.name,p.url]},{:include_blank => true}) %>
</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>
</div>
</fieldset>
<% end %>
<script type="text/javascript">
$(document).ready(function(){
$(".for_tou").click(function(){
if($(this).is(":checked")){
$("#link_select").removeClass("hide");
}else{
$("#link_select").addClass("hide");
}
})
})
</script>