Task list now shows associated project

Items in the task list now show the project they're associated with.

Change-Id: I33f67f976c31cebb196fbd6626d9c5618b72108e
This commit is contained in:
Michael Krotscheck 2014-03-13 15:29:07 -07:00
parent c1bb9b30f8
commit 8b9f371065
2 changed files with 46 additions and 4 deletions
src/app
stories/controllers
templates/story

@ -0,0 +1,34 @@
/*
* Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* Controller for our story list.
*/
angular.module('sb.story').controller('StoryTaskListItemController',
function ($scope, Project) {
'use strict';
var projectId = $scope.task.project_id || null;
if (!!projectId) {
Project.get({id: projectId},
function (project) {
$scope.project = project;
}, function () {
$scope.project = null;
});
}
});

@ -107,7 +107,8 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="task in tasks">
<tr ng-repeat="task in tasks"
ng-controller="StoryTaskListItemController">
<td>
<p><strong>
<a href="">{{task.id}}</a>
@ -120,9 +121,16 @@
<small class="text-muted">{{task.description}}</small>
</td>
<td>
<p><strong>
<a href="">Not Yet Implemented</a>
</strong></p>
<p>
<a href="#!/project/{{project.id}}/overview"
ng-show="project">
{{project.name}}
</a>
<span class="text-danger" ng-hide="project">
Project not found
</span>
</p>
</td>
<td>
<p class="text-success">{{task.status}}</p>