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>
<%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content form-horizontal">
<% @site_valid_locales.each do |locale|%> <% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane #{active_when_current_locale_eq locale}", :id => "#{locale}" do %> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale}", :id => "#{locale}" do %>
<div> <div class="control-group">
<%= t :title %> <label class="control-label"><%= t :title %></label>
<%= f.fields_for :title, @site.title do |f| %> <div class="controls">
<%= f.text_field locale %> <%= f.fields_for :title, @site.title do |f| %>
<% end %> <%= 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>
<div> <div class="control-group">
<%= t :keywords %> <label class="control-label"><%= t :keywords %></label>
<%= f.fields_for :keywords, @site.keywords do |f| %> <div class="controls">
<%= f.text_field locale %> <%= f.fields_for :keywords, @site.keywords do |f| %>
<% end %> <%= 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>
<div> <div class="control-group">
<%= t :description %> <label class="control-label"><%= t :description %></label>
<%= f.fields_for :description, @site.description do |f| %> <div class="controls">
<%= f.text_field locale %> <%= f.fields_for :description, @site.description do |f| %>
<% end %> <%= 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>
<div> <div class="control-group">
<%= t :footer %> <label class="control-label"><%= t :footer %></label>
<%= f.fields_for :footer, @site.footer do |f| %> <div class="controls">
<%= f.text_area locale, :class => "tinymce_textarea" %> <%= f.fields_for :footer, @site.footer do |f| %>
<% end %> <%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
<% end %>
</div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
</div>
</div> </div>
</div> </div>
</div> </div>
<% end %> <div class="form-actions">
<%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</div>
<% end %>
</div>