From 1d214bedec1c1666e9f423f403ebdac3c94511fb Mon Sep 17 00:00:00 2001 From: chris2tof Date: Wed, 24 Aug 2011 02:06:27 +0800 Subject: [PATCH] Revert "Revert "Clean code and add 'name' in theme.rb"" This reverts commit 00813c906053bd375af06b825e80d47aafeeb55b. --- Gemfile | 2 +- Gemfile.lock | 4 +- app/controllers/admin/pages_controller.rb | 20 +---- app/helpers/admin/item_helper.rb | 1 - app/models/design/theme.rb | 12 +++ app/models/page.rb | 15 +--- app/views/admin/pages/_edit_code.html.erb | 8 -- app/views/admin/pages/_form.html.erb | 10 ++- app/views/admin/pages/_form_code.html.erb | 3 - app/views/admin/pages/edit.html.erb | 15 ---- app/views/admin/pages/edit.js.erb | 1 - app/views/admin/pages/show.html.erb | 2 +- app/views/admin/pages/update.js.erb | 2 - lib/fraisier/themes/red.css | 1 + lib/parser.rb | 104 +--------------------- lib/tasks/dev.rake | 36 ++++++-- 16 files changed, 59 insertions(+), 177 deletions(-) delete mode 100644 app/views/admin/pages/_edit_code.html.erb delete mode 100644 app/views/admin/pages/_form_code.html.erb delete mode 100644 app/views/admin/pages/edit.html.erb delete mode 100644 app/views/admin/pages/edit.js.erb delete mode 100644 app/views/admin/pages/update.js.erb create mode 100644 lib/fraisier/themes/red.css diff --git a/Gemfile b/Gemfile index a9813caa3..1e6ce8fce 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gem 'rails', '>=3.1.0.rc4' gem 'yajl-ruby', :require => 'yajl' gem 'bson_ext' -gem 'carrierwave', '0.5.6' +gem 'carrierwave', '0.5.4' gem 'ckeditor' gem 'devise' gem 'mini_magick' diff --git a/Gemfile.lock b/Gemfile.lock index 7177ff7e8..74e4c8c14 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,7 +36,7 @@ GEM bson (1.3.1) bson_ext (1.3.1) builder (3.0.0) - carrierwave (0.5.6) + carrierwave (0.5.4) activesupport (~> 3.0) chronic (0.6.2) ckeditor (3.6.1) @@ -171,7 +171,7 @@ PLATFORMS DEPENDENCIES bson_ext - carrierwave (= 0.5.6) + carrierwave (= 0.5.4) ckeditor coffee-rails (~> 3.1.0.rc) delorean diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index d6992c71d..a0f4231e4 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -21,14 +21,11 @@ class Admin::PagesController < ApplicationController @item = Page.new @item.is_published = true @item.parent_id = @parent_item.id rescue nil + @designs = Design.all.entries + @default_design = @designs.detect {|d| d.title.to_s == 'Bob' } end def edit - @item = Page.find(params[:id]) - # @item.content = parse_content(@item.content, {:locale => 'show'}) - @item.content = parse_page_code(@item) - @i18n_variable = @item.i18n_variable - @code = params[:code] end def create @@ -51,19 +48,6 @@ class Admin::PagesController < ApplicationController end def update - @item = Page.find(params[:id]) - parse_content_update_code(@item, params[:page][:content]) - if @item.update_attributes(params[:item]) - flash[:notice] = t('admin.update_success_page') - respond_to do |format| - format.html { - redirect_to admin_page_url(@item) - } - format.js {} - end - else - render :action => "edit" - end end def destroy diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index 7994cb250..e91265fc3 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -12,7 +12,6 @@ module Admin::ItemHelper ret << "