| 1 |
{% extends "base.html" %} |
| 2 |
{% import "repo_tabs.html" as m %} |
| 3 |
{% block title %}New proposal · {{ repo.owner }}/{{ repo.name }}{% endblock %} |
| 4 |
{% block bodyattrs %} data-repo="{{ repo.url }}"{% endblock %} |
| 5 |
{% block tabs %}{% call m::tabs(repo, "proposals") %}{% endblock %} |
| 6 |
{% block content %} |
| 7 |
<div class="head"><h1>New proposal <small>add a bookmark's changes to another bookmark</small></h1></div> |
| 8 |
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %} |
| 9 |
<form class="card wide" method="get" action="{{ repo.url }}/proposals/new"> |
| 10 |
<div class="row"> |
| 11 |
<div><label for="source">Source (a bookmark here, or owner/name:bookmark of a fork)</label><input type="text" id="source" name="source" value="{{ source }}" list="bms"></div> |
| 12 |
<div><label for="target">Target</label><select id="target" name="target">{% for b in bookmarks %}<option value="{{ b }}"{% if *b == target %} selected{% endif %}>{{ b }}</option>{% endfor %}</select></div> |
| 13 |
<div><button type="submit">PREVIEW</button></div> |
| 14 |
</div> |
| 15 |
<datalist id="bms">{% for b in bookmarks %}<option value="{{ b }}">{% endfor %}</datalist> |
| 16 |
</form> |
| 17 |
{% if !preview.is_empty() %} |
| 18 |
<section class="panel"> |
| 19 |
<h2>{{ preview.len()|plural("change", "changes") }} would be added to {{ target }}{% if conflicted %} <span class="tag bad">with conflicts</span>{% endif %}</h2> |
| 20 |
{% for c in preview %}{% call m::change_row(repo, c) %}{% endfor %} |
| 21 |
</section> |
| 22 |
<form class="card wide" method="post" action="{{ repo.url }}/proposals/new"> |
| 23 |
<input type="hidden" name="_csrf" value="{{ shell.csrf }}"> |
| 24 |
<input type="hidden" name="source" value="{{ source }}"> |
| 25 |
<input type="hidden" name="target" value="{{ target }}"> |
| 26 |
<label for="title">Title</label><input type="text" id="title" name="title" required value="{% if !title.is_empty() %}{{ title }}{% else if preview.len() == 1 %}{{ preview[0].title }}{% endif %}"> |
| 27 |
<label for="body">Description (Markdown)</label><textarea id="body" name="body" class="md" rows="8">{{ body }}</textarea> |
| 28 |
{% if !assistants.is_empty() %}<div class="side-assist">{% for a in assistants %}<button type="submit" class="agent-btn" formaction="{{ repo.url }}/proposals/new/draft" formnovalidate name="assistant" value="{{ a }}" title="{{ a }}, an AI assistant, drafts the description from the changes; you edit it before opening"><img src="/avatar/agent/{{ a }}" alt="" width="16" height="16"> Draft with {{ a }}</button>{% endfor %}</div>{% endif %} |
| 29 |
<div class="choice"><label><input type="checkbox" name="draft" value="1"> draft: not ready for review</label></div> |
| 30 |
<button type="submit">OPEN PROPOSAL</button> |
| 31 |
</form> |
| 32 |
{% else if !source.is_empty() %} |
| 33 |
<p class="empty">{{ source }} adds nothing to {{ target }}.</p> |
| 34 |
{% endif %} |
| 35 |
{% endblock %} |