Begining of add new tesk

This commit is contained in:
Sagi Dayan 2015-06-21 22:27:48 +03:00
parent 19aa25de2a
commit 94a9c3dbb0
5 changed files with 80 additions and 0 deletions

View file

@ -45,6 +45,10 @@ app.config(['$routeProvider', '$locationProvider',
.when('/tasks', { .when('/tasks', {
templateUrl: 'templates/views/tasks.html', templateUrl: 'templates/views/tasks.html',
controller: 'tasksController' controller: 'tasksController'
})
.when('/tasks/new', {
templateUrl: 'templates/views/newTask.html',
controller: 'newTasksController'
}); });
} }
]); ]);

View file

@ -0,0 +1,23 @@
angular.module('SeHub').controller('newTasksController', ['$scope',
function($scope) {
$scope.componentTypes = [{
"type": "textbox"
}, {
"type": "textarea"
}, {
"type": "checkbox"
}];
$scope.task = [];
$scope.addComponent = function(){
$scope.task.push($scope.newComp);
$scope.newComp = {};
}
}
]);

View file

@ -100,6 +100,7 @@
<script src="templates/js/controllers/homeController.js"></script> <script src="templates/js/controllers/homeController.js"></script>
<script src="templates/js/controllers/settingsController.js"></script> <script src="templates/js/controllers/settingsController.js"></script>
<script src="templates/js/controllers/registerController.js"></script> <script src="templates/js/controllers/registerController.js"></script>
<script src="templates/js/controllers/newTasksController.js"></script>
</body> </body>
</html> </html>

View file

@ -0,0 +1,48 @@
<div layout-padding>
<div layout="row">
<div flex="20" layout-padding>
<h2>
<i class="fa fa-info-circle"></i> Task Info:
</h2>
</div>
<div layout="column" flex="30" layout-padding>
<div>
<h2>
<i class="fa fa-cubes"></i> Add A component:
</h2>
</div>
<div>
Select Type:
<md-select placeholder="Component Type" ng-model="newComp.type">
<md-option ng-repeat="component in componentTypes" value="{{component.type}}">{{component.type}}</md-option>
</md-select>
</div>
<div>
<md-input-container>
<label>Label</label>
<input ng-model="newComp.label" required>
</md-input-container>
</div>
<div>
<md-switch ng-model="newComp.isMandatory" aria-label="Switch 1">
Mandatory?: {{ newComp.isMandatory}}
</md-switch>
</div>
<div layout="row">
<div flex="70"></div>
<md-button class="md-primary" ng-click="addComponent()">Add Component</md-button>
</div>
</div flex="50" layout-padding>
<!-- <md-card style="background-image: url('http://www.stationeryhq.com/content/images/thumbs/0000324_clipboard_500.png')">
</md-card> -->
<h2>
<i class="fa fa-eye"></i> Task Preview:
</h2>
<p>{{task.toString()}}</p>
</div>
</div>

View file

@ -55,6 +55,10 @@
</div> </div>
</div> </div>
<!-- End Edit Div --> <!-- End Edit Div -->
<!-- Chart -->
<h4>
<i class="fa fa-bar-chart"></i> Statistics:
</h4>
<canvas id="bar" class="chart chart-bar" data="data" <canvas id="bar" class="chart chart-bar" data="data"
labels="labels" series="series"></canvas> labels="labels" series="series"></canvas>
</md-card> </md-card>