Change the parser_front_end to be used in the structure for page edit, new_ui:save_pages must be run

This commit is contained in:
chris committed 2013-10-20 18:44:04 +08:00
1 parent 1ea8d9faf9
commit 2530dace02
7 files changed
+79 -28

No files matched your search

+2 -1
View File
@@ -5,7 +5,8 @@ class Admin::PagesController < Admin::ItemsController
def show
@item = Page.find(params[:id])
@no_orbit_bar = true
render layout: 'page_layout'
@edit = true
render :text => parse_page_content(@item), :layout => 'page_layout'
end
def new
+6
View File
@@ -26,7 +26,13 @@ class PagesController < ApplicationController
when 'Page'
if params[:clicked_field_name]
render_page({"clicked_field_name"=>params["clicked_field_name"]}) unless save_from_no_lang_for_page
elsif 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(params.except(:controller, :action, :page_name)) unless save_from_no_lang_for_page
end
when 'Link'
+1 -1
View File
@@ -17,7 +17,7 @@
<%= link_to node.title, node.url %>
<% end %>
<div class="item-menu">
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), eval("admin_#{node.class.to_s.downcase}_path(node)"), class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), "/#{node.path}?edit=true", class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
<%= link_to content_tag(:i, nil, class: "icon-edit"), eval("edit_admin_#{node.class.to_s.downcase}_path(node)"), class: "open-slide tip #{node.class.to_s.downcase} edit", title: t(:edit), data: {title: t(:edit)} %>
<%= link_to content_tag(:i, nil, class: "icons-newspaper"), new_admin_page_path(:parent_id => node.id), class: "open-slide tip page", title: t(:add_page), data: {title: t(:add_page)} if node.class.to_s.eql?('Page') %>
<%= link_to content_tag(:i, nil, class: "icon-link"), new_admin_link_path(:parent_id => node.id), class: "open-slide tip link", title: t(:add_link), data: {title: t(:add_link)} if node.class.to_s.eql?('Page') %>
+15
View File
@@ -26,5 +26,20 @@
$('#myModal').modal('show')
</script>
<% end -%>
<% if @edit %>
<script>
$(window).load(function(pageslide, item) {
$('a').not('.nav').on('click', function(e){
e.preventDefault();
});
$('a').not('.nav').css("cursor", "default");
});
</script>
<style>
.body {
margin: 0;
}
</style>
<% end %>
</body>
</html>