diff --git a/app/views/admin/sites/sitemap.html.erb b/app/views/admin/sites/sitemap.html.erb
index 7c606497..cdcbc59b 100644
--- a/app/views/admin/sites/sitemap.html.erb
+++ b/app/views/admin/sites/sitemap.html.erb
@@ -2,9 +2,18 @@
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
-
-
- <%= render :partial => 'sitemap_block', :collection => @items %>
+
+
+
+ <% @site_valid_locales.each_with_index do |temp_locale, i| %>
+
">
+ <%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
+
+ <% end %>
<% content_for :page_specific_javascript do %>
@@ -13,9 +22,14 @@
$(document).ready(function(){
$('.site-map').masonry({
itemSelector: '.map-block',
- columnWidth: 260,
- isAnimated: true
+ columnWidth: 260
});
+ $('a[data-toggle="tab"]').on('shown', function (e) {
+ $('.site-map').masonry({
+ itemSelector: '.map-block',
+ columnWidth: 260
+ });
+ })
});
$(document).on('click', 'li .onoff', function () {
$(this).parents("li").toggleClass("disabled");
@@ -24,7 +38,7 @@
} else {
$(this).text("<%= t('on_upcase') %>")
}
- $.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle');
+ $.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?temp_locale=' + $(this).attr('temp_locale'));
});
$(document).on('click', 'h4 .onoff', function () {
$(this).parents(".map-block").toggleClass("disabled");
@@ -39,7 +53,7 @@
$(this).parents(".map-block").find('button').text("<%= t('on_upcase') %>")
$(this).parents(".map-block").find('li button').removeAttr("disabled")
}
- $.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?parent=true');
+ $.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?parent=true&temp_locale=' + $(this).attr('temp_locale'));
});
<% end %>
\ No newline at end of file
diff --git a/app/views/front/show_banner.html.erb b/app/views/front/show_banner.html.erb
new file mode 100644
index 00000000..2d790279
--- /dev/null
+++ b/app/views/front/show_banner.html.erb
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ <% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %>
+ <% if ad_image.display? %>
+
' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= (ad_image.direct_to_after_click? ? ad_image.out_link : ad_image.context) || ' ' %>' link_url='<%= (ad_image.out_link) %>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/>
+ <% end %>
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/front/show_page_sub_menu.html.erb b/app/views/front/show_page_sub_menu.html.erb
new file mode 100644
index 00000000..0154bfc0
--- /dev/null
+++ b/app/views/front/show_page_sub_menu.html.erb
@@ -0,0 +1,12 @@
+<% if @menu_page && @menu_page.visible_children.size > 0 %>
+
+
<%= @menu_page.title} %>
+
"
+ <% menu_page.visible_children.each do |child| %>
+ -
+ <%= child.title %>
+
+ <% end %>
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/front/show_sitemap.html.erb b/app/views/front/show_sitemap.html.erb
new file mode 100644
index 00000000..74da0ac0
--- /dev/null
+++ b/app/views/front/show_sitemap.html.erb
@@ -0,0 +1,27 @@
+
+ <% @items.each_with_index do |item, i| %>
+ <% if item.show_in_sitemap_for(I18n.locale.to_s) %>
+
+
+
+ <% item.children.each_with_index do |child, ii| %>
+ <% if child.show_in_sitemap_for(I18n.locale.to_s) %>
+ - <%= "#{i+1}-#{ii+1}" %> <%= child.title %>
+ <% end %>
+ <% end if item.children %>
+
+
+ <% end %>
+ <% end %>
+
+
+<%= javascript_include_tag "lib/jquery.masonry.min.js" %>
+
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index cae07963..2c52f6ec 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -162,7 +162,8 @@ Orbit::Application.routes.draw do
post 'upload'
end
end
- match "desktop" => "desktop#index"
+
+ match "desktop" => "desktop#index"
namespace :desktop do
match "desktop" => "desktop#desktop"
match '/journal_pages/get_journals_json' => 'journal_pages#get_journals_json'
@@ -231,6 +232,14 @@ Orbit::Application.routes.draw do
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'
+ scope '/front' do
+ match 'show_banner/:id' => 'front#show_banner', :as => :front_show_banner
+ match 'show_footer' => 'front#show_footer', :as => :front_show_footer
+ match 'show_menu/:id' => 'front#show_menu', :as => :front_show_menu
+ match 'show_page_sub_menu' => 'front#show_page_sub_menu', :as => :front_show_page_sub_menu
+ match 'show_site_sub_menu' => 'front#show_site_sub_menu', :as => :front_show_site_sub_menu
+ match 'show_sitemap' => 'front#show_sitemap', :as => :front_show_sitemap
+ end
match '/panel/:app_name/front_end/:app_action/:id(/:controller_action)' => 'pages#show_from_link', :constraints => lambda { |request|
diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb
index 2a590417..c3c43fe8 100644
--- a/lib/parsers/parser_back_end.rb
+++ b/lib/parsers/parser_back_end.rb
@@ -25,13 +25,13 @@ module ParserBackEnd
def parse_page_edit_noko(page)
body = Nokogiri::HTML(page.design.layout.body)
- parse_menu(body, page, true)
- public_r_tags = parse_contents(body, page, true)
- parse_images(body, page)
- parse_footer(body, page)
- parse_sub_menu(body, page)
+ parse_menu_edit(body, page, true)
+ public_r_tags = parse_contents_edit(body, page, true)
+ parse_images_edit(body, page)
+ parse_footer_edit(body, page)
+ parse_sub_menu_edit(body, page)
public_r_tags.each do |tag|
- send("parse_#{tag}s", body, page, true)
+ send("parse_#{tag}s_edit", body, page, true)
end
body.to_html
end
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb
index 047f72e6..6dbec1e2 100644
--- a/lib/parsers/parser_common.rb
+++ b/lib/parsers/parser_common.rb
@@ -38,7 +38,7 @@ module ParserCommon
end
# ad_banners
- def parse_ad_banners(body = nil, page = nil, edit=nil)
+ def parse_ad_banners_edit(body = nil, page = nil, edit=nil)
body.css('ad_banner').each do |banner|
res = ''
ad_banner = AdBanner.find(banner["id"]) rescue nil
@@ -94,7 +94,7 @@ module ParserCommon
end
# page_images
- def parse_images(body, page, edit=nil)
+ def parse_images_edit(body, page, edit=nil)
body.css('.page_image').each do |page_image|
# image = page.custom_images.detect{|image| image.name.eql?(tag.attr['name']) }
# image = page.design.custom_images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
@@ -112,20 +112,16 @@ module ParserCommon
end
# page_menu
- def parse_menu(body, page, edit=nil)
+ def parse_menu_edit(body, page, edit=nil)
page_menu = body.css('.page_menu').first
- if page_menu
- home = get_homepage
- menu = page.design.layout.menu
- fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, page, 1, menu, edit))
- page_menu.swap(fragment)
- else
- ''
- end
+ home = get_homepage
+ menu = page.design.layout.menu
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, menu_level(home, page, 1, menu, edit))
+ page_menu.swap(fragment)
end
# sub_menus
- def parse_sub_menus(body = nil, page = nil, edit=nil)
+ def parse_sub_menus_edit(body = nil, page = nil, edit=nil)
body.css('sub_menu').each do |sub_menu|
menu_page = Page.find(sub_menu['id']) rescue nil
res = ''
@@ -149,7 +145,7 @@ module ParserCommon
end
# page_footer
- def parse_footer(body, page)
+ def parse_footer_edit(body, page)
page_footer = body.css('.page_footer').first
if page_footer
res = ""
+ when 'public_r_tag'
+ ret << send("generate_#{part.public_r_tag}s", part.public_r_tag_object_id, page)
+ else
+ ''
+ end if part
+ end
+ scope = "<#{content.name}"
+ content.attributes.each_pair do |key, value|
+ scope << " #{key}='#{value}'"
+ end
+ scope << ">#{ret}#{content.name}>"
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, scope)
+ content.swap(fragment)
+ end
+ end
+
+ # ad_banners
+ def generate_ad_banners(*args)
+ "
"
+ end
+
+ # sitemap
+ def generate_sitemaps(*args)
+ "
"
+ end
+
+ # sub_menus
+ def generate_sub_menus(*args)
+ "
"
+ end
end
diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake
index c41e6d9b..da07e20a 100644
--- a/lib/tasks/migrate.rake
+++ b/lib/tasks/migrate.rake
@@ -304,5 +304,12 @@ namespace :migrate do
i += 1
end if news_bulletins
end
+
+ task :sitemap_i18n => :environment do
+ Item.all.each do |item|
+ item.sitemap_enabled = item.sitemap_enabled ? {'en' => 'true', 'zh_tw' => 'true'} : nil
+ item.save
+ end
+ end
end
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
index ddee9f96..02182008 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
@@ -43,7 +43,7 @@
-
+