diff --git a/app/views/admin/errors/404.html.haml b/app/views/admin/errors/404.html.haml index 5dcff399..6dad8500 100644 --- a/app/views/admin/errors/404.html.haml +++ b/app/views/admin/errors/404.html.haml @@ -4,4 +4,4 @@ %p.notice= t('.notice') %p.link.tright - = link_to preserve(t('.link')), admin_root_url + = link_to preserve(t('.link')), admin_pages_url diff --git a/app/views/admin/errors/500.html.haml b/app/views/admin/errors/500.html.haml index a9ac681b..4055d2fd 100644 --- a/app/views/admin/errors/500.html.haml +++ b/app/views/admin/errors/500.html.haml @@ -4,4 +4,4 @@ %p.notice= t('.notice') %p.link.tright - = link_to preserve(t('.link')), admin_root_url \ No newline at end of file + = link_to preserve(t('.link')), admin_pages_url \ No newline at end of file diff --git a/app/views/admin/shared/_header.html.haml b/app/views/admin/shared/_header.html.haml index 31ec52d5..ff38a234 100644 --- a/app/views/admin/shared/_header.html.haml +++ b/app/views/admin/shared/_header.html.haml @@ -4,7 +4,7 @@ = select_tag 'target_id', options_for_select(current_admin.sites.collect { |site| [truncate(site.name, :length => 32), site.id] }, current_site.id), :id => 'site-selector' = submit_tag 'Switch', :style => 'display: none' - else - = link_to current_site.name, admin_root_url, :class => 'single' + = link_to current_site.name, admin_pages_url, :class => 'single' #global-actions-bar diff --git a/config/routes.rb b/config/routes.rb index 70fb1f30..ad7bf786 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,9 +8,13 @@ Rails.application.routes.draw do # admin authentication devise_for :admin, :class_name => 'Account', :controllers => { :sessions => 'admin/sessions', :passwords => 'admin/passwords' } + as :admin do + get '/admin' => 'admin/sessions#new' + end + # admin interface for each website namespace 'admin' do - root :to => 'pages#index' + root :to => 'sessions#new' resources :pages do put :sort, :on => :member diff --git a/lib/locomotive/liquid/filters/date.rb b/lib/locomotive/liquid/filters/date.rb index d9ec339b..d4df5df0 100644 --- a/lib/locomotive/liquid/filters/date.rb +++ b/lib/locomotive/liquid/filters/date.rb @@ -4,13 +4,17 @@ module Locomotive module Date def localized_date(input, *args) - format, locale = args[0], args[1] || 'en' + format, locale = args[0], args[1] rescue 'en' return input.to_s if format.to_s.empty? if input.is_a?(String) - fragments = ::Date._strptime(input, I18n.t('date.formats.default')) - date = ::Date.new(fragments[:year], fragments[:mon], fragments[:mday]) + begin + fragments = ::Date._strptime(input, I18n.t('date.formats.default')) + date = ::Date.new(fragments[:year], fragments[:mon], fragments[:mday]) + rescue + date = Time.parse(input) + end else date = input end