OXYGENHUB
# c96b32865000 oxygenhub / templates / proposal_new.html
2.2 KiB · HTML · last changed Milestone 0.3: proposals and review 1 month ago source blame history raw
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 preview.len() == 1 %}{{ preview[0].title }}{% endif %}">
27
  <label for="body">Description (Markdown)</label><textarea id="body" name="body" class="md" rows="8"></textarea>
28
  <div class="choice"><label><input type="checkbox" name="draft" value="1"> draft: not ready for review</label></div>
29
  <button type="submit">OPEN PROPOSAL</button>
30
</form>
31
{% else if !source.is_empty() %}
32
<p class="empty">{{ source }} adds nothing to {{ target }}.</p>
33
{% endif %}
34
{% endblock %}