1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-01 12:15:25 +00:00

Added frontend pages and trying to model wrestlers on frontend

This commit is contained in:
2016-04-26 01:14:15 +00:00
parent 5b9f64b3f9
commit 84578d89da
9 changed files with 79 additions and 40 deletions

View File

@@ -13,6 +13,7 @@ json.cache! ["api_tournament", @tournament] do
json.max weight.max
json.bracket_size weight.bracket_size
json.wrestlers weight.wrestlers do |wrestler|
json.id wrestler.id
json.name wrestler.name
json.school wrestler.school.name
json.original_seed wrestler.original_seed
@@ -27,6 +28,8 @@ json.cache! ["api_tournament", @tournament] do
json.mats @tournament.mats do |mat|
json.name mat.name
json.unfinishedMatches mat.unfinishedMatches do |match|
json.w1 = match.w1
json.w2 = match.w2
json.bout_number match.bout_number
json.w1_name match.w1_name
json.w2_name match.w2_name
@@ -39,5 +42,17 @@ json.cache! ["api_tournament", @tournament] do
json.w2_name match.w2_name
json.weightClass match.weight.max
json.round match.round
json.w1 = match.w1
json.w2 = match.w2
end
json.matches @tournament.matches do |match|
json.bout_number match.bout_number
json.w1_name match.w1_name
json.w2_name match.w2_name
json.weightClass match.weight.max
json.round match.round
json.w1 = match.w1
json.w2 = match.w2
end
end

View File

@@ -1,5 +1,5 @@
'use strict';
app.controller("tournamentController", function($scope, tournamentsService, $routeParams) {
app.controller("tournamentController", function($scope, tournamentsService, $routeParams, Wrestler) {
$scope.message = "Test message in scope.";
// $scope.tournamentData = "test";
@@ -9,4 +9,7 @@ app.controller("tournamentController", function($scope, tournamentsService, $rou
$scope.tournament = data;
});
$scope.wrestler = Wrestler;
});

View File

@@ -0,0 +1,19 @@
'use strict';
app.factory('Wrestler', function Wrestler(){
var vm = this;
vm.matches = function(matches,wrestler){
var givenWrestler = wrestler;
console.log(givenWrestler.id);
return _.filter(matches, function(match){
return match.w1 == givenWrestler.id || match.w2 == givenWrestler.id;
});
}
return vm;
});

View File

@@ -31,8 +31,8 @@ function tournamentsService($http){
};
function successResponse(response){
console.log("success log below");
console.log(response);
// console.log("success log below");
// console.log(response);
return response.data;
}

View File

@@ -10,41 +10,44 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
</head>
<body style="padding-top: 70px;">
<div class="container">
<div class="navbar-roof"></div>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">WrestlingDev</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right navbar-custom-link">
<li><a href="/tournaments">Browse Tournaments</a></li>
<li><a href="/about">About</a></li>
<li><a href="/tutorials">Tutorials</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="navbar-roof"></div>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">WrestlingDev</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right navbar-custom-link">
<li><a href="/tournaments">Browse Tournaments</a></li>
<li><a href="/about">About</a></li>
<li><a href="/tutorials">Tutorials</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div id="page-content">
<div class="row no-margin">
<div class="col-md-2">
<!--leftsidebar-->
<!--left sidebar-->
</div>
<!--content-->
<div class="col-md-8" style="padding-left: 2%;" id="view" ng-view></div>
<div class="col-md-8" style="padding-left: 2%;">
<div id="view" ng-view></div>
</div>
<div class="col-md-2" >
<!--rightsidebar-->
<!--right sidebar-->
</div>
</div>
</div>
</div>
<!--footer-->
</div>
</body>
<!-- Latest compiled and minified JavaScript -->
@@ -62,8 +65,12 @@
<!--Mobile and tablet detection-->
<script type='text/javascript' src="//wurfl.io/wurfl.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</html>

View File

@@ -1,5 +1,4 @@
<div class="col-md-8" style="padding-left: 2%;">
<div class="container" ui-view="main" >
<div class="container" >
<h3>About WrestlingDev</h3>
<br>
<p>WrestlingDev was created to help bring wrestling into the 21st century for <strong>free</strong>. This site is <a href="https://github.com/jcwimer/wrestlingApp">open source</a> and is supported by the ads on the sidebar.</p>
@@ -47,4 +46,3 @@
<br>
<p>Suggestions, criticism, and kind words are welcomed. Please contact us.</p>
</div>
</div>

View File

@@ -1,5 +1,4 @@
<div class="col-md-8" style="padding-left: 2%;">
<div class="center hero-unit" ui-view="main">
<div class="center hero-unit" >
<h1>Welcome to WrestlingDev</h1>
<br>
<p>This website was created to help wrestling coaches run their tournaments. It is 2015, why are we still running bout sheets to tables and why are we still using resources to push cards on a bout board? This website was created as a <strong>free</strong> way for coaches to run a tournament smoothly with as few workers as possible.</p>
@@ -9,4 +8,3 @@
<a href='/tournaments' class="btn btn-large btn-primary">Browse Tournaments</a>
<p></p>
</div>
</div>

View File

@@ -1,5 +1,4 @@
<div class="col-md-8" style="padding-left: 2%;">
<div class="container" ui-view="main" >
<div class="container" >
<h3>Tutorials</h3>
<br>
<p>Unfortunately, I do not have tutorials available at this moment in time. If you would like to learn how to use this software, please email me at jacob.wimer@gmail.com and I will gladly provide an overview of how to use this software. I've done my best to make the software intuitive and easy to use.</p>
@@ -18,4 +17,3 @@
<li>Matches can be scored at the tables and submitted via computer or bout sheets can be brought to the head table and entered there</li>
</ul>
</div>
</div>

View File

@@ -1,7 +1,9 @@
<a href="/tournaments" class="btn btn-default">Back to browse tournaments</a>
<h1>
{{ tournament.name }}
</h1>
<h1>{{ wrestler.matches(tournament.matches,tournament.weights[0].wrestlers[0]) }}</h1>
<p>
<strong>Address:</strong>
{{ tournament.address }}
@@ -166,4 +168,3 @@