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

Unified Diff: appengine/monorail/templates/tracker/issue-search-form.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-search-form.ezt
diff --git a/appengine/monorail/templates/tracker/issue-search-form.ezt b/appengine/monorail/templates/tracker/issue-search-form.ezt
new file mode 100644
index 0000000000000000000000000000000000000000..f4953ead52ccd637c1495c4951297e10b493dea6
--- /dev/null
+++ b/appengine/monorail/templates/tracker/issue-search-form.ezt
@@ -0,0 +1,97 @@
+<div class="[issue_tab_mode]">
+<div class="isf">
+ [define offer_new_issue]Yes[end]
+ [if-any read_only][define offer_new_issue]No[end][end]
+ [if-any logged_in_user][# Note: rather than hide the New Issue link when the user is not logged in, we let them try. ]
+ [if-any page_perms.CreateIssue][else][define offer_new_issue]No[end][end]
+ [end]
+ [is offer_new_issue "Yes"]
+ <span class="inIssueEntry" style="margin-right:.4em">
+ <a class="buttonify" href="[issue_entry_url]">New issue</a>
+ </span>
+ [end]
+
+ <span class="inIssueList" style="margin:0 .4em">
+ <label for="can">Search</label>
+ <form action="list" method="GET" style="display:inline">
+ <select id="can" name="can">
+ [include "issue-can-widget.ezt" "search"]
+ </select>
+ <label for="searchq">for</label>
+ <span id="qq"><input type="text" size="[q_field_size]" id="searchq" name="q"
+ value="[query]" autocomplete="off"></span>
+ [if-any sortspec]<input type="hidden" id="sort" name="sort" value="[sortspec]">[end]
+ [if-any groupby]<input type="hidden" id="groupby" name="groupby" value="[groupby]">[end]
+ [if-any colspec]<span id="search_colspec"><input type="hidden" name="colspec" value="[colspec]"></span>[end]
+ [if-any grid_x_attr]<input type="hidden" name="x" value="[grid_x_attr]">[end]
+ [if-any grid_y_attr]<input type="hidden" name="y" value="[grid_y_attr]">[end]
+ [if-any grid_mode]<input type="hidden" name="mode" value="[if-any grid_mode]grid[end]">[end]
+ [if-any grid_cell_mode]<input type="hidden" name="cells" value="[grid_cell_mode]">[end]
+ <input type="submit" value="Search">
+ </form>
+ </span>
+
+ <span class="inIssueAdvSearch" style="margin:0 .4em">
+ <a href="advsearch">Advanced search</a>
+ </span>
+
+ <span class="inIssueSearchTips" style="margin:0 .4em">
+ <a href="searchtips">Search tips</a>
+ </span>
+
+ [if-any logged_in_user]
+ <span class="inSavedQueries" style="margin:0 .4em">
+ <a href="[logged_in_user.profile_url]queries">Saved queries</a>
+ </span>
+ [end]
+
+</div>
+</div>
+
+
+[if-any warnings]
+ <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-bottom: 6px">
+ [for warnings]
+ <tr><td class="notice">
+ [warnings]
+ </td></tr>
+ [end]
+ </table>
+[end]
+[if-any errors.query]
+ <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-bottom: 6px">
+ <tr><td class="notice">
+ [errors.query]
+ </td></tr>
+ </table>
+[end]
+
+
+<script type="text/javascript" nonce="[nonce]">
+runOnLoad(function() {
+ [# Keep track of the old scope and set it back to the old value if the
+ user selects one of the "manage" options. That ensures that if
+ the user returns to the page via the browser Back button, he/she
+ will not see the "manage" item as the current scope value.]
+ var oldScope = "2";
+ function scopeChange() {
+ [if-any logged_in_user]
+ var scopeWidget = document.getElementById('can');
+ if (scopeWidget.value == 'manageprojectqueries') {
+ scopeWidget.value = oldScope;
+ _go('../adminViews');
+ }
+ else if (scopeWidget.value == 'managemyqueries') {
+ scopeWidget.value = oldScope;
+ _go('[format "js"][logged_in_user.profile_url][end]queries');
+ }
+ else {
+ oldScope = scopeWidget.value;
+ }
+ [end]
+ }
+
+ if ($("can"))
+ $("can").addEventListener("change", scopeChange);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698