Backend for songs.zachdecook.com
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@extends('layouts.app')
@section('title', "Contribute to the $playlist->name playlist")

@section('content')

    <h2>Playlist "<i>{{$playlist->name}}</i>"</h2>
    <a href="/playlist/{{$playlist->name}}.m3u">Download audio playlist file</a>
    <ul>
    @foreach($playlist->songs as $song)
        <li><a href='{{ route('song.show', ['song' => $song, 'playlist' => $playlist]) }}'>{{$song->name}}</a>
    @endforeach
    </ul>

	@guest
	Please login to add new songs.
	@else
    <form method="POST" action="/new/song">
        <h3>Add song to playlist</h3>
        @csrf
        <input name='title' placeholder='title' type='text'/>
        <input name='author' placeholder='author' type='text'/>
        <input name='key' placeholder='Key (e.g. Am)' type='text' />
        <input name='playlist' value='{{ $playlist->id }}' hidden/>
        <br/>
        <textarea name='text' placeholder='song lyrics/chords' style='width: 100%; height: 200px; font-family: monospace;' ></textarea>
        <button type='submit'>Add song!</button>
    </form>
    @endguest
@endsection