-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbackports.html
106 lines (105 loc) · 4.29 KB
/
backports.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{#include BackportsResource/base}
{#page-class}backports{/page-class}
{#title}Backports for {milestone.title}{/title}
{#body}
<div class="ui main container">
<table class="ui celled striped table">
<thead>
<tr>
<th class="one wide" style="width:10px; text-align:right">#</th>
<th class="thirteen wide">Pull Request</th>
<th class="one wide">Cherry Pick</th>
<th class="one wide">Done</th>
</tr>
</thead>
<tbody>
{#for pr in prs}
{#set commits=pr.commits}
<tr>
<td style="text-align:right">{pr_count}</td>
<td>
<div>
<code class="ui label tiny">#{pr.number}</code> <a class="pr-title" target="_blank" href="{pr.url}">{pr.title}</a>
<span style="float:right">
{#if pr.linkedIssues.size > 0}
<div class="ui icon mini button issues" data-variation="wide" data-position="bottom center" data-html="<div class='header'>Linked issues</div><div class='content'>{#for issue in pr.linkedIssues}› <a href='{issue.url}' target='_blank'>{issue.number}</a> {issue.title}<br />{/}</div>">
<i class="exclamation circle icon"></i>
<span class="floating ui red mini circular label">{pr.linkedIssues.size}</span>
</div>
{/}
<!-- bots don't have a proper login -->
{#if pr.author.login}
<span class="ui image label"><img src="{pr.author.avatarUrl}" /> {pr.author.login}</span>
{/}
</span>
</div>
<div class="ui piled segment commits" id="commits-{pr.number}">
<div class="ui relaxed divided list">
{#for commit in commits}
<div class="item">
<div class="right floated content">
{#if commits.size > 1}
<div class="ui compact icon button clipboard-button" data-clipboard-text="git cherry-pick -x {commit.oid}">
<i class="clipboard outline icon"></i>
</div>
{/if}
</div>
<div class="middle aligned content">
<div class="commit">
<i class="git alternate icon"></i>
<code class="ui tiny label"><a href="{commit.url}">{commit.abbreviatedOid}</a></code>
<a href="{commit.url}" target="_blank">{commit.abbreviatedMessage}</a>
</div>
</div>
</div>
{/}
</div>
</div>
</td>
<td class="center aligned">
<div class="ui icon button clipboard-button" data-clipboard-text="git cherry-pick -x {#for commit in commits}{commit.oid} {/}">
<i class="clipboard outline icon"></i>
<div class="floating ui blue mini circular label">{commits.size}</div>
</div>
</td>
<td class="center aligned">
<div class="ui icon button blue" id="mark-backported-{pr.number}">
<i class="arrow alternate circle right icon"></i>
</div>
<script type="text/javascript">
$('#mark-backported-{pr.number}').click(function() {
$('#mark-backported-{pr.number}').prop("onclick", null).off("click");
$('#mark-backported-{pr.number}').addClass('loading').removeClass('blue');
$.ajax('/backports/{milestone.title}/backported/{pr.number}/').done(function() {
$('#mark-backported-{pr.number}').removeClass('loading').addClass('positive disabled');
$('#mark-backported-{pr.number} i').removeClass('arrow alternate circle right').addClass('check');
$('#mark-backported-{pr.number}').closest('tr').addClass('positive');
$('#commits-{pr.number}').toggle();
}).fail(function() {
$('#mark-backported-{pr.number}').removeClass('loading').addClass('negative disabled');
$('#mark-backported-{pr.number} i').removeClass('reply').addClass('exclamation triangle');
});
});
</script>
</td>
</tr>
{/set}
{#else}
<tr>
<td colspan="3">
Nothing to backport.
</td>
</tr>
{/for}
</tbody>
</table>
</div>
{/body}
{#scripts}
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
<script type="text/javascript">
new ClipboardJS('.clipboard-button');
$('.button.issues').popup({ on: 'click' });
</script>
{/scripts}
{/include}