Project import generated by Copybara.

GitOrigin-RevId: d9e9e3fb4e31372ec1fb43b178994ca78fa8fe70
diff --git a/templates/tracker/issue-list-controls-top.ezt b/templates/tracker/issue-list-controls-top.ezt
new file mode 100644
index 0000000..d308570
--- /dev/null
+++ b/templates/tracker/issue-list-controls-top.ezt
@@ -0,0 +1,108 @@
+<div class="list">
+  <div class="button_set">
+   <span class="active_choice choice_chip">List</span>
+   <a class="choice_chip" href="[if-any is_hotlist][else]list[end]?can=[can]&amp;q=[query]&amp;colspec=[format "url"][colspec][end]&amp;groupby=[format "url"][groupby][end]&amp;sort=[format "url"][sortspec][end]&amp;x=[grid_x_attr]&amp;y=[grid_y_attr]&amp;cells=[grid_cell_mode]&amp;mode=grid">Grid</a>
+   <a class="choice_chip" href="[if-any is_hotlist][else]list[end]?can=[can]&amp;q=[query]&amp;colspec=[format "url"][colspec][end]&amp;groupby=[format "url"][groupby][end]&amp;sort=[format "url"][sortspec][end]&amp;x=[grid_x_attr]&amp;y=[grid_y_attr]&amp;cells=[grid_cell_mode]&amp;mode=chart">Chart</a>
+  </div>
+
+   [include "../framework/artifact-list-pagination-part.ezt"]
+   [include "update-issues-hotlists-dialog.ezt"]
+
+   [if-any page_perms.EditIssue]
+     [if-any is_cross_project][else]
+       <span style="margin:0 .7em">Select:
+         <a id="selectall" href="#">All</a>
+         <a id="selectnone" href="#">None</a>
+       </span>
+     [end]
+    <select id="moreactions" class="drop-down-bub">
+     <option value="moreactions" disabled="disabled" selected="selected">Actions...</option>
+     <option value="colspec">Change columns...</option>
+     [if-any is_cross_project][else][# TODO(jrobbins): cross-project bulk edit]
+       <option value="bulk">Bulk edit...</option>
+     [end]
+     [if-any is_cross_project][else][# TODO(jrobbins): cross-project spam flagging]
+       <option value="flagspam">Flag as spam...</option>
+       <option value="unflagspam">Un-flag as spam...</option>
+     [end]
+     <option value="addtohotlist">Add to hotlist...</option>
+    </select>
+    <span id='bulk-action-loading' class='loading' style='visibility:hidden'>Processing</span>
+   [end]
+
+   [if-any hotlist_id][if-any logged_in_user]
+   <span style="margin:0 .7em">Select:
+     <a id="selectall" href="#">All</a>
+     <a id="selectnone" href="#">None</a>
+   </span>
+   <select id="moreactions" class="drop-down-bub">
+     <option value="moreactions" disabled="disabled" [if-any add_issues_selected][else]selected="selected"[end]>Actions...</option>
+     [if-any owner_permissions editor_permissions]
+     <option value="addissues" [if-any add_issues_selected]selected="selected"[end]>Add issues...</option>
+     <option value="removeissues">Remove issues...</options>
+     <option value="colspec">Change columns...</option>
+   [end]
+     <option value="addtohotlist">Add to hotlist...</option>
+   </select>
+   [end][end]
+
+
+   <form id="colspecform" action=[if-any hotlist_id]"[hotlist.name]"[else]"list"[end] method="GET" autocomplete="off"
+         style="display:inline; margin-left:1em">
+    <input type="hidden" name="can" value="[can]">
+    <input type="hidden" name="q" value="[query]">
+    <input type="hidden" name="sort" value="[sortspec]">
+    <input type="hidden" id="groupbyspec" name="groupby" value="[groupby]">
+    <span id="columnspec" style="display:none; font-size:90%">
+      <span>Columns:</span>
+      <span id="colspec_field"><input type="text" size="60" name="colspec"
+                   value="[colspec]"></span>
+      <input type="submit" name="nobtn" value="Update">
+      [# TODO(jrobbins): <a href="TODO">Learn more</a> ]
+    </span>
+   </form>
+</div>
+
+[if-any is_hotlist]
+<form id='bulkremoveissues' method="POST" action="/u/[viewed_user_id]/hotlists/[hotlist.name].do">
+<input type="hidden" name="token" value="[edit_hotlist_token]">
+  <input type="hidden" id="current_col_spec" name="current_col_spec" value="[col_spec]">
+  <input type="hidden" id="bulk_remove_local_ids" name="remove_local_ids">
+  <input type ="hidden" id="bulk_remove_value" name = "remove" value="false">
+  <span id="addissuesspec" style="display:none; font-size:90%">
+    <span>Issues:</span>
+    <span id="issues_field"><input type="text" size="60" name="add_local_ids"
+                   value="[add_local_ids]" placeholder="[placeholder]"></span>
+    <input type="submit" name="nobtn" value="Add Issues">
+  </span>
+  [if-any errors.issues]
+  <div class="fielderror">[errors.issues]</div>
+  [end]
+  <div class="fielderror">&nbsp;
+    <span id="add_local_idsfeedback">
+       [if-any errors.add_local_ids][errors.add_local_ids][end]
+    </span>
+  </div>
+</form>
+[end]
+
+<script type="text/javascript" nonce="[nonce]">
+runOnLoad(function() {
+  if ($("selectall")) {
+    $("selectall").addEventListener("click", function() { _selectAllIssues(); });
+  }
+  if ($("selectnone")) {
+    $("selectnone").addEventListener("click", function() { _selectNoneIssues(); });
+  }
+  if ($("moreactions")) {
+    $("moreactions").addEventListener("change", function(event) {
+        _handleListActions(event.target);
+    });
+    if ($("moreactions").value == 'addissues') {
+      _showID('addissuesspec');
+    }
+  }
+  window.__hotlists_dialog.onResponse = onAddIssuesResponse;
+  window.__hotlists_dialog.onFailure = onAddIssuesFailure;
+});
+</script>