Link to inyourtime.zone in all the sensible places
This commit is contained in:
parent
f86c474002
commit
440ba3511e
4 changed files with 30 additions and 11 deletions
|
|
@ -180,9 +180,10 @@ module ApplicationHelper
|
||||||
|
|
||||||
# TODO:Snap!Con: Replace this with a search for a conference logo.
|
# TODO:Snap!Con: Replace this with a search for a conference logo.
|
||||||
def nav_root_link_for(conference)
|
def nav_root_link_for(conference)
|
||||||
|
path = conference.present? ? conference_path(conference) : root_path
|
||||||
link_to(
|
link_to(
|
||||||
image_tag('snapcon_logo.png'),
|
image_tag('snapcon_logo.png'),
|
||||||
root_path,
|
path,
|
||||||
class: 'navbar-brand',
|
class: 'navbar-brand',
|
||||||
title: nav_link_text(conference)
|
title: nav_link_text(conference)
|
||||||
)
|
)
|
||||||
|
|
@ -208,4 +209,15 @@ module ApplicationHelper
|
||||||
object.picture.large.url
|
object.picture.large.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Embed links with a localized timezone URL
|
||||||
|
# Timestamps are stored at UTC but in the real timezone.
|
||||||
|
# We must convert then shift the time back to get the correct value.
|
||||||
|
def inyourtz(time, timezone = 'GMT', &block)
|
||||||
|
time = time.in_time_zone(timezone)
|
||||||
|
time -= time.utc_offset
|
||||||
|
link_to "https://inyourtime.zone/t?#{time.to_i}", target: '_blank' do
|
||||||
|
block.call
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,9 @@
|
||||||
%dl#proposal-info
|
%dl#proposal-info
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%dt Date:
|
%dt Date:
|
||||||
%dd= @event_schedule.start_time.strftime("%Y %B %e - %H:%M") if @event_schedule
|
%dd
|
||||||
|
= inyourtz(@event_schedule.start_time, @conference.timezone) do
|
||||||
|
= @event_schedule.start_time.strftime("%Y %B %e - %H:%M") if @event_schedule
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%dt Duration:
|
%dt Duration:
|
||||||
%dd= show_time(@event.event_type.length)
|
%dd= show_time(@event.event_type.length)
|
||||||
|
|
@ -121,7 +123,9 @@
|
||||||
%dl
|
%dl
|
||||||
%dt Start Time:
|
%dt Start Time:
|
||||||
%dd
|
%dd
|
||||||
= event.program.selected_event_schedules.find { |es| es.event == event }.start_time.strftime("%Y %B %e %H:%M")
|
- event_schedule = event.program.selected_event_schedules.find { |es| es.event == event }
|
||||||
|
= inyourtz(event_schedule.start_time, @conference.timezone) do
|
||||||
|
= event_schedule.start_time.strftime("%Y %B %e %H:%M")
|
||||||
%br
|
%br
|
||||||
%dt Room:
|
%dt Room:
|
||||||
%dd
|
%dd
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
-# TODO: More informative text or aria-label.
|
-# TODO: More informative text or aria-label.
|
||||||
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400
|
= link_to 'more', conference_program_proposal_path(@conference.short_title, event.id) if event.abstract.length > 400
|
||||||
- if event_schedule.present?
|
- if event_schedule.present?
|
||||||
|
= inyourtz(event_schedule.start_time, @conference.timezone) do
|
||||||
%span.track
|
%span.track
|
||||||
%span.fa.fa-clock-o
|
%span.fa.fa-clock-o
|
||||||
%span.label{ style: "background-color: grey" }
|
%span.label{ style: "background-color: grey" }
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,14 @@
|
||||||
.col-xs-12.col-md-12
|
.col-xs-12.col-md-12
|
||||||
.date-content
|
.date-content
|
||||||
%span{ class: 'date-title', id: "#{ event_schedule.start_time.strftime('%Y-%m-%d') }" }
|
%span{ class: 'date-title', id: "#{ event_schedule.start_time.strftime('%Y-%m-%d') }" }
|
||||||
|
= inyourtz(event_schedule.start_time, @conference.timezone) do
|
||||||
= date = event_schedule.start_time.strftime('%Y-%m-%d')
|
= date = event_schedule.start_time.strftime('%Y-%m-%d')
|
||||||
%a{ title: "Go up", class: "pull-right", href: "#program" }
|
%a{ title: "Go up", class: "pull-right", href: "#program" }
|
||||||
%i{ class: "fa fa-angle-double-up fa-lg", 'aria-hidden' => true }
|
%i{ class: "fa fa-angle-double-up fa-lg", 'aria-hidden' => true }
|
||||||
- unless event_schedule.start_time.strftime('%H:%M').eql?(time)
|
- unless event_schedule.start_time.strftime('%H:%M').eql?(time)
|
||||||
.col-xs-12.col-md-1
|
.col-xs-12.col-md-1
|
||||||
.start-time
|
.start-time
|
||||||
|
= inyourtz(event_schedule.start_time, @conference.timezone) do
|
||||||
= time = event_schedule.start_time.strftime('%H:%M')
|
= time = event_schedule.start_time.strftime('%H:%M')
|
||||||
.col-xs-12.col-md-11
|
.col-xs-12.col-md-11
|
||||||
.new-time-event
|
.new-time-event
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue