mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-28 01:31:29 +00:00
Added frontend pages and trying to model wrestlers on frontend
This commit is contained in:
@@ -13,6 +13,7 @@ json.cache! ["api_tournament", @tournament] do
|
|||||||
json.max weight.max
|
json.max weight.max
|
||||||
json.bracket_size weight.bracket_size
|
json.bracket_size weight.bracket_size
|
||||||
json.wrestlers weight.wrestlers do |wrestler|
|
json.wrestlers weight.wrestlers do |wrestler|
|
||||||
|
json.id wrestler.id
|
||||||
json.name wrestler.name
|
json.name wrestler.name
|
||||||
json.school wrestler.school.name
|
json.school wrestler.school.name
|
||||||
json.original_seed wrestler.original_seed
|
json.original_seed wrestler.original_seed
|
||||||
@@ -27,6 +28,8 @@ json.cache! ["api_tournament", @tournament] do
|
|||||||
json.mats @tournament.mats do |mat|
|
json.mats @tournament.mats do |mat|
|
||||||
json.name mat.name
|
json.name mat.name
|
||||||
json.unfinishedMatches mat.unfinishedMatches do |match|
|
json.unfinishedMatches mat.unfinishedMatches do |match|
|
||||||
|
json.w1 = match.w1
|
||||||
|
json.w2 = match.w2
|
||||||
json.bout_number match.bout_number
|
json.bout_number match.bout_number
|
||||||
json.w1_name match.w1_name
|
json.w1_name match.w1_name
|
||||||
json.w2_name match.w2_name
|
json.w2_name match.w2_name
|
||||||
@@ -39,5 +42,17 @@ json.cache! ["api_tournament", @tournament] do
|
|||||||
json.w2_name match.w2_name
|
json.w2_name match.w2_name
|
||||||
json.weightClass match.weight.max
|
json.weightClass match.weight.max
|
||||||
json.round match.round
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
app.controller("tournamentController", function($scope, tournamentsService, $routeParams) {
|
app.controller("tournamentController", function($scope, tournamentsService, $routeParams, Wrestler) {
|
||||||
$scope.message = "Test message in scope.";
|
$scope.message = "Test message in scope.";
|
||||||
|
|
||||||
// $scope.tournamentData = "test";
|
// $scope.tournamentData = "test";
|
||||||
@@ -9,4 +9,7 @@ app.controller("tournamentController", function($scope, tournamentsService, $rou
|
|||||||
$scope.tournament = data;
|
$scope.tournament = data;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.wrestler = Wrestler;
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
19
frontend/app/js/models/wrestler.js
Normal file
19
frontend/app/js/models/wrestler.js
Normal 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;
|
||||||
|
});
|
||||||
@@ -31,8 +31,8 @@ function tournamentsService($http){
|
|||||||
};
|
};
|
||||||
|
|
||||||
function successResponse(response){
|
function successResponse(response){
|
||||||
console.log("success log below");
|
// console.log("success log below");
|
||||||
console.log(response);
|
// console.log(response);
|
||||||
return response.data;
|
return response.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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">
|
<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>
|
</head>
|
||||||
<body style="padding-top: 70px;">
|
<body style="padding-top: 70px;">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-roof"></div>
|
<div class="navbar-roof"></div>
|
||||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
<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="sr-only">Toggle navigation</span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="/">WrestlingDev</a>
|
<a class="navbar-brand" href="/">WrestlingDev</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="navbar" class="collapse navbar-collapse">
|
<div id="navbar" class="collapse navbar-collapse">
|
||||||
<ul class="nav navbar-nav navbar-right navbar-custom-link">
|
<ul class="nav navbar-nav navbar-right navbar-custom-link">
|
||||||
<li><a href="/tournaments">Browse Tournaments</a></li>
|
<li><a href="/tournaments">Browse Tournaments</a></li>
|
||||||
<li><a href="/about">About</a></li>
|
<li><a href="/about">About</a></li>
|
||||||
<li><a href="/tutorials">Tutorials</a></li>
|
<li><a href="/tutorials">Tutorials</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div><!--/.nav-collapse -->
|
</div><!--/.nav-collapse -->
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div id="page-content">
|
<div id="page-content">
|
||||||
<div class="row no-margin">
|
<div class="row no-margin">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<!--leftsidebar-->
|
<!--left sidebar-->
|
||||||
</div>
|
</div>
|
||||||
<!--content-->
|
<div class="col-md-8" style="padding-left: 2%;">
|
||||||
<div class="col-md-8" style="padding-left: 2%;" id="view" ng-view></div>
|
<div id="view" ng-view></div>
|
||||||
|
</div>
|
||||||
<div class="col-md-2" >
|
<div class="col-md-2" >
|
||||||
<!--rightsidebar-->
|
<!--right sidebar-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!--footer-->
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<!-- Latest compiled and minified JavaScript -->
|
<!-- Latest compiled and minified JavaScript -->
|
||||||
@@ -62,8 +65,12 @@
|
|||||||
<!--Mobile and tablet detection-->
|
<!--Mobile and tablet detection-->
|
||||||
<script type='text/javascript' src="//wurfl.io/wurfl.js"></script>
|
<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]>
|
<!--[if lt IE 9]>
|
||||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<div class="col-md-8" style="padding-left: 2%;">
|
<div class="container" >
|
||||||
<div class="container" ui-view="main" >
|
|
||||||
<h3>About WrestlingDev</h3>
|
<h3>About WrestlingDev</h3>
|
||||||
<br>
|
<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>
|
<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>
|
<br>
|
||||||
<p>Suggestions, criticism, and kind words are welcomed. Please contact us.</p>
|
<p>Suggestions, criticism, and kind words are welcomed. Please contact us.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<div class="col-md-8" style="padding-left: 2%;">
|
<div class="center hero-unit" >
|
||||||
<div class="center hero-unit" ui-view="main">
|
|
||||||
<h1>Welcome to WrestlingDev</h1>
|
<h1>Welcome to WrestlingDev</h1>
|
||||||
<br>
|
<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>
|
<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>
|
<a href='/tournaments' class="btn btn-large btn-primary">Browse Tournaments</a>
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<div class="col-md-8" style="padding-left: 2%;">
|
<div class="container" >
|
||||||
<div class="container" ui-view="main" >
|
|
||||||
<h3>Tutorials</h3>
|
<h3>Tutorials</h3>
|
||||||
<br>
|
<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>
|
<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>
|
<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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
|
|
||||||
<a href="/tournaments" class="btn btn-default">Back to browse tournaments</a>
|
<a href="/tournaments" class="btn btn-default">Back to browse tournaments</a>
|
||||||
<h1>
|
<h1>
|
||||||
{{ tournament.name }}
|
{{ tournament.name }}
|
||||||
</h1>
|
</h1>
|
||||||
|
<h1>{{ wrestler.matches(tournament.matches,tournament.weights[0].wrestlers[0]) }}</h1>
|
||||||
<p>
|
<p>
|
||||||
<strong>Address:</strong>
|
<strong>Address:</strong>
|
||||||
{{ tournament.address }}
|
{{ tournament.address }}
|
||||||
@@ -166,4 +168,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user