diff --git a/app/assets/javascripts/lib/pageslide.js b/app/assets/javascripts/lib/pageslide.js
index bb96f360..d8f09e52 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 48261bf7..430bc408 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 0d45f343..2e1cae09 100644
--- a/app/views/layouts/page_layout.html.erb
+++ b/app/views/layouts/page_layout.html.erb
@@ -29,13 +29,11 @@
<% end -%>
<% if @edit %>