summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/template/en/default
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-12-11 01:57:41 +0100
committerByron Jones <bjones@mozilla.com>2012-12-11 01:57:41 +0100
commit30d411c5782453456a5818f04fad113305300443 (patch)
treeab68c12db28713ab63f56720148aa48eb67f4988 /extensions/BMO/template/en/default
parentf0e84a2cf2f4390c88349d817cbcdde70ac7bca6 (diff)
downloadbugzilla-30d411c5782453456a5818f04fad113305300443.tar.gz
bugzilla-30d411c5782453456a5818f04fad113305300443.tar.xz
Bug 786777: add facility for direct read-only database access
Diffstat (limited to 'extensions/BMO/template/en/default')
-rw-r--r--extensions/BMO/template/en/default/pages/query_database.html.tmpl47
1 files changed, 47 insertions, 0 deletions
diff --git a/extensions/BMO/template/en/default/pages/query_database.html.tmpl b/extensions/BMO/template/en/default/pages/query_database.html.tmpl
new file mode 100644
index 000000000..97f5c0a25
--- /dev/null
+++ b/extensions/BMO/template/en/default/pages/query_database.html.tmpl
@@ -0,0 +1,47 @@
+[%# This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ #
+ # This Source Code Form is "Incompatible With Secondary Licenses", as
+ # defined by the Mozilla Public License, v. 2.0.
+ #%]
+
+[% INCLUDE global/header.html.tmpl
+ title = "Query Database"
+ style_urls = [ "extensions/BMO/web/styles/reports.css" ]
+%]
+
+<form method="post" action="page.cgi">
+<input type="hidden" name="id" value="query_database.html">
+<textarea cols="80" rows="10" name="query">[% query FILTER html %]</textarea><br>
+<input type="submit" value="Execute">
+</form>
+
+[% IF executed %]
+ <hr>
+
+ [% IF sql_error %]
+ <b>[% sql_error FILTER html %]</b>
+ [% ELSIF rows.size %]
+ <table border="0" cellspacing="0" id="report">
+ <tr>
+ [% FOREACH column = columns %]
+ <th>[% column FILTER html %]</th>
+ [% END %]
+ </tr>
+ [% FOREACH row = rows %]
+ [% tr_class = loop.count % 2 ? 'report_row_even' : 'report_row_odd' %]
+ <tr class="[% tr_class FILTER html %]">
+ [% FOREACH field = row %]
+ <td>[% field FILTER html %]</td>
+ [% END %]
+ </tr>
+ [% END %]
+ </table>
+ [% ELSE %]
+ <i>no results</i>
+ [% END %]
+
+[% END %]
+
+[% INCLUDE global/footer.html.tmpl %]