{% extends "index.html" %}

{% block content %}

<form action="{{ url_for('manage_spreadsheets') }}" method="POST">
    <label for="spreadsheet_name">Spreadsheet Name:</label>
    <input type="text" name="spreadsheet_name" placeholder="Name" size="25" {{ 'disabled' if spreadsheet_name }} value="{{ spreadsheet_name }}"><br>
    <input type="submit" value="Create" {{ 'disabled' if spreadsheet_name }}>
</form>
<button type="button" id="forget-spreadsheet" {{ 'disabled' if not spreadsheet_name }}>Forget</button><br>
<script type="text/javascript">
    document.getElementById("forget-spreadsheet").addEventListener("click", (event) => {
        location.href = "{{ url_for('forget_spreadsheet', redirect_url=url_for('manage_spreadsheets')) | safe }}"
    });
</script>

{% endblock %}
