{% extends 'base.html' %}

{% block content %}
<hr>
<h1>{% block title %} Edit "{{ post['title'] }}" {% endblock %}</h1>
<hr>
<form method="POST" enctype="multipart/form-data">
    <!-- NAME-->
    <div class="form-group">
        <p>Your Radio will get a new folder name! Don't use spaces.</p>
        <label for="title"><b>Name</b> </label>
        <input type="text" name="title" id="title" placeholder="Post title"
               class="form-control"
               value="{{ post['title'] }}">
    </div>

    <!-- URL-->
    <div class="form-group">
        <label for="content"><b>URL</b> (web address)</label>
        <p style="color:red;font-size:14px;"> Requires an App restart!</p>
        <textarea name="content" id="content" placeholder="Post content"
                  class="form-control">{{ post['content'] }}</textarea>
    </div>

    <!-- Image Upload-->
    <div class="form-group">
        <label for="inputFile">Image input (jpg, png, bmp, gif, svg); default images in /eisenradio/static/images</label>
        <input class="form-control-file" type="file" name="inputFile" id="inputFile">
    </div>

    <!-- Text description -->
    <div class="form-group">
        <label for="text">Write Text</label>
        <textarea class="form-control" name="text" id="text" rows="5"
                  placeholder="Your description">{{ post['pic_comment'] }}</textarea>

    </div>

    <!-- Button-->
    <div class="form-group">
        <button type="submit" class="btn btn-primary btn-sm">Submit</button>
    </div>
</form>
<hr>
<form action="{{ url_for('delete', id=post['id']) }}" method="POST">
    <input type="submit" value="Delete Radio"
            class="btn btn-danger btn-sm"
            onclick="return confirm('Are you sure you want to delete this radio?')">
</form>
{% endblock %}
