Partial sitemap
This commit is contained in:
1 parent
12f9f666eb
commit
db9c4c0e10
7 files changed
+390
-40
No files matched your search
@@ -0,0 +1,13 @@
|
||||
<div class="map-block">
|
||||
<h4><%= sitemap_block.i18n_variable[I18n.locale] %></h4>
|
||||
<ul>
|
||||
<% sitemap_block.children.each do |child| %>
|
||||
<li class="clear">
|
||||
<%= child.i18n_variable[I18n.locale] %>
|
||||
<button id="<%= child.id %>" class="onoff pull-right">
|
||||
<%= child.sitemap_enabled ? t('on_cap') : t('off_cap') %>
|
||||
</button>
|
||||
</li>
|
||||
<% end if sitemap_block.children %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render 'side_bar' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="site-map">
|
||||
<%= render :partial => 'sitemap_block', :collection => @items %>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "lib/jquery.masonry.min.js" %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.site-map').masonry({
|
||||
itemSelector: '.map-block',
|
||||
columnWidth: 260,
|
||||
isAnimated: true
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.onoff', function () {
|
||||
$(this).parents("li").toggleClass("disabled");
|
||||
if($(this).parents("li").attr("class").indexOf("disabled") > 0){
|
||||
$(this).text('OFF')
|
||||
} else {
|
||||
$(this).text('ON')
|
||||
}
|
||||
$.getScript('admin_sites_path' + '/' + $(this).attr('id') + '/sitemap_toggle');
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
Reference in new issue
Block a user