diff options
author | Byron Jones <glob@mozilla.com> | 2015-03-23 05:49:54 +0100 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-03-23 05:50:14 +0100 |
commit | bc5f247fcfb4a6dd12a190a703c44a9d36bb4158 (patch) | |
tree | 83c0040865f477e511741c567e661608b06f814c /extensions/REMO | |
parent | 9d045e4d060bc531e4243c621d07c79699fd22c8 (diff) | |
download | bugzilla-bc5f247fcfb4a6dd12a190a703c44a9d36bb4158.tar.gz bugzilla-bc5f247fcfb4a6dd12a190a703c44a9d36bb4158.tar.xz |
Bug 1141165: Enforce mandatory field on form.reps.mentorship
Diffstat (limited to 'extensions/REMO')
-rw-r--r-- | extensions/REMO/Extension.pm | 5 | ||||
-rw-r--r-- | extensions/REMO/template/en/default/hook/global/user-error-errors.html.tmpl | 4 | ||||
-rw-r--r-- | extensions/REMO/web/js/moz_reps.js | 5 |
3 files changed, 11 insertions, 3 deletions
diff --git a/extensions/REMO/Extension.pm b/extensions/REMO/Extension.pm index 1e99182e0..9f83f7065 100644 --- a/extensions/REMO/Extension.pm +++ b/extensions/REMO/Extension.pm @@ -318,11 +318,14 @@ sub post_bug_after_creation { status => '?', requestee => $_->login } } @cc_users; + ThrowUserError('remo_missing_voucher') unless @cc_users; $bug->set_flags(\@new_flags, []) if @new_flags; $bug->add_comment( join(", ", map { $_->name || $_->login } @cc_users) . - ": You have been added as supporter to this Reps application, please comment why do you endorse their application. Thanks!" + ": You have been added as a voucher to this Reps application.\n" . + "Please provide a comment describing why you endorse this application.\n" . + "Thanks!" ); $bug->update($bug->creation_ts); diff --git a/extensions/REMO/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/REMO/template/en/default/hook/global/user-error-errors.html.tmpl index 200e678be..e13fba024 100644 --- a/extensions/REMO/template/en/default/hook/global/user-error-errors.html.tmpl +++ b/extensions/REMO/template/en/default/hook/global/user-error-errors.html.tmpl @@ -37,4 +37,8 @@ You can either <a href="[% urlbase FILTER html %]page.cgi?id=remo-form-payment.html"> create a new payment request</a> or [% "go back to $terms.bug $bugid" FILTER bug_link(bugid) FILTER none %]. +[% ELSIF error == "remo_missing_voucher" %] + [% title = "Missing Vouchers" %] + You did not provide anyone to vouch for your application. + [% END %] diff --git a/extensions/REMO/web/js/moz_reps.js b/extensions/REMO/web/js/moz_reps.js index 88c60df51..e269e4445 100644 --- a/extensions/REMO/web/js/moz_reps.js +++ b/extensions/REMO/web/js/moz_reps.js @@ -49,9 +49,10 @@ $(document).ready(function() { $('label.required').each(function (index) { var id = $(this).attr("for"); var input = $("#" + id); + var value = input.val().trim(); if (id == 'mozillian') { - if (!input.val().match(mozillian_re)) { + if (!value.match(mozillian_re)) { input.addClass("missing"); errors.push("The Mozillian Account URL is invalid"); event.preventDefault(); @@ -61,7 +62,7 @@ $(document).ready(function() { } } else { - if (input.val() == "") { + if (value == "") { input.addClass("missing"); missing = true; event.preventDefault(); |