still got errors with dates display + admin default root points to signin

This commit is contained in:
dinedine 2011-01-11 12:42:12 +01:00
parent ff01539bb5
commit 3686496bb2
5 changed files with 15 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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