Orbit/app/views/admin/sites/sitemap.html.erb

45 lines
1.9 KiB
Plaintext
Raw Normal View History

2012-07-25 07:10:15 +00:00
<% 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
});
});
2012-07-26 07:37:29 +00:00
$(document).on('click', 'li .onoff', function () {
$(this).parents("li").toggleClass("disabled");
if($(this).parents("li").attr("class").indexOf("disabled") > 0){
$(this).text("<%= t('off_upcase') %>")
} else {
$(this).text("<%= t('on_upcase') %>")
}
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle');
});
$(document).on('click', 'h4 .onoff', function () {
$(this).parents(".map-block").toggleClass("disabled");
if($(this).parents("h4").parents("div").attr("class").indexOf("disabled") > 0){
$(this).text("<%= t('off_upcase') %>")
$(this).parents(".map-block").find('li').addClass('disabled')
$(this).parents(".map-block").find('button').text("<%= t('off_upcase') %>")
2012-07-27 04:05:17 +00:00
$(this).parents(".map-block").find('li button').attr('disabled', 'disabled')
2012-07-26 07:37:29 +00:00
} else {
$(this).text("<%= t('on_upcase') %>")
$(this).parents(".map-block").find('li').removeClass('disabled')
$(this).parents(".map-block").find('button').text("<%= t('on_upcase') %>")
2012-07-27 04:05:17 +00:00
$(this).parents(".map-block").find('li button').removeAttr("disabled")
2012-07-26 07:37:29 +00:00
}
2012-07-27 04:05:17 +00:00
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?parent=true');
2012-07-25 07:10:15 +00:00
});
</script>
<% end %>