mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
Merge pull request #72 from Prommah/develop
Merge lineup forms & fix hound (again)
This commit is contained in:
commit
5464cfa6fc
5 changed files with 54 additions and 99 deletions
48
app/assets/stylesheets/themes/default/pages/_matches.scss
Normal file → Executable file
48
app/assets/stylesheets/themes/default/pages/_matches.scss
Normal file → Executable file
|
@ -156,6 +156,7 @@ div#match {
|
||||||
.team-1,
|
.team-1,
|
||||||
.team-2 {
|
.team-2 {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
.player {
|
.player {
|
||||||
@include span-columns(12);
|
@include span-columns(12);
|
||||||
|
@ -167,21 +168,8 @@ div#match {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls {
|
label.checkbox {
|
||||||
top: 0;
|
padding: 0;
|
||||||
position: absolute;
|
|
||||||
z-index: 100;
|
|
||||||
|
|
||||||
input {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
|
||||||
|
|
||||||
label.checkbox {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,16 +181,9 @@ div#match {
|
||||||
margin: 0 0 0 10px;
|
margin: 0 0 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls {
|
label.checkbox {
|
||||||
left: 0;
|
float: right;
|
||||||
}
|
margin-left: 1em;
|
||||||
|
|
||||||
form {
|
|
||||||
|
|
||||||
label.checkbox {
|
|
||||||
float: right;
|
|
||||||
margin-left: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,16 +191,9 @@ div#match {
|
||||||
@include span-columns(6);
|
@include span-columns(6);
|
||||||
@include omega;
|
@include omega;
|
||||||
|
|
||||||
.controls {
|
label.checkbox {
|
||||||
right: 0;
|
float: left;
|
||||||
}
|
margin-right: 1em;
|
||||||
|
|
||||||
form {
|
|
||||||
|
|
||||||
label.checkbox {
|
|
||||||
float: left;
|
|
||||||
margin-right: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,6 +208,10 @@ div#match {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form .controls {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scoring {
|
.scoring {
|
||||||
|
|
48
app/assets/stylesheets/themes/flat/pages/_matches.scss
Normal file → Executable file
48
app/assets/stylesheets/themes/flat/pages/_matches.scss
Normal file → Executable file
|
@ -155,6 +155,7 @@ div#match {
|
||||||
.team-1,
|
.team-1,
|
||||||
.team-2 {
|
.team-2 {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
.player {
|
.player {
|
||||||
@include span-columns(12);
|
@include span-columns(12);
|
||||||
|
@ -166,21 +167,8 @@ div#match {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls {
|
label.checkbox {
|
||||||
top: 0;
|
padding: 0;
|
||||||
position: absolute;
|
|
||||||
z-index: 100;
|
|
||||||
|
|
||||||
input {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
|
||||||
|
|
||||||
label.checkbox {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,16 +180,9 @@ div#match {
|
||||||
margin: 0 0 0 10px;
|
margin: 0 0 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.controls {
|
label.checkbox {
|
||||||
left: 0;
|
float: right;
|
||||||
}
|
margin-left: 1em;
|
||||||
|
|
||||||
form {
|
|
||||||
|
|
||||||
label.checkbox {
|
|
||||||
float: right;
|
|
||||||
margin-left: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,16 +190,9 @@ div#match {
|
||||||
@include span-columns(6);
|
@include span-columns(6);
|
||||||
@include omega;
|
@include omega;
|
||||||
|
|
||||||
.controls {
|
label.checkbox {
|
||||||
right: 0;
|
float: left;
|
||||||
}
|
margin-right: 1em;
|
||||||
|
|
||||||
form {
|
|
||||||
|
|
||||||
label.checkbox {
|
|
||||||
float: left;
|
|
||||||
margin-right: 1em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,6 +207,10 @@ div#match {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form .controls {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.scoring {
|
.scoring {
|
||||||
|
|
6
app/views/matches/_lineup.html.erb
Normal file → Executable file
6
app/views/matches/_lineup.html.erb
Normal file → Executable file
|
@ -1,7 +1,7 @@
|
||||||
<div class="players">
|
<div class="players">
|
||||||
<% contester.lineup.each do |teamer| %>
|
<% contester.lineup.each do |teamer| %>
|
||||||
<div class="player fields">
|
<div class="player fields">
|
||||||
<% if matcher = @match.matchers.first(conditions: { user_id: teamer.user_id }) %>
|
<% if matcher = @match.matchers.first(conditions: { user_id: teamer.user_id, contester_id: contester.id }) %>
|
||||||
<%= hidden_field_tag "match[matchers_attributes][#{@n}][id]", matcher.id %>
|
<%= hidden_field_tag "match[matchers_attributes][#{@n}][id]", matcher.id %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<%= hidden_field_tag "match[matchers_attributes][#{@n}][contester_id]", contester.id %>
|
<%= hidden_field_tag "match[matchers_attributes][#{@n}][contester_id]", contester.id %>
|
||||||
<%= hidden_field_tag "match[matchers_attributes][#{@n}][match_id]", @match.id %>
|
<%= hidden_field_tag "match[matchers_attributes][#{@n}][match_id]", @match.id %>
|
||||||
<%= hidden_field_tag "match[matchers_attributes][#{@n}][merc]", false %>
|
<%= hidden_field_tag "match[matchers_attributes][#{@n}][merc]", false %>
|
||||||
<%= check_box_tag "match[matchers_attributes][#{@n}][_destroy]", "keep", @match.users.exists?(teamer.user), { id: "player_#{@n}" } %>
|
<%= check_box_tag "match[matchers_attributes][#{@n}][_destroy]", "keep", !matcher.nil?, { id: "player_#{@n}" } %>
|
||||||
|
|
||||||
<%= label_tag "player_#{@n}", '', class: 'checkbox' %>
|
<%= label_tag "player_#{@n}", '', class: 'checkbox' %>
|
||||||
|
|
||||||
|
@ -45,5 +45,7 @@
|
||||||
<%= hidden_field_tag "match[matchers_attributes][#{@n}][_destroy]", "keep" %>
|
<%= hidden_field_tag "match[matchers_attributes][#{@n}][_destroy]", "keep" %>
|
||||||
|
|
||||||
<%= text_field_tag "match[matchers_attributes][#{@n}][user_id]", '', placeholder: 'Mercenary' %>
|
<%= text_field_tag "match[matchers_attributes][#{@n}][user_id]", '', placeholder: 'Mercenary' %>
|
||||||
|
|
||||||
|
<% @n = @n + 1 %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
38
app/views/matches/ref.html.erb
Normal file → Executable file
38
app/views/matches/ref.html.erb
Normal file → Executable file
|
@ -16,33 +16,25 @@
|
||||||
<div class="lineups">
|
<div class="lineups">
|
||||||
<h3>Lineups</h3>
|
<h3>Lineups</h3>
|
||||||
|
|
||||||
<div class="team-1">
|
<%= form_for @match do |f| %>
|
||||||
<%= form_for @match do |f| %>
|
<%= f.error_messages %>
|
||||||
<%= f.error_messages %>
|
|
||||||
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.submit 'Save Lineup' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="team-1">
|
||||||
<% [@match.contester1].each do |contester| %>
|
<% [@match.contester1].each do |contester| %>
|
||||||
<%= render partial: "lineup", locals: { contester: contester } %>
|
<%= render partial: "lineup", locals: { contester: contester } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div class="team-2">
|
||||||
<div class="team-2">
|
|
||||||
<%= form_for @match do |f| %>
|
|
||||||
<%= f.error_messages %>
|
|
||||||
|
|
||||||
<div class="controls">
|
|
||||||
<%= f.submit 'Save Lineup' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% [@match.contester2].each do |contester| %>
|
<% [@match.contester2].each do |contester| %>
|
||||||
<%= render partial: "lineup", locals: { contester: contester } %>
|
<%= render partial: "lineup", locals: { contester: contester } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
</div>
|
||||||
</div>
|
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.submit 'Save Lineups' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="scoring">
|
<div class="scoring">
|
||||||
|
@ -83,7 +75,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.submit 'Save Scores' %>
|
<%= f.submit 'Save Scoring' %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,6 +13,14 @@ Style/CollectionMethods:
|
||||||
find: detect
|
find: detect
|
||||||
find_all: select
|
find_all: select
|
||||||
reduce: inject
|
reduce: inject
|
||||||
|
Style/DotPosition:
|
||||||
|
Description: Checks the position of the dot in multi-line method calls.
|
||||||
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
||||||
|
Enabled: true
|
||||||
|
EnforcedStyle: leading
|
||||||
|
SupportedStyles:
|
||||||
|
- leading
|
||||||
|
- trailing
|
||||||
Style/FileName:
|
Style/FileName:
|
||||||
Description: Use snake_case for source file names.
|
Description: Use snake_case for source file names.
|
||||||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
||||||
|
@ -27,7 +35,7 @@ Style/IfUnlessModifier:
|
||||||
Description: Favor modifier if/unless usage when you have a single-line body.
|
Description: Favor modifier if/unless usage when you have a single-line body.
|
||||||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
||||||
Enabled: false
|
Enabled: false
|
||||||
MaxLineLength: 80
|
MaxLineLength: 100
|
||||||
Style/OptionHash:
|
Style/OptionHash:
|
||||||
Description: Don't use option hashes when you can use keyword arguments.
|
Description: Don't use option hashes when you can use keyword arguments.
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -223,14 +231,11 @@ Lint/LiteralInCondition:
|
||||||
Lint/LiteralInInterpolation:
|
Lint/LiteralInInterpolation:
|
||||||
Description: Checks for literals used in interpolation.
|
Description: Checks for literals used in interpolation.
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Metrics/LineLength:
|
Metrics/LineLength:
|
||||||
Description: Limit lines to 100 characters.
|
Description: Limit lines to 100 characters.
|
||||||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
|
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Max: 100
|
Max: 100
|
||||||
AllowURI: true
|
AllowURI: true
|
||||||
URISchemes:
|
URISchemes:
|
||||||
- http
|
- http
|
||||||
- https
|
- https
|
||||||
|
|
Loading…
Reference in a new issue