Skip to content

Commit c47869a

Browse files
author
Ian Redpath
committed
user page styling
1 parent 2e6a4a0 commit c47869a

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

public/project/components/users/user.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

public/project/components/users/user.view.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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>

public/project/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,8 @@
137137
padding-right: 15px;
138138
padding-left: 15px;
139139
}
140+
}
141+
142+
.no-bot-margin {
143+
margin-bottom: 4px;
140144
}

0 commit comments

Comments
 (0)