File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ export class User {
1919 newLibraryName : string
2020 fetchingUser : boolean
2121
22- constructor ( public params : RouteParams , public router : Router ,
22+ constructor ( public params : RouteParams , public router : Router ,
2323 public userService : UserService , public libraryService : LibraryService ) {
24-
24+
2525 this . fetchingUser = true
2626 this . userService . loggedIn ( )
2727 . subscribe ( data => {
@@ -82,4 +82,9 @@ export class User {
8282 } , error => { alert ( error . message ) } )
8383
8484 }
85+
86+ getWhoseLibraries ( ) {
87+ return this . userService . isActiveUser ( ) && this . userService . getActiveUser ( ) . _id === this . user . _id ?
88+ 'My' : `${ this . user . username } 's`
89+ }
8590}
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ <h1>{{user.username}}</h1>
99 < div class ="col-sm-2 col-md-2 "> </ div >
1010 </ div >
1111 < div >
12- < h3 > Libraries </ h3 >
12+
1313 < div class ="new-library " *ngIf ='hasEditRights() '>
14+ < h4 class ="no-bot-margin "> Create a new library!</ h4 >
1415 < input type ="text " [(ngModel)] ="newLibraryName " placeholder ="Library name ">
1516 < button class ="btn btn-default " (click) ='newLibrary() '> +</ button >
1617 </ div >
1718
19+ < h3 class ="no-bot-margin "> {{ getWhoseLibraries() }} libraries</ h3 >
1820 < div class ="user-libraries row ">
1921 < div *ngFor ="#library of user.libraries " class ="library-movie col-xs-6 col-sm-4 col-md-3 col-lg-2 ">
2022 < button *ngIf ="hasEditRights() " class ="btn btn-xs glyphicon glyphicon-remove thumbnail-remove " (click) ="removeLibrary(library._id) "> </ button >
Original file line number Diff line number Diff line change 137137 padding-right : 15px ;
138138 padding-left : 15px ;
139139 }
140+ }
141+
142+ .no-bot-margin {
143+ margin-bottom : 4px ;
140144 }
You can’t perform that action at this time.
0 commit comments