start_time = time_to_number @competition.start
unless start_time <= current_time
- @write '<h1>Competition has not begun</h1>'
\ No newline at end of file
+ @write render: 'competition.not_started'
\ No newline at end of file
end_time = time_to_number @competition.end
unless start_time <= current_time
- @write '<h1>Competition has not begun</h1>'
+ @write render: 'competition.not_started'
unless current_time <= end_time
- @write '<h1>Competition has ended</h1>'
\ No newline at end of file
+ @write render: 'competition.finished'
\ No newline at end of file
--- /dev/null
+include_rules
\ No newline at end of file
--- /dev/null
+html = require 'lapis.html'
+
+class CompetitionFinished extends html.Widget
+ content: =>
+ h1 'Competition has ended'
+ h3 style: 'text-align: center', -> text "Ended at #{@competition.end}"
\ No newline at end of file
--- /dev/null
+html = require 'lapis.html'
+
+class CompetitionNotStarted extends html.Widget
+ content: =>
+ h1 'Competition has not started'
+
+ h3 style: 'text-align: center', -> text "Starts at #{@competition.start}"
\ No newline at end of file