1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-19 19:43:46 +00:00

Created basic viewing pages in angular

Can now search and view tournaments. Can now view team scores, weights and seeds, mats and bout board
This commit is contained in:
2016-04-12 21:11:18 +00:00
parent 8f07bc2f82
commit 5b9f64b3f9
16 changed files with 423 additions and 62 deletions

View File

@@ -0,0 +1,25 @@
<h2>Upcoming Tournaments</h2>
<br>
<form ng-submit="searchTournaments()">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search by name or date YYYY-MM-DD" ng-model="searchTerms">
<span class="input-group-btn">
<button class="btn btn-default" type="submit" id="submit">Search</button>
</span>
</div>
</form>
<br>
<table class="table">
<thead class="font-spot-color">
<tr>
<th>Name</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tournament in allTournaments">
<td><a ng-href="/tournaments/{{tournament.id}}">{{ tournament.name }}</a></td>
<td>{{ tournament.date }}</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,169 @@
<a href="/tournaments" class="btn btn-default">Back to browse tournaments</a>
<h1>
{{ tournament.name }}
</h1>
<p>
<strong>Address:</strong>
{{ tournament.address }}
</p>
<p>
<strong>Director:</strong>
{{ tournament.director }}
</p>
<p>
<strong>Director email:</strong>
{{ tournament.director_email }}
</p>
<p>
<strong>Tournament Type:</strong>
{{ tournament.tournament_type }}
</p>
<br>
<div class="panel panel-default">
<a class="panel-heading" data-toggle="collapse" href="#Schools" aria-expanded="false" style="display: block;">
<h3 class="panel-title">School Lineups and Team Scores<span class="pull-left clickable"><i class="glyphicon glyphicon-chevron-down"></i></span></h3>
</a>
<div id="Schools" class="panel-collapse collapse">
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="school in tournament.schools | orderBy : 'score'">
<td>{{ school.name }}</td>
<td>{{ school.score }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<a class="panel-heading" data-toggle="collapse" href="#Weights" aria-expanded="false" style="display: block;">
<h3 class="panel-title">Weights and Seeds<span class="pull-left clickable"><i class="glyphicon glyphicon-chevron-down"></i></span></h3>
</a>
<div id="Weights" class="panel-collapse collapse">
<div class="panel-body">
<p>Click weight class for seeds</p>
<br>
<table class="table">
<thead>
<tr>
<th>Weight Class</th>
<th>Bracket Size</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="weight in tournament.weights | orderBy : 'max' : reverse">
<td><a data-toggle="modal" data-target="#Weight{{weight.id}}">{{ weight.max }}</a></td>
<td>{{ weight.bracket_size }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<a class="panel-heading" data-toggle="collapse" href="#Mats" aria-expanded="false" style="display: block;" >
<h3 class="panel-title">Mats and Bout Board<span class="pull-left clickable"><i class="glyphicon glyphicon-chevron-down"></i></span></h3>
</a>
<div id="Mats" class="panel-collapse collapse">
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>On Mat</th>
<th>On Deck</th>
<th>In The Hole</th>
<th>Warm Up</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="mat in tournament.mats">
<td>{{ mat.name }}</td>
<td>{{ mat.unfinishedMatches[0].bout_number }} {{ mat.unfinishedMatches[0].w1_name }} vs. {{ mat.unfinishedMatches[0].w2_name }}</td>
<td>{{ mat.unfinishedMatches[1].bout_number }} {{ mat.unfinishedMatches[0].w1_name }} vs. {{ mat.unfinishedMatches[0].w2_name }}</td>
<td>{{ mat.unfinishedMatches[2].bout_number }} {{ mat.unfinishedMatches[0].w1_name }} vs. {{ mat.unfinishedMatches[0].w2_name }}</td>
<td>{{ mat.unfinishedMatches[3].bout_number }} {{ mat.unfinishedMatches[0].w1_name }} vs. {{ mat.unfinishedMatches[0].w2_name }}</td>
</tr>
</tbody>
</table>
<br>
<h3>Matches not assigned</h3>
<br>
<table class="table">
<thead>
<tr>
<th>Round</th>
<th>Bout Number</th>
<th>Weight Class</th>
<th>Matchup</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="match in tournament.unassignedMatches">
<td>Round {{ match.round }}</td>
<td>{{ match.bout_number }}</td>
<td>{{ match.weightClass }}</td>
<td>{{ match.w1_name }} vs. {{ match.w2_name }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--Hidden modals-->
<div ng-repeat="weight in tournament.weights">
<div class="modal fade bs-example-modal-lg" id="Weight{{weight.id}}" tabindex="-1" role="dialog" aria-labelledby="Weight{{weight.id}}">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title" id="gridSystemModalLabel">{{weight.max}}</h3>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>School</th>
<th>Seed</th>
<th>Record</th>
<th>Criteria</th>
<th>Extra?</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="wrestler in weight.wrestlers | orderBy : 'original_seed' : reverse">
<td>{{wrestler.name}}</td>
<td>{{wrestler.school}}</td>
<td>{{wrestler.original_seed}}</td>
<td>{{wrestler.season_win}}-{{wrestler.season_loss}}</td>
<td>{{wrestler.criteria}} Win %{{wrestler.seasonWinPercentage}}</td>
<td>{{wrestler.extra}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>