File tree 8 files changed +18
-39
lines changed
8 files changed +18
-39
lines changed Original file line number Diff line number Diff line change 3
3
module . exports = App . ProjectEditController = Ember . ObjectController . extend ( {
4
4
// Load up a list of users that the project can be assigned
5
5
// to, which we'll use for populating the select list.
6
- allUsers : function ( ) {
6
+ clients : function ( ) {
7
7
return this . store . findAll ( 'user' ) ;
8
8
} . property ( ) ,
9
-
10
- // And then filter down to only clients.
11
- clients : function ( ) {
12
- return this . get ( 'allUsers' ) . filterBy ( 'role' , 'client' ) ;
13
- } . property ( 'allUsers.isFulfilled' ) ,
14
-
15
- // And also filter down to valid managers
16
- managers : function ( ) {
17
- return this . get ( 'allUsers' ) . rejectBy ( 'role' , 'client' ) ;
18
- } . property ( 'allUsers.isFulfilled' ) ,
19
9
} ) ;
Original file line number Diff line number Diff line change 3
3
var c = Ember . computed ;
4
4
5
5
module . exports = App . ProjectIndexController = Ember . ObjectController . extend ( {
6
- // Display the name of the project manager and client
7
- managerName : c . alias ( 'managedBy.name' ) ,
8
- clientName : c . alias ( 'client.name' ) ,
9
-
10
- // Track the project budge details
6
+ // Track the project budget and billing details
11
7
hoursBudgeted : c . alias ( 'hourBudget' ) ,
8
+ clientName : c . alias ( 'client.name' ) ,
12
9
isInternal : c . not ( 'client' ) ,
13
10
14
11
// Sum up the hours logged for the project by looping over
Original file line number Diff line number Diff line change 2
2
3
3
module . exports = App . ProjectsController = Ember . ArrayController . extend ( {
4
4
sortProperties : [ 'id' ] ,
5
- itemController : 'Project ' ,
5
+ itemController : 'ProjectIndex ' ,
6
6
} ) ;
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ module.exports = App.Project = DS.Model.extend({
5
5
description : DS . attr ( 'string' ) ,
6
6
hourBudget : DS . attr ( 'number' ) ,
7
7
rateAmount : DS . attr ( 'number' ) ,
8
- managedBy : DS . belongsTo ( 'user' ) ,
9
8
client : DS . belongsTo ( 'user' ) ,
10
9
users : DS . hasMany ( 'user' , { async : true } ) ,
11
10
tasks : DS . hasMany ( 'task' , { async : true } ) ,
Original file line number Diff line number Diff line change 33
33
classNames =" form-control" }}
34
34
</div >
35
35
</div >
36
-
37
- <div class =" form-group" >
38
- <label class =" col-sm-2 control-label" >Manager</label >
39
- <div class =" col-sm-10" >
40
- {{ view Ember.Select
41
- content =managers
42
- optionValuePath =" content.id"
43
- optionLabelPath =" content.name"
44
- selection =managedBy
45
- classNames =" form-control" }}
46
- </div >
47
- </div >
48
36
</form >
49
37
</div >
50
38
</div >
Original file line number Diff line number Diff line change 8
8
<div class =" row" >
9
9
<div class =" col-lg-12" >
10
10
<p >
11
- <span class =" fui-user" ></span >
12
- Managed by <strong >{{ managerName }} </strong >
13
- {{ #unless isInternal }}
14
- and billed to <strong >{{ clientName }} </strong >
15
- {{ /unless }}
11
+ {{ #if isInternal }}
12
+ <span class =" fui-heart" ></span >
13
+ Billed <strong >internally</strong >
14
+ {{ else }}
15
+ <span class =" fui-user" ></span >
16
+ Billed to <strong >{{ clientName }} </strong >
17
+ {{ /if }}
16
18
</p >
17
19
18
20
<p >
Original file line number Diff line number Diff line change 4
4
<tr >
5
5
<th >Name</th >
6
6
<th >Description</th >
7
- <th >Manager</th >
8
7
<th >Client</th >
9
8
</tr >
10
9
{{ #each }}
11
10
<tr >
12
11
<td >{{ #link-to ' project' this }} {{ name }} {{ /link-to }} </td >
13
12
<td >{{ description }} </td >
14
- <td >{{ managerName }} </td >
15
- <td >{{ clientName }} </td >
13
+ <td >
14
+ {{ #if isInternal }}
15
+ <span class =" text-muted" >Internal</span >
16
+ {{ else }}
17
+ {{ clientName }}
18
+ {{ /if }}
19
+ </td >
16
20
</tr >
17
21
{{ /each }}
18
22
</table >
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ module.exports = {
55
55
rate_amount : String ,
56
56
rate_code : String ,
57
57
client : 'user' ,
58
- managed_by : 'user' ,
59
58
users : [ 'user' ] ,
60
59
tasks : [ 'task' ] ,
61
60
time_entries : [ 'time_entry' ]
You can’t perform that action at this time.
0 commit comments