From: Marius Gavrilescu Date: Sun, 8 Feb 2015 10:56:33 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;ds=sidebyside;h=760348134595e67b49d9be7284ae9c74c1d2d9b5;hp=-c;p=gruntmaster-page.git Merge branch 'master' into newmc Conflicts: tmpl/skel.en --- 760348134595e67b49d9be7284ae9c74c1d2d9b5 diff --combined js/90-themes.js index 56138d3,5ec968a..9bc3604 --- a/js/90-themes.js +++ b/js/90-themes.js @@@ -3,16 -3,9 +3,15 @@@ function set_style(name){ $('#stylesheet').attr("href", "/css/" + name + ".css"); localStorage.setItem("theme", name); + $(document).ready(function() { + if(name == 'slate' || name == 'cyborg') + $('.logo').removeClass('logo-light'); + else + $('.logo').addClass('logo-light'); + }); } $( document ).ready(function() { - $('#theme-selector').removeClass('hidden'); $('#theme_slate' ).on('click', function () { set_style("slate"); }); $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); diff --combined lib/Plack/App/Gruntmaster/HTML.pm index 090ca32,bdd20c2..0a68116 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@@ -32,7 -32,7 +32,7 @@@ sub HTML::Element::iter3 } sub HTML::Element::fid { shift->look_down(id => shift) } - sub HTML::Element::fclass { shift->look_down(class => shift) } + sub HTML::Element::fclass { shift->look_down(class => qr/\b$_[0]\b/) } sub HTML::Element::namedlink { my ($self, $id, $name) = @_; @@@ -114,12 -114,15 +114,16 @@@ sub process_us sub process_ct_entry { my ($tree, %args) = @_; $_->edit_href (sub {s/contest_id/$args{id}/}) for $tree->find('a'); + $tree->fid('editorial')->detach unless $args{finished}; $tree->fid('links')->detach unless $args{started}; + my $status = ($args{time} < $args{start} ? 'starts' : 'ends'); + $tree->fclass('timer')->attr('data-stop', $status eq 'ends' ? $args{stop} : $args{start}); $tree->content_handler( start => ftime $args{start}, stop => ftime $args{stop}, + status => $status, description => literal $args{description}); + $tree->fid('ctcountdown')->detach if $args{time} >= $args{stop}; } sub process_ct { @@@ -148,25 -151,24 +152,24 @@@ sub process_pb_entry if ($args{contest_stop}) { $tree->fid('solution')->detach; $tree->fid('solution_modal')->detach; - my $countdown = $tree->fid('countdown'); - $countdown->attr('data-start' => $args{open_time}); - $countdown->attr('data-stop' => $args{contest_stop}); - $countdown->attr('data-time' => $args{time}); - my $left = $args{contest_stop} - $args{time}; - $countdown->replace_content(sprintf '%02d:%02d:%02d', $left/60/60, $left/60%60, $left%60); - $tree->fid('score')->attr('data-value' => $args{value}); - $tree->fid('score')->replace_content(Gruntmaster::Data::Result::Contest::calc_score($args{value}, $args{time} - $args{open_time}, 0, $args{contest_stop} - $args{contest_start})); + my $score = $tree->fid('score'); + $score->attr('data-start' => $args{open_time}); + $score->attr('data-stop' => $args{contest_stop}); + $score->attr('data-value' => $args{value}); + $tree->fid('countdown')->attr('data-stop' => $args{contest_stop}); } else { $tree->fid('solution')->detach unless $args{solution}; $_->detach for $tree->fclass('rc'); # requires contest $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution}); } if ($args{cansubmit}) { + $tree->fid('nosubmit')->detach; $tree->look_down(name => 'problem')->attr(value => $args{id}); my $contest = $tree->look_down(name => 'contest'); $contest->attr(value => $args{contest}) if $args{contest}; $contest->detach unless $args{contest} } else { + $tree->fid('nosubmit')->find('a')->edit_href(sub{s/id/$args{id}/}); $tree->fid('submit')->detach } } diff --combined tmpl/ct_entry.en index ec16306,c18fba2..13d2e9e --- a/tmpl/ct_entry.en +++ b/tmpl/ct_entry.en @@@ -3,11 -3,14 +3,14 @@@
Contest stop time
stop
+
+ Contest starts/ends in: +
description
diff --combined tmpl/pb_entry.en index f2e597e,c76c56c..a74fc79 --- a/tmpl/pb_entry.en +++ b/tmpl/pb_entry.en @@@ -9,15 -9,21 +9,21 @@@
Owner
owner
Level
Easy
Time limit (seconds)
1
-
Score
50
-
Contest ends in
01:30
+
Score
50
+
Contest ends in
01:30
Job log
Solution -

Submit solution

+ +
+ The contest has finished.
+ To submit solutions to this problem, please visit the problem outside the contest. +
+ +
@@@ -25,15 -31,15 +31,15 @@@
diff --combined tmpl/skel.en index 16ebd70,19f3180..19377d9 --- a/tmpl/skel.en +++ b/tmpl/skel.en @@@ -3,21 -3,20 +3,21 @@@ - +
- +

TITLE

Content goes here
- + + -