Skip to content

Commit 4be1178

Browse files
author
Ian Redpath
committed
fixed bad comment style, fixed edit library name
1 parent 4ba7344 commit 4be1178

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

public/project/components/libraries/library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class Library {
139139

140140
saveNewLibraryName() {
141141
this.isEditingLibraryName = false
142-
this.libraryService.updateLibrary(this.library)
142+
this.libraryService.updateLibrary({ name: this.library.name })
143143
.subscribe(resp => {
144144
if(resp.json().library) {
145145
this.backupName = this.library.name

public/project/components/libraries/library.view.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<div *ngIf='!fetchingLibrary' class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2">
2-
<div>
2+
<div class="library-heading">
33
<div *ngIf="!isEditingLibraryName" class="library-name-container">
44
<h1 *ngIf="hasEditRights()" (click)="editLibraryName()" class="clickable">{{library.name}}</h1>
55
<h1 *ngIf="!hasEditRights()">{{library.name}}</h1>
66
</div>
7-
<div *ngIf="isEditingLibraryName">
7+
<div *ngIf="isEditingLibraryName" class="library-edit">
88
<input type="text" [(ngModel)]="library.name" (keyup.enter)="saveNewLibraryName()">
9-
<span class="glyphicon glyphicon-check" (click)="saveNewLibraryName()"></span>
10-
<button class="btn btn-default" (click)="cancelEditingLibraryName()">Cancel</button>
9+
<span class="glyphicon glyphicon-check clickable-glyph" (click)="saveNewLibraryName()"></span>
10+
<span class="glyphicon glyphicon-remove clickable-glyph" (click)="cancelEditingLibraryName()"></span>
1111
</div>
1212
<a [routerLink]='["/User", { user: library.user._id }]'>{{library.user.username}}</a>
1313
</div>
@@ -79,7 +79,7 @@ <h6 class="timestamp">{{getCommentDate(comment.date)}} {{comment.edited ? '(edit
7979
</div>
8080
<div *ngIf="userService.getActiveUser()" class="new-comment">
8181
<textarea class="comment-input" [(ngModel)]="newComment" (keyup.enter)="addComment()"></textarea>
82-
<button class="btn" (click)="addComment()">Comment!</button>
82+
<button class="btn comment-button" (click)="addComment()">Comment!</button>
8383
</div>
8484
</div>
8585
</div>

public/project/components/movies/movie.view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h6 class="timestamp">{{getCommentDate(comment.date)}} {{comment.edited ? '(edit
9393
</div>
9494
<div *ngIf="userService.getActiveUser()" class="new-comment">
9595
<textarea class="comment-input" [(ngModel)]="newComment" (keyup.enter)="addComment()"></textarea>
96-
<button class="btn" (click)="addComment()">Comment!</button>
96+
<button class="btn comment-button" (click)="addComment()">Comment!</button>
9797
</div>
9898
</div>
9999
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" *ngIf="!fetchingLibraries">

public/project/css/style.css

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
.clickable {
22
cursor: pointer;
33
}
4-
4+
.clickable-glyph {
5+
cursor: pointer;
6+
}
7+
.clickable-glyph:hover {
8+
color: blue;
9+
}
510
.movie-title {
611
margin-left: 15px;
712
}
@@ -178,7 +183,7 @@
178183
}
179184

180185
.new-comment {
181-
margin-top: 20px;
186+
margin-top: 30px;
182187
}
183188

184189
.comment-img {
@@ -207,4 +212,13 @@
207212
}
208213
.comment-input {
209214
width:50%;
215+
vertical-align: bottom
210216
}
217+
.comment-button {
218+
vertical-align: bottom
219+
}
220+
.library-edit {
221+
display: inline-block;
222+
margin-top: 20px;
223+
margin-bottom: 10px;
224+
}

0 commit comments

Comments
 (0)