|
28 | 28 | #search { width: 150px; }
|
29 | 29 | .hide { display: none; }
|
30 | 30 | th { cursor: pointer; }
|
| 31 | + #actual-rollup { background: #c7e2ff; border: #00acf7 3px double; border-radius: 5px; width: 75%; padding: 0 1em; } |
31 | 32 | </style>
|
32 | 33 | </head>
|
33 | 34 | <body>
|
34 | 35 | <h1>Homu queue - {% if repo_url %}<a href="{{repo_url}}" target="_blank">{{repo_label}}</a>{% else %}{{repo_label}}{% endif %} {% if treeclosed %} [TREE CLOSED below priority {{treeclosed}}] {% endif %}</h2>
|
35 | 36 |
|
36 | 37 | <p>
|
37 |
| - <button type="button" id="rollup">Create a rollup</button> |
| 38 | + <button type="button" id="expand-rollup">Create a rollup</button> |
38 | 39 | <button type="button" id="synch">Synchronize</button>
|
39 | 40 | </p>
|
40 | 41 |
|
| 42 | + <div id="actual-rollup" class="hide"> |
| 43 | + <p>This will create a new pull request consisting of <span id="checkbox-count">0</span> PRs.</p> |
| 44 | + <p>A rollup is useful for shortening the queue, but jumping the queue is unfair to older PRs who have waited too long.</p> |
| 45 | + <p>When creating a real rollup, try to be fair to the PRs not rolled up. You may pick one of these strategies:</p> |
| 46 | + <ul> |
| 47 | + <li> |
| 48 | + <p>Always include the first <span class="approved">approved</span> PR in the rollup. |
| 49 | + Then give the new pull request the highest priority (p=100);</p> |
| 50 | + <p><i>or</i></p> |
| 51 | + </li> |
| 52 | + <li> |
| 53 | + <p>After creating the rollup, give it a fairly high priority (p=10), then assign |
| 54 | + even higher priorties (p=20, ...) to every PRs older than the oldest rolled up PR.</p> |
| 55 | + </li> |
| 56 | + </ul> |
| 57 | + <p> |
| 58 | + <button type="button" id="rollup">Rollup</button> |
| 59 | + — |
| 60 | + <button type="button" id="cancel-rollup">Cancel</button> |
| 61 | + </p> |
| 62 | + </div> |
| 63 | + |
41 | 64 | <p>
|
42 | 65 | {{ total }} total, {{ approved }} approved, {{ rolled_up }} rolled up, {{ failed }} failed
|
43 | 66 | /
|
@@ -91,9 +114,17 @@ <h1>Homu queue - {% if repo_url %}<a href="{{repo_url}}" target="_blank">{{repo_
|
91 | 114 | <script src="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
|
92 | 115 |
|
93 | 116 | <script>
|
94 |
| - document.getElementById('rollup').onclick = function(ev) { |
95 |
| - if (!confirm('This will create a new pull request. Proceed?')) return; |
| 117 | + document.getElementById('expand-rollup').onclick = function() { |
| 118 | + var checkboxCount = document.querySelectorAll('#queue tbody input[type=checkbox]:checked').length; |
| 119 | + document.getElementById('checkbox-count').innerHTML = checkboxCount; |
| 120 | + document.getElementById('actual-rollup').className = ''; |
| 121 | + }; |
96 | 122 |
|
| 123 | + document.getElementById('cancel-rollup').onclick = function() { |
| 124 | + document.getElementById('actual-rollup').className = 'hide'; |
| 125 | + }; |
| 126 | + |
| 127 | + document.getElementById('rollup').onclick = function(ev) { |
97 | 128 | var nums = [];
|
98 | 129 | var els = document.querySelectorAll('#queue tbody input[type=checkbox]:checked');
|
99 | 130 | for (var i=0;i<els.length;i++) {
|
|
0 commit comments