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-2 {
|
||||
position: relative;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.player {
|
||||
@include span-columns(12);
|
||||
|
@ -167,21 +168,8 @@ div#match {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
.controls {
|
||||
top: 0;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
|
||||
input {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
form {
|
||||
|
||||
label.checkbox {
|
||||
padding: 0;
|
||||
}
|
||||
label.checkbox {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,16 +181,9 @@ div#match {
|
|||
margin: 0 0 0 10px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
|
||||
label.checkbox {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
label.checkbox {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,16 +191,9 @@ div#match {
|
|||
@include span-columns(6);
|
||||
@include omega;
|
||||
|
||||
.controls {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
|
||||
label.checkbox {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
label.checkbox {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -234,6 +208,10 @@ div#match {
|
|||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
form .controls {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
.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-2 {
|
||||
position: relative;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.player {
|
||||
@include span-columns(12);
|
||||
|
@ -166,21 +167,8 @@ div#match {
|
|||
position: relative;
|
||||
}
|
||||
|
||||
.controls {
|
||||
top: 0;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
|
||||
input {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
form {
|
||||
|
||||
label.checkbox {
|
||||
padding: 0;
|
||||
}
|
||||
label.checkbox {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,16 +180,9 @@ div#match {
|
|||
margin: 0 0 0 10px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
|
||||
label.checkbox {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
label.checkbox {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,16 +190,9 @@ div#match {
|
|||
@include span-columns(6);
|
||||
@include omega;
|
||||
|
||||
.controls {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
|
||||
label.checkbox {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
label.checkbox {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -233,6 +207,10 @@ div#match {
|
|||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
form .controls {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
.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">
|
||||
<% contester.lineup.each do |teamer| %>
|
||||
<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 %>
|
||||
<% end %>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
|||
<%= 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}][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' %>
|
||||
|
||||
|
@ -45,5 +45,7 @@
|
|||
<%= hidden_field_tag "match[matchers_attributes][#{@n}][_destroy]", "keep" %>
|
||||
|
||||
<%= text_field_tag "match[matchers_attributes][#{@n}][user_id]", '', placeholder: 'Mercenary' %>
|
||||
|
||||
<% @n = @n + 1 %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
36
app/views/matches/ref.html.erb
Normal file → Executable file
36
app/views/matches/ref.html.erb
Normal file → Executable file
|
@ -16,33 +16,25 @@
|
|||
<div class="lineups">
|
||||
<h3>Lineups</h3>
|
||||
|
||||
<div class="team-1">
|
||||
<%= form_for @match do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<div class="controls">
|
||||
<%= f.submit 'Save Lineup' %>
|
||||
</div>
|
||||
<%= form_for @match do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<div class="team-1">
|
||||
<% [@match.contester1].each do |contester| %>
|
||||
<%= render partial: "lineup", locals: { contester: contester } %>
|
||||
<%= render partial: "lineup", locals: { contester: contester } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="team-2">
|
||||
<%= form_for @match do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<div class="controls">
|
||||
<%= f.submit 'Save Lineup' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="team-2">
|
||||
<% [@match.contester2].each do |contester| %>
|
||||
<%= render partial: "lineup", locals: { contester: contester } %>
|
||||
<%= render partial: "lineup", locals: { contester: contester } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<%= f.submit 'Save Lineups' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="scoring">
|
||||
|
@ -83,7 +75,7 @@
|
|||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<%= f.submit 'Save Scores' %>
|
||||
<%= f.submit 'Save Scoring' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -13,6 +13,14 @@ Style/CollectionMethods:
|
|||
find: detect
|
||||
find_all: select
|
||||
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:
|
||||
Description: Use snake_case for source file names.
|
||||
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.
|
||||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
||||
Enabled: false
|
||||
MaxLineLength: 80
|
||||
MaxLineLength: 100
|
||||
Style/OptionHash:
|
||||
Description: Don't use option hashes when you can use keyword arguments.
|
||||
Enabled: false
|
||||
|
@ -223,14 +231,11 @@ Lint/LiteralInCondition:
|
|||
Lint/LiteralInInterpolation:
|
||||
Description: Checks for literals used in interpolation.
|
||||
Enabled: false
|
||||
|
||||
Metrics/LineLength:
|
||||
Description: Limit lines to 100 characters.
|
||||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
|
||||
Enabled: true
|
||||
Max: 100
|
||||
AllowURI: true
|
||||
URISchemes:
|
||||
- http
|
||||
- https
|
||||
|
Loading…
Reference in a new issue