-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<div class='container'> | ||
<div class='playlist-holder'> | ||
<div class='playlist'> | ||
<div class='panel panel-default'> | ||
<div class='panel panel-heading'> | ||
<h4> | ||
<a [routerLink]="['/home']"> | ||
Playlists | ||
</a> | ||
> {{playlist?.name}} ({{playlist?.user_name}}'s Playlist) | ||
<button class="btn btn-primary pull-right" (click)="songModal.open()"> | ||
<i class="glyphicon glyphicon-plus"></i> | ||
Add Song | ||
</button> | ||
</h4> | ||
</div> | ||
<div class="list-group"> | ||
<div class="list-group-item" *ngFor="let song of songs" id="song-{{song.id}}"> | ||
<img src="{{song.thumbnail_url}}" (click)="playSong(song)"> | ||
<a (click)="playSong(song)"> | ||
{{ song.name }} | ||
</a> | ||
<strong> Played: {{song.play_count}} times</strong> | ||
<i class="glyphicon glyphicon-remove pull-right icons remove" (click)="delete(song)" *ngIf="playlist.user_id == current_user_id"></i> | ||
</div> | ||
<div class="list-group-item" *ngIf="songs?.length <= 0"> | ||
No songs yet! | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<modal #songModal title="Add song" submitButtonLabel="Add Song" (onSubmit)="addSong(); songModal.close()"> | ||
<modal-content> | ||
<strong>URL</strong> | ||
<input type="text" [(ngModel)]="url" name="url" ngControl="url"> | ||
</modal-content> | ||
</modal> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<div class='playlist-holder'> | ||
<div class='playlist'> | ||
<div class='panel panel-default'> | ||
<div class="panel-heading"> | ||
<h4> | ||
<span> | ||
Playlists | ||
</span> | ||
|
||
<button class="btn btn-primary pull-right" (click)="playlistModal.open()"> | ||
<i class="glyphicon glyphicon-plus"></i> | ||
Add Playlist | ||
</button> | ||
</h4> | ||
</div> | ||
<div class="list-group"> | ||
<div class="list-group-item" *ngFor="let playlist of playlists" id="playlist-{{playlist.id}}"> | ||
<a [routerLink]="['/playlists', playlist.id]"> | ||
{{ playlist.name }} | ||
<span *ngIf='current_user_id != playlist.user_id'> | ||
({{playlist.user_name}}'s playlist) | ||
</span> | ||
<span *ngIf='current_user_id == playlist.user_id'> | ||
(Your | ||
<span *ngIf='playlist.type == "PrivatePlaylist"'> | ||
Private | ||
</span> | ||
playlist) | ||
</span> | ||
|
||
</a> | ||
<i class="glyphicon glyphicon-remove pull-right icons remove" (click)="delete(playlist)" *ngIf="playlist.user_id == current_user_id"></i> | ||
<i class="glyphicon glyphicon-pencil pull-right icons edit" (click)="updateEditing(playlist);playlistEditModal.open()" *ngIf="playlist.user_id == current_user_id"></i> | ||
</div> | ||
<div class="list-group-item" *ngIf="playlists?.length <= 0"> | ||
No playlists yet! Please add one. | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<modal #playlistModal title="Add Playlist" submitButtonLabel="Add" (onSubmit)="addPlaylist(); playlistModal.close()"> | ||
<modal-content> | ||
<div> | ||
<strong>Name</strong> | ||
<input type="text" [(ngModel)]="name" name="name" ngControl="name"> | ||
</div> | ||
<br> | ||
<div> | ||
<strong>Type</strong> | ||
<select [(ngModel)]="type" name="type" ngControl="type" (change)="updateType($event.target.value)"> | ||
<option value="PrivatePlaylist" selected>Private</option> | ||
<option value="PublicPlaylist" >Public</option> | ||
</select> | ||
</div> | ||
</modal-content> | ||
</modal> | ||
|
||
<modal #playlistEditModal title="Edit Playlist" submitButtonLabel="Update" (onSubmit)="update(); playlistEditModal.close()"> | ||
<modal-content> | ||
<div> | ||
<strong>Name</strong> | ||
<input type="text" [(ngModel)]="name" name="name" ngControl="name" value="{{editingPlaylist?.name}}" (blur)="checkValidity($event)" required> | ||
</div> | ||
<br/> | ||
<div> | ||
<strong>Type</strong> | ||
<select [(ngModel)]="type" name="type" ngControl="type" (change)="updateType($event.target.value)"> | ||
<option value="PrivatePlaylist" [selected]="editingPlaylist?.type == 'PrivatePlaylist'">Private</option> | ||
<option value="PublicPlaylist" [selected]="editingPlaylist?.type == 'PublicPlaylist'">Public</option> | ||
</select> | ||
</div> | ||
</modal-content> | ||
</modal> |