mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-30 19:22:21 +00:00
Created bracket and extra flag for wrestler
This commit is contained in:
@@ -22,6 +22,7 @@ class StaticPagesController < ApplicationController
|
||||
|
||||
end
|
||||
def brackets
|
||||
|
||||
if params[:weight]
|
||||
@weight = Weight.find(params[:weight])
|
||||
@tournament = Tournament.find(@weight.tournament_id)
|
||||
|
||||
125
app/views/static_pages/_bracket.html.erb
Normal file
125
app/views/static_pages/_bracket.html.erb
Normal file
@@ -0,0 +1,125 @@
|
||||
<style>
|
||||
/*
|
||||
* Flex Layout Specifics
|
||||
*/
|
||||
main{
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
}
|
||||
.round{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:center;
|
||||
width:200px;
|
||||
list-style:none;
|
||||
padding:0;
|
||||
}
|
||||
.round .spacer{ flex-grow:1; }
|
||||
.round .spacer:first-child,
|
||||
.round .spacer:last-child{ flex-grow:.5; }
|
||||
|
||||
.round .game-spacer{
|
||||
flex-grow:1;
|
||||
}
|
||||
|
||||
/*
|
||||
* General Styles
|
||||
*/
|
||||
body{
|
||||
font-family:sans-serif;
|
||||
font-size:small;
|
||||
padding:10px;
|
||||
line-height:1.4em;
|
||||
}
|
||||
|
||||
li.game{
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
li.game.winner{
|
||||
font-weight:bold;
|
||||
}
|
||||
li.game span{
|
||||
float:right;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
li.game-top{ border-bottom:1px solid #aaa; }
|
||||
|
||||
li.game-spacer{
|
||||
border-right:1px solid #aaa;
|
||||
min-height:40px;
|
||||
}
|
||||
|
||||
li.game-bottom{
|
||||
border-top:1px solid #aaa;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<h5>Bracket After Pool</h5>
|
||||
<main id="bracket">
|
||||
<ul class="round round-1">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top ">Winner Pool 1 <span>Score</span></li>
|
||||
<li class="game game-spacer"> </li>
|
||||
<li class="game game-bottom ">Runner Up Pool 2<span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top ">Runner Up Pool 3<span>Score</span></li>
|
||||
<li class="game game-spacer"> </li>
|
||||
<li class="game game-bottom ">Winner Pool 4 <span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top ">Winner Pool 3<span>Score</span></li>
|
||||
<li class="game game-spacer"> </li>
|
||||
<li class="game game-bottom ">Runner Up Pool 4<span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top ">Runner Up Pool 1<span>Score</span></li>
|
||||
<li class="game game-spacer"> </li>
|
||||
<li class="game game-bottom ">Winner Pool 2<span>Score</span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
</ul>
|
||||
<ul class="round round-2">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <span></span></li>
|
||||
<li class="game game-spacer"> </li>
|
||||
<li class="game game-bottom "><span></span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <span></span></li>
|
||||
<li class="game game-spacer"> </li>
|
||||
<li class="game game-bottom "> <span></span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-3">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <span></span></li>
|
||||
<li class="game game-spacer"> </li>
|
||||
<li class="game game-bottom "> <span></span></li>
|
||||
|
||||
<li class="spacer"> </li>
|
||||
|
||||
</ul>
|
||||
<ul class="round round-4">
|
||||
<li class="spacer"> </li>
|
||||
|
||||
<li class="game game-top "> <span></span></li>
|
||||
|
||||
|
||||
<li class="spacer"> </li>
|
||||
</ul>
|
||||
</main>
|
||||
@@ -87,4 +87,9 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
|
||||
</br>
|
||||
</br>
|
||||
<%= render 'bracket' %>
|
||||
@@ -46,7 +46,11 @@
|
||||
<%= f.label "Seed Criteria" %><br>
|
||||
<%= f.text_field :criteria %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label "Check box if extra" %> <%= f.check_box :extra %>
|
||||
</div>
|
||||
</br>
|
||||
</br>
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
|
||||
5
db/migrate/20150206025407_add_extra_flag_for_wrestler.rb
Normal file
5
db/migrate/20150206025407_add_extra_flag_for_wrestler.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddExtraFlagForWrestler < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :wrestlers, :extra, :boolean
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20150202180900) do
|
||||
ActiveRecord::Schema.define(version: 20150206025407) do
|
||||
|
||||
create_table "matches", force: true do |t|
|
||||
t.integer "r_id"
|
||||
@@ -90,6 +90,7 @@ ActiveRecord::Schema.define(version: 20150202180900) do
|
||||
t.integer "season_loss"
|
||||
t.string "criteria"
|
||||
t.integer "poolNumber"
|
||||
t.boolean "extra"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user