From 9b1ada0af92a2d6c1b44836cae14da0865ffa717 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 15 Nov 2012 15:51:44 +0800 Subject: [PATCH] Fix these bugs: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.結構部份 a.原選單,點選編輯,無動作反應 b.新增選單後,左邊灰色架構部份不會更新 2.檔案室 a.無法編輯分類 --- app/controllers/admin/links_controller.rb | 8 +------- app/controllers/admin/pages_controller.rb | 11 ++--------- app/views/admin/pages/_edit.html.erb | 2 +- app/views/admin/pages/_new.html.erb | 2 +- app/views/admin/pages/_show.html.erb | 2 +- app/views/admin/pages/create.js.erb | 2 +- app/views/admin/pages/update.js.erb | 1 + .../back_end/archive_file_categorys/_form.html.erb | 2 +- .../back_end/archive_file_categorys/update.js.erb | 4 ++-- 9 files changed, 11 insertions(+), 23 deletions(-) diff --git a/app/controllers/admin/links_controller.rb b/app/controllers/admin/links_controller.rb index 7c7b4030..5eece0ca 100644 --- a/app/controllers/admin/links_controller.rb +++ b/app/controllers/admin/links_controller.rb @@ -1,10 +1,4 @@ -class Admin::LinksController < ApplicationController - - layout "site_editor" - - before_filter :authenticate_user! - before_filter :find_parent_item - before_filter :is_admin? +class Admin::LinksController < Admin::ItemsController def show @item ||= Link.find(params[:id]) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index cf935a09..0e58a00f 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -1,11 +1,4 @@ -class Admin::PagesController < ApplicationController - - layout "site_editor" - - before_filter :authenticate_user! - before_filter :find_parent_item - before_filter :is_admin? - before_filter :set_current_item +class Admin::PagesController < Admin::ItemsController def show @item = Page.find(params[:id]) @@ -40,7 +33,7 @@ class Admin::PagesController < ApplicationController @frontend_path = @item.app_frontend_url ? @item.app_frontend_url : @module_app.widgets.keys[0] - if @module_app.widgets.any?{|b| b.class == Array} + if @module_app && @module_app.widgets && @module_app.widgets.any?{|b| b.class == Array} @frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank? end diff --git a/app/views/admin/pages/_edit.html.erb b/app/views/admin/pages/_edit.html.erb index 8fd63c12..c94786bb 100644 --- a/app/views/admin/pages/_edit.html.erb +++ b/app/views/admin/pages/_edit.html.erb @@ -1,4 +1,4 @@ -<%= flash_messages %> +<%#= flash_messages %>

<%= t('editing.page') %>

<%= form_for @item, :url => admin_page_path(@item), :html => { :class => 'form-horizontal edit_page' } do |f| %> diff --git a/app/views/admin/pages/_new.html.erb b/app/views/admin/pages/_new.html.erb index c62d530b..3f725e0b 100644 --- a/app/views/admin/pages/_new.html.erb +++ b/app/views/admin/pages/_new.html.erb @@ -1,4 +1,4 @@ -<%= flash_messages %> +<%#= flash_messages %>

<%= t('new.page') %>

<%= form_for @item, :url => admin_pages_path, :html => { :class => 'form-horizontal edit_page' } do |f| %> diff --git a/app/views/admin/pages/_show.html.erb b/app/views/admin/pages/_show.html.erb index 29d532fb..d33d08bd 100644 --- a/app/views/admin/pages/_show.html.erb +++ b/app/views/admin/pages/_show.html.erb @@ -1,4 +1,4 @@ -<%= flash_messages %> +<%#= flash_messages %> <%= page_stylesheets(@item, true).html_safe %> diff --git a/app/views/admin/pages/create.js.erb b/app/views/admin/pages/create.js.erb index efeb27a1..7ce5b016 100644 --- a/app/views/admin/pages/create.js.erb +++ b/app/views/admin/pages/create.js.erb @@ -1,3 +1,3 @@ -$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>"); $('#back_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>"); +$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>"); history.pushState(null, document.title, "<%= escape_javascript(admin_page_url(@item)) %>"); \ No newline at end of file diff --git a/app/views/admin/pages/update.js.erb b/app/views/admin/pages/update.js.erb index 26561d07..7ce5b016 100644 --- a/app/views/admin/pages/update.js.erb +++ b/app/views/admin/pages/update.js.erb @@ -1,2 +1,3 @@ $('#back_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>"); +$('#back_sidebar').html("<%= escape_javascript(render(:partial => 'admin/items/site_map_left_bar')) %>"); history.pushState(null, document.title, "<%= escape_javascript(admin_page_url(@item)) %>"); \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb index 345390df..03609336 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_form.html.erb @@ -15,7 +15,7 @@
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
- <%= f.text_field locale, :class =>' input-xxlarge', :value => (@archive_file_category.title[locale] rescue nil) %> + <%= f.text_field locale, :class =>' input-xxlarge', :value => (@archive_file_category.title_translations[locale] rescue nil) %>
<% end %> diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb index 9a6f431e..2c5cf21e 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/update.js.erb @@ -1,4 +1,4 @@ -$("#<%= dom_id @archive_file_category %>").replaceWith("<%= j render :partial => 'link_category', :collection => [@archive_file_category] %>"); -<% @archive_file_category = WebLinkCategory.new(:display => 'List') # reset for new form %> +$("#<%= dom_id @archive_file_category %>").replaceWith("<%= j render :partial => 'archive_file_category', :collection => [@archive_file_category] %>"); +<% @archive_file_category = ArchiveFileCategory.new(:display => 'List') # reset for new form %> $(".edit_archive_file_category").replaceWith("<%= j render "form" %>") $(".new_archive_file_category")[0].reset(); \ No newline at end of file