Skip to content

Commit

Permalink
Release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LoganArnett committed Dec 9, 2014
2 parents 0595467 + ac6fd7f commit 298beee
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/app/controllers/history.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

angular.module('activ8')

.controller('HistoryController', function(Auth, $firebase){
var ref = new Firebase("https://activ8.firebaseio.com/workouts/" + Auth.getUser().uid).orderByKey().limitToLast(3);

var sync = $firebase(ref);

var historyArray = sync.$asArray();

this.historyList = historyArray



});
16 changes: 16 additions & 0 deletions src/app/controllers/main.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ angular.module('activ8')
*/
logout: function(){
auth.$unauth();
<<<<<<< HEAD
=======
console.log("HELLO")
>>>>>>> release/RELEASE
},
/**
*Get the current user.
Expand Down Expand Up @@ -92,6 +96,18 @@ angular.module('activ8')
} // END updateUser
}) // END factory(Auth)

<<<<<<< HEAD
=======
// .factory("History", function(Auth, $firebase) {
// return function() {
// // create a reference to the user's profile
// var ref = new Firebase("https://activ8.firebaseio.com/workouts/" + Auth.getUser().uid).orderBy("timestamp").limitToLast(3);
// // return it as a synchronized object
// return $firebase(ref).$asObject();
// }
// })

>>>>>>> release/RELEASE
/**
* Main application Controller
*
Expand Down
78 changes: 78 additions & 0 deletions src/app/controllers/new-workout.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

angular.module('activ8')

<<<<<<< HEAD
.controller('WorkoutController', function(Auth){
var ref = new Firebase("https://activ8.firebaseio.com/users/" + Auth.getUser().uid),
=======
.controller('WorkoutController', function(Auth, $firebase){
var ref = new Firebase("https://activ8.firebaseio.com/workouts/" + Auth.getUser().uid),
>>>>>>> release/RELEASE
self = this,
movements = {
"PullUps": {
Expand Down Expand Up @@ -44,6 +49,7 @@ angular.module('activ8')
}
};

<<<<<<< HEAD

console.log(movements["PullUps"].type)
// Utilize the Date for titles?
Expand Down Expand Up @@ -113,3 +119,75 @@ angular.module('activ8')
// <datalist id="comicstitle">
// <option data-ng-repeat="ttl in titles" value="{{ttl}}">
// </datalist>
=======
//Posting Workouts to the Workout Array
this.workout = [ ];

this.addMove = function(){
this.workout.push({
name: "",
reps: "",
rds: "",
weight: "",
moveNumber: this.workout.length + 1,
date: Date.now()
});
};
//Delete Movement from a workout
this.delete = function(move) {
var index = this.workout.indexOf(move)
this.workout.splice(index, 1);
}

// Utilize the Date for titles?
this.date = Date.now();
var sync = $firebase(ref)

this.newWorkout = sync.$asArray();
this.addWork = function(workout){
this.newWorkout.$add(workout);
this.workout = [ ];
}

// ref.orderByKey().limitToLast(3).on("child_added", function(snapshot) {
// console.log(snapshot.key());
// });
this.moveList = {};
this.moveList.movements = movements;

//Working on displaying the right properties of each movement
this.repsRounds = function(){
if($('.naming1').val() === ""){
return false;
}
else if($('.naming1').val()){
return true;
}
}
//Checking the Movement Value to display proper inputs
this.weighted = function(){
if($(".naming1").val().indexOf("Clean") > -1){
return true;
}
// else if($(".naming1").val().indexOf("Snatch") > -1){
// return true;
// }
// else if($(".naming1").val().indexOf("Jerk") > -1){
// return true;
// }
// else if($(".naming1").val().indexOf("Press") > -1){
// return true;
// }
// else if($(".naming1").val().indexOf("Kettle") > -1){
// return true;
// }
// else if($(".naming1").val().indexOf("Dumbbell") > -1){
// return true;
// }
else {
return false;
}
}

});//End Controller
>>>>>>> release/RELEASE
26 changes: 26 additions & 0 deletions src/app/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ h1 {
background-color: rgba(0,0,0,0.6);
text-align: center;
height: 100vh;
<<<<<<< HEAD
=======
position: relative;
display: flex;
>>>>>>> release/RELEASE
}
.main-dash {
width: 100%;
Expand Down Expand Up @@ -273,6 +278,27 @@ h4 {
top: 10%;
right: 2%;
}
<<<<<<< HEAD
=======
.new-move {
margin-top: 30%;
overflow: auto;
height: auto;
padding: .5rem;
width: 100%;
-webkit-overflow-scrolling: touch;
}
.new-move::-webkit-scrollbar {
display: none;
}
.history-list {
list-style-type: none;
}
.new-moves {
width: 80%;
margin: 0 auto;
}
>>>>>>> release/RELEASE
/* @media (min-width: 380px){
.loginText {
top: 75%;
Expand Down
7 changes: 7 additions & 0 deletions src/app/views/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ <h3>Days Active Chart</h3>
</section>
</div>
<div class="row row-3">
<<<<<<< HEAD
<section class="myHistory col-xs-12">
=======
<section class="myHistory col-xs-12" ng-controller="HistoryController as history">
>>>>>>> release/RELEASE
<p>My History</p>
</section>
</div>
Expand Down Expand Up @@ -90,6 +94,7 @@ <h3 class="records">Personal Records(PR's)</h3>
<a href="#dashboard"><span class="glyphicon glyphicon-chevron-up"></span></a>
</section>
</section>
<<<<<<< HEAD



Expand All @@ -104,3 +109,5 @@ <h3 class="records">Personal Records(PR's)</h3>



=======
>>>>>>> release/RELEASE
22 changes: 22 additions & 0 deletions src/app/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ <h1 class="appName">Activ8</h1>
<section ng-hide="app.loggedIn()" class="kettleBox" >
<span>You are logged out. ln#17</span>
<figure ng-click="app.login()">
<<<<<<< HEAD
<a><img src="./assets/images/kettlebell.png" alt="" class="img-responsive kettle"></a><br>
=======
<a><img src="./assets/images/reebokxfit.png" alt="" class="img-responsive kettle"></a><br>
>>>>>>> release/RELEASE
<figcaption class="loginText">
<a href="#"><h3>Login</h3></a>
</figcaption>
Expand Down Expand Up @@ -57,8 +61,26 @@ <h3>Days Active Chart</h3>
</div>
<!-- BEGIN History -->
<div class="row row-3">
<<<<<<< HEAD
<section class="myHistory col-xs-12">
<p>My History</p>
=======
<section class="myHistory col-xs-12" ng-controller="HistoryController as history">
<p>My History</p>
<ul class="history-list">
<li ng-repeat="list in history.historyList ">
<a ng-href="#">{{list[0].date | date:'short'}}</a><br>
<!-- Move:{{list[0].name}}<br>
Reps:{{list[0].reps}}<br>
Rds:{{list[0].rds}}<br>
Weight:{{list[0].weight}}<br>
Move:{{list[1].name}}<br>
Reps:{{list[1].reps}}<br>
Rds:{{list[1].rds}}<br>
Weight:{{list[1].weight}}<br> -->
</li>
</ul>
>>>>>>> release/RELEASE
</section>
</div>
<!-- BEGIN "page-down" content -->
Expand Down
43 changes: 43 additions & 0 deletions src/app/views/new-workout.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
<!-- TODO: extract, inject nav with ng-include instead -->
<<<<<<< HEAD
<div class="container-fluid main-body" ng-controller="MainController">
=======
<div class="container-fluid main-body" ng-controller="MainController as app">
>>>>>>> release/RELEASE
<nav class="navbar navbar-default main-nav" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<<<<<<< HEAD
<img class="ree" src="images/reebokxfit.png" alt="">
=======
<img class="ree" src="./assets/images/reebokxfit.png" alt="">
>>>>>>> release/RELEASE
</a>
<a class="name" href="#">
<h1 class="appName navbar-left">Activ8</h1>
</a>
<<<<<<< HEAD
<button ng-click="logOut()" class="logout navbar-right btn">Logout</button>
=======
<button ng-click="app.logout()" class="logout navbar-right btn">Logout</button>
>>>>>>> release/RELEASE
</div>
</div>
</nav>
<!-- /TODO -->
<<<<<<< HEAD

<section class="main" ng-controller="WorkoutController as work">
<form class="newMove" style="margin-top: 40%;" ng-submit="work.postWorkout()">
Expand Down Expand Up @@ -48,4 +61,34 @@ <h1 class="appName navbar-left">Activ8</h1>
<a class="addWorkout removeWorkout" ><h4>(+) Add Workout</h4></a>
<button ng-click="work.addWorkout()" class="save btn btn-primary" type="submit">Save</button>
</section>
=======
<section class="main" ng-controller="WorkoutController as work">

<form class="new-move" ng-submit="work.addWork(work.workout)">
<label><h4>Today's Workout</h4></label><br>
<div class="new-moves" ng-repeat="move in work.workout">
<input class="form-control" ng-model="move.name" type="text" list="moving" placeholder="Select Movement" autocomplete="on">
<input type="text" class="form-control" ng-model="move.reps" placeholder="Reps">
<input type="text" class="form-control" ng-model="move.rds" placeholder="Rounds">
<div class="input-group">
<input type="text" class="form-control" ng-model="move.weight" placeholder="Weight">
<span class="input-group-btn">
<button class="btn btn-danger glyphicon glyphicon-trash" type="button" ng-click="work.delete(move)"></button>
</span>
</div><!-- /input-group -->
<input type="text" ng-hide="true" ng-model="move.moveNumber"><br>

</div>
<div>
<input type="Button" class="btn btn-success" value="(+)Add Movement" ng-click="work.addMove()"><br>
<input type="submit" class="btn btn-primary" value="Save Workout">
</div>
</form>

<datalist id="moving">
<option data-ng-repeat="moves in work.moveList.movements" value="{{moves.name}}"></option>
</datalist>
<br>
</section> <!-- / .main -->
>>>>>>> release/RELEASE
</div><!-- /.main-body -->
7 changes: 7 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@
<!-- build:js({.tmp,src}) scripts/app.js -->
<script src="app/index.js"></script>
<script src="app/controllers/main.controller.js"></script>
<<<<<<< HEAD
<script src="app/controllers/new-workout.controller.js"></script>
<script src="components/navbar/navbar.controller.js"></script>
=======
<script src="components/navbar/navbar.controller.js"></script>
<script src="app/controllers/new-workout.controller.js"></script>
<script src="app/controllers/history.controller.js"></script>

>>>>>>> release/RELEASE

<!-- inject:partials -->
<!-- angular templates will be automaticaly converted in js and inserted here -->
Expand Down

0 comments on commit 298beee

Please # to comment.