Permalink
Browse files

Restore editor without mercury toolbar.

  • Loading branch information...
1 parent 625c6b0 commit 5cfc6c6214b97dc21c5c689541a0b0f4d6e0954c @peakpg peakpg committed Feb 14, 2013
Showing with 20 additions and 19 deletions.
  1. +1 −1 .rvmrc
  2. +14 −1 app/controllers/cms/content_controller.rb
  3. +4 −13 app/views/layouts/cms/page_editor.html.erb
  4. +0 −1 browsercms.gemspec
  5. +1 −0 config/routes.rb
  6. +0 −3 todo_ui_Revamp.md
View
2 .rvmrc
@@ -1,2 +1,2 @@
-rvm use 1.9.3@r3.2
+rvm use 1.9.3@bcms4
@@ -18,7 +18,7 @@ class ContentController < Cms::ApplicationController
# ----- Actions --------------------------------------------------------------
def show
- if @show_toolbar && !params[:mercury_frame]
+ if @show_toolbar
render_editing_frame
else
render_page
@@ -32,6 +32,19 @@ def show_page_route
cache_if_eligible
end
+ # Used in the iframe to display a page that's being editted.
+ def edit
+ @show_toolbar = true
+ if page = Page.where(:id => params[:id]).first
+ @page = page.as_of_draft_version
+ render_page
+ else
+ render(:layout => 'cms/application',
+ :template => 'cms/content/no_page',
+ :status => :not_found)
+ end
+
+ end
# Used by the rendering behavior
def instance_variables_for_rendering
@@ -16,21 +16,12 @@
<% end %>
})
</script>
+ <style>
+ html, body { height: 100% }
+ </style>
</head>
<body>
<%= render 'layouts/cms/thin_toolbar' %>
-<iframe src="<%= url_for(current_page.path, {:mercury_frame=>true } %>" frameborder="0"></iframe>
-<script type="text/javascript">
- // Set to the url that you want to save any given page to, leave null for default handling.
- var saveUrl = '<%= cms.page_component_path(current_page) %>';
-
- // Instantiate the PageEditor
- new Mercury.PageEditor(saveUrl, {
- saveStyle:'form', // 'form', or 'json' (default json)
- saveMethod:null, // 'PUT', or 'POST', (create, vs. update -- default PUT)
- visible:true // boolean - if the interface should start visible or not
- });
-
-</script>
+<iframe src="<%= edit_content_path(current_page) %>" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" scrolling="auto"></iframe>
</body>
</html>
View
@@ -33,7 +33,6 @@ Gem::Specification.new do |s|
s.add_dependency("rails", "< 3.3.0", ">= 3.2.5")
s.add_dependency("sass-rails")
s.add_dependency("bootstrap-sass")
- #s.add_dependency("mercury-rails")
s.add_dependency("ancestry", "~> 1.2.4")
s.add_dependency("ckeditor_rails", "~> 3.6.4")
s.add_dependency("jquery-rails", "~> 2.0")
View
@@ -2,6 +2,7 @@
# There are other routes that will be added at the root of the site (i.e. /) which can
# be found in lib/cms/route_extensions.rb
Cms::Engine.routes.draw do
+ get '/content/:id/edit', :to=>"content#edit", :as=>'edit_content'
match '/dashboard', :to=>"dashboard#index", :as=>'dashboard'
match '/', :to => 'home#index', :as=>'home'
match '/sitemap', :to=>"section_nodes#index", :as=>'sitemap'
View
@@ -5,9 +5,6 @@ Current Task:
* Do UX for the content library, admin and sitemap
* Implement implied features (Search/Notifications)
-## Integrate Mercury
-
-* Currently loading from test/dummy app. Need to ensure jquery+other libraries are loaded by the CMS engine.
* Add BrowserCMS to the list of projects using Mercury

0 comments on commit 5cfc6c6

Please sign in to comment.