fix bugs for i18n_variable in page and home
This commit is contained in:
parent
bda67684bd
commit
c44b86f284
|
@ -60,7 +60,7 @@ class Item
|
||||||
|
|
||||||
# Check if the page is home
|
# Check if the page is home
|
||||||
def is_home?
|
def is_home?
|
||||||
self.name.eql?('home') && self.parent_id.nil?
|
self.name.eql?('home') && (self.parent_id.nil? || self.parent_id.empty?)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Build the url from the array of ancestors
|
# Build the url from the array of ancestors
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag "#{f}[title]", "#{t('admin.title')} #{locale}" %>
|
<%= label_tag "home[title]", "#{t('admin.title')} #{locale}" %>
|
||||||
<%= text_field_tag "#{f}[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %>
|
<%= text_field_tag "home[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= f.label :name, t('admin.name') %>
|
<%= f.label :name, t('admin.name') %>
|
||||||
<% if @page.parent_id.nil? %>
|
<% if @page.parent_id.nil? || @page.parent_id.empty? %>
|
||||||
<%= f.text_field :name, :class => 'text', :value => 'home', :disabled => true %>
|
<%= f.text_field :name, :class => 'text', :value => 'home', :disabled => true %>
|
||||||
<%= f.hidden_field :name, :value => 'home' %>
|
<%= f.hidden_field :name, :value => 'home' %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -13,8 +13,8 @@
|
||||||
|
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag "#{f}[title]", "#{t('admin.title')} #{locale}" %>
|
<%= label_tag "page[title]", "#{t('admin.title')} #{locale}" %>
|
||||||
<%= text_field_tag "#{f}[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %>
|
<%= text_field_tag "page[i18n_variable][#{locale}]", (@i18n_variable[locale] if @i18n_variable), :class => 'text' %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue