Skip to content

Commit

Permalink
Cleaned up some display features
Browse files Browse the repository at this point in the history
  • Loading branch information
ryradack committed Jan 12, 2018
1 parent c802cd9 commit 4dbab88
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 24 deletions.
10 changes: 0 additions & 10 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ app.run(function($rootScope, $location, $mdDialog){
$rootScope.loggedIn = false;
$rootScope.newUser = false;
var db = firebase.firestore();

//Trigger drop down boxes to update with team information
// $rootScope.teamAssigned = function() {
// console.warn('emitting');
// $rootScope.$broadcast("TeamAssigned", {});
// $rootScope.$emit("TeamAssigned", {});
// }

firebase.auth().onAuthStateChanged(function(user){
console.log('Auth State Changed');
Expand All @@ -24,7 +17,6 @@ app.run(function($rootScope, $location, $mdDialog){
console.log('User exists in Firestore');
console.log('userTeam: '+doc.data().team);
$rootScope.userTeam = doc.data().team;
// $rootScope.teamAssigned();
}else{
$rootScope.showPrompt();
//Set flag to display team register directive
Expand Down Expand Up @@ -85,14 +77,12 @@ app.run(function($rootScope, $location, $mdDialog){
team : result
}, { merge: true });
$rootScope.userTeam = result;
// $rootScope.teamAssigned();
}, function() {
var ref = db.collection('users').doc($rootScope.user.uid);
ref.set({
team : 0
}, { merge: true });
$rootScope.userTeam = 0;
// $rootScope.teamAssigned();
});
};
});
Expand Down
29 changes: 29 additions & 0 deletions public/controllers/inputController.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,33 @@ app.controller('inputControl', ['$scope', '$http', '$rootScope', function($scope
$scope.calculateAverage();
})
};

$scope.preShow = true;
$scope.autoShow = false;
$scope.teleShow = false;
$scope.endShow = false;
$scope.autoBack = function(){
$scope.preShow = true;
$scope.autoShow = false;
$scope.teleShow = false;
$scope.endShow = false;
}
$scope.preNext = function(){
$scope.preShow = false;
$scope.autoShow = true;
$scope.teleShow = false;
$scope.endShow = false;
};
$scope.autoNext = function(){
$scope.autoShow = false;
$scope.teleShow = true;
$scope.preShow = false;
$scope.endShow = false;
};
$scope.teleNext = function(){
$scope.teleShow = false;
$scope.endShow = true;
$scope.preShow = false;
$scope.autoShow = false;
};
}]);
4 changes: 2 additions & 2 deletions public/directives/autoCard.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<!-- TODO - Need to figure out better label -->
</md-card-content>
<md-card-actions layout='row' layout-align='end end'>
<md-button ng-click=''>Submit</md-button>
<md-button ng-click='autoBack()'>Back</md-button>
<md-button ng-click='autoNext()'>Next</md-button>
</md-card-actions>

</md-card>
4 changes: 2 additions & 2 deletions public/directives/endGame.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</md-card-title>
<md-card-content>
<md-radio-group ng-model="CubeAutoLoca" class="flex">
<label style="font-weight:bold;">End Game</label>
<label style="font-weight:bold;">End Game</label><!-- should this be a drop-down? -->
<md-radio-button value="notryclimb" class="md-primary">Not Parked on Platform</md-radio-button>
<md-radio-button value="parked" class="md-primary">Parked on Platform</md-radio-button>
<md-radio-button value="atmpthook" class="md-primary">Attempted to Hook onto Bar</md-radio-button>
Expand All @@ -32,7 +32,7 @@
</md-checkbox>
</md-card-content>
<md-card-actions layout='row' layout-align='end end'>
<md-button ng-click='autoNext()'>Back</md-button>
<md-button ng-click=''>Submit</md-button>
</md-card-actions>

</md-card>
5 changes: 4 additions & 1 deletion public/directives/exportCSVCard.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<md-card>
<md-card-title>
<md-card-title-text>
<span class='md-headline'>Download CSV: {{ exportCompetition.id }}</span>
<span class='md-headline'>Download CSV: {{ exportCompetition.name }}</span>
</md-card-title-text><br>
</md-card-title>
<md-card-content>
Expand All @@ -10,6 +10,9 @@
<label style="position:relative;">Competition:</label>
<select ng-model="exportCompetition" class="md-no-underline" ng-options="obj.name for obj in options" ng-change="csvCompChange()"></select>
</md-input-container>
<!-- <md-checkbox ng-model="teamDataOnly" class="md-primary" aria-label="teamDataCheckbox" ng-change="csvCompChange()">
Team data only
</md-checkbox><br> -->
</md-card-content>
<md-card-actions layout='row' layout-align='end end'>
<md-button ng-csv="csvArray" csv-header="csvHeader" filename="{{ exportCompetition.id }}.csv">Download</md-button>
Expand Down
2 changes: 1 addition & 1 deletion public/directives/preMatchCard.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
</md-input-container><br>
</md-card-content>
<md-card-actions layout='row' layout-align='end end'>
<md-button ng-click=''>Submit</md-button>
<md-button ng-click='preNext()'>Next</md-button>
</md-card-actions>
</md-card>
2 changes: 1 addition & 1 deletion public/directives/sideNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class='md-toolbar-tools' layout='column' layout-align='start' layout-padding>
<h2>ScoutingFRC</h2>
<span flex></span>
<h3>User's Name</h3>
<h2>{{ user.displayName }}</h2>
</div>
</md-toolbar>

Expand Down
3 changes: 2 additions & 1 deletion public/directives/teleop.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
</md-checkbox>
</md-card-content>
<md-card-actions layout='row' layout-align='end end'>
<md-button ng-click=''>Submit</md-button>
<md-button ng-click='preNext()'>Back</md-button>
<md-button ng-click='teleNext()'>Next</md-button>
</md-card-actions>
</md-card>
11 changes: 5 additions & 6 deletions public/views/matches.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<h1>Title Card for Matches</h1>
<h1>Match Scouting</h1>

<pre-match-card></pre-match-card>
<auto-card></auto-card>

<teleop></teleop>
<end-game></end-game>
<pre-match-card ng-show='preShow'></pre-match-card>
<auto-card ng-show='autoShow'></auto-card>
<teleop ng-show='teleShow'></teleop>
<end-game ng-show='endShow'></end-game>

0 comments on commit 4dbab88

Please sign in to comment.