Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1367)

Unified Diff: appengine/monorail/templates/tracker/issue-list-js.ezt

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/monorail/templates/tracker/issue-list-js.ezt
diff --git a/appengine/monorail/templates/tracker/issue-list-js.ezt b/appengine/monorail/templates/tracker/issue-list-js.ezt
new file mode 100644
index 0000000000000000000000000000000000000000..d7e32f627db654e2991d61a72a90f6b46fe60fc6
--- /dev/null
+++ b/appengine/monorail/templates/tracker/issue-list-js.ezt
@@ -0,0 +1,61 @@
+<script type="text/javascript" nonce="[nonce]">
+runOnLoad(function() {
+ [# Pass the list of column names from HTML to JS ]
+ window._allColumnNames = [
+ [for column_values]'[column_values.column_name]'[if-index column_values last][else], [end][end]
+ ];
+
+ [# Update the issue link hrefs on-load and whenever the column-spec changes.]
+ _ctxCan = [can];
+ _ctxQuery = "[format "js"][query][end]";
+ _ctxSortspec = "[format "js"][sortspec][end]";
+ _ctxGroupBy = "[format "js"][groupby][end]";
+ _ctxDefaultColspec = "[format "js"][default_colspec][end]";
+ _ctxStart = [start];
+ _ctxNum = [num];
+ _ctxResultsPerPage = [default_results_per_page];
+ _ctxArgs = _formatContextQueryArgs();
+
+ function _goIssue(issueIndex, newWindow) {
+ var url = _makeIssueLink(issueRefs[[]issueIndex]);
+ _go(url, newWindow);
+ }
+
+ window.issueRefs = [[]
+ [for table_data]
+ {project_name: "[format "js"][table_data.project_name][end]",
+ id: [table_data.local_id]}[if-index table_data last][else],[end][end]
+ ];
+
+ function _handleResultsClick(event) {
+ var target = event.target;
+ if (target.classList.contains("label"))
+ return;
+ if (target.classList.contains("rowwidgets") || target.parentNode.classList.contains("rowwidgets"))
+ return;
+ while (target && target.tagName != "TR") target = target.parentNode;
+ event.preventDefault();
+ _goIssue(target.attributes[[]"data-idx"].value,
+ (event.metaKey || event.ctrlKey || event.button == 1));
+ };
+ $("resultstable").addEventListener("click", _handleResultsClick);
+
+ function _handleHeaderClick(event) {
+ var target = event.target;
+ while (target && target.tagName != "TH") target = target.parentNode;
+ var colIndex = target.getAttribute("data-col-index");
+ _showBelow("pop_" + colIndex, target);
+ }
+ $("resultstablehead").addEventListener("click", _handleHeaderClick);
+});
+</script>
+
+<script type="text/javascript" defer src="/static/third_party/js/kibbles-1.3.3.comp.js" nonce="[nonce]"></script>
+<script type="text/javascript" nonce="[nonce]">
+runOnLoad(function() {
+ _setupKibblesOnListPage(
+ '[project_home_url]/issues/list',
+ '[project_home_url]/issues/entry',
+ '[projectname]', 1, 0, '[set_star_token]');
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698