{% extends "admin/base.html" %}

{% block title %}New Note - StarPunk Admin{% endblock %}

{% block admin_content %}
<div class="note-editor">
  <h2>Create New Note</h2>

  <form action="{{ url_for('admin.create_note_submit') }}" method="POST" class="note-form">
    <div class="form-group">
      <label for="content">Content (Markdown)</label>
      <textarea
        id="content"
        name="content"
        rows="20"
        placeholder="Write your note in markdown..."
        required
        autofocus
      ></textarea>
      <small>Use Markdown syntax for formatting</small>
    </div>

    <div class="form-group form-checkbox">
      <input type="checkbox" id="published" name="published" checked>
      <label for="published">Publish immediately</label>
    </div>

    <div class="form-actions">
      <button type="submit" class="button button-primary">Create Note</button>
      <a href="{{ url_for('admin.dashboard') }}" class="button button-secondary">Cancel</a>
    </div>
  </form>
</div>
{% endblock %}

{% block head %}
{{ super() }}
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="{{ url_for('static', filename='js/preview.js') }}"></script>
{% endblock %}
