Ray's changes for site_info

This commit is contained in:
Christophe Vilayphiou 2012-05-07 15:55:45 +08:00
parent 0246341aef
commit f534e6ca7b
3 changed files with 58 additions and 31 deletions

View File

@ -636,6 +636,22 @@
.adbanner-action { .adbanner-action {
margin-bottom: 20px; margin-bottom: 20px;
} }
.textarea-height-s {
resize: none;
max-height: 150px;
}
.textarea-height-m {
resize: none;
max-height: 250px;
}
.textarea-height-l {
resize: none;
max-height: 350px;
}
.textarea-height-xl {
resize: none;
max-height: 500px;
}
[class^="icons-"] { [class^="icons-"] {
display: inline-block; display: inline-block;
width: 16px; width: 16px;

View File

@ -150,7 +150,7 @@ module ApplicationHelper
end end
def active_when_current_locale_eq(locale) def active_when_current_locale_eq(locale)
locale.to_sym == I18n.locale ? 'active': '' locale.to_sym == I18n.locale ? 'active in': ''
end end
end end

View File

@ -1,4 +1,5 @@
<%= form_for @site, :url => admin_site_path(@site) do |f| %> <div id="poststuff">
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %>
<div id="post-body"> <div id="post-body">
<div id="post-body-content" class="clear"> <div id="post-body-content" class="clear">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
@ -6,43 +7,53 @@
<%#= raise @site_valid_locales.inspect %> <%#= raise @site_valid_locales.inspect %>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), "##{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %> <%= content_tag :li, link_to(I18nVariable.from_locale(locale), "##{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %>
<% end %> <% end %>
<li> </ul>
<div class="tab-content form-horizontal">
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale}", :id => "#{locale}" do %>
<div class="control-group">
<label class="control-label"><%= t :title %></label>
<div class="controls">
<%= f.fields_for :title, @site.title do |f| %>
<%= f.text_field locale, :class => "input-xxlarge" %>
<% end %>
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t :keywords %></label>
<div class="controls">
<%= f.fields_for :keywords, @site.keywords do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
<% end %>
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t :description %></label>
<div class="controls">
<%= f.fields_for :description, @site.description do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
<% end %>
<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t :footer %></label>
<div class="controls">
<%= f.fields_for :footer, @site.footer do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
<% end %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
<div class="form-actions">
<%= f.submit t("submit"), :class => "btn btn-primary" %> <%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %> <%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</li>
</ul>
<div class="tab-content">
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane #{active_when_current_locale_eq locale}", :id => "#{locale}" do %>
<div>
<%= t :title %>
<%= f.fields_for :title, @site.title do |f| %>
<%= f.text_field locale %>
<% end %>
</div>
<div>
<%= t :keywords %>
<%= f.fields_for :keywords, @site.keywords do |f| %>
<%= f.text_field locale %>
<% end %>
</div>
<div>
<%= t :description %>
<%= f.fields_for :description, @site.description do |f| %>
<%= f.text_field locale %>
<% end %>
</div>
<div>
<%= t :footer %>
<%= f.fields_for :footer, @site.footer do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea" %>
<% end %>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
</div> </div>
<% end %> <% end %>
</div>