-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
4gray
committed
Nov 6, 2019
1 parent
fff2aaa
commit 1735026
Showing
8 changed files
with
122 additions
and
34 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
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,16 @@ | ||
.drop-container { | ||
/*width: 400px;*/ | ||
height: 100px; | ||
border: 1px dashed #ccc; | ||
border-radius: 10px; | ||
margin: 0 auto; | ||
padding: 10px; | ||
text-align: center; | ||
color: #666; | ||
} | ||
|
||
input { | ||
border-radius: 4px; | ||
border: 1px solid #ccc; | ||
padding: 5px; | ||
} |
51 changes: 25 additions & 26 deletions
51
src/app/components/playlist-uploader/playlist-uploader.component.html
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 |
---|---|---|
@@ -1,26 +1,25 @@ | ||
<div | ||
class="drop-container" | ||
ngFileDrop | ||
[options]="options" | ||
(uploadOutput)="onUploadOutput($event)" | ||
[uploadInput]="uploadInput"> | ||
<p> | ||
Drag files here or | ||
<label class="upload-button"> | ||
<input | ||
type="file" | ||
ngFileSelect | ||
[options]="options" | ||
(uploadOutput)="onUploadOutput($event)" | ||
[uploadInput]="uploadInput" | ||
multiple> | ||
browse | ||
</label> | ||
to upload. | ||
</p> | ||
|
||
<!-- <h3>Recent playlists:</h3> | ||
TODO | ||
<h3>Insert playlist by URL:</h3> | ||
TODO --> | ||
</div> | ||
<mat-card> | ||
<mat-card-subtitle>Add playlist</mat-card-subtitle> | ||
<div class="drop-container" ngFileDrop [options]="options" (uploadOutput)="onUploadOutput($event)" | ||
[uploadInput]="uploadInput"> | ||
<p> | ||
Drag files here or | ||
<label class="upload-button"> | ||
<input type="file" ngFileSelect [options]="options" (uploadOutput)="onUploadOutput($event)" | ||
[uploadInput]="uploadInput" multiple> | ||
browse | ||
</label> | ||
to upload. | ||
</p> | ||
</div> | ||
</mat-card> | ||
<br> | ||
<ng-container *ngIf="(playlists | keyvalue)?.length > 0"> | ||
<mat-card> | ||
<mat-card-subtitle>Recent playlists</mat-card-subtitle> | ||
<mat-card-content> | ||
<app-recent-playlists [playlists]="playlists" (playlistClicked)="setPlaylist($event)"> | ||
</app-recent-playlists> | ||
</mat-card-content> | ||
</mat-card> | ||
</ng-container> |
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
3 changes: 3 additions & 0 deletions
3
src/app/components/recent-playlists/recent-playlists.component.html
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,3 @@ | ||
<button *ngFor="let playlist of playlists | keyvalue" mat-stroked-button (click)="playlistClicked.emit(playlist.value)"> | ||
{{playlist.key}} | ||
</button> |
3 changes: 3 additions & 0 deletions
3
src/app/components/recent-playlists/recent-playlists.component.scss
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,3 @@ | ||
button { | ||
margin: 5px; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/app/components/recent-playlists/recent-playlists.component.ts
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,18 @@ | ||
import { Component, Input, Output, EventEmitter } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-recent-playlists', | ||
templateUrl: './recent-playlists.component.html', | ||
styleUrls: ['./recent-playlists.component.scss'], | ||
}) | ||
export class RecentPlaylistsComponent { | ||
/** | ||
* Playlist object | ||
*/ | ||
@Input() playlists: any; | ||
|
||
/** | ||
* Emits on playlist click | ||
*/ | ||
@Output() playlistClicked: EventEmitter<any> = new EventEmitter(); | ||
} |
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