app/views/alchemy/admin/pages/_sitemap.html.erb in alchemy_cms-3.2.1 vs app/views/alchemy/admin/pages/_sitemap.html.erb in alchemy_cms-3.3.0.rc1
- old
+ new
@@ -1,8 +1,37 @@
-<ul id="sitemap" class="list<%= @sorting ? ' sorting' : nil %>">
- <%= render :partial => 'page', :object => @page_root %>
-</ul>
+<div id="sitemap-wrapper">
+ <p class="loading"></p>
+</div>
+
+<script id="sitemap-template" type="text/x-handlebars-template">
+ <ul id="sitemap" class="list<%= @sorting ? ' sorting' : nil %>">
+ {{> list}}
+ </ul>
+</script>
+
+<script id="sitemap-list" type="text/x-handlebars-template">
+ {{#each children}}
+ <%= render partial: page_partial, object: @page_root %>
+ {{/each}}
+</script>
+
<script type="text/javascript">
- $(function() {
- Alchemy.Sitemap.init();
- });
+ $(function() {
+ Alchemy.Sitemap.init({
+ url: '<%= alchemy.tree_admin_pages_path %>',
+ page_root_id: <%= @page_root.id %>,
+ full: <%= full %>
+ <% if @sorting %>
+ ,ready: function () {
+ Alchemy.PageSorter.init();
+ }
+ <% elsif action_name == 'link' %>
+ ,spinner: Alchemy.Spinner.small(),
+ ready: function () {
+ if (Alchemy.currentDialog()) {
+ Alchemy.currentDialog().attachTreeEvents();
+ }
+ }
+ <% end %>
+ });
+ });
</script>