Description:
update Current time to properly use rails time
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r351:a14389fe8773 - - 1 file changed: 1 inserted, 1 deleted
@@ -68,66 +68,66 | |||
|
68 | 68 | rescue |
|
69 | 69 | nil |
|
70 | 70 | end |
|
71 | 71 | end |
|
72 | 72 | |
|
73 | 73 | def user_title_bar(user) |
|
74 | 74 | header = '' |
|
75 | 75 | time_left = '' |
|
76 | 76 | |
|
77 | 77 | # |
|
78 | 78 | # if the contest is over |
|
79 | 79 | if GraderConfiguration.time_limit_mode? |
|
80 | 80 | if user.contest_finished? |
|
81 | 81 | header = <<CONTEST_OVER |
|
82 | 82 | <tr><td colspan="2" align="center"> |
|
83 | 83 | <span class="contest-over-msg">THE CONTEST IS OVER</span> |
|
84 | 84 | </td></tr> |
|
85 | 85 | CONTEST_OVER |
|
86 | 86 | end |
|
87 | 87 | if !user.contest_started? |
|
88 | 88 | time_left = " " + (t 'title_bar.contest_not_started') |
|
89 | 89 | else |
|
90 | 90 | time_left = " " + (t 'title_bar.remaining_time') + |
|
91 | 91 | " #{format_short_duration(user.contest_time_left)}" |
|
92 | 92 | end |
|
93 | 93 | end |
|
94 | 94 | |
|
95 | 95 | # |
|
96 | 96 | # if the contest is in the anaysis mode |
|
97 | 97 | if GraderConfiguration.analysis_mode? |
|
98 | 98 | header = <<ANALYSISMODE |
|
99 | 99 | <tr><td colspan="2" align="center"> |
|
100 | 100 | <span class="contest-over-msg">ANALYSIS MODE</span> |
|
101 | 101 | </td></tr> |
|
102 | 102 | ANALYSISMODE |
|
103 | 103 | end |
|
104 | 104 | |
|
105 | 105 | contest_name = GraderConfiguration['contest.name'] |
|
106 | 106 | |
|
107 | 107 | # |
|
108 | 108 | # build real title bar |
|
109 | 109 | result = <<TITLEBAR |
|
110 | 110 | <div class="title"> |
|
111 | 111 | <table> |
|
112 | 112 | #{header} |
|
113 | 113 | <tr> |
|
114 | 114 | <td class="left-col"> |
|
115 | 115 | #{user.full_name}<br/> |
|
116 | - #{t 'title_bar.current_time'} #{format_short_time(Time.new)} | |
|
116 | + #{t 'title_bar.current_time'} #{format_short_time(Time.zone.now)} | |
|
117 | 117 | #{time_left} |
|
118 | 118 | <br/> |
|
119 | 119 | </td> |
|
120 | 120 | <td class="right-col">#{contest_name}</td> |
|
121 | 121 | </tr> |
|
122 | 122 | </table> |
|
123 | 123 | </div> |
|
124 | 124 | TITLEBAR |
|
125 | 125 | result.html_safe |
|
126 | 126 | end |
|
127 | 127 | |
|
128 | 128 | def markdown(text) |
|
129 | 129 | markdown = RDiscount.new(text) |
|
130 | 130 | markdown.to_html.html_safe |
|
131 | 131 | end |
|
132 | 132 | |
|
133 | 133 | end |
You need to be logged in to leave comments.
Login now