Sam Jeston
History
45 lines·
2.7 KB
·HTML
| 1 | {% extends "layout_repo.html" %} |
| 2 | {% block page_title %}Pull requests · {% endblock %} |
| 3 | {% block content %} |
| 4 | {% let base = r.base() %} |
| 5 | <div class="page-subheader"> |
| 6 | <div class="btn-group"> |
| 7 | <a class="btn btn-sm{% if showing_open %} selected{% endif %}" href="{{ base }}/pulls">{{ crate::web::fmt::icon("git-pull-request")|safe }} {{ open_count }} Open</a> |
| 8 | <a class="btn btn-sm{% if !showing_open %} selected{% endif %}" href="{{ base }}/pulls?state=closed">{{ crate::web::fmt::icon("check")|safe }} {{ closed_count }} Closed</a> |
| 9 | </div> |
| 10 | {% if ctx.user.is_some() %}<a class="btn btn-sm btn-primary" href="{{ base }}/compare">New pull request</a>{% endif %} |
| 11 | </div> |
| 12 | {% if pulls.is_empty() %} |
| 13 | <div class="blankslate box"> |
| 14 | {{ crate::web::fmt::icon("git-pull-request")|safe }} |
| 15 | <h3>{% if showing_open %}No open pull requests{% else %}No closed pull requests{% endif %}</h3> |
| 16 | <p>Pull requests let you propose, discuss and review changes before merging them into a branch.</p> |
| 17 | {% if showing_open && ctx.user.is_some() %}<a class="btn btn-primary" href="{{ base }}/compare">New pull request</a>{% endif %} |
| 18 | </div> |
| 19 | {% else %} |
| 20 | <div class="box"> |
| 21 | {% for pr in pulls %} |
| 22 | <div class="box-row issue-row"> |
| 23 | <span class="issue-icon state-color-{{ pr.state }}">{% if pr.state == "merged" %}{{ crate::web::fmt::icon("git-merge")|safe }}{% else if pr.state == "closed" %}{{ crate::web::fmt::icon("git-pull-request-closed")|safe }}{% else %}{{ crate::web::fmt::icon("git-pull-request")|safe }}{% endif %}</span> |
| 24 | <div class="issue-main"> |
| 25 | <a class="issue-title" href="{{ base }}/pull/{{ pr.number }}">{{ pr.title }}</a> |
| 26 | <div class="issue-meta"> |
| 27 | #{{ pr.number }} |
| 28 | {% if pr.state == "merged" %} |
| 29 | by {{ pr.author }} was merged {% if let Some(t) = pr.merged_at %}<time title="{{ crate::web::fmt::datetime_full(t) }}">{{ crate::web::fmt::ago(t) }}</time>{% endif %} |
| 30 | {% else if pr.state == "closed" %} |
| 31 | by {{ pr.author }} was closed {% if let Some(t) = pr.closed_at %}<time title="{{ crate::web::fmt::datetime_full(t) }}">{{ crate::web::fmt::ago(t) }}</time>{% endif %} |
| 32 | {% else %} |
| 33 | opened <time title="{{ crate::web::fmt::datetime_full(pr.created_at) }}">{{ crate::web::fmt::ago(pr.created_at) }}</time> by {{ pr.author }} |
| 34 | {% endif %} |
| 35 | <span class="branch-pair"><span class="branch-label">{{ pr.base_branch }}</span> ← <span class="branch-label">{{ pr.head_branch }}</span></span> |
| 36 | </div> |
| 37 | </div> |
| 38 | {% if pr.comments > 0 %} |
| 39 | <a class="issue-comments" href="{{ base }}/pull/{{ pr.number }}">{{ crate::web::fmt::icon("message-square")|safe }} {{ pr.comments }}</a> |
| 40 | {% endif %} |
| 41 | </div> |
| 42 | {% endfor %} |
| 43 | </div> |
| 44 | {% endif %} |
| 45 | {% endblock %} |