Sha256: 5a1806b6c5604c95bc503e8291015b9e2ef6367607861c45a38299967ac94154

Contents?: true

Size: 1.27 KB

Versions: 9

Compression:

Stored size: 1.27 KB

Contents

(function() {
  var $page;

<% if @old_page_layout != @page.page_layout -%>
  Alchemy.ElementsWindow.reload();
  Alchemy.growl('<%= j Alchemy.t(:page_layout_changed_notice) %>');
<% end -%>

<% if @while_page_edit -%>

  Alchemy.reloadPreview();
  $('#page_<%= @page.id %>_status').replaceWith('<%= j render("page_status", page: @page) %>');

<% else -%>

  var page_html = "<%= j render('page', page: @page) %>";
  var compiler = Handlebars.compile(page_html);
  var tree = JSON.parse('<%== @tree.to_json %>');
  var html = compiler(tree.pages[0]);
  $('#page_<%= @page.id %>').replaceWith(html);
  $page = $('#page_<%= @page.id %>');

  <% if @page.locked? && @page.locker == current_alchemy_user -%>
    $('#locked_page_<%= @page.id %> > a').html('<%= @page.name %>');
  <% end -%>

  <% if @page.restricted? -%>
    $('.page_status:nth-child(3)', $page).addClass('restricted', 'not_restricted').removeClass('not_restricted');
  <% elsif @page.redirects_to_external? -%>
    $('span.redirect_url', $page).html('&raquo; <%= Alchemy.t("Redirects to") %>: <%= h @page.external_urlname %>');
  <% else -%>
    $('.page_status:nth-child(3)', $page).addClass('not_restricted').removeClass('restricted');
  <% end -%>

<% end -%>

  Alchemy.growl("<%= j @notice %>");
  Alchemy.closeCurrentDialog();
})()

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-3.4.2 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.4.1 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.3.3 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.3.2 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.4.0 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.4.0.rc1 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.3.1 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.3.0 app/views/alchemy/admin/pages/update.js.erb
alchemy_cms-3.3.0.rc2 app/views/alchemy/admin/pages/update.js.erb