|
- <div class="row">
- <div class="col-lg-8">
- <div class="card shadow-sm">
- <div class="card-body">
- <h1 class="h3 mb-4">New Post</h1>
-
- <form method="post" action="<%= PostsUrl() %>">
- <div class="mb-3">
- <label class="form-label" for="Title">Title</label>
- <input class="form-control" type="text" id="Title" name="Title" required>
- </div>
-
- <div class="mb-3">
- <label class="form-label" for="Summary">Summary</label>
- <textarea class="form-control" id="Summary" name="Summary" rows="3"></textarea>
- </div>
-
- <div class="mb-3">
- <label class="form-label" for="Body">Body</label>
- <textarea class="form-control html-editor" id="Body" name="Body" rows="14" required></textarea>
- <div class="form-text">HTML is supported. Use the editor toolbar to format the post.</div>
- </div>
-
- <div class="mb-4">
- <label class="form-label" for="CategoryID">Category ID</label>
- <input class="form-control" type="number" id="CategoryID" name="CategoryID" min="0" value="0">
- </div>
-
- <div class="d-flex gap-2">
- <button class="btn btn-primary" type="submit">Create Post</button>
- <a class="btn btn-outline-secondary" href="<%= PostsUrl() %>">Cancel</a>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
-
- <script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
- <script>
- if (window.tinymce) {
- tinymce.init({
- selector: 'textarea.html-editor',
- menubar: false,
- branding: false,
- height: 420,
- plugins: 'lists link code autoresize',
- toolbar: 'undo redo | blocks | bold italic underline | bullist numlist | link blockquote | removeformat | code',
- content_style: 'body { font-family: Inter, Arial, sans-serif; font-size: 16px; line-height: 1.6; }'
- });
- }
- </script>
|