From f13ebc6c4670debf89469cda74c1b2671253af16 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Fri, 24 Feb 2012 19:11:51 +0800 Subject: [PATCH] Fix bugs and changes for nccu --- Gemfile | 1 + Gemfile.lock | 3 ++ app/assets/javascripts/site_editor.js | 3 +- app/controllers/admin/pages_controller.rb | 6 +-- app/helpers/admin/item_helper.rb | 2 +- app/models/design/design.rb | 2 +- app/views/admin/designs/index.html.erb | 2 +- app/views/layouts/_orbit_bar.html.erb | 2 +- app/views/layouts/_side_bar.html.erb | 20 ++++------ lib/parsers/parser_common.rb | 6 +-- lib/tasks/page_content.rake | 11 +++++ .../front_end/bulletins_controller.rb | 4 +- .../back_end/bulletins/_form.html.erb | 6 ++- .../front_end/bulletins/index.html.erb | 40 +++++++++---------- .../front_end/bulletins/show.html.erb | 30 ++++++++++---- .../widget/bulletins/index.html.erb | 2 +- .../front_end/page_contexts/index.html.erb | 4 +- .../widget/web_links_controller.rb | 4 +- .../widget/web_links/_web_links.html.erb | 10 +++++ .../widget/web_links/reload_web_links.js.erb | 1 + 20 files changed, 98 insertions(+), 61 deletions(-) create mode 100644 lib/tasks/page_content.rake create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/_web_links.html.erb create mode 100644 vendor/built_in_modules/web_resource/app/views/panel/web_resource/widget/web_links/reload_web_links.js.erb diff --git a/Gemfile b/Gemfile index 17373085..eb1f5434 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,7 @@ gem 'rubyzip' gem 'sinatra' gem 'sprockets' gem 'tinymce-rails' +gem 'therubyracer' # Gems used only for assets and not required # in production environments by default. diff --git a/Gemfile.lock b/Gemfile.lock index 18f66fbf..d6960e2b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -179,6 +179,8 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) subexec (0.2.1) + therubyracer (0.9.9) + libv8 (~> 3.3.10) thor (0.14.6) tilt (1.3.3) tinymce-rails (3.4.8) @@ -234,6 +236,7 @@ DEPENDENCIES sinatra spork sprockets + therubyracer tinymce-rails uglifier watchr diff --git a/app/assets/javascripts/site_editor.js b/app/assets/javascripts/site_editor.js index ef4acc85..98405564 100644 --- a/app/assets/javascripts/site_editor.js +++ b/app/assets/javascripts/site_editor.js @@ -7,5 +7,4 @@ //= require jquery //= require jquery_ujs //= require page_edit -//= require side_bar_history -//= require rc \ No newline at end of file +//= require side_bar_history \ No newline at end of file diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 1cee9f54..411297ce 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -60,10 +60,10 @@ class Admin::PagesController < ApplicationController def update @item = Page.find(params[:id]) - - if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank? + + if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank? @item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id ) - end + end if @item.update_attributes(params[:page]) flash[:notice] = t('admin.update_success_page') diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index db75619b..d7a3455b 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -11,7 +11,7 @@ module Admin::ItemHelper end ret << "