Skip to content

Commit

Permalink
Created select
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCodeDestroyer committed Jan 19, 2015
1 parent 73278a4 commit c3980f0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
5 changes: 4 additions & 1 deletion www/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
}
},
"workout": {
"TITLE": "Workout"
"TITLE": "Workout",
"placeholders":{
"DAY_SELECT": "Select a day"
}
},
"sideMenu": {
"TITLE": "Main menu"
Expand Down
2 changes: 1 addition & 1 deletion www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ angular.module('arete', [
'use strict';

$translateProvider.useLocalStorage();
$translateProvider.preferredLanguage('en-US');
$translateProvider.useStaticFilesLoader({
prefix: 'i18n/',
suffix: '.json'
});
$translateProvider.preferredLanguage('en-US');

persistence.debug = false;
persistence.store.cordovasql.config(
Expand Down
9 changes: 8 additions & 1 deletion www/js/workout/controllers/wrkDetailCtrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
angular.module('arete.controllers').controller('wrkDetailCtrl', function ($state, $stateParams) {
angular.module('arete.controllers').controller('wrkDetailCtrl', function ($scope, $translate, $stateParams) {
'use strict';

var vm = this;
vm.workoutId = $stateParams.id;
vm.selected = '';
vm.days = [];

for (var i = 1; i < 8; i++) {
var day = { id: i, label: 'general.days.' + i };
vm.days.push(day);
}

});
17 changes: 10 additions & 7 deletions www/js/workout/partials/wrkDetail.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<ion-view title="{{ 'workout.TITLE' | translate }}">
<ion-content has-bouncing="false">
<div class="list">
<label class="item item-input item-stacked-label">
<label class="item item-input">
<span class="input-label">Name</span>
<input type="text" placeholder="Workout name">
<input ng-model="wrkDetail.workout.name" type="text" placeholder="Workout name">
</label>
<label class="item item-input item-stacked-label">
<label class="item item-input">
<span class="input-label">Time</span>
<input type="text" placeholder="Time">
<timepicker class="ionic-input-reset" ng-model="wrkDetail.workout.time" hour-step="1" minute-step="1" show-meridian="true"></timepicker>
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Date/Day</span>
<input type="text" placeholder="Date/Day">
<label class="item item-input item-select">
<span class="input-label">Day</span>
<select ng-model="wrkDetail.selectedDay">
<option translate value="">workout.placeholders.DAY_SELECT</option>
<option ng-repeat="day in wrkDetail.days" value="{{ day.id }}" translate>{{ day.label }}</option>
</select>
</label>
</div>
</ion-content>
Expand Down

0 comments on commit c3980f0

Please sign in to comment.