diff --git a/app/assets/javascripts/side_bar_history.js b/app/assets/javascripts/side_bar_history.js index ad29b497..f23fd6cc 100644 --- a/app/assets/javascripts/side_bar_history.js +++ b/app/assets/javascripts/side_bar_history.js @@ -1,14 +1,5 @@ var history_edited = false; -$('#back_sidebar a, #back_main a.nav').live('click', - function () { - $.getScript(this.href); - history.pushState(null, document.title, this.href); - history_edited = true; - return false; - } -); - $('#back_main a.reload').live('click', function () { $.getScript(this.href); @@ -18,7 +9,7 @@ $('#back_main a.reload').live('click', } ); -$('#back_main .form').live('submit', function () { +$('#back_main form').live('submit', function () { $.post(this.action, $(this).serialize(), null, 'script'); history_edited = true; return false; diff --git a/app/assets/stylesheets/sidebar.css.erb b/app/assets/stylesheets/sidebar.css.erb index 1e4b4010..76d1e4e9 100644 --- a/app/assets/stylesheets/sidebar.css.erb +++ b/app/assets/stylesheets/sidebar.css.erb @@ -18,6 +18,9 @@ padding: 3px 0px; display: block; } +.nav-list>li>ol { + margin-left: 0; +} /* #back_sidebar h1 { background: url(<%= asset_path "h1_bg.png" %>) repeat-x scroll left top transparent; @@ -126,7 +129,7 @@ background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #DDDDDD; border-radius: 5px 5px 5px 5px; - margin: 0 0 0 3px; + margin: 0 0 0 20px; padding: 0; z-index:1; position: absolute; @@ -155,7 +158,7 @@ ol.nav>li>.icons-moves { } .sortable i { position: absolute; - left: -20px; + left: 0px; top: 6px; margin-right: 0; opacity: 0.3; @@ -166,6 +169,9 @@ ol.nav>li>.icons-moves { opacity: 0.7; filter: alpha(opacity=70); } +.with_action { + padding-left: 20px; +} .placeholder { background-color: rgba(0,136,204,.6); border-radius: 3px; diff --git a/app/controllers/admin/links_controller.rb b/app/controllers/admin/links_controller.rb index 533ff829..c233c18f 100644 --- a/app/controllers/admin/links_controller.rb +++ b/app/controllers/admin/links_controller.rb @@ -65,9 +65,11 @@ class Admin::LinksController < ApplicationController end def delete + @item = Link.find(params[:id]) + @item.destroy respond_to do |format| format.html {} - format.js { destroy } + format.js { @item = @item.parent } end end diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index 44bda4aa..5fc6cb77 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -51,7 +51,7 @@ class Admin::PagesController < ApplicationController def create @item = Page.new(params[:page]) - if @item.module_app.key == 'page_content' + if @item.module_app && @item.module_app.key == 'page_content' @item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id ) end @@ -99,14 +99,16 @@ class Admin::PagesController < ApplicationController format.html { redirect_to admin_items_url( :parent_id => @item.parent_id ) } - format.js {} + format.js { redirect_to admin_items_url } end end def delete + @item = Page.find(params[:id]) + @item.destroy respond_to do |format| format.html {} - format.js { destroy } + format.js { @item = @item.parent } end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1455619a..5fd9de5c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -157,7 +157,7 @@ class ApplicationController < ActionController::Base end def get_homepage - Item.first(:conditions => {:parent_id => nil}) + Page.root end def layout_by_resource diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index b5ab255e..78e911b9 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -11,14 +11,14 @@ module Admin::ItemHelper no_nested = 'no-nest' end ret << "