From ac0b47eca9b8560881b0763b8ff2fdd5f0bf846f Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Fri, 25 Apr 2014 23:15:15 +0100 Subject: [PATCH] Improved styling for contests and referee admin pages Fixes deleting maps form contests --- app/assets/stylesheets/components/_forms.scss | 4 +- .../stylesheets/components/_tables.scss | 6 +- .../stylesheets/layout/_navigation.scss | 2 +- app/assets/stylesheets/pages/_contests.scss | 47 +++++ app/assets/stylesheets/pages/_matches.scss | 95 +++++++++ app/views/contests/show.html.erb | 42 ++-- app/views/issues/new.html.erb | 2 +- app/views/matches/_form.html.erb | 52 ++--- app/views/matches/_lineup.html.erb | 73 +++---- app/views/matches/edit.html.erb | 7 +- app/views/matches/new.html.erb | 6 +- app/views/matches/ref.html.erb | 190 +++++++++--------- config/routes.rb | 8 +- 13 files changed, 341 insertions(+), 193 deletions(-) diff --git a/app/assets/stylesheets/components/_forms.scss b/app/assets/stylesheets/components/_forms.scss index 176ce8d..cab3868 100644 --- a/app/assets/stylesheets/components/_forms.scss +++ b/app/assets/stylesheets/components/_forms.scss @@ -3,6 +3,7 @@ */ form { + .inline { float: left; display: inline-block; @@ -48,6 +49,7 @@ form { display: inline-block; margin-right: em(10); float: left; + max-width: 100%; select { @include appearance(none); @@ -65,6 +67,7 @@ form { margin: 0; padding: $select-padding em(50) $select-padding $input-padding; font-size: $input-font-size; + max-width: 100%; option { font-size: $input-font-size; @@ -143,7 +146,6 @@ form { } > label.checkbox { - display: none; position: relative; width: em(40); height: em(40); diff --git a/app/assets/stylesheets/components/_tables.scss b/app/assets/stylesheets/components/_tables.scss index 3cb4dc8..3d2e0f0 100644 --- a/app/assets/stylesheets/components/_tables.scss +++ b/app/assets/stylesheets/components/_tables.scss @@ -12,13 +12,13 @@ table { th { border-bottom: 1px solid darken($base-border-color, 15%); font-weight: bold; - padding: ($base-line-height / 2) 0; + padding: 0.5em 0; text-align: left; } td { border-bottom: 1px solid $base-border-color; - padding: ($base-line-height / 2) 0; + padding: 0.5em 0; } tr, td, th { @@ -41,4 +41,4 @@ table.striped > tbody { > tr:nth-child(2n) td { background-color: transparentize($light-blue, 0.9); } -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/layout/_navigation.scss b/app/assets/stylesheets/layout/_navigation.scss index f6db7c3..d2be986 100644 --- a/app/assets/stylesheets/layout/_navigation.scss +++ b/app/assets/stylesheets/layout/_navigation.scss @@ -27,7 +27,7 @@ ul.navigation { > li { float: left; width: (100%/7); - border-right: em(1) solid transparent; + border-right: 0.1em solid transparent; .count { float: right; diff --git a/app/assets/stylesheets/pages/_contests.scss b/app/assets/stylesheets/pages/_contests.scss index 25cb5c5..4731663 100644 --- a/app/assets/stylesheets/pages/_contests.scss +++ b/app/assets/stylesheets/pages/_contests.scss @@ -144,3 +144,50 @@ table.brackets { width: em(150); } } + +/* + Contest Page +*/ + +#contest { + + table.weeks { + + .week { + width: 50%; + } + + .date { + width: 30%; + } + + .score { + width: 10%; + text-align: right; + } + } + + table.matches { + + .team { + width: 50%; + } + + .date { + width: 50%; + text-align: right; + } + } + + table.predictions { + + .user { + width: 50%; + } + + .result { + width: 50%; + text-align: right; + } + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/pages/_matches.scss b/app/assets/stylesheets/pages/_matches.scss index 5fe69e8..a0c483c 100644 --- a/app/assets/stylesheets/pages/_matches.scss +++ b/app/assets/stylesheets/pages/_matches.scss @@ -141,10 +141,47 @@ div#match { @include span-columns(12); margin: em(20) 0 em(40); + h3 { + text-align: center; + margin-bottom: 1em; + } + i { color: $gold; } + .team-1, + .team-2 { + position: relative; + + .player { + @include span-columns(12); + line-height: em(40); + margin-bottom: em(10); + } + + .players { + position: relative; + } + + .controls { + top: 0; + position: absolute; + z-index: 100; + + input { + margin: 0; + } + } + + form { + + label.checkbox { + padding: 0; + } + } + } + .team-1 { @include span-columns(6); text-align: right; @@ -152,16 +189,64 @@ div#match { .flag { margin: 0 0 0 em(10); } + + .controls { + left: 0; + } + + form { + + label.checkbox { + float: right; + margin-left: 1em; + } + } } .team-2 { @include span-columns(6); @include omega; + + .controls { + right: 0; + } + + form { + + label.checkbox { + float: left; + margin-right: 1em; + } + } } &.shift .team-2 { @include shift(6); } + + .mercenaries { + @include span-columns(12); + + input { + margin: 0; + } + } + } + + .scoring { + @include span-columns(12); + border-top: em(3) solid $light-gray; + + h3 { + margin-bottom: 1em; + } + + .scores input { + width: auto; + margin-left: 0; + text-align: center; + width: em(40); + } } .predictions { @@ -209,6 +294,16 @@ div#match { margin: em(20) 0; padding-top: em(20); border-top: em(3) solid $light-gray; + + textarea { + margin: em(20) 0; + width: 100%; + height: em(600); + } + + .mceLayout { + margin: em(20) 0; + } } } diff --git a/app/views/contests/show.html.erb b/app/views/contests/show.html.erb index 12007f5..dac3088 100644 --- a/app/views/contests/show.html.erb +++ b/app/views/contests/show.html.erb @@ -51,15 +51,15 @@ <% if @contest.weeks.count > 0 %> - +
<% @contest.weeks.ordered.each do |week| %> <% next if week.matches.realfinished.size == 0 %> - - - + + + <% if @contest.contest_type == Contest::TYPE_LADDER %> - + <% end %> <% week.matches.realfinished.ordered.reverse_each do |match| %> @@ -72,14 +72,14 @@ - <% if @contest.contest_type == Contest::TYPE_LADDER %> - <% end %> @@ -88,13 +88,13 @@ <% end %>
<%= week.name %>DateScore<%= week.name %>DateScorePointsPoints
<%= shorttime match.match_time %> + <%= link_to match, :class => "bold #{match.score_color}" do %> <%= h match.score1 %> - <%= h match.score2 %> <% end %> + <%= match.points1 %> / <%= match.points2 %>
<% else %> - +
- - - + + + <% if @contest.contest_type == Contest::TYPE_LADDER %> - + <% end %> @@ -129,10 +129,10 @@ Matches to be played -
TeamsDateScoreTeamsDateScorePointsPoints
+
- - + + <% @contest.matches.unfinished.ordered.reverse_each do |match| %> @@ -142,7 +142,7 @@ vs <%= namelink match.contester2.team if match.contester2 %> - @@ -152,22 +152,22 @@
-
TeamsDateTeamsDate
+ <%= link_to shorttime(match.match_time), match %>
+
- - + + <% @contest.preds_with_score.each do |prediction| %> - + <% end %>
UserResultUserResult
<%= namelink prediction.user %><%= prediction.correct %> / <%= prediction.total %> correct (<%= prediction.score.to_f.round(2) %>%)<%= prediction.correct %> / <%= prediction.total %> correct (<%= prediction.score.to_f.round(2) %>%)
-