| 1 |
{% extends "base.html" %} |
| 2 |
{% import "repo_tabs.html" as m %} |
| 3 |
{% block title %}{% if new_file %}New file{% else %}Edit {{ path }}{% endif %} · {{ repo.owner }}/{{ repo.name }}{% endblock %} |
| 4 |
{% block bodyattrs %} data-repo="{{ repo.url }}"{% endblock %} |
| 5 |
{% block tabs %}{% call m::tabs(repo, "code") %}{% endblock %} |
| 6 |
{% block mainclass %} class="wide"{% endblock %} |
| 7 |
{% block content %} |
| 8 |
<div class="head"><h1>{% if new_file %}New file{% else if conflicted %}Resolve {{ path }}{% else %}Edit {{ path }}{% endif %} <small>on ◆ {{ r }}</small></h1></div> |
| 9 |
{% if let Some(d) = delegation %}<div class="strip warn">{{ d }}</div>{% endif %} |
| 10 |
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %} |
| 11 |
{% if conflicted %}<div class="strip bad">This file is in conflict. Edit the text between the markers into what it should say and remove every marker line; saving records a resolution change that depends on both sides.</div>{% endif %} |
| 12 |
<form class="card wide editor" method="post" action="{{ repo.url }}/edit/{{ r }}"> |
| 13 |
<input type="hidden" name="_csrf" value="{{ shell.csrf }}"> |
| 14 |
<input type="hidden" name="original" value="{% if !new_file %}{{ path }}{% endif %}"> |
| 15 |
<label for="path">Path</label><input type="text" id="path" name="path" value="{{ path }}" required> |
| 16 |
<textarea class="code" name="content" data-path="{{ path }}" rows="28" spellcheck="false">{{ content }}</textarea> |
| 17 |
<label for="message">Change message</label><input type="text" id="message" name="message" value="{{ message }}" required placeholder="{% if new_file %}Add {{ path }}{% else if conflicted %}Resolve {{ path }}{% else %}Update {{ path }}{% endif %}"> |
| 18 |
<div class="choice"> |
| 19 |
{% if is_bookmark %}<label><input type="radio" name="mode" value="commit" checked> commit to <strong>{{ r }}</strong></label>{% endif %} |
| 20 |
<label><input type="radio" name="mode" value="propose"{% if !is_bookmark %} checked{% endif %}> new bookmark <input type="text" name="new_bookmark" placeholder="name (optional)" size="18"> and propose it</label> |
| 21 |
</div> |
| 22 |
<p class="small mute">The change is authored by your linked key and signed by this hub's key as your delegate; the repository's policy decides whether it may land.</p> |
| 23 |
<div class="choice"> |
| 24 |
<button type="submit"{% if delegation.is_some() %} disabled{% endif %}>SAVE</button> |
| 25 |
{% if !new_file %}<button type="submit" name="delete" value="1" class="danger-btn"{% if delegation.is_some() %} disabled{% endif %} data-confirm="Delete {{ path }}?">DELETE FILE</button>{% endif %} |
| 26 |
<a class="go" href="{{ repo.url }}/{% if new_file %}tree/{{ r }}{% else %}file/{{ r }}/{{ path }}{% endif %}">CANCEL</a> |
| 27 |
</div> |
| 28 |
</form> |
| 29 |
{% endblock %} |