Meilleure gestion des traductions pour les dates
This commit is contained in:
parent
665fc69b14
commit
c31ed7e0a2
10
Gemfile.lock
10
Gemfile.lock
@ -1,6 +1,6 @@
|
|||||||
GIT
|
GIT
|
||||||
remote: git://github.com/gregbell/active_admin.git
|
remote: git://github.com/gregbell/active_admin.git
|
||||||
revision: 35f2f8a934fe3fc3f35bac9d7e8b624d9236e04d
|
revision: 83059dc2894b7d887cb1a6061fbde741bd4d1854
|
||||||
specs:
|
specs:
|
||||||
activeadmin (1.0.0.pre)
|
activeadmin (1.0.0.pre)
|
||||||
arbre (~> 1.0, >= 1.0.2)
|
arbre (~> 1.0, >= 1.0.2)
|
||||||
@ -133,7 +133,7 @@ GEM
|
|||||||
em-websocket (~> 0.5)
|
em-websocket (~> 0.5)
|
||||||
guard (~> 2.0)
|
guard (~> 2.0)
|
||||||
multi_json (~> 1.8)
|
multi_json (~> 1.8)
|
||||||
guard-minitest (2.3.1)
|
guard-minitest (2.3.2)
|
||||||
guard (~> 2.0)
|
guard (~> 2.0)
|
||||||
minitest (>= 3.0)
|
minitest (>= 3.0)
|
||||||
guard-rubocop (1.1.0)
|
guard-rubocop (1.1.0)
|
||||||
@ -193,7 +193,7 @@ GEM
|
|||||||
parser (2.2.0.pre.4)
|
parser (2.2.0.pre.4)
|
||||||
ast (>= 1.1, < 3.0)
|
ast (>= 1.1, < 3.0)
|
||||||
slop (~> 3.4, >= 3.4.5)
|
slop (~> 3.4, >= 3.4.5)
|
||||||
polyamorous (1.0.0)
|
polyamorous (1.1.0)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
polyglot (0.3.5)
|
polyglot (0.3.5)
|
||||||
powerpack (0.0.9)
|
powerpack (0.0.9)
|
||||||
@ -226,12 +226,12 @@ GEM
|
|||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rainbow (2.0.0)
|
rainbow (2.0.0)
|
||||||
rake (10.3.2)
|
rake (10.3.2)
|
||||||
ransack (1.2.3)
|
ransack (1.3.0)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
i18n
|
i18n
|
||||||
polyamorous (~> 1.0.0)
|
polyamorous (~> 1.1)
|
||||||
rb-fsevent (0.9.4)
|
rb-fsevent (0.9.4)
|
||||||
rb-inotify (0.9.5)
|
rb-inotify (0.9.5)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
|
@ -11,7 +11,12 @@ header.calendar-header
|
|||||||
|
|
||||||
.city:after
|
.city:after
|
||||||
content: ':'
|
content: ':'
|
||||||
margin-right: -1px
|
|
||||||
|
p.full_address
|
||||||
|
span:after
|
||||||
|
content: ','
|
||||||
|
span:last-child:after
|
||||||
|
content: ''
|
||||||
|
|
||||||
body.events.index table
|
body.events.index table
|
||||||
width: 90%
|
width: 90%
|
||||||
|
@ -24,6 +24,19 @@ module EventsHelper
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def display_date(event = @event)
|
||||||
|
if event.same_day?
|
||||||
|
t 'date.formats.same_day',
|
||||||
|
date: l(event.start_time.to_date, format: :long),
|
||||||
|
start: l(event.start_time, format: :hours),
|
||||||
|
end: l(event.end_time, format: :hours)
|
||||||
|
else
|
||||||
|
t 'date.formats.period',
|
||||||
|
start: l(event.start_time, format: :at),
|
||||||
|
end: l(event.end_time, format: :at)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def wrap(s, width = 78)
|
def wrap(s, width = 78)
|
||||||
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
|
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
|
||||||
end
|
end
|
||||||
|
@ -34,7 +34,7 @@ xml.rdf :RDF,
|
|||||||
xml.item 'rdf:about' => event_url(event) do
|
xml.item 'rdf:about' => event_url(event) do
|
||||||
title = event.city
|
title = event.city
|
||||||
title += ": #{event.title}"
|
title += ": #{event.title}"
|
||||||
xml.title title + ", le #{l event.start_time.to_date, format: :long}"
|
xml.title title + ", #{l event.start_time.to_date, format: :long}"
|
||||||
xml.link event_url event
|
xml.link event_url event
|
||||||
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
|
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
|
||||||
xml.dc :identifier, "#{event.id}@#{domain}"
|
xml.dc :identifier, "#{event.id}@#{domain}"
|
||||||
|
@ -32,21 +32,13 @@
|
|||||||
|
|
||||||
%h3=t '.dateAndPlace'
|
%h3=t '.dateAndPlace'
|
||||||
|
|
||||||
%p
|
%p= display_date
|
||||||
- if @event.same_day?
|
|
||||||
Le #{l @event.start_time.to_date, format: :long},
|
|
||||||
de #{l @event.start_time, format: :hours} à #{l @event.end_time, format: :hours}.
|
|
||||||
- else
|
|
||||||
Du
|
|
||||||
=l @event.start_time, format: :at
|
|
||||||
au
|
|
||||||
#{l @event.end_time, format: :at}.
|
|
||||||
|
|
||||||
%p
|
%p.full_address
|
||||||
= raw [@event.address.present? ? @event.address : nil,
|
%span= @event.address
|
||||||
link_to(@event.city, "http://fr.wikipedia.org/wiki/#{url_encode @event.city}"),
|
%span= link_to @event.city, "http://fr.wikipedia.org/wiki/#{url_encode @event.city}"
|
||||||
link_to(@event.related_region.try(:name),
|
%span= link_to @event.related_region.try(:name),
|
||||||
"http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.name}")].compact.join(', ')
|
"http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.name}"
|
||||||
|
|
||||||
- if @event.latitude && @event.longitude
|
- if @event.latitude && @event.longitude
|
||||||
#map(latitude="#{@event.latitude}" longitude="#{@event.longitude}")
|
#map(latitude="#{@event.latitude}" longitude="#{@event.longitude}")
|
||||||
|
@ -22,15 +22,7 @@
|
|||||||
- @events.each do |event|
|
- @events.each do |event|
|
||||||
%tr
|
%tr
|
||||||
%td= event.title
|
%td= event.title
|
||||||
%td
|
%td= display_date event
|
||||||
- if event.same_day?
|
|
||||||
Le #{l event.start_time.to_date, format: :long},
|
|
||||||
de #{l event.start_time, format: :hours} à #{l event.end_time, format: :hours}
|
|
||||||
- else
|
|
||||||
Du
|
|
||||||
=l event.start_time, format: :at
|
|
||||||
au
|
|
||||||
=l event.end_time, format: :at
|
|
||||||
%td= event.city
|
%td= event.city
|
||||||
%td= event.related_region.name
|
%td= event.related_region.name
|
||||||
%td= time_ago_in_words event.submission_time
|
%td= time_ago_in_words event.submission_time
|
||||||
|
@ -2,36 +2,24 @@
|
|||||||
=t '.title'
|
=t '.title'
|
||||||
%em= params[:id]
|
%em= params[:id]
|
||||||
|
|
||||||
%p=raw t '.future', count: @events_future.count
|
- if @events_future.any?
|
||||||
%ul
|
%p=raw t '.future', count: @events_future.count
|
||||||
|
%ul
|
||||||
- @events_future.find_each do |event|
|
- @events_future.find_each do |event|
|
||||||
%li
|
%li
|
||||||
%div
|
%div
|
||||||
= link_to event do
|
= link_to event do
|
||||||
%em.city= event.city
|
%em.city= event.city
|
||||||
= event.title
|
= event.title
|
||||||
- if event.same_day?
|
= display_date event
|
||||||
le
|
|
||||||
=l event.start_time.to_date, format: :long
|
|
||||||
- else
|
|
||||||
du
|
|
||||||
=l event.start_time.to_date, format: :long
|
|
||||||
au
|
|
||||||
=l event.end_time.to_date, format: :long
|
|
||||||
|
|
||||||
%p=raw t '.past', count: @events_past.count
|
- if @events_past.any?
|
||||||
%ul
|
%p=raw t '.past', count: @events_past.count
|
||||||
|
%ul
|
||||||
- @events_past.find_each do |event|
|
- @events_past.find_each do |event|
|
||||||
%li
|
%li
|
||||||
%div
|
%div
|
||||||
= link_to event do
|
= link_to event do
|
||||||
%em.city= event.city
|
%em.city= event.city
|
||||||
= event.title
|
= event.title
|
||||||
- if event.same_day?
|
= display_date event
|
||||||
le
|
|
||||||
=l event.start_time.to_date, format: :long
|
|
||||||
- else
|
|
||||||
du
|
|
||||||
=l event.start_time.to_date, format: :long
|
|
||||||
au
|
|
||||||
=l event.end_time.to_date, format: :long
|
|
||||||
|
@ -11,6 +11,8 @@ fr:
|
|||||||
formats:
|
formats:
|
||||||
long: "%A %d %B %Y"
|
long: "%A %d %B %Y"
|
||||||
month: "%B %Y"
|
month: "%B %Y"
|
||||||
|
period: Du %{start} au %{end}.
|
||||||
|
same_day: Le %{date} de %{start} au %{end}.
|
||||||
time:
|
time:
|
||||||
formats:
|
formats:
|
||||||
at: "%A %d %B %Y à %Hh%M"
|
at: "%A %d %B %Y à %Hh%M"
|
||||||
|
Loading…
Reference in New Issue
Block a user