Only one parser for front end
Separate site map for i18n
This commit is contained in:
1 parent
f1c628f2d6
commit
fcbba6660b
20 files changed
+445
-168
No files matched your search
@@ -138,7 +138,7 @@
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium", %>
|
||||
<%= select_tag 'ad_banner[id]',options_from_collection_for_select(AdBanner.all, "id", "title",params[:ad_banner_id]) , :class=>"input-medium" %>
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div,:class => "tab-pane #{active_when_current_locale_eq locale}",:id=>"#{locale}" do%>
|
||||
<div class="title">
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<div class="map-block <%= 'disabled' if !sitemap_block.sitemap_enabled %>">
|
||||
<div class="map-block <%= 'disabled' if !sitemap_block.show_in_sitemap_for(temp_locale) %>">
|
||||
<h4>
|
||||
<button id="<%= sitemap_block.id %>" class="onoff pull-right"><%= sitemap_block.sitemap_enabled ? t('on_upcase') : t('off_upcase') %></button>
|
||||
<span><%= sitemap_block_counter + 1 %> <%= sitemap_block.title %></span>
|
||||
<button id="<%= sitemap_block.id %>" class="onoff pull-right" temp_locale="<%= temp_locale %>"><%= sitemap_block.show_in_sitemap_for(temp_locale) ? t('on_upcase') : t('off_upcase') %></button>
|
||||
<span><%= sitemap_block_counter + 1 %> <%= sitemap_block.title_translations[temp_locale] %></span>
|
||||
</h4>
|
||||
<ul>
|
||||
<% sitemap_block.children.each_with_index do |child, i| %>
|
||||
<li class="clear <%= 'disabled' if !child.sitemap_enabled %>">
|
||||
<%= content_tag :button, :id => child.id, :class => "onoff pull-right", :disabled => !sitemap_block.sitemap_enabled do %>
|
||||
<%= child.sitemap_enabled ? t('on_upcase') : t('off_upcase') %>
|
||||
<li class="clear <%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
|
||||
<%= content_tag :button, :id => child.id, :class => "onoff pull-right", :temp_locale => temp_locale, :disabled => !child.show_in_sitemap_for(temp_locale) do %>
|
||||
<%= child.show_in_sitemap_for(temp_locale) ? t('on_upcase') : t('off_upcase') %>
|
||||
<% end %>
|
||||
<span><%= "#{sitemap_block_counter + 1}-#{i + 1}" %> <%= child.title %></span>
|
||||
<span><%= "#{sitemap_block_counter + 1}-#{i + 1}" %> <%= child.title_translations[temp_locale] %></span>
|
||||
</li>
|
||||
<% end if sitemap_block.children %>
|
||||
</ul>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
|
||||
<div class="site-map">
|
||||
<%= render :partial => 'sitemap_block', :collection => @items %>
|
||||
<ul class="nav nav-tabs">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? " class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<% @site_valid_locales.each_with_index do |temp_locale, i| %>
|
||||
<div class="tab-pane site-map <%= temp_locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% 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'));
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user