summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.htaccess1
-rw-r--r--extensions/REMO/template/en/default/bug/create/comment-csa-discourse.txt.tmpl28
-rw-r--r--extensions/REMO/template/en/default/bug/create/comment-remo-it.txt.tmpl12
-rw-r--r--extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl88
-rw-r--r--extensions/REMO/template/en/default/bug/create/create-remo-it.html.tmpl31
-rw-r--r--extensions/REMO/web/js/moz_csa_discourse.js44
6 files changed, 161 insertions, 43 deletions
diff --git a/.htaccess b/.htaccess
index 116c26118..7c7057e08 100644
--- a/.htaccess
+++ b/.htaccess
@@ -55,6 +55,7 @@ RewriteRule ^form[\.:]reps[\.:]budget$ enter_bug.cgi?product=Mozilla+Reps&format
RewriteRule ^form[\.:]reps[\.:]swag$ enter_bug.cgi?product=Mozilla+Reps&format=remo-swag
RewriteRule ^form[\.:]reps[\.:]it$ enter_bug.cgi?product=Mozilla+Reps&format=remo-it
RewriteRule ^form[\.:]reps[\.:]payment$ page.cgi?id=remo-form-payment.html
+RewriteRule ^form[\.:]csa[\.:]discourse$ enter_bug.cgi?product=Infrastructure+\%26\+Operations&format=csa-discourse
RewriteRule ^form[\.:]employee[\.\-:]incident$ enter_bug.cgi?product=mozilla.org&format=employee-incident
RewriteRule ^form[\.:]brownbag$ https://air.mozilla.org/requests
RewriteRule ^form[\.:]finance$ enter_bug.cgi?product=Finance&format=finance
diff --git a/extensions/REMO/template/en/default/bug/create/comment-csa-discourse.txt.tmpl b/extensions/REMO/template/en/default/bug/create/comment-csa-discourse.txt.tmpl
new file mode 100644
index 000000000..4e65607e8
--- /dev/null
+++ b/extensions/REMO/template/en/default/bug/create/comment-csa-discourse.txt.tmpl
@@ -0,0 +1,28 @@
+[%# 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.
+ #%]
+
+[% USE Bugzilla %]
+[% cgi = Bugzilla.cgi %]
+
+Name:
+[%+ cgi.param('name') %]
+
+Mozillians.org Profile:
+[%+ cgi.param('mozillian') %]
+
+Community Name:
+[%+ cgi.param('community') %]
+
+Category Names:
+[%+ cgi.param('discourse_names') %]
+
+Background Hex Code:
+[%+ cgi.param('discourse_bg') || "-" %]
+
+Comments:
+[%+ cgi.param('comments') || "-" %]
diff --git a/extensions/REMO/template/en/default/bug/create/comment-remo-it.txt.tmpl b/extensions/REMO/template/en/default/bug/create/comment-remo-it.txt.tmpl
index 7e95dd017..b95e05184 100644
--- a/extensions/REMO/template/en/default/bug/create/comment-remo-it.txt.tmpl
+++ b/extensions/REMO/template/en/default/bug/create/comment-remo-it.txt.tmpl
@@ -55,18 +55,6 @@ Hosting data:
Domain Name:
[%+ cgi.param('domain_name') %]
-[% ELSIF item == "discourse" %]
-:: Discourse Category
-
-Category Names:
-[%+ cgi.param('discourse_names') %]
-
-Moderators:
-[%+ cgi.param('discourse_mods') %]
-
-Background Hex Code:
-[%+ cgi.param('discourse_bg') || "-" %]
-
[% ELSIF item == "other" %]
:: Other
diff --git a/extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl
new file mode 100644
index 000000000..691bc7155
--- /dev/null
+++ b/extensions/REMO/template/en/default/bug/create/create-csa-discourse.html.tmpl
@@ -0,0 +1,88 @@
+[%# 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.
+ #%]
+
+[% PROCESS global/variables.none.tmpl %]
+
+[% PROCESS global/header.html.tmpl
+ title = "Community IT Discourse Request"
+ style_urls = [ "extensions/REMO/web/styles/moz_reps.css" ]
+ javascript_urls = [ "extensions/REMO/web/js/moz_csa_discourse.js" ]
+%]
+
+[% USE Bugzilla %]
+
+<noscript>
+ <h1>Javascript is required to use this form.</h1>
+</noscript>
+
+<h1>Community IT Discourse Request</h1>
+
+<form method="post" action="post_bug.cgi" id="tmRequestForm" name="f">
+ <input type="hidden" name="product" value="Infrastructure & Operations">
+ <input type="hidden" name="component" value="Community IT: Discourse">
+ <input type="hidden" name="bug_severity" value="normal">
+ <input type="hidden" name="rep_platform" value="All">
+ <input type="hidden" name="priority" value="--">
+ <input type="hidden" name="op_sys" value="Other">
+ <input type="hidden" name="version" value="other">
+ <input type="hidden" name="format" value="[% format FILTER html %]">
+ <input type="hidden" name="comment" id="comment" value="">
+ <input type="hidden" name="short_desc" id="short_desc" value="">
+ <input type="hidden" name="token" value="[% token FILTER html %]">
+
+ <table id="reps-form">
+ <tr class="odd">
+ <th><label class="required" for="name">Your Name:</label></th>
+ <td><input id="name" name="name" size="40" value="[% user.name FILTER html %]"></td>
+ </tr>
+
+ <tr class="even">
+ <th><label class="required" for="mozillan">Mozillians.org Profile:</label></th>
+ <td><input id="mozillian" name="mozillian" size="40"></td>
+ </tr>
+
+ <tr class="odd">
+ <th><label class="required" for="community">Your Community's Name:</label></th>
+ <td><input id="community" name="community" size="40"></td>
+ </tr>
+
+ <tr class="even">
+ <th><label class="required" for="discourse_names">Discourse Category Names:</label></th>
+ <td><input id="discourse_names" name="discourse_names" size="40"></td>
+ </tr>
+
+ <tr class="odd">
+ <th><label for="discourse_bg">Hex code of background of category tag:</th>
+ <td><input id="discourse_bg" name="discourse_bg" size="40"></td>
+ </tr>
+
+ <tr class="even">
+ <th colspan="2">
+ <label for="comments">
+ Other Comments
+ </label>
+ </th>
+ </tr>
+
+ <tr class="even">
+ <td colspan="2">
+ Please explain anything else this form does not include.
+ <br>
+ <textarea id="comments" name="comments" rows="4"></textarea>
+ </td>
+ </tr>
+
+ <tr class="odd">
+ <td colspan="2">
+ <input id="submit" type="submit" value="Submit">
+ </td>
+ </tr>
+ </table>
+</form>
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/extensions/REMO/template/en/default/bug/create/create-remo-it.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-remo-it.html.tmpl
index a1085ae97..aeea160a4 100644
--- a/extensions/REMO/template/en/default/bug/create/create-remo-it.html.tmpl
+++ b/extensions/REMO/template/en/default/bug/create/create-remo-it.html.tmpl
@@ -67,10 +67,6 @@ function submitForm() {
) {
fields.push('domain_name');
}
- if (Dom.get('item_discourse').checked) {
- fields.push('discourse_names');
- fields.push('discourse_mods');
- }
if (Dom.get('item_other').checked) {
fields.push('other_value');
}
@@ -107,11 +103,6 @@ function setItemVisibility() {
} else {
Dom.addClass('domain', 'bz_default_hidden');
}
- if (Dom.get('item_discourse').checked) {
- Dom.removeClass('discourse', 'bz_default_hidden');
- } else {
- Dom.addClass('discourse', 'bz_default_hidden');
- }
if (Dom.get('item_other').checked) {
Dom.removeClass('other', 'bz_default_hidden');
} else {
@@ -190,10 +181,6 @@ function init() {
<label for="item_domain">Domain</label>
</div>
<div>
- <input type="checkbox" name="items" value="discourse" id="item_discourse">
- <label for="item_discourse">Discourse Category</label>
- </div>
- <div>
<input type="checkbox" name="items" value="ssl" id="item_ssl">
<label for="item_ssl">SSL</label>
</div>
@@ -236,24 +223,6 @@ function init() {
</tr>
</tbody>
-<tbody id="discourse">
-<tr class="even">
- <th colspan="2">Discourse Category</th>
-</tr>
-<tr class="odd">
- <th>Discourse Category Names:[% mandatory FILTER none %]</th>
- <td><input id="discourse_names" name="discourse_names" size="40"></td>
-</tr>
-<tr class="odd">
- <th>Moderators:[% mandatory FILTER none %]</th>
- <td><input id="discourse_mods" name="discourse_mods" size="40"></td>
-</tr>
-<tr class="odd">
- <th>Hex code of background of category tag:</th>
- <td><input id="discourse_bg" name="discourse_bg" size="40"></td>
-</tr>
-</tbody>
-
<tbody id="other">
<tr class="even">
<th colspan="2">Other Item</th>
diff --git a/extensions/REMO/web/js/moz_csa_discourse.js b/extensions/REMO/web/js/moz_csa_discourse.js
new file mode 100644
index 000000000..a885588f6
--- /dev/null
+++ b/extensions/REMO/web/js/moz_csa_discourse.js
@@ -0,0 +1,44 @@
+/* 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. */
+
+$(document).ready(function() {
+ 'use strict';
+
+ $('#tmRequestForm').submit(function (event) {
+ var mozillian_re = /^https?:\/\/mozillians.org\/([^\/]+\/)?u\/[^\/]+$/i;
+ var errors = [];
+ var missing = false;
+
+ $('label.required').each(function (index) {
+ var id = $(this).attr("for");
+ var input = $("#" + id);
+
+ if (input.val() == "") {
+ input.addClass("missing");
+ missing = true;
+ event.preventDefault();
+ }
+ else {
+ input.removeClass("missing");
+ }
+ });
+
+ if (missing) {
+ errors.push("There are missing required fields");
+ }
+
+ if (errors.length) {
+ alert(errors.join("\n"));
+ event.preventDefault();
+ return;
+ }
+
+ $('#short_desc').val(
+ "IT Discourse Request: " + $('#community').val() + ' (' + $('#name').val() + ')'
+ );
+ });
+});