still got errors with dates display + admin default root points to signin
This commit is contained in:
parent
ff01539bb5
commit
3686496bb2
@ -4,4 +4,4 @@
|
|||||||
%p.notice= t('.notice')
|
%p.notice= t('.notice')
|
||||||
|
|
||||||
%p.link.tright
|
%p.link.tright
|
||||||
= link_to preserve(t('.link')), admin_root_url
|
= link_to preserve(t('.link')), admin_pages_url
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
%p.notice= t('.notice')
|
%p.notice= t('.notice')
|
||||||
|
|
||||||
%p.link.tright
|
%p.link.tright
|
||||||
= link_to preserve(t('.link')), admin_root_url
|
= link_to preserve(t('.link')), admin_pages_url
|
@ -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'
|
= 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'
|
= submit_tag 'Switch', :style => 'display: none'
|
||||||
- else
|
- else
|
||||||
= link_to current_site.name, admin_root_url, :class => 'single'
|
= link_to current_site.name, admin_pages_url, :class => 'single'
|
||||||
|
|
||||||
|
|
||||||
#global-actions-bar
|
#global-actions-bar
|
||||||
|
@ -8,9 +8,13 @@ Rails.application.routes.draw do
|
|||||||
# admin authentication
|
# admin authentication
|
||||||
devise_for :admin, :class_name => 'Account', :controllers => { :sessions => 'admin/sessions', :passwords => 'admin/passwords' }
|
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
|
# admin interface for each website
|
||||||
namespace 'admin' do
|
namespace 'admin' do
|
||||||
root :to => 'pages#index'
|
root :to => 'sessions#new'
|
||||||
|
|
||||||
resources :pages do
|
resources :pages do
|
||||||
put :sort, :on => :member
|
put :sort, :on => :member
|
||||||
|
@ -4,13 +4,17 @@ module Locomotive
|
|||||||
module Date
|
module Date
|
||||||
|
|
||||||
def localized_date(input, *args)
|
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?
|
return input.to_s if format.to_s.empty?
|
||||||
|
|
||||||
if input.is_a?(String)
|
if input.is_a?(String)
|
||||||
fragments = ::Date._strptime(input, I18n.t('date.formats.default'))
|
begin
|
||||||
date = ::Date.new(fragments[:year], fragments[:mon], fragments[:mday])
|
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
|
else
|
||||||
date = input
|
date = input
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user