Sitemap with main

This commit is contained in:
Christophe Vilayphiou committed 2012-07-27 19:13:39 +08:00
1 parent 38804bd118
commit 934b515914
5 files changed
+54 -21

No files matched your search

@@ -1,12 +1,13 @@
<div class="map-block">
<h4><%= sitemap_block.i18n_variable[I18n.locale] %><button class="onoff pull-right"><%= sitemap_block.sitemap_enabled ? t('on_upcase') : t('off_upcase') %></button></h4>
<div class="map-block <%= 'disabled' if !sitemap_block.sitemap_enabled %>">
<h4>
<button id="<%= sitemap_block.id %>" class="onoff pull-right"><%= sitemap_block.sitemap_enabled ? t('on_upcase') : t('off_upcase') %></button>
<span><%= sitemap_block.i18n_variable[I18n.locale] %></span>
</h4>
<ul>
<% sitemap_block.children.each do |child| %>
<li class="clear <%= 'disabled' if !child.sitemap_enabled %>">
<%= child.i18n_variable[I18n.locale] %>
<button id="<%= child.id %>" class="onoff pull-right">
<%= child.sitemap_enabled ? t('on_upcase') : t('off_upcase') %>
</button>
<button id="<%= child.id %>" class="onoff pull-right" disabled="<%= 'disabled' if !sitemap_block.sitemap_enabled %>" ><%= child.sitemap_enabled ? t('on_upcase') : t('off_upcase') %></button>
<span><%= child.i18n_variable[I18n.locale] %></span>
</li>
<% end if sitemap_block.children %>
</ul>
+3
View File
@@ -32,11 +32,14 @@
$(this).text("<%= t('off_upcase') %>")
$(this).parents(".map-block").find('li').addClass('disabled')
$(this).parents(".map-block").find('button').text("<%= t('off_upcase') %>")
$(this).parents(".map-block").find('li button').attr('disabled', 'disabled')
} else {
$(this).text("<%= t('on_upcase') %>")
$(this).parents(".map-block").find('li').removeClass('disabled')
$(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');
});
</script>
<% end %>