PoliSage / src /templates /drafts /create_draft.html
yasserrmd's picture
Upload 80 files
0a40ab8 verified
{% extends "base.html" %}
{% block title %}New Draft - PoliSage{% endblock %}
{% block content %}
<div class="container mt-4">
<h2>Create New Draft</h2>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<form method="POST" action="{{ url_for("drafting.create_draft") }}">
<div class="mb-3">
<label for="title" class="form-label">Draft Title <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="title" name="title" value="{{ title or '' }}" required>
</div>
<div class="mb-3">
<label for="policy_intent" class="form-label">Policy Intent / Purpose <span class="text-danger">*</span></label>
<textarea class="form-control" id="policy_intent" name="policy_intent" rows="4" required>{{ policy_intent or '' }}</textarea>
<div class="form-text">Describe the goal or problem this draft aims to address. This can be used by the AI to help generate content later.</div>
</div>
<div class="mb-3">
<label for="related_legislation_id" class="form-label">Related Legislation (Optional)</label>
<select class="form-select" id="related_legislation_id" name="related_legislation_id">
<option value="">None</option>
{% for leg in legislations %}
<option value="{{ leg.id }}" {% if related_legislation_id == leg.id|string %}selected{% endif %}>{{ leg.title }} (ID: {{ leg.id }})</option>
{% endfor %}
</select>
<div class="form-text">Link this draft to an existing piece of legislation if applicable.</div>
</div>
<div class="mb-3">
<label for="initial_content" class="form-label">Initial Content (Optional)</label>
<textarea class="form-control" id="initial_content" name="initial_content" rows="10">{{ initial_content or '' }}</textarea>
<div class="form-text">You can provide initial text, or leave this blank and check the box below to use AI generation.</div>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" id="use_ai_generation" name="use_ai_generation" value="true" {% if use_ai_generation %}checked{% endif %}>
<label class="form-check-label" for="use_ai_generation">
Generate initial content using AI (if Initial Content field is empty)
</label>
</div>
<button type="submit" class="btn btn-primary">Create Draft</button>
<a href="{{ url_for("drafting.list_drafts") }}" class="btn btn-secondary">Cancel</a>
</form>
</div>
{% endblock %}