diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 8829dfef..4f9128bb 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -112,7 +112,16 @@ module ApplicationHelper
end
def page_title(page)
- "
+ <%= 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 %>
- <%= t :title %>
+ <%= t 'admin.site_title' %>
<%= f.fields_for :title, @site.title do |f| %>
<%= f.text_field locale %>
<% end %>
- <%= t :keywords %>
+ <%= t 'admin.keywords' %>
<%= f.fields_for :keywords, @site.keywords do |f| %>
<%= f.text_field locale %>
<% end %>
- <%= t :description %>
+ <%= t 'admin.site_description' %>
<%= f.fields_for :description, @site.description do |f| %>
<%= f.text_field locale %>
<% end %>
- <%= t :footer %>
+ <%= t 'admin.site_footer' %>
<%= f.fields_for :footer, @site.footer do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea" %>
<% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index eeb5e63a..862ccf13 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -98,6 +98,7 @@ en:
admin: Admin
action: Action
all_articles: List
+ always_display_title: Always displayed in the title bar
announcement: Announcement
asset: Asset
assets:
@@ -147,6 +148,7 @@ en:
is_published: Is published
item: Item
key: Key
+ keywords: Keywords
language: Language
layout: Layout
layout_name: Layout name
@@ -199,7 +201,10 @@ en:
setup_translations: Translations setup
setup_designs: Designs setup
site: Site
+ site_description: Site description
+ site_footer: Site footer
site_settings: Site Setting
+ site_title: Site title
super_pages: Super pages
structure: Structure
title: Title
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index 661253c4..27f4a2f6 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -91,6 +91,7 @@ zh_tw:
add_drop_down_item: +增加Orbit選單
admin: 網站管理者
all_articles: 列表
+ always_display_title: 永遠顯示於標題列
announcement: 公告管理
asset: 資產
assets:
@@ -144,6 +145,7 @@ zh_tw:
is_published: 被出版
item: 網站架構
key: 關鍵
+ keywords: 關鍵字
language: 語言
layout: 佈局
layout_name: 佈局名字
@@ -189,7 +191,10 @@ zh_tw:
purchase: 購買
role: 身份
roles: 身份
+ site_description: 網站描述
+ site_footer: 網站頁尾
site_settings: 基本設定
+ site_title: 網站標題
setup_member: 成員設置
setup_translations: 語系設定
setup_designs: 版型設定
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb
index 04fe2e6c..6ee09656 100644
--- a/lib/parsers/parser_common.rb
+++ b/lib/parsers/parser_common.rb
@@ -3,46 +3,34 @@ module ParserCommon
def menu_level(page, current, menu, edit = false)
res = ''
- if menu.levels > 0 && current <= menu.levels
- if current != 0
- res << "
"
- else
- res << '
'
- res << "- " + "#{page.i18n_variable[I18n.locale]}" + "
"
- page.ordered_and_visible_children.each do |child|
- res << "- " + menu_level(child, current + 1, menu, edit) + "
"
- end
- res << '
'
+ if page.children.size > 0
+ res << ""
end
res
end
def menu_li(page, current, menu, i, edit)
res = ""
end
@@ -104,7 +92,7 @@ module ParserCommon
page_menu = body.css('.page_menu').first
home = get_homepage
menu = page.design.layout.menu
- fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, 0, menu, edit))
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, 1, menu, edit))
page_menu.swap(fragment)
end
@@ -135,7 +123,7 @@ module ParserCommon
res << @site.footer[I18n.locale]
res << "
"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
- page_footer.swap(fragment)
+ page_footer.swap(fragment) rescue nil
end
end