Commit a078fb71 authored by Evren Kutar's avatar Evren Kutar

ADD task widget

parent 58bea1aa
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*
* @author Evren Kutar
*/
/**
* @memberof ulakbus.dashboard
* @ngdoc directive
* @name stats
* @description Directive for .
*/
angular.module('ulakbus.dashboard')
.directive('userTasks', function (WSOps) {
return {
templateUrl: 'components/dashboard/directives/user-tasks.html',
restrict: 'E',
replace: true,
scope: {},
controller: function ($scope) {
$scope.task_list = [
{WFToken: "yfuialhfuial", title: "sample 1 workflow", description: "sample 1", wf_type: "type x"},
{WFToken: "yfuialhfuial", title: "sample 2 workflow", description: "sample 2", wf_type: "type x"},
{WFToken: "yfuialhfuial", title: "sample 3 workflow", description: "sample 3", wf_type: "type y"},
{WFToken: "yfuialhfuial", title: "sample 4 workflow", description: "sample 4", wf_type: "type y"}
];
var regroup_tasks = function () {
var grouped_tasks = {};
angular.forEach($scope.task_list, function (value, key) {
grouped_tasks[value.wf_type] = grouped_tasks[value.wf_type] || [];
grouped_tasks[value.wf_type].push(value);
});
return grouped_tasks;
};
$scope.task_list = regroup_tasks();
$scope.$on("task_list", function (event, data) {
$scope.task_list = data;
regroup_tasks();
});
$scope.gototask = function (wf_token) {
WSOps.doSend({view: "open_wf", wf_token: wf_token});
}
}
};
});
\ No newline at end of file
<div class="col-lg-6 col-md-12 student-assignment-list">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">Görevler</div>
</div>
<div class="panel-body">
<ul>
<li ng-repeat="(k,v) in task_list" class="last-assignment">
<div class="panel-heading">
<div class="panel-title">{{k}}</div>
</div>
<a ng-repeat="task in v" role="button" ng-click="gototask(task.wf_token)" class="clearfix">
<span class="assignment-status">
<div class="assignment-circle" uib-tooltip="Acil"></div>
</span>
<span class="assignment-title">
<div>{{task.title}}</div>
<div>{{task.description}}</div>
</span>
<span class="assignment-due-date">
<div>18</div>
<div>ŞUB</div>
</span>
</a>
</li>
<!-- end of urgent-assignment -->
<!--<li class="approaching-assignment">-->
<!--<a href="#" class="clearfix">-->
<!--<span class="assignment-status">-->
<!--<div class="assignment-circle" uib-tooltip="Yaklaşıyor"></div>-->
<!--</span>-->
<!--<span class="assignment-title">-->
<!--<div>Storyboard Design</div>-->
<!--<div>435 - Project Management and Development</div>-->
<!--</span>-->
<!--<span class="assignment-due-date">-->
<!--<div>27</div>-->
<!--<div>ŞUB</div>-->
<!--</span>-->
<!--</a>-->
<!--</li>-->
<!--&lt;!&ndash; end of approaching-assignment &ndash;&gt;-->
<!--<li class="non-urgent-assignment">-->
<!--<a href="#" class="clearfix">-->
<!--<span class="assignment-status">-->
<!--<div class="assignment-circle" uib-tooltip="Acil olmayan"></div>-->
<!--</span>-->
<!--<span class="assignment-title">-->
<!--<div>Design Report</div>-->
<!--<div>435 - Project Management and Development</div>-->
<!--</span>-->
<!--<span class="assignment-due-date">-->
<!--<div>05</div>-->
<!--<div>MAR</div>-->
<!--</span>-->
<!--</a>-->
<!--</li>-->
<!--&lt;!&ndash; end of non-urgent-assignment &ndash;&gt;-->
<!--<li class="last-assignment">-->
<!--<div class="panel-heading">-->
<!--<div class="panel-title">Tamamlanan Son Görevler</div>-->
<!--</div>-->
<!--<a href="#" class="clearfix">-->
<!--<span class="assignment-status">-->
<!--<div></div>-->
<!--</span>-->
<!--<span class="assignment-title">-->
<!--<div>Design Report</div>-->
<!--<div>435 - Project Management and Development</div>-->
<!--</span>-->
<!--<span class="assignment-due-date">-->
<!--<div><i class="fa fa-check"></i></div>-->
<!--</span>-->
<!--</a>-->
<!--</li>-->
<!-- end of last-assignment -->
</ul>
</div>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment