diff --git a/app/controllers.ts b/app/controllers.ts index aefcab8..0354f68 100755 --- a/app/controllers.ts +++ b/app/controllers.ts @@ -10,7 +10,7 @@ class WeightsCtrl { weights: any[]; constructor( public Weights: Services.IWeightsService - ) { + ) { this.weights = Weights.all(); } remove(weight) { @@ -28,17 +28,15 @@ class WeightDetailCtrl { constructor( public Weights: Services.IWeightsService, public $stateParams: IStateParams - ) { + ) { this.weight = Weights.get($stateParams.weightId); } } class SettingsCtrl { settings: Object; - constructor() { - this.settings = { - enableFriends: true - }; + constructor(public Settings: Services.IUserSettings) { + this.settings = Settings; } } diff --git a/app/services.ts b/app/services.ts index dd97193..ddb3fbb 100755 --- a/app/services.ts +++ b/app/services.ts @@ -13,6 +13,54 @@ module Services { face: String; } + export interface IExercise { + id: Number; + name: String; + workingWeight: Number; + warmupWeight: Number; + workingSets: Number; + warmupSets: Number; + maxWeight: Number; + reps: Number; + } + + export interface ISession { + id: Number; + date: Date; + exercises: Array; + } + + export interface IUserSettings { + restPerExercise: Number; + restPerSet: Number; + availableWeights: Array; + } + + + export class WeightValue { + constructor(public weight: Number, public enabled: Boolean) { + this.weight = weight; + this.enabled = enabled; + } +} + export class UserSettings implements IUserSettings { + restPerExercise: 180; + restPerSet: 90; + + availableWeights: Array + constructor() { + this.availableWeights = []; + this.restPerExercise = 180; + this.restPerSet = 90; + let defaultWeightValues = [2.5, 5, 10, 15, 25, 35, 45]; + + for (let val in defaultWeightValues) { + this.availableWeights.push(new WeightValue(defaultWeightValues[val], true)); + } + + } + } + export class Weights implements IWeightsService { weights: Array; constructor() { @@ -62,5 +110,5 @@ module Services { } angular.module('starter.services', []) - + .service('Settings', Services.UserSettings) .service('Weights', Services.Weights); diff --git a/www/templates/tab-settings.html b/www/templates/tab-settings.html index 8ba3c2c..de2517d 100755 --- a/www/templates/tab-settings.html +++ b/www/templates/tab-settings.html @@ -1,9 +1,18 @@ - - Enable Friends - + Rest Time Per Exercise (s) + + Rest Time Per Set (s) + + + + Available Weights + + + {{weight.weight}} + +