Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | <div class="list"> |
| 2 | <div class="button_set"> |
| 3 | <span class="active_choice choice_chip">List</span> |
| 4 | <a class="choice_chip" href="[if-any is_hotlist][else]list[end]?can=[can]&q=[query]&colspec=[format "url"][colspec][end]&groupby=[format "url"][groupby][end]&sort=[format "url"][sortspec][end]&x=[grid_x_attr]&y=[grid_y_attr]&cells=[grid_cell_mode]&mode=grid">Grid</a> |
| 5 | <a class="choice_chip" href="[if-any is_hotlist][else]list[end]?can=[can]&q=[query]&colspec=[format "url"][colspec][end]&groupby=[format "url"][groupby][end]&sort=[format "url"][sortspec][end]&x=[grid_x_attr]&y=[grid_y_attr]&cells=[grid_cell_mode]&mode=chart">Chart</a> |
| 6 | </div> |
| 7 | |
| 8 | [include "../framework/artifact-list-pagination-part.ezt"] |
| 9 | [include "update-issues-hotlists-dialog.ezt"] |
| 10 | |
| 11 | [if-any page_perms.EditIssue] |
| 12 | [if-any is_cross_project][else] |
| 13 | <span style="margin:0 .7em">Select: |
| 14 | <a id="selectall" href="#">All</a> |
| 15 | <a id="selectnone" href="#">None</a> |
| 16 | </span> |
| 17 | [end] |
| 18 | <select id="moreactions" class="drop-down-bub"> |
| 19 | <option value="moreactions" disabled="disabled" selected="selected">Actions...</option> |
| 20 | <option value="colspec">Change columns...</option> |
| 21 | [if-any is_cross_project][else][# TODO(jrobbins): cross-project bulk edit] |
| 22 | <option value="bulk">Bulk edit...</option> |
| 23 | [end] |
| 24 | [if-any is_cross_project][else][# TODO(jrobbins): cross-project spam flagging] |
| 25 | <option value="flagspam">Flag as spam...</option> |
| 26 | <option value="unflagspam">Un-flag as spam...</option> |
| 27 | [end] |
| 28 | <option value="addtohotlist">Add to hotlist...</option> |
| 29 | </select> |
| 30 | <span id='bulk-action-loading' class='loading' style='visibility:hidden'>Processing</span> |
| 31 | [end] |
| 32 | |
| 33 | [if-any hotlist_id][if-any logged_in_user] |
| 34 | <span style="margin:0 .7em">Select: |
| 35 | <a id="selectall" href="#">All</a> |
| 36 | <a id="selectnone" href="#">None</a> |
| 37 | </span> |
| 38 | <select id="moreactions" class="drop-down-bub"> |
| 39 | <option value="moreactions" disabled="disabled" [if-any add_issues_selected][else]selected="selected"[end]>Actions...</option> |
| 40 | [if-any owner_permissions editor_permissions] |
| 41 | <option value="addissues" [if-any add_issues_selected]selected="selected"[end]>Add issues...</option> |
| 42 | <option value="removeissues">Remove issues...</options> |
| 43 | <option value="colspec">Change columns...</option> |
| 44 | [end] |
| 45 | <option value="addtohotlist">Add to hotlist...</option> |
| 46 | </select> |
| 47 | [end][end] |
| 48 | |
| 49 | |
| 50 | <form id="colspecform" action=[if-any hotlist_id]"[hotlist.name]"[else]"list"[end] method="GET" autocomplete="off" |
| 51 | style="display:inline; margin-left:1em"> |
| 52 | <input type="hidden" name="can" value="[can]"> |
| 53 | <input type="hidden" name="q" value="[query]"> |
| 54 | <input type="hidden" name="sort" value="[sortspec]"> |
| 55 | <input type="hidden" id="groupbyspec" name="groupby" value="[groupby]"> |
| 56 | <span id="columnspec" style="display:none; font-size:90%"> |
| 57 | <span>Columns:</span> |
| 58 | <span id="colspec_field"><input type="text" size="60" name="colspec" |
| 59 | value="[colspec]"></span> |
| 60 | <input type="submit" name="nobtn" value="Update"> |
| 61 | [# TODO(jrobbins): <a href="TODO">Learn more</a> ] |
| 62 | </span> |
| 63 | </form> |
| 64 | </div> |
| 65 | |
| 66 | [if-any is_hotlist] |
| 67 | <form id='bulkremoveissues' method="POST" action="/u/[viewed_user_id]/hotlists/[hotlist.name].do"> |
| 68 | <input type="hidden" name="token" value="[edit_hotlist_token]"> |
| 69 | <input type="hidden" id="current_col_spec" name="current_col_spec" value="[col_spec]"> |
| 70 | <input type="hidden" id="bulk_remove_local_ids" name="remove_local_ids"> |
| 71 | <input type ="hidden" id="bulk_remove_value" name = "remove" value="false"> |
| 72 | <span id="addissuesspec" style="display:none; font-size:90%"> |
| 73 | <span>Issues:</span> |
| 74 | <span id="issues_field"><input type="text" size="60" name="add_local_ids" |
| 75 | value="[add_local_ids]" placeholder="[placeholder]"></span> |
| 76 | <input type="submit" name="nobtn" value="Add Issues"> |
| 77 | </span> |
| 78 | [if-any errors.issues] |
| 79 | <div class="fielderror">[errors.issues]</div> |
| 80 | [end] |
| 81 | <div class="fielderror"> |
| 82 | <span id="add_local_idsfeedback"> |
| 83 | [if-any errors.add_local_ids][errors.add_local_ids][end] |
| 84 | </span> |
| 85 | </div> |
| 86 | </form> |
| 87 | [end] |
| 88 | |
| 89 | <script type="text/javascript" nonce="[nonce]"> |
| 90 | runOnLoad(function() { |
| 91 | if ($("selectall")) { |
| 92 | $("selectall").addEventListener("click", function() { _selectAllIssues(); }); |
| 93 | } |
| 94 | if ($("selectnone")) { |
| 95 | $("selectnone").addEventListener("click", function() { _selectNoneIssues(); }); |
| 96 | } |
| 97 | if ($("moreactions")) { |
| 98 | $("moreactions").addEventListener("change", function(event) { |
| 99 | _handleListActions(event.target); |
| 100 | }); |
| 101 | if ($("moreactions").value == 'addissues') { |
| 102 | _showID('addissuesspec'); |
| 103 | } |
| 104 | } |
| 105 | window.__hotlists_dialog.onResponse = onAddIssuesResponse; |
| 106 | window.__hotlists_dialog.onFailure = onAddIssuesFailure; |
| 107 | }); |
| 108 | </script> |