Add i18n for site_info.

Add always display site title.
Changes for menu in front-end
This commit is contained in:
Christophe Vilayphiou committed 2012-05-07 15:11:43 +08:00
1 parent e52119e258
commit 8b61314cc4
6 files changed
+47 -37

No files matched your search

+11 -1
View File
@@ -112,7 +112,16 @@ module ApplicationHelper
end
def page_title(page)
"<title>#{page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]}</title>\n"
res = "<title>"
page_title = page.title ? page.title[I18n.locale] : page.i18n_variable[I18n.locale]
if page.is_home? && @site.title
res << @site.title[I18n.locale]
elsif @site.title && @site.title_always_on
res << @site.title[I18n.locale] + ' - ' + page_title
else
res << page_title
end
res << "</title>\n"
end
def page_stylesheets(page, edit=nil)
@@ -123,6 +132,7 @@ module ApplicationHelper
stylesheets << "<link href='/assets/style.css' rel='stylesheet' type='text/css' />\n"
end
stylesheets << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.reset_css
# stylesheets << "<link href='/assets/menu.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.default_css
theme = page.design.themes.detect{ |d| d.id == page.theme_id }
stylesheets << "<link href='#{theme.file.url}' rel='stylesheet' type='text/css' />\n" if theme
+1
View File
@@ -11,6 +11,7 @@ class Site
field :roaming_id
field :private_key, :type => Binary
field :public_key, :type => Binary
field :title_always_on, :type => Boolean, :default => false
field :school
field :department
+5 -4
View File
@@ -12,28 +12,29 @@
</li>
</ul>
<div class="tab-content">
<%= f.check_box :title_always_on %> <%= t 'admin.always_display_title' %>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane #{active_when_current_locale_eq locale}", :id => "#{locale}" do %>
<div>
<%= t :title %>
<%= t 'admin.site_title' %>
<%= f.fields_for :title, @site.title do |f| %>
<%= f.text_field locale %>
<% end %>
</div>
<div>
<%= t :keywords %>
<%= t 'admin.keywords' %>
<%= f.fields_for :keywords, @site.keywords do |f| %>
<%= f.text_field locale %>
<% end %>
</div>
<div>
<%= t :description %>
<%= t 'admin.site_description' %>
<%= f.fields_for :description, @site.description do |f| %>
<%= f.text_field locale %>
<% end %>
</div>
<div>
<%= t :footer %>
<%= t 'admin.site_footer' %>
<%= f.fields_for :footer, @site.footer do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea" %>
<% end %>