diff --git a/Gemfile b/Gemfile index 77796d11..b4500c96 100644 --- a/Gemfile +++ b/Gemfile @@ -9,10 +9,12 @@ gem 'rails', '~> 3.1.1' gem 'devise', '~> 1.4.9' gem 'cancan', '~> 1.6.7' -gem 'mongoid', '~> 2.3.2' +gem 'bson', '~> 1.3.1' +gem 'mongo', '~> 1.3.1' gem 'bson_ext', '~> 1.3.1' +gem 'mongoid', '~> 2.3.3' gem 'locomotive_mongoid_acts_as_tree', '0.1.5.7', :require => 'mongoid_acts_as_tree', :path => '../gems/acts_as_tree' # TODO: REPLACE IT -gem 'custom_fields', '~> 1.1.0.rc1' +gem 'custom_fields', '~> 1.1.0.rc1', :path => '../gems/custom_fields' gem 'will_paginate', '~> 3.0.2' gem 'haml', '~> 3.1.3' diff --git a/Gemfile.lock b/Gemfile.lock index fc5a16df..01e40520 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,6 +19,14 @@ PATH specs: locomotive_mongoid_acts_as_tree (0.1.5.7) +PATH + remote: ../gems/custom_fields + specs: + custom_fields (1.1.0.rc1) + activesupport (~> 3.1.1) + carrierwave-mongoid (~> 0.1.3) + mongoid (~> 2.3.2) + GEM remote: http://rubygems.org/ specs: @@ -61,7 +69,7 @@ GEM autotest (4.4.6) ZenTest (>= 4.4.1) bcrypt-ruby (3.0.1) - bson (1.4.1) + bson (1.3.1) bson_ext (1.3.1) builder (3.0.0) bushido (0.0.35) @@ -93,20 +101,16 @@ GEM execjs coffee-script-source (1.1.2) columnize (0.3.4) - cucumber (1.1.0) + cucumber (1.1.1) builder (>= 2.1.2) diff-lcs (>= 1.1.2) - gherkin (~> 2.5.0) + gherkin (~> 2.6.0) json (>= 1.4.6) term-ansicolor (>= 1.0.6) cucumber-rails (1.1.1) capybara (>= 1.1.1) cucumber (>= 1.1.0) nokogiri (>= 1.5.0) - custom_fields (1.1.0.rc1) - activesupport (~> 3.1.1) - carrierwave-mongoid (~> 0.1.3) - mongoid (= 2.3.2) daemons (1.1.4) database_cleaner (0.6.7) delayed_job (2.1.4) @@ -149,7 +153,7 @@ GEM activesupport (>= 2.3.7) i18n (~> 0.4) fssm (0.2.7) - gherkin (2.5.4) + gherkin (2.6.2) json (>= 1.4.6) growl-glue (1.0.7) haml (3.1.3) @@ -182,11 +186,11 @@ GEM mime-types (1.17.2) mimetype-fu (0.1.2) mocha (0.9.12) - mongo (1.4.1) - bson (= 1.4.1) - mongoid (2.3.2) + mongo (1.3.1) + bson (>= 1.3.1) + mongoid (2.3.3) activemodel (~> 3.1) - mongo (~> 1.4) + mongo (~> 1.3) tzinfo (~> 0.3.22) multi_json (1.0.3) multi_xml (0.4.1) @@ -316,6 +320,7 @@ DEPENDENCIES ZenTest actionmailer-with-request (~> 0.3.0) autotest + bson (~> 1.3.1) bson_ext (~> 1.3.1) bushido (= 0.0.35) cancan (~> 1.6.7) @@ -325,7 +330,7 @@ DEPENDENCIES coffee-script (~> 2.2.0) compass! cucumber-rails - custom_fields (~> 1.1.0.rc1) + custom_fields (~> 1.1.0.rc1)! database_cleaner delayed_job (~> 2.1.1) delayed_job_mongoid (~> 1.0.4) @@ -347,7 +352,8 @@ DEPENDENCIES locomotive_mongoid_acts_as_tree (= 0.1.5.7)! mimetype-fu (~> 0.1.2) mocha (= 0.9.12) - mongoid (~> 2.3.2) + mongo (~> 1.3.1) + mongoid (~> 2.3.3) pickle rack-cache (~> 1.1) rails (~> 3.1.1) diff --git a/app/cells/locomotive/global_actions_cell.rb b/app/cells/locomotive/global_actions_cell.rb index d921fae1..7fb734b0 100644 --- a/app/cells/locomotive/global_actions_cell.rb +++ b/app/cells/locomotive/global_actions_cell.rb @@ -11,7 +11,7 @@ class Locomotive::GlobalActionsCell < ::Locomotive::MenuCell protected def build_list - add :welcome, :url => edit_locomotive_my_account_url, :i18n_options => { + add :welcome, :url => edit_my_account_url, :i18n_options => { :key => 'locomotive.shared.header.welcome', :arg => :name, :value => @current_account.name @@ -24,7 +24,7 @@ class Locomotive::GlobalActionsCell < ::Locomotive::MenuCell end add :help, :url => '#', :class => 'tutorial', :id => 'help' - add :logout, :url => destroy_locomotive_session_url, :confirm => t('locomotive.messages.confirm') + add :logout, :url => destroy_session_url, :confirm => t('locomotive.messages.confirm') end def localize_label(label, options = {}) diff --git a/app/cells/locomotive/main_menu_cell.rb b/app/cells/locomotive/main_menu_cell.rb index c6c4b4b5..3712accb 100644 --- a/app/cells/locomotive/main_menu_cell.rb +++ b/app/cells/locomotive/main_menu_cell.rb @@ -3,8 +3,8 @@ class Locomotive::MainMenuCell < ::Locomotive::MenuCell protected def build_list - add :contents, :url => locomotive_pages_url - add :settings, :url => edit_locomotive_current_site_url + add :contents, :url => pages_url + add :settings, :url => edit_current_site_url end end diff --git a/app/cells/locomotive/settings_menu_cell.rb b/app/cells/locomotive/settings_menu_cell.rb index ec1271ca..69386dfd 100644 --- a/app/cells/locomotive/settings_menu_cell.rb +++ b/app/cells/locomotive/settings_menu_cell.rb @@ -3,9 +3,9 @@ class Locomotive::SettingsMenuCell < ::Locomotive::SubMenuCell protected def build_list - add :site, :url => edit_locomotive_current_site_url - add :theme_assets, :url => locomotive_theme_assets_url - add :account, :url => edit_locomotive_my_account_url + add :site, :url => edit_current_site_url + add :theme_assets, :url => theme_assets_url + add :account, :url => edit_my_account_url end end diff --git a/app/controllers/locomotive/accounts_controller.rb b/app/controllers/locomotive/accounts_controller.rb index 6bb618a8..cf741bd8 100644 --- a/app/controllers/locomotive/accounts_controller.rb +++ b/app/controllers/locomotive/accounts_controller.rb @@ -11,7 +11,7 @@ module Locomotive @account = Account.create(params[:account]) current_site.memberships.create(:account => @account) if @account.errors.empty? - respond_with @account, :location => edit_locomotive_current_site_url + respond_with @account, :location => edit_current_site_url end end diff --git a/app/controllers/locomotive/assets_controller.rb b/app/controllers/locomotive/assets_controller.rb index 403681cf..e75b142c 100644 --- a/app/controllers/locomotive/assets_controller.rb +++ b/app/controllers/locomotive/assets_controller.rb @@ -48,7 +48,7 @@ module Locomotive :content_type => asset.content_type, :url => asset.source.url, :vignette_url => asset.vignette_url, - :destroy_url => locomotive_asset_url(asset, :json) + :destroy_url => asset_url(asset, :json) } end diff --git a/app/controllers/locomotive/base_controller.rb b/app/controllers/locomotive/base_controller.rb index f6ac3607..eb9dea50 100644 --- a/app/controllers/locomotive/base_controller.rb +++ b/app/controllers/locomotive/base_controller.rb @@ -20,9 +20,9 @@ module Locomotive helper_method :sections, :current_site_url, :site_url, :page_url, :current_ability # https://rails.lighthouseapp.com/projects/8994/tickets/1905-apphelpers-within-plugin-not-being-mixed-in - Dir[File.dirname(__FILE__) + "/../../helpers/**/*_helper.rb"].each do |file| - helper "locomotive/#{File.basename(file, '.rb').gsub(/_helper$/, '')}" - end + # Dir[File.dirname(__FILE__) + "/../../helpers/**/*_helper.rb"].each do |file| + # helper "locomotive/#{File.basename(file, '.rb').gsub(/_helper$/, '')}" + # end self.responder = Locomotive::AdminResponder # custom responder @@ -38,7 +38,7 @@ module Locomotive else flash[:alert] = exception.message - redirect_to locomotive_pages_url + redirect_to pages_url end end diff --git a/app/controllers/locomotive/content_types_controller.rb b/app/controllers/locomotive/content_types_controller.rb index e0e5f444..a70da4a3 100644 --- a/app/controllers/locomotive/content_types_controller.rb +++ b/app/controllers/locomotive/content_types_controller.rb @@ -4,7 +4,7 @@ module Locomotive sections 'contents' def destroy - destroy! { locomotive_pages_url } + destroy! { pages_url } end end diff --git a/app/controllers/locomotive/contents_controller.rb b/app/controllers/locomotive/contents_controller.rb index 8ae5170b..c220cf3e 100644 --- a/app/controllers/locomotive/contents_controller.rb +++ b/app/controllers/locomotive/contents_controller.rb @@ -36,11 +36,11 @@ module Locomotive def sort @content_type.sort_contents!(params[:children]) - respond_with(@content_type, :location => locomotive_contents_url(@content_type.slug)) + respond_with(@content_type, :location => contents_url(@content_type.slug)) end def destroy - destroy! { locomotive_contents_url(@content_type.slug) } + destroy! { contents_url(@content_type.slug) } end protected @@ -55,7 +55,7 @@ module Locomotive def after_create_or_update_url if params[:breadcrumb_alias].blank? - edit_locomotive_content_url(@content_type.slug, @content.id) + edit_content_url(@content_type.slug, @content.id) else self.breadcrumb_url end @@ -72,11 +72,11 @@ module Locomotive end def breadcrumb_url - edit_locomotive_content_url(self.breadcrumb_root._parent.slug, self.breadcrumb_root) + edit_content_url(self.breadcrumb_root._parent.slug, self.breadcrumb_root) end def back_url - self.breadcrumb_root ? self.breadcrumb_url : locomotive_contents_url(@content_type.slug) + self.breadcrumb_root ? self.breadcrumb_url : contents_url(@content_type.slug) end end diff --git a/app/controllers/locomotive/current_site_controller.rb b/app/controllers/locomotive/current_site_controller.rb index efa499c1..73aaea72 100644 --- a/app/controllers/locomotive/current_site_controller.rb +++ b/app/controllers/locomotive/current_site_controller.rb @@ -15,7 +15,7 @@ module Locomotive def update update! do |success, failure| - success.html { redirect_to edit_locomotive_current_site_url(new_host_if_subdomain_changed) } + success.html { redirect_to edit_current_site_url(new_host_if_subdomain_changed) } end end diff --git a/app/controllers/locomotive/import_controller.rb b/app/controllers/locomotive/import_controller.rb index f47f1a55..2492bb71 100644 --- a/app/controllers/locomotive/import_controller.rb +++ b/app/controllers/locomotive/import_controller.rb @@ -14,7 +14,7 @@ module Locomotive respond_to do |format| format.html do - redirect_to new_locomotive_import_url if @job.nil? + redirect_to new_import_url if @job.nil? end format.json { render :json => { :step => @job.nil? ? 'done' : @job.step, @@ -34,7 +34,7 @@ module Locomotive flash[:notice] = t("fash.locomotive.import.create.#{Locomotive.config.delayed_job ? 'notice' : 'done'}") - redirect_to Locomotive.config.delayed_job ? locomotive_import_url : new_locomotive_import_url + redirect_to Locomotive.config.delayed_job ? import_url : new_import_url rescue Exception => e logger.error "[Locomotive import] #{e.message} / #{e.backtrace}" diff --git a/app/controllers/locomotive/installation_controller.rb b/app/controllers/locomotive/installation_controller.rb index 633471ee..789fffef 100644 --- a/app/controllers/locomotive/installation_controller.rb +++ b/app/controllers/locomotive/installation_controller.rb @@ -36,7 +36,7 @@ module Locomotive when 1 # create account @account = Account.create(params[:account]) if @account.valid? - redirect_to locomotive_installation_step_url(2) + redirect_to installation_step_url(2) else render 'step_1' end @@ -67,14 +67,14 @@ module Locomotive end def allow_installation? - redirect_to locomotive_pages_url if Site.count > 0 && Account.count > 0 + redirect_to pages_url if Site.count > 0 && Account.count > 0 end def last_url if Locomotive.config.manage_domains? - locomotive_session_url(:host => Site.first.domains.first, :port => request.port) + session_url(:host => Site.first.domains.first, :port => request.port) else - locomotive_session_url + session_url end end diff --git a/app/controllers/locomotive/memberships_controller.rb b/app/controllers/locomotive/memberships_controller.rb index a4a75289..817a20da 100644 --- a/app/controllers/locomotive/memberships_controller.rb +++ b/app/controllers/locomotive/memberships_controller.rb @@ -8,18 +8,18 @@ module Locomotive case resource.process! when :create_account - redirect_to new_locomotive_account_url(:email => resource.email) + redirect_to new_account_url(:email => resource.email) when :save_it - respond_with resource, :location => edit_locomotive_current_site_url + respond_with resource, :location => edit_current_site_url when :error respond_with resource, :flash => true when :already_created - respond_with resource, :alert => t('flash.locomotive.memberships.create.already_created'), :location => edit_locomotive_current_site_url + respond_with resource, :alert => t('flash.locomotive.memberships.create.already_created'), :location => edit_current_site_url end end def destroy - destroy! { edit_locomotive_current_site_url } + destroy! { edit_current_site_url } end end diff --git a/app/controllers/locomotive/my_account_controller.rb b/app/controllers/locomotive/my_account_controller.rb index 44fc4e0a..6ad409ad 100644 --- a/app/controllers/locomotive/my_account_controller.rb +++ b/app/controllers/locomotive/my_account_controller.rb @@ -10,7 +10,7 @@ module Locomotive skip_load_and_authorize_resource def update - update! { edit_locomotive_my_account_url } + update! { edit_my_account_url } end protected diff --git a/app/controllers/locomotive/sessions_controller.rb b/app/controllers/locomotive/sessions_controller.rb index af4a0b6b..14daf541 100644 --- a/app/controllers/locomotive/sessions_controller.rb +++ b/app/controllers/locomotive/sessions_controller.rb @@ -12,7 +12,7 @@ module Locomotive protected def after_sign_in_path_for(resource) - locomotive_pages_url + pages_url end def after_sign_out_path_for(resource) diff --git a/app/controllers/locomotive/sites_controller.rb b/app/controllers/locomotive/sites_controller.rb index b3866787..c0f30221 100644 --- a/app/controllers/locomotive/sites_controller.rb +++ b/app/controllers/locomotive/sites_controller.rb @@ -9,7 +9,7 @@ module Locomotive @site = Site.new(params[:site]) @site.memberships.build :account => @current_account, :role => 'admin' - create! { edit_locomotive_my_account_url } + create! { edit_my_account_url } end def destroy @@ -21,7 +21,7 @@ module Locomotive @site.errors.add(:base, 'Can not destroy the site you are logging in now') end - respond_with @site, :location => edit_locomotive_my_account_url + respond_with @site, :location => edit_my_account_url end protected diff --git a/app/controllers/locomotive/snippets_controller.rb b/app/controllers/locomotive/snippets_controller.rb index 6fcd2852..e4515b86 100644 --- a/app/controllers/locomotive/snippets_controller.rb +++ b/app/controllers/locomotive/snippets_controller.rb @@ -7,7 +7,7 @@ module Locomotive def destroy destroy! do |format| - format.html { redirect_to locomotive_theme_assets_url } + format.html { redirect_to theme_assets_url } end end diff --git a/app/helpers/locomotive/box_helper.rb b/app/helpers/locomotive/box_helper.rb index 97e332ea..1d404258 100644 --- a/app/helpers/locomotive/box_helper.rb +++ b/app/helpers/locomotive/box_helper.rb @@ -15,7 +15,7 @@ module Locomotive::BoxHelper end def next_installation_step_link(step = 1, label = nil) - link_to(content_tag(:span, label || t('locomotive.installation.common.next')), locomotive_installation_step_url(step), :class => 'button') + link_to(content_tag(:span, label || t('locomotive.installation.common.next')), installation_step_url(step), :class => 'button') end end diff --git a/app/helpers/locomotive/content_types_helper.rb b/app/helpers/locomotive/content_types_helper.rb index a0869a10..ec712014 100644 --- a/app/helpers/locomotive/content_types_helper.rb +++ b/app/helpers/locomotive/content_types_helper.rb @@ -42,7 +42,7 @@ module Locomotive::ContentTypesHelper item_on = (content_type.slug == @content_type.slug) rescue nil label = truncate(content_type.name, :length => 15) - url = locomotive_contents_url(content_type.slug) + url = contents_url(content_type.slug) css = @content_type && content_type.slug == @content_type.slug ? 'on' : '' html = admin_content_menu_item(label, url, :i18n => false, :css => css) do diff --git a/app/helpers/locomotive/custom_fields_helper.rb b/app/helpers/locomotive/custom_fields_helper.rb index 1e8cc36c..21893320 100644 --- a/app/helpers/locomotive/custom_fields_helper.rb +++ b/app/helpers/locomotive/custom_fields_helper.rb @@ -129,9 +129,9 @@ module Locomotive::CustomFieldsHelper options.merge!( :new_item => { :label => t('locomotive.contents.form.has_many.new_item'), - :url => new_locomotive_content_url(field.target_klass._parent.slug, url_options) + :url => new_content_url(field.target_klass._parent.slug, url_options) }, - :edit_item_url => edit_locomotive_content_url(field.target_klass._parent.slug, 42, url_options) + :edit_item_url => edit_content_url(field.target_klass._parent.slug, 42, url_options) ) end diff --git a/app/views/locomotive/accounts/new.html.haml b/app/views/locomotive/accounts/new.html.haml index 8e45cbd2..64d3ee2b 100644 --- a/app/views/locomotive/accounts/new.html.haml +++ b/app/views/locomotive/accounts/new.html.haml @@ -5,7 +5,7 @@ %p!= t('.help') -= semantic_form_for @account, :url => locomotive_accounts_url do |f| += semantic_form_for @account, :url => accounts_url do |f| = f.foldable_inputs :name => :information do = f.input :name @@ -18,4 +18,4 @@ = f.input :password, :input_html => { :autocomplete => "off" } = f.input :password_confirmation, :input_html => { :autocomplete => "off" } - = render 'admin/shared/form_actions', :back_url => edit_locomotive_current_site_url, :button_label => :create \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => edit_current_site_url, :button_label => :create \ No newline at end of file diff --git a/app/views/locomotive/content_types/edit.html.haml b/app/views/locomotive/content_types/edit.html.haml index 1f03219d..05887668 100644 --- a/app/views/locomotive/content_types/edit.html.haml +++ b/app/views/locomotive/content_types/edit.html.haml @@ -7,15 +7,15 @@ = render 'admin/shared/actions/contents' - content_for :buttons do - = admin_button_tag :show_items, locomotive_contents_url(@content_type.slug_was), :class => 'show' - = admin_button_tag :new_item, new_locomotive_content_url(@content_type.slug_was), :class => 'new' + = admin_button_tag :show_items, contents_url(@content_type.slug_was), :class => 'show' + = admin_button_tag :new_item, new_content_url(@content_type.slug_was), :class => 'new' %p!= t('.help') -= semantic_form_for @content_type, :url => locomotive_content_type_url(@content_type) do |f| += semantic_form_for @content_type, :url => content_type_url(@content_type) do |f| = render 'form', :f => f - = render 'admin/shared/form_actions', :back_url => locomotive_contents_url(@content_type.slug_was), :button_label => :update + = render 'admin/shared/form_actions', :back_url => contents_url(@content_type.slug_was), :button_label => :update = render 'admin/custom_fields/edit_field', :content_type => @content_type \ No newline at end of file diff --git a/app/views/locomotive/content_types/new.html.haml b/app/views/locomotive/content_types/new.html.haml index 5889a5c8..757552e9 100644 --- a/app/views/locomotive/content_types/new.html.haml +++ b/app/views/locomotive/content_types/new.html.haml @@ -8,10 +8,10 @@ %p!= t('.help') -= semantic_form_for @content_type, :url => locomotive_content_types_url do |f| += semantic_form_for @content_type, :url => content_types_url do |f| = render 'form', :f => f - = render 'admin/shared/form_actions', :back_url => locomotive_pages_url, :button_label => :create + = render 'admin/shared/form_actions', :back_url => pages_url, :button_label => :create = render 'admin/custom_fields/edit_field', :content_type => @content_type \ No newline at end of file diff --git a/app/views/locomotive/contents/_list.html.haml b/app/views/locomotive/contents/_list.html.haml index 199520ff..e8acb97b 100644 --- a/app/views/locomotive/contents/_list.html.haml +++ b/app/views/locomotive/contents/_list.html.haml @@ -1,5 +1,5 @@ - if contents.empty? - %p.no-items!= t('.no_items', :url => new_locomotive_content_url(@content_type.slug)) + %p.no-items!= t('.no_items', :url => new_content_url(@content_type.slug)) - else %ul{ :id => 'contents-list', :class => "list #{'sortable' if @content_type.order_by == '_position_in_list'}", :'data-url' => sort_admin_contents_path(@content_type.slug, :json) } - contents.each do |content| diff --git a/app/views/locomotive/contents/edit.html.haml b/app/views/locomotive/contents/edit.html.haml index 91f24f81..157f6fb0 100644 --- a/app/views/locomotive/contents/edit.html.haml +++ b/app/views/locomotive/contents/edit.html.haml @@ -11,13 +11,13 @@ - content_for :buttons do - if can?(:manage, ContentType) - = admin_button_tag t('locomotive.contents.index.edit'), edit_locomotive_content_type_url(@content_type), :class => 'edit' + = admin_button_tag t('locomotive.contents.index.edit'), edit_content_type_url(@content_type), :class => 'edit' - = admin_button_tag t('locomotive.contents.index.new'), new_locomotive_content_url(@content_type.slug), :class => 'new' + = admin_button_tag t('locomotive.contents.index.new'), new_content_url(@content_type.slug), :class => 'new' %p= @content_type.description -= semantic_form_for @content, :as => :content, :url => locomotive_content_url(@content_type.slug, @content), :html => { :multipart => true, :class => 'save-with-shortcut' } do |form| += semantic_form_for @content, :as => :content, :url => content_url(@content_type.slug, @content), :html => { :multipart => true, :class => 'save-with-shortcut' } do |form| = render 'form', :f => form diff --git a/app/views/locomotive/contents/index.html.haml b/app/views/locomotive/contents/index.html.haml index d149ea7c..b8730e15 100644 --- a/app/views/locomotive/contents/index.html.haml +++ b/app/views/locomotive/contents/index.html.haml @@ -11,9 +11,9 @@ - content_for :buttons do - if can?(:manage, ContentType) - = admin_button_tag :edit, edit_locomotive_content_type_url(@content_type), :class => 'edit' + = admin_button_tag :edit, edit_content_type_url(@content_type), :class => 'edit' - = admin_button_tag :new, new_locomotive_content_url(@content_type.slug), :class => 'new' + = admin_button_tag :new, new_content_url(@content_type.slug), :class => 'new' - if @content_type.description.present? %p= @content_type.description @@ -29,4 +29,4 @@ - if can?(:manage, ContentType) #local-actions-bottom-bar %p.tleft - = link_to(content_tag(:em, escape_once(' ')) + t('.destroy'), locomotive_content_type_url(@content_type), :confirm => t('locomotive.messages.confirm'), :method => :delete, :class => 'button small remove') + = link_to(content_tag(:em, escape_once(' ')) + t('.destroy'), content_type_url(@content_type), :confirm => t('locomotive.messages.confirm'), :method => :delete, :class => 'button small remove') diff --git a/app/views/locomotive/contents/new.html.haml b/app/views/locomotive/contents/new.html.haml index ea7c8b73..c5f30092 100644 --- a/app/views/locomotive/contents/new.html.haml +++ b/app/views/locomotive/contents/new.html.haml @@ -11,11 +11,11 @@ - if can?(:manage, ContentType) - content_for :buttons do - = admin_button_tag t('locomotive.contents.index.edit'), edit_locomotive_content_type_url(@content_type), :class => 'edit' + = admin_button_tag t('locomotive.contents.index.edit'), edit_content_type_url(@content_type), :class => 'edit' %p= @content_type.description -= semantic_form_for @content, :as => :content, :url => locomotive_contents_url(@content_type.slug), :html => { :multipart => true } do |form| += semantic_form_for @content, :as => :content, :url => contents_url(@content_type.slug), :html => { :multipart => true } do |form| = render 'form', :f => form diff --git a/app/views/locomotive/cross_domain_sessions/new.html.haml b/app/views/locomotive/cross_domain_sessions/new.html.haml index 650cc29f..36ad2e8e 100644 --- a/app/views/locomotive/cross_domain_sessions/new.html.haml +++ b/app/views/locomotive/cross_domain_sessions/new.html.haml @@ -1,6 +1,6 @@ - title t('.title') -= form_tag locomotive_cross_domain_sessions_url(:host => @target, :port => request.port), :method => 'post' do += form_tag cross_domain_sessions_url(:host => @target, :port => request.port), :method => 'post' do = hidden_field_tag 'token', current_account.switch_site_token diff --git a/app/views/locomotive/current_site/_form.html.haml b/app/views/locomotive/current_site/_form.html.haml index 0e4bbb94..0eb8d5f4 100644 --- a/app/views/locomotive/current_site/_form.html.haml +++ b/app/views/locomotive/current_site/_form.html.haml @@ -64,7 +64,7 @@ = fm.select :role, (Ability::ROLES - ['admin']).map { |r| [t("locomotive.memberships.roles.#{r}"), r] }, :include_blank => false %span.actions - = link_to image_tag('admin/form/icons/trash.png'), locomotive_membership_url(membership), :class => 'remove first', :confirm =>t('locomotive.messages.confirm'), :method => :delete + = link_to image_tag('admin/form/icons/trash.png'), membership_url(membership), :class => 'remove first', :confirm =>t('locomotive.messages.confirm'), :method => :delete - else .role diff --git a/app/views/locomotive/current_site/edit.html.haml b/app/views/locomotive/current_site/edit.html.haml index dd217f49..ac7d78f3 100644 --- a/app/views/locomotive/current_site/edit.html.haml +++ b/app/views/locomotive/current_site/edit.html.haml @@ -5,14 +5,14 @@ - content_for :buttons do - if can?(:manage, @site) - = admin_button_tag :export, new_locomotive_export_url, :class => 'new' - = admin_button_tag :import, new_locomotive_import_url, :class => 'new' + = admin_button_tag :export, new_export_url, :class => 'new' + = admin_button_tag :import, new_import_url, :class => 'new' - if can?(:create, Account) - = admin_button_tag t('.new_membership'), new_locomotive_membership_url, :class => 'new' + = admin_button_tag t('.new_membership'), new_membership_url, :class => 'new' %p!= t('.help') -= semantic_form_for @site, :url => locomotive_current_site_url, :html => { :class => 'save-with-shortcut' } do |f| += semantic_form_for @site, :url => current_site_url, :html => { :class => 'save-with-shortcut' } do |f| = render 'form', :f => f diff --git a/app/views/locomotive/custom_fields/edit_category.html.haml b/app/views/locomotive/custom_fields/edit_category.html.haml index 78607a90..dbf5a3d4 100644 --- a/app/views/locomotive/custom_fields/edit_category.html.haml +++ b/app/views/locomotive/custom_fields/edit_category.html.haml @@ -4,7 +4,7 @@ %p!= t('.help') - = semantic_form_for @field, :as => :custom_field, :url => locomotive_custom_field_url(@parent.class.model_name.underscore, @parent.slug, @field) do |f| + = semantic_form_for @field, :as => :custom_field, :url => custom_field_url(@parent.class.model_name.underscore, @parent.slug, @field) do |f| = f.foldable_inputs :name => t('.collection_label'), :class => 'editable-list off' diff --git a/app/views/locomotive/errors/404.html.haml b/app/views/locomotive/errors/404.html.haml index 177fc519..6bc67e02 100644 --- a/app/views/locomotive/errors/404.html.haml +++ b/app/views/locomotive/errors/404.html.haml @@ -4,4 +4,4 @@ %p.notice= t('.notice') %p.link.tright - = link_to preserve(t('.link')), locomotive_pages_url + = link_to preserve(t('.link')), pages_url diff --git a/app/views/locomotive/errors/500.html.haml b/app/views/locomotive/errors/500.html.haml index d7482a0c..08e5a019 100644 --- a/app/views/locomotive/errors/500.html.haml +++ b/app/views/locomotive/errors/500.html.haml @@ -4,4 +4,4 @@ %p.notice= t('.notice') %p.link.tright - = link_to preserve(t('.link')), locomotive_pages_url \ No newline at end of file + = link_to preserve(t('.link')), pages_url \ No newline at end of file diff --git a/app/views/locomotive/import/new.html.haml b/app/views/locomotive/import/new.html.haml index 3aad3bb7..95f369f6 100644 --- a/app/views/locomotive/import/new.html.haml +++ b/app/views/locomotive/import/new.html.haml @@ -5,7 +5,7 @@ %p!= t('.help') -= form_tag locomotive_import_url, :multipart => true, :class => 'formtastic import' do += form_tag import_url, :multipart => true, :class => 'formtastic import' do %fieldset.inputs %legend diff --git a/app/views/locomotive/import/show.html.haml b/app/views/locomotive/import/show.html.haml index c9c4a17f..e1e0148a 100644 --- a/app/views/locomotive/import/show.html.haml +++ b/app/views/locomotive/import/show.html.haml @@ -8,7 +8,7 @@ %p!= t('.help') -%ul{ :id => 'import-steps', :class => 'list', :'data-url' => locomotive_import_url(:json), :'data-success-message' => t('.messages.success'), :'data-failure-message' => t('.messages.failure') } +%ul{ :id => 'import-steps', :class => 'list', :'data-url' => import_url(:json), :'data-success-message' => t('.messages.success'), :'data-failure-message' => t('.messages.failure') } - %w(site content_types assets snippets pages).each do |step| %li{ :id => "#{step}-step" } %em diff --git a/app/views/locomotive/installation/step_1.html.haml b/app/views/locomotive/installation/step_1.html.haml index a25fc471..094de877 100644 --- a/app/views/locomotive/installation/step_1.html.haml +++ b/app/views/locomotive/installation/step_1.html.haml @@ -7,7 +7,7 @@ = include_stylesheets :installation - if @step_done.blank? - = semantic_form_for(@account, :url => locomotive_installation_step_url(1)) do |f| + = semantic_form_for(@account, :url => installation_step_url(1)) do |f| .inner = f.inputs do = f.input :name, :label => t('.name'), :required => false diff --git a/app/views/locomotive/installation/step_2.html.haml b/app/views/locomotive/installation/step_2.html.haml index 1c13700b..57cfcb8b 100644 --- a/app/views/locomotive/installation/step_2.html.haml +++ b/app/views/locomotive/installation/step_2.html.haml @@ -7,7 +7,7 @@ = include_stylesheets :installation = include_javascripts :installation -= semantic_form_for(@site, :url => locomotive_installation_step_url(2), :html => { :multipart => true }) do |f| += semantic_form_for(@site, :url => installation_step_url(2), :html => { :multipart => true }) do |f| .inner %p.explanations diff --git a/app/views/locomotive/mailer/reset_password_instructions.html.haml b/app/views/locomotive/mailer/reset_password_instructions.html.haml index 3c06c016..7c375880 100644 --- a/app/views/locomotive/mailer/reset_password_instructions.html.haml +++ b/app/views/locomotive/mailer/reset_password_instructions.html.haml @@ -5,7 +5,7 @@ %p != t('.reset_password_instruction') %p - = link_to t('.change_my_password'), edit_locomotive_password_url(@resource, :reset_password_token => @resource.reset_password_token) + = link_to t('.change_my_password'), edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %p != t('.wrong_request_instruction') %p diff --git a/app/views/locomotive/memberships/new.html.haml b/app/views/locomotive/memberships/new.html.haml index 559c8de2..cbc849c4 100644 --- a/app/views/locomotive/memberships/new.html.haml +++ b/app/views/locomotive/memberships/new.html.haml @@ -5,11 +5,11 @@ %p!= t('.help') -= semantic_form_for @membership, :url => locomotive_memberships_url do |f| += semantic_form_for @membership, :url => memberships_url do |f| = f.inputs :name => :membership_email, :class => 'inputs email' do = f.custom_input :email, { :css => 'string full', :with_label => false } do = f.text_field :email - = render 'admin/shared/form_actions', :back_url => edit_locomotive_current_site_url, :button_label => :create \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => edit_current_site_url, :button_label => :create \ No newline at end of file diff --git a/app/views/locomotive/my_account/edit.html.haml b/app/views/locomotive/my_account/edit.html.haml index f320ecc9..42acaaba 100644 --- a/app/views/locomotive/my_account/edit.html.haml +++ b/app/views/locomotive/my_account/edit.html.haml @@ -8,11 +8,11 @@ - if multi_sites? - content_for :buttons do - = admin_button_tag t('.new_site'), new_locomotive_site_url, :class => 'new' if can?(:create, Site) + = admin_button_tag t('.new_site'), new_site_url, :class => 'new' if can?(:create, Site) %p= t('.help') -= semantic_form_for @account, :as => :my_account, :url => locomotive_my_account_url, :html => { :class => 'save-with-shortcut' } do |f| += semantic_form_for @account, :as => :my_account, :url => my_account_url, :html => { :class => 'save-with-shortcut' } do |f| = f.foldable_inputs :name => :information, :style => 'display: none' do = f.input :name @@ -31,7 +31,7 @@ - if admin_on?(site) && site != current_site %span{ :class => 'actions' } - = link_to image_tag('admin/form/icons/trash.png'), locomotive_site_url(site), :class => 'remove first', :confirm => t('locomotive.messages.confirm'), :method => :delete + = link_to image_tag('admin/form/icons/trash.png'), site_url(site), :class => 'remove first', :confirm => t('locomotive.messages.confirm'), :method => :delete = f.foldable_inputs :name => :language, :class => 'language' do = f.custom_input :language, { :css => 'full', :with_label => false } do diff --git a/app/views/locomotive/pages/_form.html.haml b/app/views/locomotive/pages/_form.html.haml index e6851877..f00efc29 100644 --- a/app/views/locomotive/pages/_form.html.haml +++ b/app/views/locomotive/pages/_form.html.haml @@ -11,7 +11,7 @@ - if not @page.index? and not @page.not_found? = f.input :parent_id, :as => :select, :collection => parent_pages_options, :include_blank => false - = f.input :slug, :required => false, :hint => @page.slug.blank? ? ' ' : page_url(@page), :input_html => { :'data-url' => get_path_locomotive_pages_url, :disabled => @page.index? || @page.not_found? }, :wrapper_html => { :style => "#{'display: none' if @page.templatized?};" } + = f.input :slug, :required => false, :hint => @page.slug.blank? ? ' ' : page_url(@page), :input_html => { :'data-url' => get_path_pages_url, :disabled => @page.index? || @page.not_found? }, :wrapper_html => { :style => "#{'display: none' if @page.templatized?};" } = render 'editable_elements', :page => @page diff --git a/app/views/locomotive/pages/_page.html.haml b/app/views/locomotive/pages/_page.html.haml index 80fd3fdd..f252bf9c 100644 --- a/app/views/locomotive/pages/_page.html.haml +++ b/app/views/locomotive/pages/_page.html.haml @@ -8,16 +8,16 @@ = admin_item_toggler(page) %em - %strong= link_to truncate(page.title, :length => 80), edit_locomotive_page_url(page) + %strong= link_to truncate(page.title, :length => 80), edit_page_url(page) .more %span!= t('.updated_at') = l page.updated_at, :format => :short - if !page.index_or_not_found? && can?(:manage, page) - = link_to image_tag('admin/list/icons/trash.png'), locomotive_page_url(page), :class => 'remove', :confirm => t('locomotive.messages.confirm'), :method => :delete + = link_to image_tag('admin/list/icons/trash.png'), page_url(page), :class => 'remove', :confirm => t('locomotive.messages.confirm'), :method => :delete - if with_children - %ul{ :id => "folder-#{page._id}", :class => "folder depth-#{(page.depth || 0) + 1}", :'data-url' => sort_locomotive_page_url(page), :style => "display: #{cookies["folder-#{page._id}"] || 'block'}" } + %ul{ :id => "folder-#{page._id}", :class => "folder depth-#{(page.depth || 0) + 1}", :'data-url' => sort_page_url(page), :style => "display: #{cookies["folder-#{page._id}"] || 'block'}" } = render children \ No newline at end of file diff --git a/app/views/locomotive/pages/edit.html.haml b/app/views/locomotive/pages/edit.html.haml index 7a1d11a2..37d54080 100644 --- a/app/views/locomotive/pages/edit.html.haml +++ b/app/views/locomotive/pages/edit.html.haml @@ -11,8 +11,8 @@ %p!= t('.help') -= semantic_form_for @page, :url => locomotive_page_url(@page), :html => { :class => 'save-with-shortcut', :multipart => true } do |form| += semantic_form_for @page, :url => page_url(@page), :html => { :class => 'save-with-shortcut', :multipart => true } do |form| = render 'form', :f => form - = render 'admin/shared/form_actions', :back_url => locomotive_pages_url, :button_label => :update \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => pages_url, :button_label => :update \ No newline at end of file diff --git a/app/views/locomotive/pages/index.html.haml b/app/views/locomotive/pages/index.html.haml index be1b31d9..e357dc86 100644 --- a/app/views/locomotive/pages/index.html.haml +++ b/app/views/locomotive/pages/index.html.haml @@ -11,12 +11,12 @@ - if can? :create, Page - content_for :buttons do - = admin_button_tag :new, new_locomotive_page_url, :class => 'new', :id => 'newpage' + = admin_button_tag :new, new_page_url, :class => 'new', :id => 'newpage' %p!= t('.help') - if @pages.empty? - %p.no-items!= t('.no_items', :url => new_locomotive_page_url) + %p.no-items!= t('.no_items', :url => new_page_url) - else %ul#pages-list = render @pages diff --git a/app/views/locomotive/pages/new.html.haml b/app/views/locomotive/pages/new.html.haml index 1ff51308..4cc65b32 100644 --- a/app/views/locomotive/pages/new.html.haml +++ b/app/views/locomotive/pages/new.html.haml @@ -8,8 +8,8 @@ %p!= t('.help') -= semantic_form_for @page, :url => locomotive_pages_url do |form| += semantic_form_for @page, :url => pages_url do |form| = render 'form', :f => form - = render 'admin/shared/form_actions', :back_url => locomotive_pages_url, :button_label => :create \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => pages_url, :button_label => :create \ No newline at end of file diff --git a/app/views/locomotive/shared/_header.html.haml b/app/views/locomotive/shared/_header.html.haml index 00e0b4ee..66f3ff94 100644 --- a/app/views/locomotive/shared/_header.html.haml +++ b/app/views/locomotive/shared/_header.html.haml @@ -1,5 +1,5 @@ %h1 - = link_to current_site.name, locomotive_pages_url, :class => 'single' + = link_to current_site.name, pages_url, :class => 'single' = render_cell 'admin/global_actions', :show, :current_account => current_account, :current_site_url => current_site_url @@ -9,8 +9,8 @@ - current_account.sites.each do |site| - unless current_site._id == site._id %li - = link_to site.name, new_locomotive_cross_domain_session_url(:target_id => site._id) + = link_to site.name, new_cross_domain_session_url(:target_id => site._id) - if can?(:manage, Site) %p.action - = link_to t('locomotive.sites_picker.new'), new_locomotive_site_url \ No newline at end of file + = link_to t('locomotive.sites_picker.new'), new_site_url \ No newline at end of file diff --git a/app/views/locomotive/shared/actions/_contents.html.haml b/app/views/locomotive/shared/actions/_contents.html.haml index 3fd24d4e..06144617 100644 --- a/app/views/locomotive/shared/actions/_contents.html.haml +++ b/app/views/locomotive/shared/actions/_contents.html.haml @@ -1,2 +1,2 @@ - if can? :manage, ContentType - = link_to content_tag(:em) + content_tag(:span, t('locomotive.content_types.index.new')), new_locomotive_content_type_url \ No newline at end of file + = link_to content_tag(:em) + content_tag(:span, t('locomotive.content_types.index.new')), new_content_type_url \ No newline at end of file diff --git a/app/views/locomotive/shared/menu/_contents.html.haml b/app/views/locomotive/shared/menu/_contents.html.haml index 4aa35656..f75b46d4 100644 --- a/app/views/locomotive/shared/menu/_contents.html.haml +++ b/app/views/locomotive/shared/menu/_contents.html.haml @@ -1,21 +1,21 @@ -= admin_content_menu_item 'pages', locomotive_pages_url do += admin_content_menu_item 'pages', pages_url do - if can? :manage, @page .header - %p= link_to t('locomotive.pages.index.new'), new_locomotive_page_url + %p= link_to t('locomotive.pages.index.new'), new_page_url .inner %h2!= t('locomotive.pages.index.lastest_items') %ul - current_site.pages.latest_updated.minimal_attributes.each do |page| %li - = link_to truncate(page.title, :length => 25), edit_locomotive_page_url(page) + = link_to truncate(page.title, :length => 25), edit_page_url(page) %span= time_ago_in_words(page.updated_at) - each_content_type_menu_item do |content_type| .header - %p= link_to t('locomotive.contents.index.new'), new_locomotive_content_url(content_type.slug) + %p= link_to t('locomotive.contents.index.new'), new_content_url(content_type.slug) - if can? :manage, content_type - %p.edit= link_to t('locomotive.contents.index.edit'), edit_locomotive_content_type_url(content_type) + %p.edit= link_to t('locomotive.contents.index.edit'), edit_content_type_url(content_type) .inner %h2!= t('locomotive.contents.index.lastest_items') @@ -30,4 +30,4 @@ %ul.big-links - content_types.each do |content_type| %li - = link_to truncate(content_type.name, :length => 20), locomotive_contents_url(content_type.slug) \ No newline at end of file + = link_to truncate(content_type.name, :length => 20), contents_url(content_type.slug) \ No newline at end of file diff --git a/app/views/locomotive/snippets/edit.html.haml b/app/views/locomotive/snippets/edit.html.haml index 79856448..2d8d0a06 100644 --- a/app/views/locomotive/snippets/edit.html.haml +++ b/app/views/locomotive/snippets/edit.html.haml @@ -4,12 +4,12 @@ = render_cell 'admin/settings_menu', :show - content_for :buttons do - = admin_button_tag t('locomotive.snippets.index.new'), new_locomotive_snippet_url, :class => 'new' + = admin_button_tag t('locomotive.snippets.index.new'), new_snippet_url, :class => 'new' %p!= t('.help', :slug => @snippet.slug) -= semantic_form_for @snippet, :url => locomotive_snippet_url(@snippet), :html => { :class => 'save-with-shortcut' } do |form| += semantic_form_for @snippet, :url => snippet_url(@snippet), :html => { :class => 'save-with-shortcut' } do |form| = render 'form', :f => form - = render 'admin/shared/form_actions', :back_url => locomotive_theme_assets_url, :button_label => :update \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => theme_assets_url, :button_label => :update \ No newline at end of file diff --git a/app/views/locomotive/snippets/new.html.haml b/app/views/locomotive/snippets/new.html.haml index 4945bc9c..b8852d2f 100644 --- a/app/views/locomotive/snippets/new.html.haml +++ b/app/views/locomotive/snippets/new.html.haml @@ -5,8 +5,8 @@ %p!= t('.help') -= semantic_form_for @snippet, :url => locomotive_snippets_url do |form| += semantic_form_for @snippet, :url => snippets_url do |form| = render 'form', :f => form - = render 'admin/shared/form_actions', :back_url => locomotive_theme_assets_url, :button_label => :create \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => theme_assets_url, :button_label => :create \ No newline at end of file diff --git a/app/views/locomotive/theme_assets/edit.html.haml b/app/views/locomotive/theme_assets/edit.html.haml index 73dbce3b..91314bed 100644 --- a/app/views/locomotive/theme_assets/edit.html.haml +++ b/app/views/locomotive/theme_assets/edit.html.haml @@ -5,7 +5,7 @@ - if can?(:manage, ThemeAsset) - content_for :buttons do - = admin_button_tag t('locomotive.theme_assets.index.new'), new_locomotive_theme_asset_url, :class => 'new' + = admin_button_tag t('locomotive.theme_assets.index.new'), new_theme_asset_url, :class => 'new' %p - if %w(image javascript stylesheet).include?(@theme_asset.content_type.to_s) @@ -14,8 +14,8 @@ != t('.help', :url => @theme_asset.source.url) -= semantic_form_for @theme_asset, :url => locomotive_theme_asset_url(@theme_asset), :html => { :multipart => true, :class => 'save-with-shortcut' } do |form| += semantic_form_for @theme_asset, :url => theme_asset_url(@theme_asset), :html => { :multipart => true, :class => 'save-with-shortcut' } do |form| = render 'form', :f => form - = render 'admin/shared/form_actions', :back_url => locomotive_theme_assets_url, :button_label => :update \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => theme_assets_url, :button_label => :update \ No newline at end of file diff --git a/app/views/locomotive/theme_assets/images.html.haml b/app/views/locomotive/theme_assets/images.html.haml index e1d8f776..879f8447 100644 --- a/app/views/locomotive/theme_assets/images.html.haml +++ b/app/views/locomotive/theme_assets/images.html.haml @@ -2,7 +2,7 @@ %h2!= t('.title') .actions - = admin_button_tag t('locomotive.theme_assets.index.new'), locomotive_theme_assets_url(:json), :class => 'button small add', :id => 'upload-link' + = admin_button_tag t('locomotive.theme_assets.index.new'), theme_assets_url(:json), :class => 'button small add', :id => 'upload-link' - if @images.empty? %p.no-items!= t('.no_items') diff --git a/app/views/locomotive/theme_assets/index.html.haml b/app/views/locomotive/theme_assets/index.html.haml index f3af8b74..c434fd5c 100644 --- a/app/views/locomotive/theme_assets/index.html.haml +++ b/app/views/locomotive/theme_assets/index.html.haml @@ -4,15 +4,15 @@ = render_cell 'admin/settings_menu', :show - content_for :buttons do - = admin_button_tag t('locomotive.snippets.index.new'), new_locomotive_snippet_url, :class => 'new' if can?(:manage, Snippet) - = admin_button_tag :new, new_locomotive_theme_asset_url, :class => 'new' if can?(:manage, ThemeAsset) + = admin_button_tag t('locomotive.snippets.index.new'), new_snippet_url, :class => 'new' if can?(:manage, Snippet) + = admin_button_tag :new, new_theme_asset_url, :class => 'new' if can?(:manage, ThemeAsset) %p!= t('.help') - if can?(:manage, Snippet) %h3!= t('.snippets') - if @snippets.empty? - %p.no-items!= t('locomotive.snippets.index.no_items', :url => new_locomotive_snippet_url) + %p.no-items!= t('locomotive.snippets.index.no_items', :url => new_snippet_url) - else %ul.list.theme-assets = render @snippets @@ -22,7 +22,7 @@ - if can?(:manage, ThemeAsset) %h3!= t('.css_and_js') - if @js_and_css_assets.empty? - %p.no-items!= t('.no_items', :url => new_locomotive_theme_asset_url) + %p.no-items!= t('.no_items', :url => new_theme_asset_url) - else %ul.list.theme-assets = render :partial => 'asset', :collection => @js_and_css_assets @@ -31,7 +31,7 @@ %h3!= t('.images') - if @assets[:images].nil? - %p.no-items!= t('.no_items', :url => new_locomotive_theme_asset_url) + %p.no-items!= t('.no_items', :url => new_theme_asset_url) - else %ul.list.theme-assets = render :partial => 'asset', :collection => @assets[:images] diff --git a/app/views/locomotive/theme_assets/new.html.haml b/app/views/locomotive/theme_assets/new.html.haml index f42cb9bd..cb53127f 100644 --- a/app/views/locomotive/theme_assets/new.html.haml +++ b/app/views/locomotive/theme_assets/new.html.haml @@ -5,8 +5,8 @@ %p!= t('.help') -= semantic_form_for @theme_asset, :url => locomotive_theme_assets_url, :html => { :multipart => true } do |form| += semantic_form_for @theme_asset, :url => theme_assets_url, :html => { :multipart => true } do |form| = render 'form', :f => form - = render 'admin/shared/form_actions', :back_url => locomotive_theme_assets_url, :button_label => :create \ No newline at end of file + = render 'admin/shared/form_actions', :back_url => theme_assets_url, :button_label => :create \ No newline at end of file diff --git a/doc/upgrade_to_rails_3.1.txt b/doc/upgrade_to_rails_3.1.txt index c80162d7..2a821f17 100644 --- a/doc/upgrade_to_rails_3.1.txt +++ b/doc/upgrade_to_rails_3.1.txt @@ -2,3 +2,14 @@ -> script to change images/ in the url to assets/ + +- documentation: + - http://edgeapi.rubyonrails.org/classes/Rails/Engine.html + - http://guides.rubyonrails.org/configuring.html + - https://github.com/asee/mixable_engines + - http://stackoverflow.com/questions/2964050/rails-engines-extending-functionality + - http://dmathieu.com/fr/rails/introduction-aux-rails-engines + - https://github.com/radar/forem + - https://github.com/sferik/rails_admin + - http://railscasts.com/episodes/277-mountable-engines?view=comments + diff --git a/lib/locomotive/engine.rb b/lib/locomotive/engine.rb index 39054d30..ee82f609 100644 --- a/lib/locomotive/engine.rb +++ b/lib/locomotive/engine.rb @@ -30,6 +30,8 @@ $:.unshift File.dirname(__FILE__) module Locomotive class Engine < Rails::Engine + isolate_namespace Locomotive + config.autoload_once_paths += %W( #{config.root}/app/controllers #{config.root}/app/models #{config.root}/app/helpers #{config.root}/app/uploaders) # initializer 'locomotive.load_controllers_and_models' do |app| diff --git a/lib/locomotive/liquid/drops/contents.rb b/lib/locomotive/liquid/drops/contents.rb index bfe8ad7a..2f590ce1 100644 --- a/lib/locomotive/liquid/drops/contents.rb +++ b/lib/locomotive/liquid/drops/contents.rb @@ -48,7 +48,7 @@ module Locomotive end def api - { 'create' => @context.registers[:controller].send('locomotive_api_contents_url', @content_type.slug) } + { 'create' => @context.registers[:controller].send('api_contents_url', @content_type.slug) } end def before_method(meth) diff --git a/lib/locomotive/liquid/tags/inline_editor.rb b/lib/locomotive/liquid/tags/inline_editor.rb index 159ce289..23968be2 100644 --- a/lib/locomotive/liquid/tags/inline_editor.rb +++ b/lib/locomotive/liquid/tags/inline_editor.rb @@ -8,14 +8,14 @@ module Liquid output = %{ - + } if context.registers[:inline_editor] controller = context.registers[:controller] output << %{ - + diff --git a/lib/locomotive/routing/site_dispatcher.rb b/lib/locomotive/routing/site_dispatcher.rb index 65c0d8ca..cf30712d 100644 --- a/lib/locomotive/routing/site_dispatcher.rb +++ b/lib/locomotive/routing/site_dispatcher.rb @@ -33,7 +33,7 @@ module Locomotive def require_site return true if current_site - redirect_to locomotive_installation_url and return false if Account.count == 0 || Site.count == 0 + redirect_to installation_url and return false if Account.count == 0 || Site.count == 0 render_no_site_error and return false end @@ -47,7 +47,7 @@ module Locomotive sign_out(current_account) flash[:alert] = I18n.t(:no_membership, :scope => [:devise, :failure, :locomotive]) - redirect_to new_locomotive_session_url and return false + redirect_to new_session_url and return false end end diff --git a/spec/dummy/log/development.log b/spec/dummy/log/development.log index 648355da..630b1e77 100644 --- a/spec/dummy/log/development.log +++ b/spec/dummy/log/development.log @@ -39,7 +39,7 @@ MONGODB locomotive_engine_dev['$cmd'].find({:create=>"locomotive_accounts"}).lim MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 89ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) @@ -56,7 +56,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 96ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) @@ -74,7 +74,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 32ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms) @@ -92,7 +92,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 96ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) @@ -110,7 +110,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 54ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms) @@ -127,7 +127,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 98ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) @@ -147,7 +147,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 33ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.8ms) @@ -173,7 +173,7 @@ MONGODB locomotive_engine_dev['system.namespaces'].find({}) MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 148ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms) @@ -191,7 +191,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 31ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms) @@ -209,7 +209,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 30ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) @@ -227,7 +227,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 35ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) @@ -245,7 +245,7 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 38ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms) @@ -263,9 +263,200 @@ MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) Completed 500 Internal Server Error in 96ms -NameError (undefined local variable or method `locomotive_installation_url' for #): +NameError (undefined local variable or method `installation_url' for #): Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms) Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (4.2ms) +MongoDB logging. Please note that logging negatively impacts performance and should be disabled for high-performance production apps. +MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1) + + +Started GET "/" for 127.0.0.1 at 2011-10-31 20:36:37 +0100 + Processing by Locomotive::RenderingController#show as HTML +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['system.namespaces'].find({}) +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['system.namespaces'].find({}) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}).limit(-1) +Redirected to http://localhost:8080/locomotive/installation +Completed 302 Found in 226ms + + +Started GET "/locomotive/installation" for 127.0.0.1 at 2011-10-31 20:36:37 +0100 + Processing by Locomotive::InstallationController#show as HTML + Parameters: {"step"=>1} +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).limit(-1).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['locomotive_accounts'].find({}).limit(-1).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_sites", "query"=>{}, "fields"=>nil}).limit(-1) +Rendered /Users/didier/Desktop/NoCoffee/LocomotiveCMS/engine/app/views/locomotive/installation/step_1.html.haml within /locomotive/layouts/box (406.2ms) +Completed 500 Internal Server Error in 527ms + +ActionView::Template::Error (undefined method `include_stylesheets' for #<#:0x00000107271ef8>): + 4: - title t('.title') + 5: + 6: - content_for :head do + 7: = include_stylesheets :installation + 8: + 9: - if @step_done.blank? + 10: = semantic_form_for(@account, :url => installation_step_url(1)) do |f| + + +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.6ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (5.6ms) +MongoDB logging. Please note that logging negatively impacts performance and should be disabled for high-performance production apps. +MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1) +MongoDB logging. Please note that logging negatively impacts performance and should be disabled for high-performance production apps. +MONGODB admin['$cmd'].find({:ismaster=>1}) +MONGODB admin['$cmd'].find({:ismaster=>1}) +DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from acts_as_tree at /Users/didier/Desktop/NoCoffee/LocomotiveCMS/gems/acts_as_tree/lib/mongoid_acts_as_tree.rb:21) +MONGODB locomotive_engine_dev['system.namespaces'].find({}) +MONGODB locomotive_engine_dev['locomotive_pages'].find({}).sort([[:_id, :asc]]) +MongoDB logging. Please note that logging negatively impacts performance and should be disabled for high-performance production apps. +MONGODB admin['$cmd'].find({:ismaster=>1}) +MONGODB admin['$cmd'].find({:ismaster=>1}) +DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from acts_as_tree at /Users/didier/Desktop/NoCoffee/LocomotiveCMS/gems/acts_as_tree/lib/mongoid_acts_as_tree.rb:21) +MONGODB locomotive_engine_dev['system.namespaces'].find({}) +MONGODB locomotive_engine_dev['locomotive_pages'].find({}).sort([[:_id, :asc]]) +MongoDB logging. Please note that logging negatively impacts performance and should be disabled for high-performance production apps. +MONGODB admin['$cmd'].find({:ismaster=>1}) +MONGODB admin['$cmd'].find({:ismaster=>1}) + + +Started GET "/" for 127.0.0.1 at 2011-11-01 00:41:45 +0100 + Processing by Locomotive::RenderingController#show as HTML +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['system.namespaces'].find({}) +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['system.namespaces'].find({}) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}) +Redirected to http://localhost:8080/locomotive/installation +Completed 302 Found in 30ms + + +Started GET "/locomotive/installation" for 127.0.0.1 at 2011-11-01 00:41:46 +0100 + Processing by Locomotive::InstallationController#show as HTML + Parameters: {"step"=>1} +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['locomotive_accounts'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_sites", "query"=>{}, "fields"=>nil}) +Rendered /Users/didier/Desktop/NoCoffee/LocomotiveCMS/engine/app/views/locomotive/installation/step_1.html.haml within /locomotive/layouts/box (250.6ms) +Completed 500 Internal Server Error in 440ms + +ActionView::Template::Error (undefined method `include_stylesheets' for #<#:0x000001049db228>): + 4: - title t('.title') + 5: + 6: - content_for :head do + 7: = include_stylesheets :installation + 8: + 9: - if @step_done.blank? + 10: = semantic_form_for(@account, :url => installation_step_url(1)) do |f| + + +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.6ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (4.9ms) + + +Started GET "/" for 127.0.0.1 at 2011-11-01 00:43:27 +0100 + Processing by Locomotive::RenderingController#show as HTML +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_accounts", "query"=>{}, "fields"=>nil}) +Redirected to http://localhost:8080/locomotive/installation +Completed 302 Found in 2ms + + +Started GET "/locomotive/installation" for 127.0.0.1 at 2011-11-01 00:43:27 +0100 + Processing by Locomotive::InstallationController#show as HTML + Parameters: {"step"=>1} +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['locomotive_accounts'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_sites", "query"=>{}, "fields"=>nil}) +Rendered /Users/didier/Desktop/NoCoffee/LocomotiveCMS/engine/app/views/locomotive/installation/step_1.html.haml within /locomotive/layouts/box (196.0ms) +Completed 500 Internal Server Error in 208ms + +ActionView::Template::Error (undefined method `include_stylesheets' for #<#:0x0000010434d280>): + 4: - title t('.title') + 5: + 6: - content_for :head do + 7: = include_stylesheets :installation + 8: + 9: - if @step_done.blank? + 10: = semantic_form_for(@account, :url => installation_step_url(1)) do |f| + + +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (4.3ms) + + +Started GET "/locomotive/installation" for 127.0.0.1 at 2011-11-01 00:43:29 +0100 + Processing by Locomotive::InstallationController#show as HTML + Parameters: {"step"=>1} +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['locomotive_accounts'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_sites", "query"=>{}, "fields"=>nil}) +Rendered /Users/didier/Desktop/NoCoffee/LocomotiveCMS/engine/app/views/locomotive/installation/step_1.html.haml within /locomotive/layouts/box (200.2ms) +Completed 500 Internal Server Error in 213ms + +ActionView::Template::Error (undefined method `include_stylesheets' for #<#:0x000001049a9db8>): + 4: - title t('.title') + 5: + 6: - content_for :head do + 7: = include_stylesheets :installation + 8: + 9: - if @step_done.blank? + 10: = semantic_form_for(@account, :url => installation_step_url(1)) do |f| + + +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (4.9ms) + + +Started GET "/locomotive/installation" for 127.0.0.1 at 2011-11-01 00:43:33 +0100 + Processing by Locomotive::InstallationController#show as HTML + Parameters: {"step"=>1} +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +[LocomotiveCMS] [fetch site] host = localhost / localhost:8080 +MONGODB locomotive_engine_dev['locomotive_sites'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['locomotive_accounts'].find({}).sort([[:_id, :asc]]) +MONGODB locomotive_engine_dev['$cmd'].find({"count"=>"locomotive_sites", "query"=>{}, "fields"=>nil}) +Rendered /Users/didier/Desktop/NoCoffee/LocomotiveCMS/engine/app/views/locomotive/installation/step_1.html.haml within /locomotive/layouts/box (200.1ms) +Completed 500 Internal Server Error in 213ms + +ActionView::Template::Error (undefined method `include_stylesheets' for #<#:0x00000104ac0490>): + 4: - title t('.title') + 5: + 6: - content_for :head do + 7: = include_stylesheets :installation + 8: + 9: - if @step_done.blank? + 10: = semantic_form_for(@account, :url => installation_step_url(1)) do |f| + + +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms) +Rendered /Users/didier/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (4.3ms) diff --git a/spec/lib/locomotive/routing/site_dispatcher_spec.rb b/spec/lib/locomotive/routing/site_dispatcher_spec.rb index 198755cf..7a83600d 100644 --- a/spec/lib/locomotive/routing/site_dispatcher_spec.rb +++ b/spec/lib/locomotive/routing/site_dispatcher_spec.rb @@ -84,7 +84,7 @@ describe Locomotive::Routing::SiteDispatcher do @controller.instance_variable_set('@_response', ActionDispatch::Response.new) @controller.expects(:current_site).returns(false) - @controller.stubs(:locomotive_installation_url).returns('/admin/install/url/') + @controller.stubs(:installation_url).returns('/admin/install/url/') @controller.stubs(:redirect_to).with('/admin/install/url/') end @@ -107,7 +107,7 @@ describe Locomotive::Routing::SiteDispatcher do @controller.instance_variable_set('@_response', ActionDispatch::Response.new) @controller.expects(:current_site).returns(false) - @controller.stubs(:locomotive_installation_url).returns('/admin/install/url/') + @controller.stubs(:installation_url).returns('/admin/install/url/') @controller.stubs(:redirect_to).with('/admin/install/url/') end @@ -165,7 +165,7 @@ describe Locomotive::Routing::SiteDispatcher do @controller.stubs(:request).returns(@request) @controller.stubs(:current_account).returns(@account) @controller.stubs(:sign_out).with(@account) - @controller.stubs(:new_locomotive_session_url).returns('/new/admin/session') + @controller.stubs(:new_session_url).returns('/new/admin/session') end context 'when a site is present' do