kitgit

tirbofish/kitgit

feat/better-search / templates / pull_new.html · 1418 bytes

templates/pull_new.html
{% extends "layout.html" %}

{% block title %}new pull · {{ owner.username }}/{{ repo.name }} — kitgit{% endblock %}

{% block content %}
<section class="kg-section">
  <h1 class="kg-title">New pull request</h1>
  {% let tab = "pulls" %}
  {% let archive_ref = repo.default_branch %}
  {% include "partials/repo_tabs.html" %}
  {% if let Some(err) = error %}
    <div class="kg-flash">{{ err }}</div>
  {% endif %}
  <form class="kg-form" method="post" action="/{{ owner.username }}/{{ repo.name }}/pulls">
    <label>
      title
      <input type="text" name="title" required autofocus />
    </label>
    <label>
      source branch
      <select name="source_branch" required>
        {% for b in branches %}
          <option value="{{ b }}">{{ b }}</option>
        {% endfor %}
      </select>
    </label>
    <label>
      target branch
      <select name="target_branch" required>
        {% for b in branches %}
          <option value="{{ b }}"{% if b.as_str() == repo.default_branch.as_str() %} selected{% endif %}>{{ b }}</option>
        {% endfor %}
      </select>
    </label>
    <label>
      body
      <textarea name="body" rows="8"></textarea>
    </label>
    <div class="kg-actions">
      <button class="kg-btn" type="submit">create</button>
      <a class="kg-btn kg-btn--ghost" href="/{{ owner.username }}/{{ repo.name }}/pulls">cancel</a>
    </div>
  </form>
</section>
{% endblock %}