diff --git a/app/assets/javascripts/lib/pageslide.js b/app/assets/javascripts/lib/pageslide.js index bb96f3601..d8f09e525 100644 --- a/app/assets/javascripts/lib/pageslide.js +++ b/app/assets/javascripts/lib/pageslide.js @@ -327,15 +327,7 @@ function setForm(data) { $.each(data, function(key, value) { - switch($("#pageslide form #" + key).prop("tagName")) - { - case "INPUT": - $("#pageslide form #" + key).val(value); - break; - case "SELECT": - $("#pageslide form #" + key).val(value); - break; - } + $("#pageslide form #" + key).val(value); }); } diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 48261bf74..430bc4084 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -9,7 +9,15 @@ class PagesController < ApplicationController if @item delayed_impressionist(@item) - render_page + if params[:edit] + if request.referer && request.referer.ends_with?("admin/items") + redirect_to admin_page_url(@item) + else + render :file => "#{Rails.root}/public/403.html", :status => 403 + end + else + render_page + end else redirect_to '/admin/dashboards',:notice=>t(:need_home) # render :text => t(:need_home) diff --git a/app/views/layouts/page_layout.html.erb b/app/views/layouts/page_layout.html.erb index 0d45f3430..2e1cae09e 100644 --- a/app/views/layouts/page_layout.html.erb +++ b/app/views/layouts/page_layout.html.erb @@ -29,13 +29,11 @@ <% end -%> <% if @edit %>